layout_default: Default layout for new slides

View source: R/pptx_layout_helper.R

layout_defaultR Documentation

Default layout for new slides

Description

Set or remove the default layout used when calling add_slide().

Usage

layout_default(x, layout = NULL, master = NULL, as_list = FALSE)

Arguments

x

An rpptx object.

layout

Layout name. If NULL (default), removes the default layout.

master

Name of master. Only required if layout name is not unique across masters.

as_list

If TRUE, return a list with layout and master instead of the rpptx object.

Value

The rpptx object.

See Also

add_slide()

Examples

# set and remove the default layout
x <- read_pptx()
layout_default(x) # no defaults
x <- layout_default(x, "Title and Content") # set default
layout_default(x)
x <- add_slide(x) # new slide with default layout
x <- layout_default(x, NULL) # remove default
layout_default(x) # no defaults

# use when repeatedly adding slides with same layout
x <- read_pptx()
x <- layout_default(x, "Title and Content")
x <- add_slide(x, title = "1. Slide", body = "Some content")
x <- add_slide(x, title = "2. Slide", body = "Some more content")
x <- add_slide(x, title = "3. Slide", body = "Even more content")

davidgohel/oxbase documentation built on June 12, 2025, 12:36 a.m.