Repository navigation
Fix running header chapter prefix when lang is non-English - #3
Merged
Merged
Conversation
The book() function exposes a supplement-chapter parameter that drives the running header via a show heading rule. typst-show.typ did not forward Quarto's localized chapter prefix variable, so the header showed the default English "Chapter N." regardless of lang:. The line is gated on the template variable being defined, so the default English "Chapter" supplied by book()'s own default applies when the variable is unset (e.g., Quarto versions that do not yet surface this metadata, or non-Quarto consumers of the template). Refs quarto-dev/quarto-cli#14524
This was referenced May 19, 2026
Merged
cderv
added a commit
that referenced
this pull request
May 21, 2026
Switches supplement-chapter, list-of-figure-title, and list-of-table-title to consume the new internal Pandoc template-variable namespace introduced in quarto-dev/quarto-cli#14530. The flat $crossref-ch-prefix$ / $crossref-lof-title$ / $crossref-lot-title$ forms relied on Quarto copying values into Pandoc YAML metadata, which leaked into writers with +yaml_metadata_block (markdown, native, json). The namespaced form is delivered via the defaults-file variables: section and is not serialized back to output by any writer. list-of-figure-title and list-of-table-title use nested $if(...)$ guards so that on pre-#14530 Quarto (or any non-Quarto consumer) where $quarto.language.*$ is not populated, the argument is omitted entirely and book()'s built-in default ("List of Figures" / "List of Tables") applies. Without the nested guard the else-branch would pass an empty string to book(), which is what PR #3's form effectively did too. User-override path via the crossref: block ($crossref.lof-title$ / $crossref.lot-title$) is preserved as the first cascade branch. Supersedes the form introduced in #3 for supplement-chapter.
cderv
added a commit
that referenced
this pull request
May 21, 2026
Switches supplement-chapter, list-of-figure-title, and list-of-table-title to consume the new internal Pandoc template-variable namespace introduced in quarto-dev/quarto-cli#14530. The flat $crossref-ch-prefix$ / $crossref-lof-title$ / $crossref-lot-title$ forms relied on Quarto copying values into Pandoc YAML metadata, which leaked into writers with +yaml_metadata_block (markdown, native, json). The namespaced form is delivered via the defaults-file variables: section and is not serialized back to output by any writer. list-of-figure-title and list-of-table-title use nested $if(...)$ guards so that on pre-#14530 Quarto (or any non-Quarto consumer) where $quarto.language.*$ is not populated, the argument is omitted entirely and book()'s built-in default ("List of Figures" / "List of Tables") applies. Without the nested guard the else-branch would pass an empty string to book(), which is what PR #3's form effectively did too. User-override path via the crossref: block ($crossref.lof-title$ / $crossref.lot-title$) is preserved as the first cascade branch. Supersedes the form introduced in #3 for supplement-chapter.
cderv
added a commit
that referenced
this pull request
May 21, 2026
Switches supplement-chapter, list-of-figure-title, and list-of-table-title to consume the new internal Pandoc template-variable namespace introduced in quarto-dev/quarto-cli#14530. The flat $crossref-ch-prefix$ / $crossref-lof-title$ / $crossref-lot-title$ forms relied on Quarto copying values into Pandoc YAML metadata, which leaked into writers with +yaml_metadata_block (markdown, native, json). The namespaced form is delivered via the defaults-file variables: section and is not serialized back to output by any writer. list-of-figure-title and list-of-table-title use nested $if(...)$ guards so that on pre-#14530 Quarto (or any non-Quarto consumer) where $quarto.language.*$ is not populated, the argument is omitted entirely and book()'s built-in default ("List of Figures" / "List of Tables") applies. Without the nested guard the else-branch would pass an empty string to book(), which is what PR #3's form effectively did too. User-override path via the crossref: block ($crossref.lof-title$ / $crossref.lot-title$) is preserved as the first cascade branch. Supersedes the form introduced in #3 for supplement-chapter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When rendering a Typst book with
lang:set to a non-English locale, the running header keeps the EnglishChapter N.prefix instead of the locale's word (e.g.Chapitre N.forlang: fr).The
book()function exposes asupplement-chapterparameter that drives the running header via ashow headingrule, buttypst-show.typwas not forwarding Quarto's localized chapter prefix variable.The line is gated on the template variable being defined, so the default English
Chaptersupplied bybook()'s own default applies when the variable is unset (e.g., Quarto versions that do not yet surface this metadata, or non-Quarto consumers of the template).Refs quarto-dev/quarto-cli#14524