0
votes

I'm using Pandoc to convert a Rmarkdown document into a html-document.

rmarkdown::render('ReportTemp.Rmd', output_file = paste0('TestDocument', '_', filename_invoice, '.html'),
                    envir = new.env(parent = globalenv()),
                    run_pandoc = TRUE) 

This works fine when running local in Rstudio. But when running this in a dockerized setting the knitting part seems to go fine, but then I get this weird error message.


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

I can't find nothing in the pandoc-manual about this exit code 7. It simply doesn't seem to exist.

It seems to produce the correct md.-format, but fails to convert this into a html-document.

Does anyone know this code and what is going on?

I personally think it has something to do with the way pandoc is called by Rstudio and the platform R-base is running on About Pandoc & Rstudio

It seems that Rstudio has a build in older version of Pandoc (1.12.x). Does this mean that newer versions of pandoc (2.x) do not work with Rmarkdown 2.1.x?

Locally, in Rstudio I have

  1. R-base v3.6.3
  2. Platform: x86_64-w64-mingw32
  3. Rmarkdown v2.1;
  4. Knitr v1.28
  5. Flexdashboard V0.5.1.1
  6. Pandoc V2.9.2.1 (this is a seperate install, could be Rstudio uses a different version I'm not aware of).

In the docker Image I use:

  1. R-base v3.6.3
  2. Platform: x86_64-pc-linux-gnu
  3. Rmarkdown v2.1
  4. Knitr v1.28
  5. Flexdashboard V0.5.1.1
  6. Pandoc V2.5

Any help would be much appreciated!

1

1 Answers

0
votes

In the end, it had something to do with the environmental variables I declared / set in the beginning of the R script. Still not sure why it invoked the exit code 7 (and what this code means). But I'm happy it did not happen again.