我一直在试图用RStudio的“Knit PDF”功能来制作一个简单的PDF。R knitr生成pdf时出错41(windows)
每次我试图将样本文档转换为PDF我得到以下信息:
|............. | 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
我编辑了我的电脑上的路径位置以及PDF的所要的标题(改变他们在适当的地方使用“PATH1”,“PATH2”和“DOCTITLE”。)
我已经使用该链接多次下载MikTex到多个位置,我曾尝试使用ProTex,因为其他一些成功的做法。我曾尝试将MikTex的bin添加到环境中,但无论如何,似乎R无法找到Tex。大多数可用的建议都是针对OSX的,并且我已尝试将这些解决方案适用于Windows,但无济于事。
请打开'cmd.exe'并输入'pdflatex'。你看到'This is pdfTeX ...'还是错误信息? –
您是否安装了MikTex,完成版本? 32位:http://mirrors.ctan.org/systems/win32/miktex/setup/setup-2.9.5870.exe 64位:http://mirrors.ctan.org/systems/win32/miktex/setup/setup-2.9 .5870-x64.exe然后重新启动R-studio – NangSaigon
CL,当我输入pdflatex时,我得到的回应是:'This is pdfTex,Version 3.14159265-2.6-1.40.16' –