Knitting in PDF to R

I am new to R and try to knit R Markdown files in PDF format.

I constantly get an error message:

pandoc: pdflatex not found. pdflatex is required for pdf output. Error. Error pandoc document conversion with error 41 Execution paused

No TeX installation detected (TeX is required to create a PDF file). You should install the recommended TeX distribution for your platform:

Windows: MiKTeX (Complete) - http://miktex.org/2.9/setup (NOTE: Be sure to download the full, not the basic installation).

Mac OS X: TexLive 2013 (full) - http://tug.org/mactex/ (NOTE: It is recommended to download from Safari, but not strongly recommended to Chrome)

Linux: use the system package manager

I downloaded pandoc and I also downloaded TexLive and installed them both on my computer. For life, I can’t understand why R doesn’t know that Ive installed them, and knit in PDF.

Please, help!

+5
source share
2 answers

For Mac OS X, if you installed TexLive (I installed it using the homebrew caskroom), you must have pdftex accessible via the command line.

type 'which pdftex' to make sure something appears. from there I created a symbolic link in my $ PATH, in particular in my / usr / local / bin (where all my home stuff is stored):

ln -s /usr/texbin/pdftex /usr/local/bin/pdflatex 

from there, using knitr in RStudio and R generally seemed to work and rendering R Markdown was definitely a really nice option (check out some of the templates, as well as Tufte!)

+4
source

I had the same problem after downloading mactex via FireFox and installing the package. I quit and restarted RStudio and it worked (no change at the terminal command line level). The output of .pdf, however, is a bit blurry, at least from my first try.

0
source

Source: https://habr.com/ru/post/1212654/


All Articles