Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.brainworkup.org/llms.txt

Use this file to discover all available pages before exploring further.

Luria Voice is a framework that turns structured Quarto Markdown into polished, clinic-ready neuropsychological evaluation PDFs. You write .qmd source files that mix prose, R or Python code, and patient data; Quarto executes the code, then hands off the composed document to Typst, which renders a precisely formatted PDF in seconds. The ecosystem is named after Alexander Luria, the Soviet neuropsychologist whose process-oriented approach to assessment underpins the report design.

Ecosystem components

Quarto extensions

Four format-specific extensions (neurotyp-adult, neurotyp-pediatric, neurotyp-forensic, neurotyp-luria) each supply a Typst template and show rules tailored to their report type. You activate one by setting it as the output format in your .qmd front matter.

Typst rendering layer

The style repository holds all Quarto extensions and acts as the central rendering layer. Typst replaces LaTeX for PDF generation — it is faster to compile, easier to debug, and produces consistent typography without complex package management.

cingulate R package

cingulate handles data ingestion from neuropsychological test batteries, computes scaled scores and percentile ranks, generates plots, and optionally drafts narrative text via a local Ollama backend. Its output feeds directly into the report’s cognitive domain sections.

Brand and theming

The _brand/ directory in each extension project holds _brand.yml, which centralizes clinic colors, preferred fonts, and logo placement. Changing a brand file updates all pages without touching the Typst template directly.

How the rendering pipeline works

The following steps describe what happens from the moment you run quarto render to when the PDF lands on disk.
1

Quarto reads the master template

Quarto reads template.qmd (or your patient-specific .qmd file), parses the YAML front matter to determine the output format (e.g., neurotyp-adult-typst), and resolves the correct extension from _extensions/.
2

R/Python code chunks execute

Quarto runs any embedded R or Python chunks — typically calls to the cingulate package that load test scores, compute statistics, and produce score tables or figures. The results are embedded in the document as data frames, plots, or inline values.
3

Section partials are included

Cognitive domain findings live in separate .qmd partial files (for example, _domains_to_include.qmd). Quarto resolves these {{< include >}} directives, assembling a single unified document tree.
4

Quarto converts to Typst source

Quarto’s Pandoc engine converts the assembled Markdown and code outputs into a .typ source file, injecting the extension’s typst-template.typ (page geometry, headers, margins) and typst-show.typ (typography show rules, heading styles).
5

Typst compiles to PDF

Typst compiles the .typ source to a final PDF. Compilation is fast — typically under two seconds for a full report — and the output is deterministic, meaning the same source always produces the same PDF.
6

PDF is ready for clinical use

The rendered PDF meets clinic formatting standards: A4 page, 30 mm top margin, 25 mm side margins, a CONFIDENTIAL running header on pages 2 and beyond, and justified body text. You distribute or archive the file directly.

Why Quarto + Typst?

The choice of Quarto and Typst is intentional and complementary. Neither tool alone would satisfy all the requirements of a clinical reporting workflow.
Quarto provides the scientific computing layer: you can execute R or Python code inside the document, which means test scores, percentile tables, and cognitive domain plots are computed and embedded automatically rather than copied by hand. Quarto also handles multi-format output from a single source, so the same .qmd file could render to HTML for review and PDF for delivery. Typst provides the typographic precision layer. Unlike LaTeX, Typst has a readable scripting syntax, compiles in milliseconds rather than seconds, and produces predictable output without intermediate auxiliary files. The neurotyp extensions encode all formatting decisions — margins, fonts, heading treatment, confidentiality headers — in Typst show rules, keeping the .qmd source clean of layout concerns.

Optional AI-assisted narrative generation

The cingulate package includes an optional integration with Ollama, a local large-language model runner. When enabled, Ollama drafts narrative paragraphs for each cognitive domain based on the computed scores. These drafts are inserted into the report as starting points for clinician review and editing — they are not intended for use without clinical oversight.
AI-generated narrative text requires clinical review before inclusion in any patient document. The Ollama integration is a drafting aid, not a substitute for clinician interpretation.

Repository layout

The Neurotyp ecosystem is spread across several repositories, each with a distinct responsibility.
RepositoryRole
neurotyp-adultQuarto extension + Typst template for adult evaluations
neurotyp-pediatricQuarto extension + Typst template for pediatric evaluations
neurotyp-forensicQuarto extension + Typst template for forensic evaluations
neurotyp-luriaQuarto extension + Typst template for LLM-templated patient reports
styleCentral rendering layer; hosts all extensions
cingulateR package for data processing, plotting, and AI narrative drafting
Last modified on May 20, 2026