Skip to content

Commit 3ead22c

Browse files
committed
typst: use Typst 0.15 native std.divider for horizontal rules
Reverts the divider() alias from f67d9f4b7. Quarto's template no longer shadows divider, so Pandoc 3.13's `#divider()` output resolves to the native std.divider element, matching pandoc's default template with typst >= 0.15 (Quarto bundles Typst 0.15.1, so pandoc's polyfill branch is never taken). Rationale: the centered 25-75% line was inherited from pandoc's old definitions.typst (97a1d3d), not a Quarto design decision. Pinning it would diverge from upstream permanently and shadow the native element, which users can restyle with `#show divider:` rules. Horizontal rules in typst output now render full-width instead of centered half-width; the visual change is tracked for the 1.12 changelog.
1 parent 3238896 commit 3ead22c

3 files changed

Lines changed: 8 additions & 10 deletions

File tree

‎llm-docs/pandoc-quarto-typst-templates.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Combines Pandoc definitions with Quarto-specific functionality:
8686

8787
**From Pandoc**:
8888
- `content-to-string` helper to extract text from content nodes (used for PDF metadata and link colors)
89-
- `horizontalrule` definition for horizontal rules, plus a `divider()` alias to it (Pandoc 3.13's typst writer emits `#divider()`; the alias keeps Quarto's centered 25-75% line instead of typst's full-width std divider)
89+
- `horizontalrule` definition (a centered 25-75% line, kept for `notes.typ` and external templates that call `#horizontalrule`). Pandoc 3.13's typst writer emits `#divider()` for HorizontalRule; Quarto deliberately does not define `divider`, so it resolves to Typst 0.15's native `std.divider` (full-width, restyleable via `#show divider:` rules), matching pandoc's default template behavior with typst >= 0.15
9090
- Term list hanging indent (`#set terms(hanging-indent: 1.5em)`; Pandoc 3.13 dropped its custom `terms.item` show rule)
9191
- CSL citeproc formatting (`#show <refs>: set par(...)` with `csl-hanging-indent` / `csl-entry-spacing` under `$if(csl-settings)$`, from Pandoc 3.12.1's `default.typst`; applies CSL hanging indent and entry spacing to Pandoc-citeproc bibliographies)
9292
- Code highlighting definitions (conditionally included)

‎src/resources/formats/typst/pandoc/quarto/definitions.typ‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
}
1313

1414
#let horizontalrule = line(start: (25%,0%), end: (75%,0%))
15-
// Pandoc 3.13's typst writer emits #divider() for HorizontalRule; alias it to
16-
// Quarto's rule so documents keep the centered 25-75% line instead of typst's
17-
// full-width std divider.
18-
#let divider() = horizontalrule
1915

2016
#let endnote(num, contents) = [
2117
#stack(dir: ltr, spacing: 3pt, super[#num], contents)

‎tests/docs/smoke-all/typst/horizontal-rule.qmd‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
---
2-
title: "Horizontal rule keeps Quarto's look"
2+
title: "Horizontal rule uses Typst's native divider"
33
format:
44
typst:
55
keep-typ: true
66
_quarto:
77
tests:
88
typst:
9-
# Pandoc 3.13 writer emits #divider() for HorizontalRule; Quarto's
10-
# template aliases divider to its centered 25-75% horizontalrule.
9+
# Pandoc 3.13's typst writer emits #divider() for HorizontalRule; Quarto's
10+
# template must not shadow divider so it resolves to the native
11+
# std.divider element (restyleable via show/set rules), matching
12+
# pandoc's default template with typst >= 0.15.
1113
ensureTypstFileRegexMatches:
12-
- ['\#divider\(\)', '\#let divider\(\) = horizontalrule']
13-
- ['std\.divider']
14+
- ['\#divider\(\)']
15+
- ['\#let divider']
1416
noErrors: default
1517
---
1618

0 commit comments

Comments
 (0)