问题
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:
- Find the path where
pdflatex
is installed on your system--likely/usr/texbin
, but usefind /usr -name pdflatex
if you need help. - 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