Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pandoc document conversion failed with error 41 #34

Open
isaacfab opened this issue Feb 19, 2016 · 2 comments
Open

pandoc document conversion failed with error 41 #34

isaacfab opened this issue Feb 19, 2016 · 2 comments

Comments

@isaacfab
Copy link

If there is not a set of latex and pandoc software installed on the localhost then the pdf options will throw the error in the title. I haven't tried this on a shiny server but it is certainly the case with local host instances.

@SayaliSonawane
Copy link

Solution:
Step 1: Download and Install MiKTeX from http://miktex.org/2.9/setup
Step 2: Run Sys.getenv("PATH") in R studio
This command returns the path where Rstudio is trying to find pdflatex.exe
In windows (64-bit) it should return C:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe
If pdflatex.exe is not located in this location Rstudio gives this error code 41.
Step 3: To set this path variable run:
Sys.setenv(PATH=paste(Sys.getenv("PATH"),"C:/Program Files/MiKTeX 2.9/miktex/bin/x64/",sep=";"))

@janeshdev
Copy link

HI @SayaliSonawane I am also getting similar error. I tried to set the variable by using the command you wrote:

I am trying to use bookdown package to convert to pdf document. The error I am getting is as follows:

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS _main.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output _main.tex --table-of-contents --toc-depth 2 --template "C:\Users\DSI\Documents\R\win-library\3.3\rmarkdown\rmd\latex\default-1.17.0.2.tex" --number-sections --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in" --variable tables=yes --standalone --bibliography thrush-bibliography.bib --filter pandoc-citeproc 
Error: Failed to compile _main.tex.
In addition: Warning message:
running command '"pdflatex" -halt-on-error -interaction=batchmode "_main.tex"' had status 1 

Any suggestions to fix this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants