Skip to contents

Add a slide into a pptx presentation.

Usage

add_slide(
  x,
  layout = "Title and Content",
  master = "Office Theme",
  ...,
  .dots = NULL
)

Arguments

x

an rpptx object.

layout

slide layout name to use.

master

master layout name where layout is located.

...

Key-value pairs of the form "short form location" = object passed to phs_with. See section "Short forms" in phs_with for details, available short forms and examples.

.dots

List of key-value pairs of the form list("short form location" = object). Alternative to .... See phs_with for details.

Examples

x <- read_pptx()
layout_summary(x)
#>              layout       master
#> 1       Title Slide Office Theme
#> 2 Title and Content Office Theme
#> 3    Section Header Office Theme
#> 4       Two Content Office Theme
#> 5        Comparison Office Theme
#> 6        Title Only Office Theme
#> 7             Blank Office Theme
x <- add_slide(x, layout = "Two Content", master = "Office Theme")

# use `...` to fill placeholders in same step
x <- read_pptx()
x <- add_slide(x,
  layout = "Two Content", `Title 1` = "A title",
  dt = "Jan. 26, 2025", `body[2]` = "Body 2",
  left = "Left side", `6` = "Footer"
)