user2946746
user2946746

Reputation: 1780

r markdown to pdf error on output

I'm getting an error when Knit to pdf in rstudio using R markdown. It works without issue to Knit to 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

Upvotes: 1

Views: 5426

Answers (1)

M_Merciless
M_Merciless

Reputation: 408

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

  1. Make sure the Miktex console settings > General > install missing packages on the fly
  2. Install the dev version of tinytex in r studio install.packages('rmarkdown') devtools::install_github('yihui/tinytex')
  3. Also, I had changed this: In R-Studio Tools > Global Options, under the Sweave tab, try changing "Weave Rnw using:"

If I get nothing else done today, this will still make it a day to remember.

Upvotes: 5

Related Questions