pdfTeX error in R Markdown

Starting yesterday I get an error message when knitting R Markdown on every chunk. However, the document knits just fine. Note that I am outputting to a beamer_presentation. And I am sure that it is relevant that I did a fresh install.packages("tinytex") yesterday. The message I get is

!!! Error: pdfTeX run failed with value 1!
C:\texlive\2021\bin\win32\runscript.tlu:915: command failed with exit code 2:
perl.exe c:\texlive\2021\texmf-dist\scripts\pdfcrop\pdfcrop.pl "foo_files/figure-beamer/pressure-1.pdf" "foo_files/figure-beamer/pressure-1.pdf"
output file: foo.knit.md

The rmd file is the default file generated by RStudio.

title: "Untitled"

output: beamer_presentation

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

## R Markdown

This is an R Markdown presentation. 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.

## Slide with Bullets

- Bullet 1
- Bullet 2
- Bullet 3

## Slide with R Output

```{r cars, echo = TRUE}

## Slide with Plot

```{r pressure}

I can't reproduce this for now.

Can you share packageVersion('tinytex') please ? and also packageVersion("knitr") ?


Also a note: You are using TeX Live 2021 it seems, and TeX Live 2023 is out. Just a heads up in case this could be related.

1 Like

You guys are so helpful. Really appreciate it.

> packageVersion('tinytex')
[1] ‘0.45’
> packageVersion('knitr')
[1] ‘1.42’

Um, this may be a little embarrassing to ask: How do I update TeX Live?

You should handle this with TinyTeX - that is the easiest.

If your willing to update, I would try that, and then we'll see if there is still issues

1 Like

You fixed me. Thanks!

1 Like

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.