Saturday, October 25, 2014

Fixing the "No TeX detected. Please install Tex before compiling." error for Rstudio on OS X

If you use RStudio on OS X you have probably seen the following error at least once

 No TeX installation detected. Please install TeX before compiling.

For some reason I have found it near impossible to google a answer for this one easily.  You usually find pages that go into a bit of detail about the issue, but no clear and easy answer on how to fix it.  Then if you do fix it, something will happen to your system that breaks the fix and you have to go searching all over again.  I am posting the fix here in the hopes that no one else will ever have to go through a frustrating search like I have had to do more times than I would like to admit.

I found the fix on an RStudio Support page (

Dave Dyer posted this

I had the same problem, and the following two symbolic links fixed it:
sudo ln -s /Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin /usr/texbin
sudo ln -s /usr/texbin/pdflatex /usr/bin/pdflatex
Not sure that it matters, but I am using TeXShop, and didn't have to re-install anything.


Hopefully someone else will also find this useful