Rmd: 在标题和内容页上隐藏页脚
Rmd: Hide FOOTER on title&content page
我正在创建 RMarkdown Beamer 幻灯片 模板,并使用 metropolis 主题作为基础。
现在我想添加一个页脚,左侧是一些文本,右侧是幻灯片编号。这样可行。此外,整个页脚不应显示在标题和内容页面上。 如何控制显示脚线的位置?
这是我的(最小工作示例):
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
includes:
in_header:
#- toc.tex
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}}}
---
```{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)
```
我知道在 Latex 中可以通过 begingroup
& endgroup
命令结合 plain
-option ({}
) 用于 [=16] =]:
\documentclass{beamer}
\setbeamertemplate{footline}[frame number]
\begin{document}
\begin{frame}
normal frame
\end{frame}
\begingroup
\setbeamertemplate{footline}{}
\begin{frame}
without footline
\end{frame}
\endgroup
\begin{frame}
normal frame
\end{frame}
\end{document}
但是不知道如何在RMarkdown中实现
要从您的标题页和目录页中删除脚注,您可以使用与 https://topanswers.xyz/tex?q=1004#a1198
中相同的技巧
将以下内容添加到您的 header 包括:
\makeatletter
\def\ps@navigation@titlepage{%
\setbeamertemplate{footline}{}
\@nameuse{ps@navigation}
}
\addtobeamertemplate{title page}{\thispagestyle{navigation@titlepage}}{}
\pretocmd{\tableofcontents}{\thispagestyle{navigation@titlepage}}{}{}
\makeatother
(请注意语法 \tiny{...}
是错误的。这个宏是一个开关,不带参数。您可以改用 {\tiny ...}
---
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
includes:
in_header:
#- toc.tex
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}}}
- \makeatletter
- \def\ps@navigation@titlepage{\setbeamertemplate{footline}{}\@nameuse{ps@navigation}}
- \addtobeamertemplate{title page}{\thispagestyle{navigation@titlepage}}{}
- \pretocmd{\tableofcontents}{\thispagestyle{navigation@titlepage}}{}{}
- \setbeamertemplate{section in toc}{\leavevmode\inserttocsectionnumber. \inserttocsection\par}
- \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)
```
我正在创建 RMarkdown Beamer 幻灯片 模板,并使用 metropolis 主题作为基础。
现在我想添加一个页脚,左侧是一些文本,右侧是幻灯片编号。这样可行。此外,整个页脚不应显示在标题和内容页面上。 如何控制显示脚线的位置?
这是我的(最小工作示例):
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
includes:
in_header:
#- toc.tex
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}}}
---
```{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)
```
我知道在 Latex 中可以通过 begingroup
& endgroup
命令结合 plain
-option ({}
) 用于 [=16] =]:
\documentclass{beamer}
\setbeamertemplate{footline}[frame number]
\begin{document}
\begin{frame}
normal frame
\end{frame}
\begingroup
\setbeamertemplate{footline}{}
\begin{frame}
without footline
\end{frame}
\endgroup
\begin{frame}
normal frame
\end{frame}
\end{document}
但是不知道如何在RMarkdown中实现
要从您的标题页和目录页中删除脚注,您可以使用与 https://topanswers.xyz/tex?q=1004#a1198
中相同的技巧将以下内容添加到您的 header 包括:
\makeatletter
\def\ps@navigation@titlepage{%
\setbeamertemplate{footline}{}
\@nameuse{ps@navigation}
}
\addtobeamertemplate{title page}{\thispagestyle{navigation@titlepage}}{}
\pretocmd{\tableofcontents}{\thispagestyle{navigation@titlepage}}{}{}
\makeatother
(请注意语法 \tiny{...}
是错误的。这个宏是一个开关,不带参数。您可以改用 {\tiny ...}
---
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
includes:
in_header:
#- toc.tex
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}}}
- \makeatletter
- \def\ps@navigation@titlepage{\setbeamertemplate{footline}{}\@nameuse{ps@navigation}}
- \addtobeamertemplate{title page}{\thispagestyle{navigation@titlepage}}{}
- \pretocmd{\tableofcontents}{\thispagestyle{navigation@titlepage}}{}{}
- \setbeamertemplate{section in toc}{\leavevmode\inserttocsectionnumber. \inserttocsection\par}
- \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)
```