0

I tried putting the following lines under header-inludes: in the YAML header of the markdown.

- \setbeamertemplate{section in toc}[round]
- \setbeamerfont{section number projected}{size=\large}
- \setbeamercolor{section number projected}{bg=red,fg=green}

That didn't work and it produced this error:

Error producing PDF.
! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.

What I am aiming is to set custom title and the look of toc.

This is test markdown document:

---
title: Test beamer
date: April 2019
theme: Madrid
aspectratio: 169
header-includes:
  - \setbeamertemplate{section in toc}[round] 
  - \setbeamerfont{section number projected}{size=\large}
  - \setbeamercolor{section number projected}{bg=red,fg=green} 
---

\tableofcontents

# Head 1
## Slide title 1 
Some content

# Head 2
## Slide title 2
Some other content

And pandoc command:

pandoc -t beamer -o testbeamer.pdf testbeamer.md --slide-level=2
1

Pandoc is escaping the square brackets, which is causing the LaTeX error. You can either add header-includes from the command line or escape the input. Note that instead of adding \tableofcontents to the document, it's better to add --table-of-contents to the shell command:

---
title: Test beamer
date: April 2019
theme: Madrid
aspectratio: 169
header-includes: |
  `\setbeamertemplate{section in toc}[round]`{=latex}
  \setbeamerfont{section number projected}{size=\large}
  \setbeamercolor{section number projected}{bg=red,fg=green} 
---

# Head 1
## Slide title 1 
Some content

# Head 2
## Slide title 2
Some other content

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.