Mik*_*nen 4 r rstudio r-markdown
我正在使用 rmarkdown 在 RStudio 中进行投影仪演示。我想在演示文稿的顶部获得幻灯片代码。德累斯顿主题应该支持那些行情德累斯顿

那么是否有可能通过使用 rmarkdown 来获取这些代码?当我编织 pdf 时,我得到的演示文稿没有幻灯片行情。
示例代码:
---
title: "Example"
output: beamer_presentation
theme: Dresden
---
# R Markdown
This is an R Markdown presentation. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document.
# Slide with Bullets
- Bullet 1
- Bullet 2
- Bullet 3
# Slide with R Code and Output
```{r}
summary(cars)
```
# Slide with Plot
```{r, echo=FALSE}
plot(cars)
```
Run Code Online (Sandbox Code Playgroud)
我认为该slide_level选项可能是您正在寻找的:
slide_level 选项定义了定义单个幻灯片的标题级别。默认情况下,这是层次结构中最高的标题级别,紧随其后的是内容,而不是文档中某处的另一个标题。可以通过指定显式的 slide_level文档源来覆盖此默认值
例如slide_level: 2:
---
title: "Example"
output:
beamer_presentation:
slide_level: 2
theme: Dresden
---
Run Code Online (Sandbox Code Playgroud)
为您提供以下输出
但是,您需要为幻灯片标题提供较低级别的标题,例如
# R Markdown
## Description
This is an R Markdown presentation. Markdown is a simple formatting
syntax for authoring HTML, PDF, and MS Word documents. For more
details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that
includes both content as well as the output of any embedded R code
chunks within the document.
Run Code Online (Sandbox Code Playgroud)
编辑要获得与您附加的图像相同的输出,请按以下方式对演示文稿进行分段:
---
title: "Example"
output:
beamer_presentation:
slide_level: 3
theme: Dresden
---
# Section 1
## Subsection 1
### Title A
### Title B
## Subsection 2
### Title A
## Subsection 3
### Title A
### Title B
### Title C
# Section 2
## Subsection 1
### Title A
### Title B
Run Code Online (Sandbox Code Playgroud)
并生成以下演示标题:
| 归档时间: |
|
| 查看次数: |
648 次 |
| 最近记录: |