简体   繁体   English

r输出降到pdf错误

[英]r markdown to pdf error on output

I'm getting an error when Knit to pdf in rstudio using R markdown. 使用R markdown在rstudio中将其编织为pdf时出现错误。 It works without issue to Knit to html. 编织到html时没有问题。

The error I'm getting is: 我得到的错误是:

Output created: PA1_template.pdf
Error in tools::file_path_as_absolute(output_file) : 
  file 'PA1_template.pdf' does not exist
Calls: <Anonymous> -> <Anonymous>
In addition: Warning messages:
1: running command '"pdflatex" -halt-on-error -interaction=batchmode     "PA1_template.tex"' had status 1 
2: In readLines(logfile) :
  incomplete final line found on 'PA1_template.log'
Execution halted

Any help on how to fix the issue would be appreciated. 任何有关如何解决此问题的帮助将不胜感激。

James 詹姆士

Resolved the above for me, please see below: 为我解决以上问题,请参见以下内容:

Hi all, 大家好,

I finally got markdown knitting. 我终于得到了降价针织。 Here's a github link with the solution: https://github.com/rstudio/rmarkdown/issues/1285#issuecomment-374340175 这是解决方案的github链接: https : //github.com/rstudio/rmarkdown/issues/1285#issuecomment-374340175

  1. Make sure the Miktex console settings > General > install missing packages on the fly 确保Miktex控制台设置>常规>快速安装缺少的软件包
  2. Install the dev version of tinytex in r studio install.packages('rmarkdown') devtools::install_github('yihui/tinytex') 在r studio install.packages('rmarkdown')devtools :: install_github('yihui / tinytex')中安装tinytex的开发版本
  3. Also, I had changed this: In R-Studio Tools > Global Options, under the Sweave tab, try changing "Weave Rnw using:" 另外,我也做了以下更改:在R-Studio工具>全局选项中,在Sweave选项卡下,尝试更改“使用以下方式编织Rnw:”

If I get nothing else done today, this will still make it a day to remember. 如果我今天什么都没做,这仍将是值得纪念的一天。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM