Help building PowerPoint Template

Hope folks don't mind that I keep coming back to the well....especially @mfherman!

Can anyone help me create a custom powerpoint template that would correspond to the following slides? Slide 1 is a Cover or Title page, Slide 2 is a Commentary Page (No Charts), and Slide 3 is a mix of Charts and Commentary (Slides 2 and 3 are typically repeated with differing content multiple times within a presentation.)

Appreciate any help you can provide!

Attached is

What have you tried so far? Where are you having problems? Below are some of the resources that have helped me to make PPT templates to render using R Markdown:

1 Like

I've tried a bunch of different things (kind of throwing stuff against the wall - and I didn't save them when they didn't work.) I'll spend some time with these references - thanks again for the help!

I've tried both of these templates and both produce the same output (Black, Centered Text on Title Page, and Chart on slide 2 without the desired Header Bar and Language.)

---
title: "Untitled"
date: "3/4/2020"
output: powerpoint_presentation
reference_doc: "template_1.pptx"
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(
  echo = FALSE,
  message = FALSE,
  warning = FALSE,
  # dev = "svg",
  fig.width = 12,
  fig.height = 7
)
library(patchwork)
library(tidyverse)
library(gridtext)
# prep frequency table
freqtable <- table(mpg$manufacturer)
df <- as.data.frame.table(freqtable)
theme_set(theme_classic())
# Plot
g <- ggplot(df, aes(Var1, Freq))
g <- g + geom_bar(stat="identity", width = 0.5, fill="tomato2") + 
  theme(axis.text.x = element_text(angle=65, vjust=0.6)) +
  theme(axis.title.x = element_blank())

t <- richtext_grob("• Hello <br> <br> • Goodbye", halign = 0, valign = -10)
(g+g) / (g+t)

The first 3 slides show Template_1 which has 3 slides when viewing the Master Layout. See attached images.



The second 3 slides show Template_2 which has 3 slides when viewing the Master Layout - the 3rd slide is blank and PPT won't let me delete it. See attached images.



The results are the same for both templates as shown below.


1 Like

Maybe when rendering to a PowerPoint, we can't adjust font color...?

"The Markdown syntax has no built-in method for changing text colors" from Yihui's R Markdown Cookbook in section 4.1.

That would be a Bummer....

For those that are interested, I am looking to replicate this slide (and many more.) Just not sure I can use R to do so....

Check out the template here: mattherman/static/ppt/template-red.pptx at master · mfherman/mattherman · GitHub

I've changed the color and alignment of the title on the main slide and added a title slide. Hopefully you can use this as a starting point for futher customization. This is the code the results in the following slide

---
title: "Title"
author: "Subtitle"
date: "3/5/2020"
output:
  powerpoint_presentation:
    reference_doc: "template-red.pptx"
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(
  echo = FALSE,
  message = FALSE,
  warning = FALSE,
  fig.width = 12,
  fig.height = 7
  )
```

## Auto Industry Indicators
```{r}
library(patchwork)
library(tidyverse)
library(gridtext)
# prep frequency table
freqtable <- table(mpg$manufacturer)
df <- as.data.frame.table(freqtable)
theme_set(theme_classic())
# Plot
g <- ggplot(df, aes(Var1, Freq))
g <- g + geom_bar(stat="identity", width = 0.5, fill="tomato2") + 
  theme(axis.text.x = element_text(angle=65, vjust=0.6)) +
  theme(axis.title.x = element_blank())

t <- richtext_grob("• Hello <br> <br> • Goodbye", halign = 0, valign = -10)
(g+g) / (g+t)
```

2 Likes

Thanks Matt - some of the things I’ve read are starting to click as I read your solution. Really appreciate your help and patience with these iterations! Thanks again.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.