RMarkdown beamer & Table 内容

RMarkdown beamer & Table of content

我正在尝试使用 RMarkdown beamer 创建我的第一组幻灯片。

我目前拥有的:

---
title: title
author: author
date: date
output: beamer_presentation: default
ioslides_presentation: default
linkcolor: blue
---
    
## Plan for today
    
text
        
## Outline
    
text
    
## Day 1
    
text
    
## Day 2
    
text
    
## Day 3
    
text
    
## Day 4
    
text
    
## Day 5
    
text

我在 header 的顶部看到了内容 Table 的演示文稿,当演示者切换到具有不同部分的新幻灯片时,它会突出显示 header 演示者所在的位置。为了做到这一点,我需要什么代码?理想情况下,我希望在 介绍 下的 Table 目录 'Plan for today' 和 'Outline',然后是 第 1 天 , 第 2 天, 等等 结论.

我也想:

  1. 在右上角header添加图片
  2. 在右下角的页脚添加页码,如3/14(仅在扉页之后)

有什么想法吗?非常感谢。

我正在尝试做的事情的图片:

对于header中的TOC,最好在支持这个的predefined themes中选择,例如Szeged,然后在带有 theme: Szeged.

的 YAML

要获得所需的大纲,您需要使用 first-level(从 # 开始)和 second-level(从 ## 开始)部分的正确组合 headers,见下文。我也设置了slide_level: 3.

向右上角添加徽标、向页脚添加页码以及自定义标题幻灯片需要将一些 LaTeX 代码插入到用于编译最终 PDF 输出的模板中。您可以通过使用 .Rmd 文件的 YAML header 中的 includes 选项将代码包含在单独的 .tex 文件中来执行此操作。它应该是这样的:

presentation.Rmd

---
output:
  beamer_presentation:
    theme: Szeged
    slide_level: 3
    includes:
      in_header: header.tex
---

# Introduction

## Plan for today
text

## Outline
text

# Day 1

text

# Day 2

and so on ...

# Conclusion

your conclusion

header.tex

% add custom title slide
\setbeamertemplate{title page}{
  \inserttitle\[0.5ex] 
  \insertauthor\[0.5ex] 
  \insertdate
  \pagenumbering{gobble}
  \thispagestyle{plain}
}
% remove title slides at beginning of sections
\AtBeginSection{}
\AtBeginSubsection{}
% add page counter to the footer
\setbeamertemplate{footline}[frame number]
\setbeamertemplate{frametitle}{}
% add logo
\usepackage{textpos}
\addtobeamertemplate{frametitle}{}{%
\begin{textblock*}{100mm}(0.9\textwidth,0.5cm)
 \includegraphics[height=0.5cm,width=1cm]{logo}
\end{textblock*}}

徽标是来自 here 的 .PNG 文件。为了让您的图像能够很好地显示,您可能需要对位置和大小进行一些调整。注意 header.texlogo.png 需要和 [=47= 在同一个目录].