When attempting to run knitr in R Studio (from OSX - I'm currently running the Yosemite beta but I get the same errors in my Mavericks partition) I get the following error:
pandoc: pdflatex not found. pdflatex is needed for pdf output.
Error: pandoc document conversion failed with error 41
No TeX installation detected (TeX is required to create PDF output). You should install a recommended TeX distribution for your platform:
Windows: MiKTeX (Complete) - http://miktex.org/2.9/setup
(NOTE: Be sure to download the Complete rather than Basic installation)
Mac OS X: TexLive 2013 (Full) - http://tug.org/mactex/
(NOTE: Download with Safari rather than Chrome strongly recommended)
Linux: Use system package manager
Also, when attempting to run texi2dvi, I get the error:
Error in texi2dvi("samplefile.tex", pdf = TRUE) :
Running 'texi2dvi' on 'samplefile.tex' failed.
What I don't understand is that running the same texi2dvi command works just fine when I run R from terminal. But in any GUI environment none of the TeX commands work.
From R console, if I run Sys.getenv("PATH") it returns the following:
So, texbin is there, and in /usr/texbin I see both "texi2dvi" as well as "pdflatex". I've checked other solutions on the forum, reinstalled MacTex, R, RStudio and nothing seems to work. Any help would be appreciated.