# R Markdown PDF document header no longer working after RStudio 1.3 and R 4 upgrade

I've been using the same YAML header to knit pdf documents for quite a while... and I like it. It's served my purposes well. However, after upgrading to RStudio 1.3 and R 4, it no longer works. I get an error related to LaTeX compilation. I've always relied on R Markdown to handle LaTeX for me, for the most part. Any help anyone can provide here is appreciated. Below is a sample document, which would normally have an image at the top of the first page, but I've just put in a fake image name here (someImage.png). I realize that may cause knitting to fail, but the error I keep running in to occurs prior to R Markdown failing from lack of an image. I can't get past the LaTeX error. The code;

---
title: This is a Test
author: |
| _____________________________________
|
|
| Author N One^1^, Author N Two^2^
|
| ^1^Affiliation 1
| ^2^Affiliation 2
|
|
| _____________________________________
date: |
|
| _____________
| July 10, 2020
- \usepackage{titling}
- \pretitle{\begin{center}\LARGE\bfseries\includegraphics[width=5.5in]{someImage.png}\\[\bigskipamount]}
 - \posttitle{\end{center}}
- \usepackage{caption}
- \pagenumbering{gobble}
- \usepackage{raggedr}
- \usepackage{pdflscape}
- \newcommand{\blandscape}{\begin{landscape}}
- \newcommand{\elandscape}{\end{landscape}}
- \usepackage{float}
 output:
 pdf_document:
 fig_caption: yes
 number_sections: yes
 ---

\centering
\raggedright
\newpage
\tableofcontents
\justify
\newpage
\pagenumbering{arabic}

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

# R Markdown

This is my test pdf.

Produces the error;

! Undefined control sequence.
\->\let \reserved@e
\relax \let \reserved@f \relax @ifstar {\let \reserved...
l.83 ..._____________________}

Error: LaTeX failed to compile testRMD.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See testRMD.log for more info.
Execution halted

It never gave me that error before, just a really nice title page and table of contents. Again, any help here is appreciated.

Also, I'm having a hard to getting the code above to look right in this post. The error is related to the Author and Date parts of the YAML header.

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