RStudio can't find LaTeX after Mavericks updat

2019-06-09 19:18发布

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条回答
Viruses.
2楼-- · 2019-06-09 19:31

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.

查看更多
登录 后发表回答