I'm having problems extremely similar to this thread; using template file to generate powerpoint slides via R Markdown - R Markdown - Posit Forum (formerly RStudio Community)
Essentially, I would like to use RMarkdown to create a PowerPoint presentation with a custom template. However, every time I add a reference_doc:
rmarkdown produces a PowerPoint that is unreadable (and unrepairable). I have made sure that the template slides are named correctly; this does not help.
The only time this does not occur is when I use the alison_template from apreshill's rmd2ppt templates on GitHub ( rmd2ppt/templates at main · apreshill/rmd2ppt · GitHub, but any edit I make to the template (e.g. changing font colors) results in an unreadable PowerPoint again.
My code looks like this:
---
date: "`r Sys.Date()`"
author: "Your Name"
title: "Untitled"
output:
officedown::rpptx_document:
reference_doc: alison-template.pptx
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, fig.cap = TRUE)
library(officedown)
library(ggplot2)
library(rvg)
```
## Table
```{r layout='Two Content', ph=officer::ph_location_left()}
head(cars)
```
```{r layout='Two Content', ph=officer::ph_location_right()}
head(iris)
```
## Slide with Plot
```{r plot1}
dml(plot(pressure))
```
The same issue occurs when I use powerpoint_presentation:
instead of officedown::rpptx_document:
.
Could anyone give me an idea of what the issue could be or how to continue troubleshooting?
My R Markdown version is 2.20, and all files are local.