[英]Error when converting from Knit to pdf in Rmarkdown
Code 码
```{r, eval=TRUE}
library(caret)
plot(iris$Sepal.Length)
```
Error reported 报告错误
pandoc.exe: pdflatex not found.
pandoc.exe:找不到pdflatex。 pdflatex is needed for pdf output.
pdflatex对于pdf输出是必需的。 Error: pandoc document conversion failed with error 41 In addition: Warning message: running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS t4.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output t4.pdf --template "C:\\Users\\15235330\\Documents\\R\\R-3.3.0\\library\\rmarkdown\\rmd\\latex\\default-1.15.2.tex" --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).
错误:pandoc文档转换失败,错误41,另外:警告消息:运行命令'“ C:/ Program Files / RStudio / bin / pandoc / pandoc” + RTS -K512m -RTS t4.utf8.md-至乳胶-来自markdown + autolink_bare_uris + ascii_identifiers + tex_math_single_backslash-输出t4.pdf-模板“ C:\\ Users \\ 15235330 \\ Documents \\ R \\ R-3.3.0 \\ library \\ rmarkdown \\ rmd \\ latex \\ default-1.15.2.tex “ --highlight-style探戈--latex-engine pdflatex --variable graphics = yes --variable” geometry:margin = 1in“'的状态为41。执行中止没有检测到TeX安装(创建PDF输出需要TeX)。 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
你应该安装你的平台推荐的TeX的分布:对于Windows:MIKTEX(完成) - http://miktex.org/2.9/setup (注:一定要下载完整的,而不是基本安装)的Mac OS X:2013的texlive(全) - http://tug.org/mactex/ (注:下载使用,而不是Chrome的_strongly_建议Safari浏览器)的Linux:使用系统包管理器
After getting a new computer, I found this post I wrote a year ago, and the technique I documented below still worked. 买了一台新计算机后,我发现了我一年前写的这篇文章,下面记录的技术仍然有效。 However my original instructions were not clear, and I have updated to hopefully help others having the same challenge.
但是,我的原始说明尚不清楚,因此我进行了更新,希望可以帮助其他面临相同挑战的人。 Of course, YMMV.
当然是YMMV。
I spent hours trying to resolve this. 我花了几个小时试图解决这个问题。 I installed Miktex, but was unable to get the packages directly from the package manager due to sitting behind a firewall at work.
我安装了Miktex,但是由于正坐在防火墙后面而无法直接从软件包管理器中获取软件包。 I finally was able to resolve this using the following steps:
我终于能够使用以下步骤解决此问题:
Go to the CTAN package archive and download the following .tar.lzma files: 转到CTAN软件包存档并下载以下.tar.lzma文件:
After downloading the above files, move the above .tar.lzma files to the folder you created, eg "C:\\miktex_pkgs" 下载以上文件后,将以上.tar.lzma文件移动到您创建的文件夹中,例如“ C:\\ miktex_pkgs”
Now you should be able to knit as PDF. 现在,您应该可以将其编织为PDF了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.