rmarkdown: specify manually pandoc path?
Asked Answered
R

2

8

I have a rmarkdown document that I render regularly with rmarkdown::render

It works fine on my computer (Windows) as I have RStudio installed, and it has setup automatically the path to pandoc.

However when I try to run it on my server (outside RStudio), it fails with error that pandoc is not found.

How can I set up manually the path the pandoc from my script? Without changing the configuration on the server.

I have tried this but it doesn't work:

Sys.setenv(RSTUDIO_PANDOC="PATH_TO_MY_PANDOC_BIN/binaries/pandoc/pandoc.exe")
Retiform answered 18/11, 2016 at 8:55 Comment(2)
Just thought I'd comment here for people working in environments where editing the path is frowned upon - in a pinch you could just drop the pandoc.exe file in the same directory as your rmarkdown files and you can get it to run and render properly.Quicksilver
Amazing comment, saved my lifeSickroom
B
2

I suggest to set the system path for pandoc (Windows 10 instructions):
1. In the Start menu, search for "Edit the system environment variables"
2. At this point, Windows may ask you for username + password (for a user with permission to change system settings)
3. Click "Environment Variables" button
4. In the lower part of the window (System variables), select the line with "Path" and click Edit
5. Add the path to the folder where pandoc.exe is, but not including "pandoc.exe" or a slash at the end

Bismarck answered 23/2, 2018 at 11:52 Comment(1)
Is there a similar solution that does not involve admin rights?Accrescent
S
0

Sys.setenv(RSTUDIO_PANDOC="PATH_TO_MY_PANDOC_BIN/binaries/pandoc/pandoc.exe")

That is actually almost correct, just omit the *.exe files, write the path only up to folder contain pandoc.exe

like this : Sys.setenv(RSTUDIO_PANDOC="PATH_TO_MY_PANDOC_BIN/binaries/pandoc")

i believe this doesn't require admin rights

Subalternate answered 28/6, 2022 at 14:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.