[英]rmarkdown Table of Contents not being populated
I have a simple test .Rmd script which I am using to generate a PDF file with the rmarkdown
render
function. 我有一个简单的测试.Rmd脚本,正在使用
rmarkdown
render
功能生成PDF文件。
When I set the toc
to be true
, the second PDF page is a blank white page and I would expect to see 'Slide With Bullets' and 'Slide with R Code and Output' to be in there. 当我将
toc
设置为true
,第二个PDF页面是白页,我希望看到其中有“带有项目符号的幻灯片”和“带有R代码和输出的幻灯片”。
Does anyone know how to format the slide titles so that they appear in the table of contents? 有谁知道如何设置幻灯片标题的格式,使其出现在目录中?
---
title: "test"
author: "test"
date: '2015-10-29'
output: beamer_presentation
toc: true
---
## Slide with Bullets
- Bullet 1
- Bullet 2
- Bullet 3
## Slide with R Code and Output
```{r}
summary(cars)
```
According to the documentation toc only works with level 1 headings. 根据文档,toc仅适用于1级标题。 So the code below will create a table of contents to the title slide.
因此,下面的代码将为标题幻灯片创建目录。 I can't get it to work with slides that contain content though.
我无法使其与包含内容的幻灯片一起使用。 Maybe this is how the table of contents is designed to work???
也许这就是目录设计的工作方式???
---
title: "Untitled"
output:
beamer_presentation:
toc: yes
---
# A Title Slide:
## Slide with Bullets
- Bullet 1
- Bullet 2
- Bullet 3
## Slide with R Code and Output
```{r}
summary(cars)
```
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.