Default/Demo Rmarkdown file will not knit. R 3.6.0 All packages and MikTex current.

When I attempt to knit the default Rmarkdown file it produces the following output. The final error message is in bold.

processing file: MarkdownTest.Rmd
|............. | 20%
ordinary text without R code

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

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

|.................................................... | 80%
label: cars
|.................................................................| 100%
ordinary text without R code

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS MarkdownTest.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output MarkdownTest.tex --template "C:\Users\cuffn\Documents\R\win-library\3.6\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style tango --pdf-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in" --variable "compact-title:yes"
output file: MarkdownTest.knit.md

Error: Failed to compile MarkdownTest.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips.
In addition: Warning message:
In readLines(logfile) : incomplete final line found on 'MarkdownTest.log'
Execution halted

This is the text (Note this is the default when you open the new file):

title: "Untitled"
author: "Author"
date: "6/11/2019"
output: pdf_document

knitr::opts_chunk$set(echo = TRUE)

R Markdown

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:

summary(cars)

I have reloaded the rmarkdown packages, knitr packages, and updated MikTex.

Hi @cuffnela ! Welcome to community.rstudio.com!

If I read through the link on the error message, it looks like yihui is recommending adding the following options before knitting.

If you are using R Markdown and the Knit button in RStudio, you should set the option in a code chunk in the R Markdown document.

```{r, include=FALSE}
options(tinytex.verbose = TRUE)

I also recall this issue a bit ago with MikTex (not sure if it applies to your situation).

Lastly, you can change the .pdf engine (this has worked for me in the past) by following the instructions here.

  • Martin
1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.