I'm having trouble trying to set up rmarkdown to work within VSCode.
I have tried Sys.setenv(RSTUDIO_PANDOC = "path")
, but if I set it to the same path that R Studio successfully uses, if I do rmarkdown::pandoc_available()
it still returns [1] FALSE
.
I have also tried setting it as an environment variable in my VSCode settings.json. Again, I can knit with no problems from R Studio. I have looked at many answers to similar questions here on StackOverflow, but none of them have worked for me thus far. I am running Windows 10.
EDIT:
r$> Sys.getenv("RSTUDIO_PANDOC")
Returns
[1] "C:/Program Files/RStudio/bin/quarto/bin/tools/pandoc.exe"
I have tried running
Sys.setenv(RSTUDIO_PANDOC = "C:/Program Files/RStudio/bin/quarto/bin/tools/pandoc.exe")
My settings.json file includes this
"terminal.integrated.env.windows": { "RSTUDIO_PANDOC":"C:/Program Files/RStudio/bin/quarto/bin/tools/pandoc.exe" }
Add the pandoc folder to your Path
environment variable:
C:\Program Files\RStudio\bin\quarto\bin\tools\
. It should be at the bottom of the listThis is based on https://github.com/rstudio/rmarkdown/issues/289, which I interpret as advising to use the Path
environment variable rather than the RSTUDIO_PANDOC
environment variable when outside RStudio.