Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: pandoc document conversion failed with error 43 Windows 7 R studio

Tags:

r

pdf

rstudio

knitr

I have search the answers in the forum, but they dont seem to work.

I am knitting a pdf document in Rstudio using the knitr package. I am using Windows 7 and Rstudio.

pandoc.exe: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43
In addition: Warning message:
running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" PA1_template.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output PA1_template.pdf --template "C:\R\Library\rmarkdown\rmd\latex\default.tex" --highlight-style tango --latex-engine pdflatex --variable "geometry:margin=1in"' had status 43 
Execution halted

Thanks,

Luis

like image 907
Luis Candanedo Avatar asked Nov 17 '14 14:11

Luis Candanedo


1 Answers

I had the same issue but on Linux using the latest rmarkdown package and pandoc 1.13. In essence it seems like pdflatex does not work with the output generated by pandoc - you need to replace the latex-engine pdflatex with xelatex (part of TeXLive)

For rmarkdown my solution was to edit the file

rmarkdown/templates/tufte_handout/resources/tufte-common.def

and replace the line

\typeoutbool{pdfatex}{@tufte@pdf}

with

\typeoutbool{xelatex}{@tufte@pdf}

Then xelatex will be used instead of pdflatex to generate pdf's with rmarkdown

like image 62
Michael Mayer Avatar answered Oct 30 '22 19:10

Michael Mayer