rmarkdown beamer介绍:如何不打印部分幻灯片?

时间:2017-02-24 13:24:59

标签: r knitr r-markdown beamer

我正在rmarkdown写一个投影仪演示文稿并用knitr将其转换为pdf。我想在header1级别定义部分,例如# Introduction,然后标题为其他内容的幻灯片,例如## Introducing my brilliant research。拥有header1级别定义部分是很好的,因为部分的名称可以在某些beamer主题的幻灯片标题中显示,这就是我包含它的原因。

但是我不希望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和Including Chunks。我希望这些幻灯片标记省略的部分。这可能吗?

1 个答案:

答案 0 :(得分:8)

创建一个新的Latex模板,从前言中删除此部分:

\AtBeginSection[]
{
  ....
}

将此乳胶模板放在与.Rmd文件相同的文件夹中,并使用template: mytemplate.tex按照here所述,在Rmd Yaml前端问题中引用它。

相关问题