Skip to contents

For a pptx document this starts a new slide and sets its title; for a docx document it adds a heading paragraph.

Usage

report_add_slide(
  doc,
  title = NULL,
  layout = NULL,
  master = NULL,
  heading_level = 1
)

Arguments

doc

A document from report_new().

title

Optional slide title / heading text.

layout, master

PowerPoint layout and master names. NULL (default) picks the template's best content layout automatically (by inspecting placeholders, so corporate templates with renamed layouts work). Name a layout from report_layouts() to override.

heading_level

Word heading level (1-3). Defaults to 1.

Value

The updated document.

Details

Automatic selection scores every layout of the template: a title placeholder plus a single content placeholder is the ideal, and the layout's placeholders decide – not its (language-dependent) name. If the chosen layout has no title placeholder, the title is skipped with a warning rather than failing the build.

Examples

doc <- report_new("pptx") %>% report_add_slide("Audience")
class(doc)
#> [1] "rpptx"