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

19,914

Solution 1

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

Solution 2

I faced the same issue, here are the steps I took to solve the problem:

  • install devtools in Rstudio (install.packages(devtools))
  • install rmarkdown (devtools::install_github("rstudio/rmarkdown"))
  • fix the files tufte-common.def and tufte-handout.tex in ~/R/x86_64-pc-linux-gnu-library/3.2/rmarkdown/rmarkdown/templates/tufte_handout/resources/

If the rmarkdown installation did not go smoothly this way then do it like this (devtools::install_github("git://github.com/rstudio/rmarkdown"))

In tufte-common.def do the following:

  • Add this line \typeoutbool{xelatex}{@tufte@pdf}

  • uncomment this line \typeoutbool{xelatex}{@tufte@xetex} remember % is used to uncomment latex

Add the following lines in tufte-handout.tex:

% UTF encoding \usepackage[utf8]{inputenc}

When I tried to compile a document I still got the following error (! Font \XeTeXLink@font=pzdr at 0.00002pt not loadable: Metric (TFM) file or ins talled font not found.), I tackled it by installing texlive-fonts-recommended:

sudo apt-get install texlive-fonts-recommended

Share:
19,914
Luis Candanedo
Author by

Luis Candanedo

Updated on July 26, 2022

Comments

  • Luis Candanedo
    Luis Candanedo almost 2 years

    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