Skip to content

Typst book running header not localized when lang: is set to a non-English locale #14524

@cderv

Description

@cderv

For a Typst book project with lang: set to a non-English locale, the running header on chapter pages keeps the English Chapter N. prefix instead of the locale's word (e.g. Chapitre N. for lang: fr).

Minimal reproduction:

# _quarto.yml
project:
  type: book

book:
  title: "Livre Test"
  author: "Auteur Test"
  chapters:
    - index.qmd
    - chapter1.qmd

lang: fr

format:
  typst:
    keep-typ: true
<!-- index.qmd -->
# Préface {.unnumbered}

Préface.
<!-- chapter1.qmd -->
# Introduction

Du contenu, assez long pour faire déborder sur une deuxième page et faire apparaître l'en-tête de page.

After quarto render, the running header on chapter pages reads Chapter 1. Introduction. Expected: Chapitre 1. Introduction.

The orange-book extension's book(...) accepts a supplement-chapter parameter (default "Chapter") that drives the running header via a show heading rule:

#let book(title: "", subtitle: "", date: "", author: (), paper-size: "a4", width: none, height: none, margin: (x: 3cm, bottom: 2.5cm, top: 3cm), logo: none, cover: none, cover-background: auto, image-index:none, body, main-color: blue, copyright: [], lang: "en", list-of-figure-title: none, list-of-table-title: none, supplement-chapter: "Chapter", supplement-part: "Part", font-size: 10pt, part-style: 0, part-font-size: auto, lowercase-references: false, padded-heading-number: true, outline-font-size: auto, outline-small-depth: 2, outline-small-width: 9.5cm, heading-style: 0, first-line-indent: true, outline-depth: 3) = {

The Quarto-side typst-show.typ never passes supplement-chapter to book.with(...), so the default English value applies:

https://github.com/quarto-dev/quarto-cli/blob/a8d0dcfee2394f9caba3f1576b371c7e3bbeb47b/src/resources/extension-subtrees/orange-book/_extensions/orange-book/typst-show.typ

The localized value exists in _language-fr.yml as crossref-ch-prefix: "Chapitre":

crossref-ch-prefix: "Chapitre"

It is exposed as a Lua filter param via languageFilterParams but never written into Pandoc YAML metadata where the typst-show.typ template variable would resolve. The existing list-of-figure-title and list-of-table-title pipes in the same template are affected the same way and currently render as empty strings when the user enables lof: true / lot: true.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtypst

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions