如何解决beamer_presentation中的错误,文件不存在?

时间:2018-04-06 06:51:37

标签: r r-markdown knitr pandoc miktex

编织到beamer_presentation我收到此错误消息时,是否有人知道如何阅读并解决此问题?

代码:

---
title: "Untitled"
author: "Author"
date: "6 April 2018"
output: beamer_presentation
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

## R Markdown

Something

错误讯息:

processing file: TEST.Rmd
  |......................                                           |  33%
  ordinary text without R code

  |...........................................                      |  67%
label: setup (with options) 
List of 1
 $ include: logi FALSE

  |.................................................................| 100%
  ordinary text without R code


output file: TEST.knit.md

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS TEST.utf8.md --to beamer --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output TEST.tex --highlight-style tango --latex-engine pdflatex --self-contained 

Output created: TEST.pdf
Error in tools::file_path_as_absolute(output_file) : 
  file 'TEST.pdf' does not exist
Calls: <Anonymous> -> <Anonymous>
In addition: Warning message:
running command '"pdflatex" -halt-on-error -interaction=batchmode "TEST.tex"' had status 1 
Execution halted

版本信息:

> sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=German_Switzerland.1252  LC_CTYPE=German_Switzerland.1252   
[3] LC_MONETARY=German_Switzerland.1252 LC_NUMERIC=C                       
[5] LC_TIME=German_Switzerland.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.16    tufte_0.3       digest_0.6.15   withr_2.1.2     rprojroot_1.3-2
 [6] R6_2.2.2        backports_1.1.2 git2r_0.21.0    magrittr_1.5    evaluate_0.10.1
[11] httr_1.3.1      stringi_1.1.7   curl_3.2        rmarkdown_1.9.8 devtools_1.13.5
[16] tools_3.4.4     stringr_1.3.0   rsconnect_0.8.8 yaml_2.1.18     compiler_3.4.4 
[21] memoise_1.1.0   htmltools_0.3.6 knitr_1.20 

注意: 几个月前,这项工作毫无问题。

1 个答案:

答案 0 :(得分:2)

根据GitHub issue rstudio/rmarkdown#1285,有两种解决方案。

第一次降级rmarkdown

devtools::install_version("rmarkdown", version = "1.8", 
                          repos = "http://cran.us.r-project.org")

<强>

第二次安装/升级tinytex

install.packages('rmarkdown')  # installs v 1.9 at the moment
devtools::install_github('yihui/tinytex')

我选择了第二个选项,对我来说很好。

相关问题