【发布时间】:2017-07-15 08:26:39
【问题描述】:
我正在 rmarkdown 中编写投影仪演示文稿,并使用 knitr 将其转换为 pdf。我想在 header1 级别定义部分,例如# Introduction,然后有一张幻灯片,标题为其他内容,例如## Introducing my brilliant research。让 header1 级别定义部分很好,因为部分的名称可以显示在某些投影仪主题的幻灯片标题中,这就是我包含它的原因。
但我不希望 rmarkdown 插入一张幻灯片,该幻灯片仅说明部分之间的部分名称,目前它正在这样做。有没有办法在部分之间不打印带有部分名称的幻灯片?我以为slide_level 会控制这种行为,但它似乎没有(或者我可能用错了)。
可以使用以下代码获得我的问题的最小可重现示例:
---
title: "Test Pres"
author: "Professor Genius Researcher"
date: "24 February 2017"
output:
beamer_presentation:
slide_level: 2
theme: "Singapore"
colortheme: "rose"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
# Markdown Intro
## 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.
# Using Bullets
## Slide with Bullets
- Bullet 1
- Bullet 2
- Bullet 3
# Including Chunks
## Slide with R Output
```{r cars, echo = TRUE}
summary(cars)
```
## Slide with Plot
```{r pressure}
plot(pressure)
```
目前,此代码会生成显示 Markdown Intro、Using Bullets 和 Include Chunks 的幻灯片。我想要那些标明省略部分的幻灯片。这可能吗?
【问题讨论】:
-
使用
slide_level: 1?这能解决您的问题吗? -
不,这使节标题成为幻灯片的标题,并将所有后续幻灯片放入其下方的文本框中
-
删除 header1 后的空格也不是您的想法吗?
-
见LaTeX Beamer prevent showing the TOC,我尝试用
\section*{Including Chunks}替换# Including Chunks,但是latex-engine pdflatex返回错误! Missing \endgroup inserted.
标签: r knitr r-markdown beamer