I have a very simple test.Rmd file:
--- title: "test" output: pdf_document --- done.
This is what I get after render:
processing file: test.Rmd
ordinary text without R code
output file: test.knit.md
"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.tex --template "C:\Users\username\Documents\R\win-library\3.4\rmarkdown\rmd\latex\default-220.127.116.11.tex" --highlight-style tango --pdf-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in"
Error: Failed to compile test.tex.
In addition: Warning message:
running command '"pdflatex" -halt-on-error -interaction=batchmode "test.tex"' had status 1
I could see that only test.tex file was created. Also:
- When I run pdflatex using the same command in console, it worked fine and created the PDF:
system('"pdflatex" -halt-on-error -interaction=batchmode "test.tex"')
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6630 64-bit)
entering extended mode
- If I don't run rmarkdown::render but instead use the "Knit" button in RStudio, the PDF was also produced just fine.
I'm using RStudio 1.1.419, rmarkdown 1.9.5, knitr 1.20, pdfTex and MikTex versions see above, and everything was run on Windows 10.
I searched web a lot but didn't see anything that'd help. I put the Rmd file in a path that had no space or any weird char, reinstalled MiKTex and pdflatex required packages, tried disable or enable shell escape commands, same error message every time.