如何在Rmarkdown中断一个增量的项目列表,然后在一个情节或数字之后重新获得它?

时间:2016-06-12 03:06:01

标签: r-markdown pandoc beamer

我真的很想知道用RStudio打断在Rmarkdown中创建的项目的增量列表,以显示图表和数字,然后重新列出列表突出显示。这在Latex中非常简单,但我无法弄清楚如何使用Rmarkdown获得相同的结果。下面是一些投影仪示例。

---
title: "Sample Document"
author: "Author"
output:
 beamer_presentation:
  fonttheme: structurebold
  highlight: pygments
  incremental: yes
  keep_tex: yes
  theme: AnnArbor
  toc: true
  slide_level: 3
---

# Some stuff 1
### Some very important stuff

- More detail on stuff 1 
- More detail on stuff 1
- More detail on stuff 1

# The following chart should appear between the first and second item above

```{r, prompt=TRUE}
summary(iris[, "Sepal.Length"])

# Stuff 2
### There are other kinds of stuff?

```{r, prompt=TRUE}
summary(mtcars[, "cyl"])

enter image description here enter image description here enter image description here enter image description here

2 个答案:

答案 0 :(得分:0)

您正在询问pandoc的incremental选项的行为,makes"幻灯片中的列表项逐渐显示(逐个)。&#34 ;该选项导致pandoc生成以下LaTeX(进而生成PDF):

\\begin{itemize}[<+->]

我不确定LaTeX的确切行为,但以下情况如何呢?

- More detail on stuff 1
- ```{r, prompt=TRUE}
  summary(iris[, "Sepal.Length"])
  ``` 
- More detail on stuff 1
- More detail on stuff 1

答案 1 :(得分:0)

您可以在以下项目之间插入幻灯片:

---
title: "Sample Document"
author: "Author"
output:
 beamer_presentation:
  fonttheme: structurebold
  highlight: pygments
  incremental: yes
  keep_tex: yes
  theme: AnnArbor
  toc: true
  slide_level: 3
---

# Some stuff 1
``` {=latex}
\end{frame}
\begin{frame}<1>[label=foo]
\frametitle{some very important stuff}
```


- More detail on stuff 1 
- More detail on stuff 1
- More detail on stuff 1

``` {=latex}
\end{frame}
```

### Some chart

insert chart here

``` {=latex}
\end{frame}
\againframe<2->{foo}
```

### other stuff