将页脚添加到部分的开始/标题页

Posted

技术标签:

【中文标题】将页脚添加到部分的开始/标题页【英文标题】:Add footer to section's start/title page 【发布时间】:2021-11-30 03:52:46 【问题描述】:

我正在创建 Beamer 幻灯片RMarkdown 模板,并使用 metropolis 主题作为基础。 这已经包括:

编号目录 在标题页上隐藏页脚

现在我想将页脚添加到该部分的开始/标题页(该页面仅包含幻灯片中间的下一部分的标题)。我试图通过这段代码片段在此页面上显示页脚

  - |
    \makeatletter
    \def\ps@sectionpage%
      \setbeamertemplateframe footer\tiny\textcolorbeaublueConference 56. Jahrestagung der DGSMP, 2021 | SIMON RESS
    
    \addtobeamertemplatesection page\thispagestylesectionpage
    \makeatother

,但它不起作用。


这是我的(最小的工作示例):

幻灯片.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
  - \definecolorbeaubluergb0.74, 0.83, 0.9
  - \setbeamertemplateframe footer\tiny\textcolorbeaublueConference 56. Jahrestagung der DGSMP, 2021 | SIMON RESS
#hide footer on title page:
  - |
    \makeatletter
    \def\ps@titlepage%
      \setbeamertemplatefootline
    
    \addtobeamertemplatetitle page\thispagestyletitlepage
    \makeatother
#show footer on section's start/title pages
  - |
    \makeatletter
    \def\ps@sectionpage%
      \setbeamertemplateframe footer\tiny\textcolorbeaublueConference 56. Jahrestagung der DGSMP, 2021 | SIMON RESS
    
    \addtobeamertemplatesection page\thispagestylesectionpage
    \makeatother
#add secrtion numbers to TOC:
  - |
    \setbeamertemplatesection in toc
    \leavevmode%
    \inserttocsectionnumber. 
    \inserttocsection\par%
    
    \setbeamertemplatesubsection 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)
```

【问题讨论】:

【参考方案1】:

metropolis 主题使用硬编码的plain,c,noframenumbering 作为其部分页面,但您可以像这样覆盖它们的定义:

---
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
  - \definecolorbeaubluergb0.74, 0.83, 0.9
  - \setbeamertemplateframe footer\tiny\textcolorbeaublueConference 56. Jahrestagung der DGSMP, 2021 | SIMON RESS
#hide footer on title page:
  - |
    \makeatletter
    \def\ps@titlepage%
      \setbeamertemplatefootline
    
    \addtobeamertemplatetitle page\thispagestyletitlepage
    \makeatother
#show footer on section's start/title pages
  - |
    \makeatletter
    \def\ps@sectionpage%
      \setbeamertemplateframe footer\tiny\textcolorbeaublueConference 56. Jahrestagung der DGSMP, 2021 | SIMON RESS
    
    \addtobeamertemplatesection page\thispagestylesectionpage
    
    \makeatother
#add secrtion numbers to TOC:
  - |
    \setbeamertemplatesection in toc
    \leavevmode%
    \inserttocsectionnumber. 
    \inserttocsection\par%
    
    \setbeamertemplatesubsection in toc
    \leavevmode\leftskip=2.5em\inserttocsubsection\par
    \includefoo
---

```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)
```

foo.tex:

\makeatletter
\renewcommand\metropolis@enablesectionpage
  \AtBeginSection
    \ifbeamer@inframe
      \sectionpage
    \else
      \frame[c]\sectionpage
    \fi
  

\metropolis@enablesectionpage
\makeatother

【讨论】:

以上是关于将页脚添加到部分的开始/标题页的主要内容,如果未能解决你的问题,请参考以下文章

Vuetify 数据表如何垂直适合表格以及分页页脚粘在底部

Android将页脚添加到ListView addFooterView()?

无法将页脚添加到集合视图

将页脚添加到 Angular Material Datepicker

可以将页脚添加到 MVCContrib 网格吗?

将页脚添加到可展开的 ListView