Copies a bundled report template (and its supporting bibliography/title
files) into location.
Usage
create_report(
location = getwd(),
template_name = "t_test_example",
child = TRUE,
type = ".qmd",
include_bib = TRUE,
include_tex = TRUE,
install_brand = FALSE,
filename = NULL
)Arguments
- location
Directory to create the report in (default
getwd()).- template_name
One of
"t_test_example"(default),"example", or"temple".- child
Logical (default
TRUE); also copy the child-document template.- type
One of
".qmd"(default) or".Rmd".- include_bib
Logical (default
TRUE); also copy the.bibfile.- include_tex
Logical (default
TRUE); also copy the title.texfile.- install_brand
Logical (default
FALSE); for the"temple"template, also runuse_temple_brand(location), which downloads the extension intolocationitself. Leave thisFALSEwhen the extension is already installed at the project root (seeuse_temple_brand); it doesn't need reinstalling per report.- filename
Base name (no extension) for the report file, default
NULLusestemplate_name. The report is always written tolocation, so callingcreate_report()twice for the samelocationwith the sametemplate_name(or the samefilename) overwrites the first report; pass a distinctfilenamefor each report that shares alocation, e.g.create_report("analysis", filename = "analysis1")andcreate_report("analysis", filename = "analysis2").
Details
The "temple" template renders with the
quarto_temple_brand
extension's temple-html, temple-pdf, and temple-typst
formats, so it needs that extension installed somewhere Quarto can find it
from location (see use_temple_brand): either at an
ancestor project root shared by every report, or, with install_brand
= TRUE, in location itself for a one-off report. It uses no
title.tex or child document, and is Quarto-only.
Examples
if (FALSE) { # \dontrun{
create_report(here::here("analysis"))
# A project with several "temple" reports: install the extension once at
# the project root, then scaffold each report without install_brand.
use_temple_brand(here::here())
create_report(here::here("analysis"), template_name = "temple")
create_report(here::here("reports"), template_name = "temple", filename = "q3")
# A single one-off "temple" report instead installs beside itself.
create_report(here::here("analysis"), template_name = "temple", install_brand = TRUE)
# Two reports sharing one location need distinct `filename`s, or the
# second call overwrites the first report file:
create_report(here::here("analysis"), template_name = "temple", filename = "analysis1")
create_report(here::here("analysis"), template_name = "temple", filename = "analysis2")
} # }
