Two bugs in inst/quarto/typst/civilytics-typst.typ surface when the template is used for real documents (found while rendering the COG finance API spec PDF with Quarto 1.9 / Typst 0.14).
1. Title/subtitle/date are injected as bare Typst → compile error on keyword text
So any title/subtitle/date containing a Typst keyword word (e.g. for, in, let) is parsed as code and compilation fails. Example: a subtitle "a web API for exploring …" errors with expected keyword 'in'. Note the abstract line already wraps correctly as [$abstract$].
2. Using the file as a full template: drops Quarto's Skylighting definitions
When set via format: typst: { template: civilytics-typst.typ }, any fenced code block fails with unknown variable: Skylighting, because a full template replaces Quarto's auto-generated definitions partial (which defines Skylighting / NormalTok / …).
Fix: ship the template as Quarto template-partials instead — split into typst-template.typ (the #let civilytics(...) = { … } function) and typst-show.typ (the #show: doc => civilytics(...) entry point, without a trailing $body$). Partials keep Quarto's definitions, so code blocks and the branding both render. Worth documenting this usage in inst/quarto/examples/report.qmd (the current example has no visible code blocks, which is why this went unnoticed).
Both are patched locally in the COG API deliverable; folding them upstream fixes every branded Typst doc. Related to #11 (same template file).
Two bugs in `inst/quarto/typst/civilytics-typst.typ` surface when the template is used for real documents (found while rendering the COG finance API spec PDF with Quarto 1.9 / Typst 0.14).
## 1. Title/subtitle/date are injected as bare Typst → compile error on keyword text
The Quarto entry point passes these unquoted:
```
title: $title$,
$if(subtitle)$subtitle: $subtitle$,$endif$
$if(date)$date: $date$,$endif$
```
So any title/subtitle/date containing a Typst keyword word (e.g. `for`, `in`, `let`) is parsed as code and compilation fails. Example: a subtitle "a web API **for** exploring …" errors with `expected keyword 'in'`. Note the `abstract` line already wraps correctly as `[$abstract$]`.
**Fix:** wrap in content brackets — `title: [$title$]`, `subtitle: [$subtitle$]`, `date: [$date$]`.
## 2. Using the file as a full `template:` drops Quarto's Skylighting definitions
When set via `format: typst: { template: civilytics-typst.typ }`, any fenced code block fails with `unknown variable: Skylighting`, because a full template replaces Quarto's auto-generated `definitions` partial (which defines `Skylighting` / `NormalTok` / …).
**Fix:** ship the template as Quarto **template-partials** instead — split into `typst-template.typ` (the `#let civilytics(...) = { … }` function) and `typst-show.typ` (the `#show: doc => civilytics(...)` entry point, without a trailing `$body$`). Partials keep Quarto's definitions, so code blocks and the branding both render. Worth documenting this usage in `inst/quarto/examples/report.qmd` (the current example has no visible code blocks, which is why this went unnoticed).
Both are patched locally in the COG API deliverable; folding them upstream fixes every branded Typst doc. Related to #11 (same template file).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Two bugs in
inst/quarto/typst/civilytics-typst.typsurface when the template is used for real documents (found while rendering the COG finance API spec PDF with Quarto 1.9 / Typst 0.14).1. Title/subtitle/date are injected as bare Typst → compile error on keyword text
The Quarto entry point passes these unquoted:
So any title/subtitle/date containing a Typst keyword word (e.g.
for,in,let) is parsed as code and compilation fails. Example: a subtitle "a web API for exploring …" errors withexpected keyword 'in'. Note theabstractline already wraps correctly as[$abstract$].Fix: wrap in content brackets —
title: [$title$],subtitle: [$subtitle$],date: [$date$].2. Using the file as a full
template:drops Quarto's Skylighting definitionsWhen set via
format: typst: { template: civilytics-typst.typ }, any fenced code block fails withunknown variable: Skylighting, because a full template replaces Quarto's auto-generateddefinitionspartial (which definesSkylighting/NormalTok/ …).Fix: ship the template as Quarto template-partials instead — split into
typst-template.typ(the#let civilytics(...) = { … }function) andtypst-show.typ(the#show: doc => civilytics(...)entry point, without a trailing$body$). Partials keep Quarto's definitions, so code blocks and the branding both render. Worth documenting this usage ininst/quarto/examples/report.qmd(the current example has no visible code blocks, which is why this went unnoticed).Both are patched locally in the COG API deliverable; folding them upstream fixes every branded Typst doc. Related to #11 (same template file).