R Sweave: NO TeX installation detected

前端 未结 1 1002
遇见更好的自我
遇见更好的自我 2021-02-06 16:17

I\'ve tried searching on google to fix this, with very minimal helpful solutions.

I have installed, Miktex, R and R studio. I would like to use Sweave to create PDF doc

相关标签:
1条回答
  • 2021-02-06 17:01

    Usually Rstudio finds the correct path to your Latex installation automatically. In your case that doesn't seem to be the case. After making sure Miktex is installed correctly (have you opened it and compiled a simple file?) you can set the pdflatex path manually:

    Sys.setenv(PATH = paste(Sys.getenv("PATH"), "C:\\Program Files\\MiKTeX 2.9\\miktex\\bin\\x64", sep=.Platform$path.sep))
    

    This is the path to my pdflatex.exe file, yours might live somewhere else.

    You will have to run this every time you restart RStudio. Adding the path to pdflatex.exe to your PATH variable in Windows should make this permanent but I haven't tested that. Go to System Properties, click on Environment Variables, then on Path and then Edit. Then just enter the path to your pdflatex.exe:

    0 讨论(0)
提交回复
热议问题