首页 > 解决方案 > RMarkdown 到 PPT:未加载 reference_doc()

问题描述

我正在尝试使用 PPT 模板来格式化 RStudio > RMarkdown > PPT 文件。这是我的测试文件(保存为 testing.Rmd):

---
title: "Aarduous Aardvarks"
author: "Aanonymous Aardvark"
date: "5/4/2019"
output: powerpoint_presentation
reference_doc: template.pptx
---

## My title

```{r myplot}
plot(mtcars)
```

当我第一次编织这个时,生成了一个 PPT 文件。我打开该文件,将幻灯片母版背景设为红色,字体设为蓝色(故意为测试而设计),将其保存为“template.pptx”,保存在与上述相同的文件夹中。

但是,当我重新编织文档时,背景仍然是白色,字体仍然是黑色。我需要什么来识别我的模板文件?

系统:

标签: r-markdownpandoc

解决方案


YAML 中的缩进很重要。使用官方文档中描述的结构:

---
title: "Aarduous Aardvarks"
output:
  powerpoint_presentation:
    reference_doc: template.pptx
---

推荐阅读