---
title: "This is the title"
author: "Author"
date: "Thursday, April 09, 2015"
output: beamer_presentation
---
## Slide with Bullets
- Bullet 1
- Bullet 2
- Bullet 3
期望的标题幻灯片应为
这是标题
作者
从属关系
2015年4月9日星期四
---
title: "This is the title"
author: "Author"
date: "Thursday, April 09, 2015"
output: beamer_presentation
---
## Slide with Bullets
- Bullet 1
- Bullet 2
- Bullet 3
期望的标题幻灯片应为
这是标题
作者
从属关系
2015年4月9日星期四
如果您使用管道符号|
,则可以将作者行分成多行:
---
title: "The title"
author: |
| The author
| The affiliation
date: "9 April 2015"
output: beamer_presentation
---
输出:
编辑(我们可以调整标题、作者/机构的字体吗?):
如果您想更改不同的字体大小,我建议您玩一下演示文稿头文件的includes: in_header
选项(请参阅此RStudio链接以获取详细信息)。
这指向您计算机上的一个简单的.tex
文件,在其中可以添加针对演示文稿导言的LaTeX命令。因此,您可以在桌面上拥有一个名为preamble.tex
的文件,并使用\setbeamerfont{XX}{size={\fontsize{YY}{ZZ}}}
命令,其中XX是要更改的特定项(标题,作者);YY是要应用的字体大小;ZZ是跳过行数(以pt为单位)(也可参见此链接以获取更多详细信息)。
因此,对于您的示例,我们有:
在桌面上(或任何您想要的位置)创建一个名为preamble.tex
的文件,其中只包含两行:
\setbeamerfont{title}{size={\fontsize{30}{25}}}
\setbeamerfont{author}{size={\fontsize{5}{20}}}
您的foo.Rmd
文件:
---
title: "The title"
author: |
| The author
| The affiliation
output:
beamer_presentation:
includes:
in_header: ~/Desktop/preamble.tex
---
## R Markdown
This is an R Markdown presentation.
Markdown is a simple formatting syntax for
authoring HTML, PDF, and MS Word documents.
输出结果将是:
而且您应该能够拥有多个作者和机构。
title: This is the title
author:
- Author Juan$^1$
- Author Tu$^2$
institute:
- $^1$Juans Casa
- $^2$Tus Place
date: "Thursday, April 09, 2015"
output:
beamer_presentation
在beamer
中处理机构信息的正确方式是通过\institute{}
(参见tex.SE上这个答案)。
从pandoc 1.17开始,默认的beamer模板中就包含了institute
字段,所以如果您有适当的版本,则只需执行以下操作:
---
title: "This is the title"
author: "Author"
institute: "Affiliation"
date: "Thursday, April 09, 2015"
---
如果您使用较旧的pandoc版本(< 1.17),或者rmarkdown的默认beamer模板尚未更新,则可能需要它。 为使其与pandoc配合使用,您可以编辑您的beamer模板。 如果您尚未编辑过它,可以使用以下命令创建:
pandoc -D beamer > ~/.pandoc/templates/default.beamer
接下来,打开文件并在作者信息后添加以下内容:
$if(institute)$
\institute[]{$institute$}
$endif$
最后,将学院选项添加到您的yaml文件中:
---
title: "This is the title"
author: "Author"
institute: "Affiliation"
date: "Thursday, April 09, 2015"
---
如果您使用rmarkdown,可能需要指定模板:
---
title: "This is the title"
author: "Author"
institute: "Affiliation"
date: "Thursday, April 09, 2015"
output:
beamer_presentation:
template: ~/.pandoc/templates/default.beamer
---
使用这种方法相对于多行作者有两个优点。
\setbeamerfont{institute}{size={\fontsize{5}{20}}}