knitr beamer幻灯片章节和子章节标题的放置框架

knitr beamer幻灯片章节和子章节标题的放置框架,r,latex,knitr,r-markdown,beamer,R,Latex,Knitr,R Markdown,Beamer,使用法兰克福主题制作带knitr的beamer幻灯片时,PDF输出包括带有章节和小节名称的幻灯片 --- title: Movies author: Chewy output: beamer_presentation: slide_level: 3 theme: "Frankfurt" --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = FALSE) ``` #Introduction ##Background

使用法兰克福主题制作带knitr的beamer幻灯片时,PDF输出包括带有章节和小节名称的幻灯片

---
title: Movies
author: Chewy
output:
  beamer_presentation:
  slide_level: 3
theme: "Frankfurt"
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

#Introduction

##Background

###History

A long time ago ...

###History

... in a galaxy far far away

#The End

##This the end

### My only friend, the end 
给这个输出

幻灯片1-4:

幻灯片5-8:


如何在保留幻灯片顶部显示的文档结构的同时,去掉带有章节和小节标题的幻灯片(2、3、6和7)?

这些框架由命令
\AtBeginSubsection{}
\atbeginstation{}
生成,您可以在YAML前端事件中重新定义为不做任何事情:

---
header-includes: 
- \AtBeginSubsection{}
- \AtBeginSection{}
---

谢谢@soca。在我的非简化应用程序中,我还有一个
beamer\u演示:includes:In\u header:header.txt
作为我的beamer前导。您的回答似乎使对
header.txt
的调用不再起作用。你知道我怎么能把这两行都包括进去吗?你只需要在你的标题中添加这两行,而不需要前面的
-
。真是太棒了!