Typst template: title/subtitle break on keyword text; full-template drops Skylighting #12
Closed
opened 2026-07-09 15:14:31 -04:00 by jared
·
0 comments
No Branch/Tag Specified
Labels
Clear labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
kodor
kodor/feature-proposal
kodor/fix
kodor/needs-review
kodor/triaged
question
wontfix
kodor
kodor/feature-proposal
kodor/fix
kodor/needs-review
kodor/triaged
Something isn't working
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Good for newcomers
Extra attention is needed
This doesn't seem right
Kodor should process this issue
Kodor has written a feature proposal
Kodor should implement a fix (assigned to Kodor)
Kodor's work or failure needs Jared's review
Kodor has already triaged this issue (skip)
Further information is requested
This will not be worked on
needs
human
Cannot move without a person -- a decision, a check an agent cannot make, something outside the repo
origin
client
Came from a client ask
origin
obligation
Created by a change elsewhere
origin
review
Came from human review
origin
roborev
Promoted from a roborev finding
type
chore
Maintenance with no behaviour change
type
debt
Owed work -- docs, tests, cleanup a change obligated
type
decision
Needs a decision before work can proceed
type
defect
Something is wrong
type
feature
New capability
ws
helpers
Analysis and workflow helpers
ws
logo
Logo and branded output composition
ws
packaging
Package infrastructure and release
ws
quarto
Quarto themes and publishing templates
ws
theme
Themes, palettes, and fonts
Assign a task to kodor
Kodor thinks this needs a feature.
Kodor should fix this
Kodor thinks the user is ready to review this.
Kodor is done with this issue.
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Civilytics/civilyticsR#12
Reference in New Issue
Block a user
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).