将标题文本添加到markdown幻灯片

时间:2016-08-18 05:23:11

标签: r knitr r-markdown beamer

在输出.Rmd的{​​{1}}文件中,我们可以创建带有双重标签的新幻灯片。即,

beamer_presentation

这将开始一张标题为## Slide with Plot some text here 的新幻灯片,然后将文字Slide with Plot作为幻灯片的内容。

此外,在R markdown中,要将文本指定为标题2元素,我们使用some text here。现在,当我放置标题1时,我会自动获得一张新幻灯片,文本位于幻灯片的中心。当我放置标题2时,我会自动获得一张带有顶部文本的新幻灯片

是否可以在幻灯片中使用标题1或2而无需开始新幻灯片?

此外,所有标题3标题6大小在我看来都是相同的大小。

以下是一个示例## some text文件,可以重现我的问题。

.Rmd

修改 要清楚,我希望幻灯片--- title: "SO reproduce" author: "shayaa" date: "August 18, 2016" output: beamer_presentation --- ## First Slide Some Text # Auto Slide with Header 1 ## New Slide ### Header 3 ###### Header 6 same size? 不会创建新的幻灯片;相反它应该只是一个大小为Header 1的文本。我理解如果我使用Auto Slide with Header 1来创建幻灯片,那么这个标题将被放置为带有标准(Header 2)大小标题的新幻灯片的标题。但请注意,如果您运行我的代码,我在---定义标题的位置,此##将只是Header 1,但它将放在新幻灯片的中间。我的第二个问题是如何使其Header 1的大小为Header 6 same size?的一半。

1 个答案:

答案 0 :(得分:1)

目前尚不清楚自己想做什么。也许您正在寻找新幻灯片---

---
title: "SO reproduce"
author: "shayaa"
date: "August 18, 2016"
output: 
  beamer_presentation: 
    keep_tex: yes
---

# First Slide (with header 1)

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

---

# Second Slide (with header 1)

## Second Slide (with header 2)

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

## Second Slide (with another header 2)

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

---

## Third Slide (with header 2)

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.