Add a slide into a pptx presentation.
add_slide(x, layout = NULL, master = NULL, ..., .dots = NULL)
an rpptx
object.
slide layout name to use. Can be ommited of a default layout is set via layout_default()
.
master layout name where layout
is located. Only required in case of several masters if layout is
not unique.
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.
List of key-value pairs of the form list("short form location" = object)
. Alternative to ...
. See
phs_with for details.
print.rpptx()
, read_pptx()
, layout_summary()
, plot_layout_properties()
, ph_with()
, phs_with()
, layout_default()
Other functions to manipulate slides:
move_slide()
,
on_slide()
,
remove_slide()
,
set_notes()
x <- read_pptx()
layout_summary(x) # available layouts
#> 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")
x <- layout_default(x, "Title Slide") # set default layout for `add_slide()`
x <- add_slide(x) # uses default layout
# use `...` to fill placeholders when adding slide
x <- add_slide(x,
layout = "Two Content", `Title 1` = "A title",
dt = "Jan. 26, 2025", `body[2]` = "Body 2",
left = "Left side", `6` = "Footer"
)