我试图使用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}
阴谋(地铁)
当我第一次编织它时,会生成一个PPT文件。我打开了该文件,使幻灯片母版背景红色和字体蓝色(故意可怕的测试),将它保存为"template.pptx“,与上面的文件夹相同。
然而,当我重新编织文档时,背景仍然是白色的,字体仍然是黑色的。我需要什么来识别我的模板文件?
系统:
发布于 2019-05-06 10:03:30
在YAML中缩进是很重要的。使用官方文件中描述的结构
---
title: "Aarduous Aardvarks"
output:
powerpoint_presentation:
reference_doc: template.pptx
---
发布于 2019-10-19 22:02:19
我也遇到过同样的问题,但是当插入上面的YAML时,它不会修复。这些额外的变化帮助我解决了这个问题:
reference_doc
保存为.potx
文件格式,并在YAML头中引用该扩展名- Title
- Section Header
- Title and Content
- Two Content
当所有这三个都被处理好后,我的幻灯片就会从Rmd中织得很好。
发布于 2021-04-21 23:30:17
在编写powerpoint模板时,我遇到了一个类似的错误--文档中的缩进(缩进‘reference_doc:.’)给了我一个错误:“扫描器错误:在这个上下文中不允许映射值”,这表明缩进在YAML中是错误的。我能够通过以下格式(通过尝试和错误)解决问题:
---
title: "TITLE"
author: "Mike Harris"
date: "4/9/2021"
resource_files:
- template.pptx
output:
powerpoint_presentation:
reference_doc: template.pptx
---
希望这能节省一些额外的时间。
https://stackoverflow.com/questions/55985758
复制相似问题