Add tex distribution to PATH for R studio

笑着哭i 提交于 2019-12-05 15:05:17

R will always source the Rprofile.site file first. On Windows, the file is in the C:\Program Files\R\R-n.n.n\etc directory.

see here: Add TeX path to R Studio - Ubuntu and here: Customizing Startup

I found package tinytex to be of interest. It allows to install a minimal tex distrib without administrator privilege, takes care of path, and useful function to add missing tex packages. Works well with knitr

It is written by Xie Yihui author of knitr.

Let me build up to @HeavenZone's answer:

You should go onto

C:\Program Files\R\R-n.n.n\etc

directory and give permissions to modify the files in on the folder. This can be done by doing

Right click->Properties->Security->Edit->Select Users->In Permissions list tick->Write

Once you're done you should open the file Renviron.site on the directory etc. And add a line like

PATH=C:\Program Files\MiKTeX 2.9\miktex\bin\64:${PATH}

I wrote a new line, assume that the definitions are concatenated. Perhaps you need also \pdflatex.exe in the above path.

Once you have this, restart Rstudio and it should grasp now the latex distribution.

I would probably change the title of this question to include that this is the Windows version so that it is easy to look for it, however my edit was rejected so I leave it to someone else...

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