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.
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.
Related
I've been creating PDF reports via RMarkdown for a couple months now, but after installing MikTex, R and the rmarkdown and tidyverse packages on a new machine today, I received the following error message when attemping to knit a PDF:
"C:/PROGRA~2/Pandoc/pandoc" +RTS -K512m -RTS Test.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output test.pdf --template "C:\Users\drewm\Documents\R\win-library\3.4\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style tango --latex-engine xelatex --variable graphics=yes --variable "geometry:margin=1in"
! Undefined control sequence.
<argument> \LaTeX3 error:
Erroneous variable \c__fontspec_shape_n_n_tl used!
l.3806 \emfontdeclare{ \emshape, \eminnershape }
pandoc.exe: Error producing PDF
Error: pandoc document conversion failed with error 43
In addition: Warning message:
running command '"C:/PROGRA~2/Pandoc/pandoc" +RTS -K512m -RTS Test.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output test.pdf --template "C:\Users\drewm\Documents\R\win-library\3.4\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style tango --latex-engine xelatex --variable graphics=yes --variable "geometry:margin=1in"' had status 43
I was able to recreate the error with the simple example below:
Test.R
library(rmarkdown)
library(knitr)
setwd(C:/something)
render("Test.rmd", output_format=pdf_document(latex_engine="xelatex"), output_file="test.pdf")
Test.Rmd
---
title: "Habits"
output:
pdf_document:
latex_engine: xelatex
---
Hello World!
I also see the error when I knit Test.Rmd directly in RStudio instead of using a separate .R file with render(). I also tried using the lualatex pdf engine and received the same error as above. I am able to generate PDFs using the RMarkdown PDF example built into RStudio.
This post on Sourceforge seems relevant, but not useful since the solution was to update the fontspec package and I'm already using an updated fontspec package.
Session Info
> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 15063)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] knitr_1.17 rmarkdown_1.6
loaded via a namespace (and not attached):
[1] compiler_3.4.1 backports_1.1.0 magrittr_1.5 rprojroot_1.2
[5] tools_3.4.1 htmltools_0.3.6 yaml_2.1.14 Rcpp_0.12.12
[9] stringi_1.1.5 stringr_1.2.0 digest_0.6.12 evaluate_0.10.1
Any help or advice is greatly appreciated!
The uninstall/reinstall of MikTex reverted several of the packages to outdated versions (it would be helpful if the MikTex installer prompted the user to update packages after installation). In this case, my fontspec package was reverted to 2.6a (see potential issue outlined in Sourceforge link above). After running MikTex Update to update all my installed packages. I was able to successfully produce the PDF output desired.
I'm generating a README.md GitHub page from a Rmd file. It was generated correctly a week ago but now it's throwing the following error:
"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS
README.md --to html --from markdown_github --output README.html
--standalone --self-contained --highlight-style pygments --template "C:\Users\E\Documents\R\win-library\3.3\rmarkdown\rmarkdown\templates\github_document\resources\preview.html"
--variable "github-markdown-css:C:\Users\E\Documents\R\win-library\3.3\rmarkdown\rmarkdown\templates\github_document\resources\github.css"
--email-obfuscation none pandoc.exe: Could not fetch https://img.shields.io/codecov/c/github/erzk/fnirsr/master.svg
HttpExceptionRequest Request { host =
"img.shields.io" port = 443 secure =
True requestHeaders = [] path =
"/codecov/c/github/erzk/fnirsr/master.svg" queryString = ""
method = "GET" proxy = Nothing
rawBody = False redirectCount = 10
responseTimeout = ResponseTimeoutDefault requestVersion =
HTTP/1.1 } (InternalException (HandshakeFailed Error_EOF)) Error:
pandoc document conversion failed with error 67 In addition: Warning
message: running command '"C:/Program Files/RStudio/bin/pandoc/pandoc"
+RTS -K512m -RTS README.md --to html --from markdown_github --output README.html --standalone --self-contained --highlight-style pygments
--template "C:\Users\E\Documents\R\win-library\3.3\rmarkdown\rmarkdown\templates\github_document\resources\preview.html"
--variable "github-markdown-css:C:\Users\E\Documents\R\win-library\3.3\rmarkdown\rmarkdown\templates\github_document\resources\github.css"
--email-obfuscation none' had status 67 Execution halted
I checked the URL and it works, the badge is also visible on the old README.md file.
As suggested here, I updated rmarkdown and knitr (first to CRAN version, then to GitHub version), but it didn't help.
Then I tried adding self_contained: no as suggested here. Still throws an error.
sessionInfo()
R version 3.3.2 (2016-10-31) Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale: 1 LC_COLLATE=English_United Kingdom.1252
LC_CTYPE=English_United Kingdom.1252 LC_MONETARY=English_United
Kingdom.1252 4 LC_NUMERIC=C
LC_TIME=English_United Kingdom.1252
attached base packages: 1 stats graphics grDevices utils
datasets methods base
other attached packages: 1 fnirsr_0.1.0
loaded via a namespace (and not attached): 1 Rcpp_0.12.8
knitr_1.16.3 magrittr_1.5 lattice_0.20-34 R6_2.2.0
stringr_1.2.0 [7] dplyr_0.5.0 tools_3.3.2
grid_3.3.2 R.oo_1.21.0 RPMG_2.2-1 DBI_0.5-1
[13] R.matlab_3.6.1 htmltools_0.3.6 yaml_2.1.14
assertthat_0.1 digest_0.6.12 rprojroot_1.2 [19]
tibble_1.2 readr_1.0.0 R.utils_2.5.0 evaluate_0.10
rmarkdown_1.5.9000 stringi_1.1.2 [25] RSEIS_3.7-4
backports_1.0.4 R.methodsS3_1.7.1 Rwave_2.4-5 zoo_1.7-14
I get the same error on Ubuntu 16.04.
I didn't submit it as an issue to knitr yet as there might be a simple solution.
Any ideas how to fix it?
This question already has an answer here:
Rmarkdown: pandoc document conversion failed with error 43 because of large number
(1 answer)
Closed 6 years ago.
I'm trying to knit following Rmardown:
---
title: "Title"
author: "Author"
date: '20 nov 2016 г '
output:
pdf_document:
latex_engine: xelatex
---
## Next inline code produced error: `r 98809`
Error:
processing file: 111.Rmd
output file: 111.knit.md
! Missing $ inserted.
<inserted text>
$
l.91 ...e code produced error: 9.880910\^{}\{4\}}}
pandoc.exe: Error producing PDF
Ошибка: pandoc document conversion failed with error 43
If I edit the number and delete last "9" to looks likes this r 9880 all going to be fine...
Is this a bug?
I'm testing on fresh R:
> sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=Russian_Russia.1251 LC_CTYPE=Russian_Russia.1251 LC_MONETARY=Russian_Russia.1251 LC_NUMERIC=C LC_TIME=Russian_Russia.1251
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] magrittr_1.5 assertthat_0.1 htmltools_0.3.5 tools_3.3.2 yaml_2.1.13 tibble_1.2 Rcpp_0.12.7 stringi_1.1.2 rmarkdown_1.1 stringr_1.1.0 digest_0.6.10
[12] evaluate_0.10
>
Try modify the last line of your file:
## Next inline code produced error: `r format(98809)`
I am unable to compile a Rmd as pdf with the CrossTable example from the "Using pander with knitr" vignette.
Here is my code
---
title: "Pander CrossTable test"
author: "Christiaan Pauw"
date: "08 March 2016"
output: pdf_document
---
```{r }
library(pander)
library(descr, quietly = TRUE)
pander(CrossTable(mtcars$gear, mtcars$cyl))
```
The error message reads:
output file: Untitled.knit.md
! LaTeX Error: There's no line here to end.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.159 ~\\15\\\\
pandoc: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43
Execution halted
Here is my session info
> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.5 (Yosemite)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] descr_1.1.2 pander_0.6.0 ggplot2_2.0.0 reshape2_1.4.1 stargazer_5.2 raster_2.5-2
[7] Matrix_1.2-3 sp_1.2-1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.3 knitr_1.12.3 magrittr_1.5 munsell_0.4.2 colorspace_1.2-6
[6] xtable_1.8-0 lattice_0.20-33 stringr_1.0.0 plyr_1.8.3 tools_3.2.3
[11] grid_3.2.3 gtable_0.1.2 htmltools_0.3 yaml_2.1.13 digest_0.6.9
[16] rmarkdown_0.9.5.1 stringi_1.0-1 scales_0.3.0
For the record: The problem seemed to solve itself. When I returned to this problem after a few updates everything worked
It works for R version 3.3.0 with Rstudio Version 0.99.902. The pandoc version is 1.15.2
I am using rmarkdown in Rstudio to try to Knit a PDF using the example code provided by Rstudio (code below):
---
title: "Untitled"
output:
pdf_document:
keep_tex: yes
---
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r}
summary(cars)
```
You can also embed plots, for example:
```{r, echo=FALSE}
plot(cars)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
But, I get the following error:
! pdfTeX error (font expansion): auto expansion is only possible with scalable
fonts.
\AtBegShi#Output ...ipout \box \AtBeginShipoutBox
\fi \fi
l.144 \end{document}
pandoc.exe: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43
In addition: Warning message:
running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS test_rmarkdown.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output test_rmarkdown.pdf --template "C:\Users\XXXX\Documents\R\win-library\3.2\rmarkdown\rmd\latex\default.tex" --highlight-style tango --latex-engine pdflatex --variable "geometry:margin=1in"' had status 43 Execution halted
My session info is shown below:
> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] Rcpp_0.11.6 digest_0.6.8 MASS_7.3-43 grid_3.2.2 plyr_1.8.2 gtable_0.1.2 magrittr_1.5 scales_0.2.4
[9] ggplot2_1.0.1 stringi_0.4-1 reshape2_1.4.1 rmarkdown_0.8 proto_0.3-10 tools_3.2.2 stringr_1.0.0 munsell_0.4.2
[17] yaml_2.1.13 colorspace_1.2-6 htmltools_0.2.6
And I am running the complete TeXworks version 0.4.6 64-bit.
I had similar problems before.
Try to run devtools::install_github("rstudio/rmarkdown")
This worked for me.
If you dont have devtools you need to run this to:
install.packages("devtools")
library(devtools).