report_new

report_new(
    format='pptx',
    template=None,
    style='elevated',
    slide_numbers=True,
    keep_slides=True,
)

Start a new PowerPoint or Word report.

Opens a python-pptx or python-docx document you can build up with the report_add_*() helpers and write out with report_save(): the “build it from Python” path. Slide layouts are chosen by inspecting the template’s placeholders, so any organisation template works; see report_layouts() for what yours contains. For a quick deck from a list of charts and tables, report_deck() does the whole thing in one call; for a document-driven workflow, scaffold_report() gives you a Quarto template instead. Needs the reports extra.

Parameters

Name Type Description Default
format str “pptx” (default) for PowerPoint or “docx” for Word. 'pptx'
template str Path to a .pptx / .docx to use as the style template. None (default) uses the brand template registered by use_brand(), falling back to one of the package’s built-in 16:9 templates (see style). None
style str Built-in template used when no template is set. “elevated” (default) is the styled deck: a navy/gold identity with a full-bleed navy cover, navy section dividers, a navy title over one slim rule on every content slide and slide numbers in the corner. “plain” is the same widescreen deck with no decoration. 'elevated'
slide_numbers bool If True (default), every content slide added with report_add_slide() shows the template’s slide number. True
keep_slides bool PowerPoint only. If True (default), slides already in the template stay and yours are added after them. False starts from an empty deck. True

Returns

Name Type Description
pptx.Presentation or docx.Document The document.

See Also

report_add_slide, report_add_plot, report_add_table, report_save, report_deck

Examples

>>> doc = report_new("pptx")