3
votes

I have been trying to make a simple PDF using the "Knit PDF" functionality from RStudio.

Every time I try to convert the sample doc to a PDF I get the following message:

|............. | 20%

ordinary text without R code

|.......................... | 40%

label: unnamed-chunk-1

|....................................... | 60%

ordinary text without R code

|.................................................... | 80%

label: unnamed-chunk-2 (with options)

List of 1

$ echo: logi FALSE

|.................................................................| 100%

ordinary text without R code

"PATH1" +RTS -K512m -RTS ECON_404_HW_4.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output DOCTITLE.pdf --template "PATH2" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in" output file: DOCTITLE.knit.md

pandoc.exe: pdflatex not found. pdflatex is needed for pdf output.

Error: pandoc document conversion failed with error 41

In addition: Warning message:

running command '"PATH1" +RTS -K512m -RTS DOCTITLE.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output DOCTITLE.pdf --template "PATH2" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in"' had status 41

Execution halted

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

I edited out the path locations on my PC as well as the intended title of the PDF (changing them with "PATH1", "PATH2", and "DOCTITLE" where appropriate.)

I have used the link to download MikTex multiple times to multiple locations, I have tried using ProTex as some others have had success doing. I have tried adding the bin of MikTex to the environment but no matter what, it seems that R is unable to find Tex. Most of the advice available is for OSX, and I have tried adapting those solutions for windows to no avail.

1
Please open cmd.exe and type pdflatex. Do you see This is pdfTeX ... or an error message?CL.
Did you install MikTex, completed version? 32bits: mirrors.ctan.org/systems/win32/miktex/setup/setup-2.9.5870.exe 64bits: mirrors.ctan.org/systems/win32/miktex/setup/… then restart R-studioNangSaigon
CL, when I type pdflatex I get the response: This is pdfTex, Version 3.14159265-2.6-1.40.16 <MiKTeX 2.9>Matty R
@MattyR did you ever figure this out. having the same problemguyabel

1 Answers

0
votes

@Matty R, after getting that error I restarted Rstudio, and then it asked me to instally packages like "upquote" using MikTex Package Manager, after three or four packages installation I got the pdf file created.