我正在使用Pandoc将Rmarkdown文档转换为html文档。
rmarkdown::render('ReportTemp.Rmd', output_file = paste0('TestDocument', '_', filename_invoice, '.html'),
envir = new.env(parent = globalenv()),
run_pandoc = TRUE)
在Rstudio中运行本地时,此操作效果良好。但当在码头化设置中运行时,编织部分似乎很好,但后来我收到了这个奇怪的错误消息。
output file: ReportTemp.knit.md
/usr/bin/pandoc +RTS -K512m -RTS ReportTemp.utf8.md --to html4 --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output Report_fake.html --email-obfuscation none --standalone --section-divs --template /usr/local/lib/R/site-library/flexdashboard/rmarkdown/templates/flex_dashboard/resources/default.html --variable 'theme:cosmo' --include-in-header /tmp/Rtmp95MPQt/rmarkdown-str179e2a9e3.html --mathjax --variable 'mathjax-url:ReportTemp_fake_files/mathjax-local/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --metadata pagetitle=DocssReportTemp.utf8.md --include-in-header /tmp/Rtmp95MPQt/file17545e146html --highlight-style pygments --include-before-body /tmp/Rtmp95MPQt/file1515f007c.html --include-after-body /tmp/Rtmp95MPQt/file15bd062c2.html
Error : pandoc document conversion failed with error 7
我在pandoc手册中找不到任何关于这个退出代码7的内容。它似乎根本不存在。
它似乎生成了正确的md.-格式,但未能将其转换为html文档。
有人知道这个代码吗?发生了什么?
我个人认为这与Rstudio对pandoc的调用方式以及R-base平台在About pandoc&Rstudio
似乎Rstudio有一个旧版本Pandoc(1.12.x(的内置。这是否意味着新版本的Pandoc(2.x(不适用于Rmarkdown 2.1.x?
在本地,在Rstudio我有
- R-base v3.6.3
- 平台:x86_64-w64-mingw32
- Rmarkdown v2.1
- Knitr v1.28
- 柔性仪表板V0.5.1.1
- PandocV2.9.2.1(这是一个单独的安装,可能是Rstudio使用了一个我不知道的不同版本(
在docker图像中我使用:
- R-base v3.6.3
- 平台:x86_64-pc-linux-gnu
- Rmarkdown v2.1
- Knitr v1.28
- 柔性仪表板V0.5.1.1
- Pandoc V2.5
如有任何帮助,我们将不胜感激!
最后,它与我在R脚本开头声明/设置的环境变量有关。仍然不确定它为什么调用退出代码7(以及该代码的含义(。但我很高兴它没有再次发生。