'Add footer to section's start/title page
I am creating a RMarkdown template of Beamer slides and use the metropolis theme as a basis. This already includes:
- Numbered TOC
- Hiding of footer on title page
Now I want to add the footer to the section's start/title pages (the page which includes only the title of the next section in the middle of the slide). I tried to show the footer on this pages by this code snipet
- |
\makeatletter
\def\ps@sectionpage{%
\setbeamertemplate{frame footer}{\tiny{\textcolor{beaublue}{Conference 56. Jahrestagung der DGSMP, 2021 | SIMON RESS}}}
}
\addtobeamertemplate{section page}{\thispagestyle{sectionpage}}{}
\makeatother
, but it is not working.
This is my (minimal working example):
slides.rmd
---
title: "Title"
subtitle: "Subtitle"
author: "Simon"
institute: "RUB"
date: "September 22, 2021"
output:
beamer_presentation:
keep_md: true
keep_tex: no
latex_engine: xelatex
#theme: metropolis
slide_level: 2 # which header level should be printed as slides
incremental: no
header-includes:
- \usetheme[numbering=fraction]{metropolis}
- \definecolor{beaublue}{rgb}{0.74, 0.83, 0.9}
- \setbeamertemplate{frame footer}{\tiny{\textcolor{beaublue}{Conference 56. Jahrestagung der DGSMP, 2021 | SIMON RESS}}}
#hide footer on title page:
- |
\makeatletter
\def\ps@titlepage{%
\setbeamertemplate{footline}{}
}
\addtobeamertemplate{title page}{\thispagestyle{titlepage}}{}
\makeatother
#show footer on section's start/title pages
- |
\makeatletter
\def\ps@sectionpage{%
\setbeamertemplate{frame footer}{\tiny{\textcolor{beaublue}{Conference 56. Jahrestagung der DGSMP, 2021 | SIMON RESS}}}
}
\addtobeamertemplate{section page}{\thispagestyle{sectionpage}}{}
\makeatother
#add secrtion numbers to TOC:
- |
\setbeamertemplate{section in toc}{
\leavevmode%
\inserttocsectionnumber.
\inserttocsection\par%
}
\setbeamertemplate{subsection in toc}{
\leavevmode\leftskip=2.5em\inserttocsubsection\par}
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
## Content
\tableofcontents[]
# Level I
Test
## Slide with Bullets
- Bullet 1
- Bullet 2
- Bullet 3
# Slide with R Output
```{r cars, echo = TRUE}
summary(cars)
```
Solution 1:[1]
The metropolis theme uses hard coded plain,c,noframenumbering
for their section pages, but you can overwrite their definition like this:
---
title: "Title"
subtitle: "Subtitle"
author: "Simon"
institute: "RUB"
date: "September 22, 2021"
output:
beamer_presentation:
keep_md: true
keep_tex: true
latex_engine: xelatex
#theme: metropolis
slide_level: 2 # which header level should be printed as slides
incremental: no
header-includes:
- \usetheme[numbering=fraction]{metropolis}
- \definecolor{beaublue}{rgb}{0.74, 0.83, 0.9}
- \setbeamertemplate{frame footer}{\tiny{\textcolor{beaublue}{Conference 56. Jahrestagung der DGSMP, 2021 | SIMON RESS}}}
#hide footer on title page:
- |
\makeatletter
\def\ps@titlepage{%
\setbeamertemplate{footline}{}
}
\addtobeamertemplate{title page}{\thispagestyle{titlepage}}{}
\makeatother
#show footer on section's start/title pages
- |
\makeatletter
\def\ps@sectionpage{%
\setbeamertemplate{frame footer}{\tiny{\textcolor{beaublue}{Conference 56. Jahrestagung der DGSMP, 2021 | SIMON RESS}}}
}
\addtobeamertemplate{section page}{\thispagestyle{sectionpage}}{}
\makeatother
#add secrtion numbers to TOC:
- |
\setbeamertemplate{section in toc}{
\leavevmode%
\inserttocsectionnumber.
\inserttocsection\par%
}
\setbeamertemplate{subsection in toc}{
\leavevmode\leftskip=2.5em\inserttocsubsection\par}
\makeatletter
\renewcommand{\metropolis@enablesectionpage}{
\AtBeginSection{
\ifbeamer@inframe
\sectionpage
\else
\frame[c]{\sectionpage}
\fi
}
}
\metropolis@enablesectionpage
\makeatother
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
## Content
\tableofcontents[]
# Level I
Test
## Slide with Bullets
- Bullet 1
- Bullet 2
- Bullet 3
# Slide with R Output
```{r cars, echo = TRUE}
summary(cars)
```
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |