Rmarkdown beamer: 如何让标题页左对齐

3

如何将我的Rmarkdown幻灯片演示文稿的标题页面左对齐,而不是默认的居中对齐?

例如,默认为居中对齐:

---
title: "Untitled"
author: "S SS"
date: "2/4/2018"
output: beamer_presentation
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

## 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.

enter image description here

2个回答

2
您可以使用以下方法将标题页左对齐:

``````

\setbeamertemplate{title page}[default][left]

要在rmarkdown中使用它,请将此行放置在名为preamble.tex的文件中并使用。
---
title: "Untitled"
author: "S SS"
date: "2/4/2018"
output: 
  beamer_presentation:
    includes:
      in_header: preamble.tex

---

test

这里输入图片描述


编辑:

使用最新版本的markdown,您还可以直接进行操作。

---
title: "Untitled"
author: "S SS"
date: "2/4/2018"
output: 
  beamer_presentation
header-includes:
  - \setbeamertemplate{title page}[default][left]
---

test

0

在没有更好的答案之前,这里有一个技巧:我们将放弃标准的幻灯片标题页,只需将第一张幻灯片格式化为标题页即可:

---
output: beamer_presentation
header-includes:
  - \usepackage{color}
---

\color{blue}
\LARGE{\textbf{This is the title}}  
\color{black}
\vspace{0.2cm}
\large{Author Name}  
\large{February 4, 2018}

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

## 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.

enter image description here


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接