rmarkdown: pandoc: pdflatex not found

askming picture askming · Feb 27, 2014 · Viewed 71k times · Source

When I use the render{rmarkdown} to produce pdf file from .Rmd file on my Mac, an error message says

pandoc: pdflatex not found. pdflatex is needed for pdf output. Error: pandoc document conversion failed

However when I check with

pdflatex -v

I got

pdfTeX 3.1415926-2.4-1.40.13 (TeX Live 2012)
kpathsea version 6.1.0
Copyright 2012 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.5.10; using libpng 1.5.10
Compiled with zlib 1.2.7; using zlib 1.2.7
Compiled with xpdf version 3.03

The pdflatex is installed in my machine.

Can anyone help to tell how can I tell R where to find the pdflatex?

Many thanks!

Answer

Dunk picture Dunk · Aug 6, 2015

For people using ubuntu who get stranded here a better option (because it is 1/5 the size) is to use:

sudo apt-get install texlive-latex-base

Which I found via https://tex.stackexchange.com/a/128309