I write many documents using RStudio, including beamer slides from both LaTeX (Sweave/rnw) and Rmarkdown (rmd).

I understand that \setbeamertemplate{footline}[frame number] will add frame numbers to beamer slides. This works when I use LaTeX, but not when I use Rmarkdown. Specifically, the error is:

l.100 \setbeamertemplate{footline}{[}f
Error: pandoc document conversion failed with error 43

How do I fix this? Or more generally, how do I add frame numbers to a beamer document created with Rmarkdown?

Minimal Example:

Sweave/LaTeX (works):

\title{Put Title Here}
\setbeamertemplate{navigation symbols}{} 
\setbeamertemplate{footline}[frame number]{}


\begin{frame}{Title of Slide}
  Slide text


Rmarkdown (throws pandoc error):

title: "Put Title Here"
output: beamer_presentation
  - \setbeamertemplate{navigation symbols}{} 
  - \setbeamertemplate{footline}[frame number]

## Slide Title

Slide text

Thank you.


1 Answer 1


Summarising information from the answer https://stackoverflow.com/a/38687577/2777074

Create a new .tex file called header_pagenrs.tex which includes the line

\setbeamertemplate{navigation symbols}{} 
\setbeamertemplate{footline}[frame number]

Then in the .Rmd file:

title: "Things and Stuff"
author: "Me"
      in_header: header_pagenrs.tex

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.