Post

1 follower Follow
0
Avatar

RStudio and Latex

Greetings! I have a problem compiling latex in RStudio.

Opened a new document in RStudio and input the following latex code:

\documentclass{article}
\begin{document}
test document
\end{document}

Hitting compile pdf produces the following error:

"Running pdflatex on test_latex.tex...failed
Error running /usr/texbin/pdflatex (exit code 1)"

Testing the path in terminal:

"Eriks-MacBook-Air:~ Erik$ which latex
/usr/texbin/latex
Eriks-MacBook-Air:~ Erik$ which pdflatex
/usr/texbin/pdflatex
Eriks-MacBook-Air:~ Erik$ echo$PATH
-bash: echo/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin: No such file or directory"

Running the same latex script in TexShop works fine.

Any help would be greatly appreciated!

Rstudio version 0.97.551
Tex distribution Tex Live 2013
OSX 10.8.4

Erik Nilsson Answered

2 comments

0
Avatar

Updated the path to include folder with the TEX installation - to no avail.

Ran "FixMacTeX.pgk" that was included with the LaTeX installation - still not working.

Erik Nilsson 0 votes
Comment actions Permalink
1
Avatar

Problem solved. Seems I was using XeLaTeX as the typeset option i RStudio. When switching to LaTeX it works.

Erik Nilsson 1 vote
Comment actions Permalink