rmarkdown 投影仪演示 : how to not print section slides?

标签 r knitr r-markdown beamer

我正在 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。我想要那些标记省略部分的幻灯片。这可能吗?

最佳答案

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

\AtBeginSection[]
{
  ....
}

将此 latex 模板与您的 .Rmd 文件放在同一文件夹中,并使用 template: mytemplate.tex 在 Rmd Yaml 前端内容中引用它。如解释 here .

关于rmarkdown 投影仪演示 : how to not print section slides?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42439763/

相关文章:

r - 添加脚注/感谢 Rmarkdown 标题幻灯片

r - 有条件地创建多个变量

r - 根据 R 中一步中的出现频率聚合分类 data.table 列

r - 提取R函数的代码,用于控制宽度的knitr

r - 使用Knitr和RStudio将ggplot2输出嵌入LaTeX pdf中

r - 在 Rmarkdown 中使用 booktabs

sql - dplyr:row_number()不适用于sql表(SQLite)

r - 在 ggplot 中为趋势线添加单独的图例

r - 交叉引用在 rmarkdown 投影仪演示中不起作用

r - 仅从 Rmd 文档中提取文本