template.qmd. Instead, each cognitive domain lives in its own .qmd partial file — a self-contained fragment of Quarto markdown that holds prose, R code, score tables, and figures for that domain. The report assembles these partials at render time through a single include file called _domains_to_include.qmd. This modular structure makes it easy to add, remove, or reuse domain sections across different report types.
How partial includes work in Quarto
Quarto’s{{< include >}} shortcode pastes the contents of another .qmd file directly into the parent document before rendering. It is equivalent to writing all that content inline, but stored in a separate file.
In template.qmd, the cognitive domain section looks like this:
_domains_to_include.qmd is itself just a list of further includes:
_domains_to_include.qmd.
Create _domains_to_include.qmd
The template scaffolds a starter _domains_to_include.qmd for you. Open it and edit the list to match the domains you actually assessed.
- Manual selection
- Full battery
- cingulate pipeline
List only the domains relevant to this evaluation. Remove or comment out any domains not administered.
Anatomy of a domain partial file
Each domain partial follows the same structure: a section heading, optional narrative prose, and one or more R code chunks that load data and produce output using thecingulate package.
Here is a complete example for the neurocognitive functioning domain. A domain partial starts with a section heading, optional narrative prose, and R code chunks.
Section heading and narrative prose (_neurocognitive.qmd):
Key conventions
- Section heading: Use
##(H2) so the domain appears as a top-level section in the report’s table of contents. - chunk labels: Give every code chunk a unique
label. Duplicate labels across partials will cause a render error. echo: false: Always set this so raw R code does not appear in the PDF output.- Data loading: Use
cingulate::load_domain_data()with the domain name matching your data directory conventions.
Create a new domain partial from scratch
If the template does not include a partial for a domain you need, create one manually.1
Create the file
Create a new
.qmd file in your project directory. Use the naming convention _DOMAIN-NAME.qmd, for example _processing-speed.qmd.2
Add the section heading and narrative
Open the file and add a
## heading and your clinical narrative for this domain.3
Add R code chunks for score data
Add code chunks that load and visualize the score data using
cingulate. In your .qmd partial, add an R chunk like the following:4
Register the partial in _domains_to_include.qmd
Add an include line to
_domains_to_include.qmd at the position where you want this domain to appear in the report.5
Render and verify
Run
quarto render and confirm the new domain section appears in the correct position in the PDF.Using the cingulate pipeline to auto-generate includes
Thecingulate package can inspect your scored data directory and automatically produce a _domains_to_include.qmd that lists only the domains for which data is present.
Auto-generation does not create the domain partial files themselves — only the
include list. You still need a corresponding
_[domain].qmd file for each
domain detected. The template provides starters for all standard domains; the
pipeline only selects which ones to activate.