How to add logo to first slide of beamer presentation using rmarkdown YAML header?

Viewed 110

I am new to Rmarkdown, Beamer presentations and the like and have been having some trouble inserting my logo to the header. I don't exactly know how the code works, Here is the code I am trying to use for my header, but it is giving me a "Undefined Control Sequence" error.

---
title: "Lifewerks Reporting Numbers 2021-2022"
date: "`r Sys.Date()`"
header-includes: 
  - \usepackage{subfig}
  - \logo{\incudegraphics[width = 3cm]{sfp-logo.png}}
output: beamer_presentation
---

Any help or resources that I could learn from would be greatly appreciated! Thank you!!

1 Answers
  • there is a small typo, it should be \includegraphics [the l is missing]

  • if you want the image just on the first page, I would use \titlegraphic instead of \logo (the later would add the image to all frames)


---
title: "Lifewerks Reporting Numbers 2021-2022"
date: "`r Sys.Date()`"
header-includes: 
  - \titlegraphic{\includegraphics[width = 3cm]{example-image-duck}}
output: 
  beamer_presentation:
    keep_tex: true
---

test
Related