How to solve error in beamer_presentation, file do

2019-01-20 13:02发布

问题:

When knitting to beamer_presentation I'm receiving this error message, does anyone know how to read it and solve this issue?

Code:

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

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

## R Markdown

Something

Error message:

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

Version infos:

> 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 

Note: A few months ago this worked without problems.

回答1:

According to the GitHub issue rstudio/rmarkdown#1285, there are two solutions.

1st downgrade rmarkdown

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

or

2nd install/upgrade tinytex

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

I chose the 2nd option, works fine for me.