R Sweave: NO TeX installation detected

此生再无相见时 提交于 2019-12-03 08:44:21

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:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!