RStudio can't find LaTeX after Mavericks update

空扰寡人 提交于 2019-12-08 12:05:47

问题


I have been using Sweave for quite sometime on my system using RStudio. However, I recently upgraded my Mac OS from Lion to Mavericks.

This caused several issues: First, RStudio was not able to locate the R library, and it just wont start. I reinstalled RStudio, but still got the same issue. So I reinstalled both R and RStudio, and then RStudio started to work.

And now, RStudio is still not able to locate TeX installation, and gives me the following warning: "No TeX installation detected. Please install TeX before compiling."

This will probably get fixed by a reinstall, but I would prefer to avoid a fresh download of TeX (~2.3G).

Any ideas on how to resolve this?


回答1:


RStudio expects pdflatex to be on the system path (i.e. entering Sys.which("pdflatex") at the R console should return the path to pdflatex).

You can fix the problem by getting pdflatex back on the system path:

  1. Find the path where pdflatex is installed on your system--likely /usr/texbin, but use find /usr -name pdflatex if you need help.
  2. Create a file called TeX in /etc/paths.d that contains this path.

For example:

$ sudo -s "echo /usr/texbin > /etc/paths.d/TeX"

You'll need to restart to apply the changes.



来源:https://stackoverflow.com/questions/23229657/rstudio-cant-find-latex-after-mavericks-update

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