Skip to content

Commit 84c4916

Browse files
authored
Update bundled Pandoc to 3.13 (#15320)
Update the bundled Pandoc from 3.10 to 3.13 and port Quarto's custom templates (Typst, LaTeX/Beamer, HTML theme: pandoc, reveal.js) to the 3.13 versions. The user-visible Pandoc behavior changes are listed in the 1.12 changelog. - Typst: horizontal rules use Typst 0.15's native divider, so they are full-width. A QUARTO_TYPST binary must be Typst 0.15 or later. Also ported: tight definition lists, and the csl-settings block that sets hanging indent and entry spacing for citeproc bibliographies. - LaTeX/Beamer: table caption setup, removal of the footnotehyper longtable hook, and the duplicate TOC fix in the Beamer toc partial. - HTML theme: pandoc: print styles, links that inherit the text color unless linkcolor is set, and currentColor borders. The print media block moves to the end of styles.html, as upstream now places it, so print resets apply over the screen rules. - reveal.js: plugin and highlight script paths point into dist/. - Remove the stale revealjs patch.sh and reveal.patch, which nothing called. Pandoc 3.13's automatic dark mode is not enabled for theme: pandoc, because the Quarto CSS loaded on that path is light only. Word output: cross-reference targets are now hidden bookmarks with generated names, so a lookup by Quarto id from outside the document no longer finds them.
1 parent 27e746a commit 84c4916

58 files changed

Lines changed: 489 additions & 231 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
paths:
3+
- tests/docs/smoke-all/pptx/**
4+
---
5+
6+
# pptx Tests
7+
8+
How the `ensurePptx*` verifiers address slides, their argument shapes, and why layout assertions depend on the bundled Pandoc: `llm-docs/pptx-testing.md`.

‎.gitignore‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ package/dist/**
1818
/tests/test-out.json
1919
*~
2020
.env
21-
# deno lock file generated by test runs (the root deno.lock is committed)
21+
# deno lock files generated outside the pinned root lockfile (the root deno.lock is committed)
2222
tests/deno.lock
23+
src/deno.lock
2324

2425
# deno_std library
2526
src/resources/deno_std/cache

‎configuration‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
export DENO=v2.9.8
1414
# TODO figure out where 0.1.41 apple silicon libs are available
1515
export DENO_DOM=v0.1.41-alpha-artifacts
16-
export PANDOC=3.10
16+
export PANDOC=3.13
1717
export DARTSASS=1.107.1
1818
export ESBUILD=0.28.2
1919
export TYPST=0.15.1

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Pandoc's `common.latex` is copied as `latex.common`; Quarto maintains its own `c
120120

121121
| File | Purpose |
122122
| ---------------- | --------------------------------------------------------------------------- |
123-
| `tables.tex` | Table packages (longtable, booktabs, array, multirow) and footnote handling |
123+
| `tables.tex` | Table packages (longtable, booktabs, array, multirow) and caption setup |
124124
| `graphics.tex` | graphicx package and `\pandocbounded` command for auto-scaling images |
125125
| `citations.tex` | CSL citation definitions (`\citeproc`, `CSLReferences` environment) |
126126
| `babel-lang.tex` | Babel language configuration and font setup |

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Two files are copied from Pandoc for typst support:
3636

3737
**default.typst** (becomes `typst.template`): The main Pandoc template that orchestrates the document structure. It:
3838
- Defines a horizontal rule helper
39-
- Sets up term list rendering with indented descriptions
39+
- Sets up term list rendering with a hanging indent
4040
- Configures table styling with no strokes
4141
- Sets figure caption positions for tables (top) and images (bottom)
4242
- Optionally includes syntax highlighting definitions
@@ -86,8 +86,9 @@ 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
90-
- Term list show rule with indented descriptions
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
90+
- Term list hanging indent (`#set terms(hanging-indent: 1.5em)`; Pandoc 3.13 dropped its custom `terms.item` show rule)
91+
- 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)
9192
- Code highlighting definitions (conditionally included)
9293

9394
**Quarto additions**:

‎llm-docs/pptx-testing.md‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
main_commit: 38e34ec50
3+
analyzed_date: 2026-11-09
4+
key_files:
5+
- tests/verify.ts
6+
- tests/smoke/smoke-all.test.ts
7+
- tests/docs/smoke-all/pptx/bullets-table-bullets-one-slide.qmd
8+
---
9+
10+
# Testing PowerPoint (pptx) output
11+
12+
pptx is tested through smoke-all documents (`tests/docs/smoke-all/`), with the verifiers `ensurePptxXpath`, `ensurePptxLayout`, `ensurePptxMaxSlides` and `ensurePptxRegexMatches` in `tests/verify.ts`. Few tests exist; for one worth copying see `tests/docs/smoke-all/pptx/bullets-table-bullets-one-slide.qmd`.
13+
14+
## How a verifier reads the deck
15+
16+
`withPptxContent` (`tests/verify.ts`) copies the `.pptx`, unzips it, and reads `ppt/slides/slide<N>.xml` (or its `_rels/slide<N>.xml.rels` for layouts). Everything is per slide number.
17+
18+
- **Slide 1 is the generated title slide** whenever the document has a `title` (and `author`/`date`). The first slide made from a `##` heading is slide 2.
19+
- **Text before the first heading becomes its own slide.** Put the scenario explanation of a test in an HTML comment, not in body prose, or the slide count changes.
20+
21+
## Verifier arguments in `_quarto: tests: pptx:`
22+
23+
| Key | Value | Notes |
24+
|---|---|---|
25+
| `ensurePptxMaxSlides` | `- N` | Fails if slide N+1 exists. A ceiling, not an exact count. Also fails if slide N is missing. |
26+
| `ensurePptxLayout` | `- [N, "Layout name"]`, one entry per slide | Layout name is the `p:cSld/@name` of the slide's layout. |
27+
| `ensurePptxXpath` | `- [N, [must-match xpaths], [must-not-match xpaths]]` | Namespaces such as `a:` and `p:` are available, e.g. `//a:tbl`. |
28+
| `ensurePptxRegexMatches` | `- [regexes]` then `- N` | Regexes run on the raw slide XML. Slide number is the second item, after the regex list. |
29+
30+
Pass a list of lists to check several slides with `ensurePptxLayout` or `ensurePptxXpath`; a single `[N, ...]` entry also works.
31+
32+
## Layouts come from Pandoc
33+
34+
Pandoc's pptx writer chooses the layout (Title Slide, Section Header, Two Content, Comparison, Content with Caption, Blank, Title and Content) from the slide content, using the layouts of its default `reference-doc`. A Pandoc upgrade can change both the choice and the slide splitting, so layout and slide-count assertions are characterization tests of the bundled Pandoc, not of Quarto code. Say so in the test comment, and re-check them on each Pandoc bump.
35+
36+
Pandoc 3.13 example: text followed by a table gets "Title and Content" where Pandoc 3.10 chose "Content with Caption", and a bullet list, a table and another bullet list stay on one slide.
37+
38+
## Comparing against another Pandoc version
39+
40+
To show that a pptx test depends on the Pandoc version, run it with `QUARTO_PANDOC` set to the `bin/tools/pandoc` of an installed Quarto release (see the `qvm` skill), then run it again without. `QUARTO_<BINARY>` overrides any bundled tool path.
41+
42+
## Inspecting a deck by hand
43+
44+
```bash
45+
quarto render doc.qmd --to pptx
46+
mkdir x && cd x && unzip -q ../doc.pptx
47+
ls ppt/slides/*.xml # slide count
48+
cat ppt/slides/_rels/slide2.xml.rels # which slideLayout<N>.xml
49+
grep -o '<p:cSld name="[^"]*"' ppt/slideLayouts/slideLayout2.xml
50+
```

‎news/changelog-1.12.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ All changes included in 1.12:
77
- Update `esbuild` to 0.28.2 (fixes a CSS minification bug involving `&` and a TypeScript import-alias tree-shaking bug).
88
- Update `typst-gather` to 0.2.4.
99
- Update `verapdf` to 1.30.3 (used by `quarto install verapdf` for PDF/A validation).
10+
- Update `pandoc` to 3.13
11+
- ([jgm/pandoc#11540](https://github.com/jgm/pandoc/issues/11540)): Horizontal rules (`---`) in Typst output are now full-width, following Pandoc 3.13's use of Typst 0.15's native `divider` element, instead of the previous centered half-width line. Restyle them with `#show divider: set line(stroke: 2pt)` in a raw Typst block or a custom template. A Typst binary set through `QUARTO_TYPST` must now be version 0.15 or later.
12+
- ([jgm/pandoc#11748](https://github.com/jgm/pandoc/pull/11748)): In Typst output, a single-paragraph definition in a tight definition list now sits on the same line as its term instead of below it. Definitions in loose lists, or made of several blocks, still start below the term.
13+
- ([jgm/pandoc#11831](https://github.com/jgm/pandoc/pull/11831)): HTML documents using `theme: pandoc` pick up Pandoc 3.13's style updates. Links now inherit the surrounding text color unless `linkcolor` is set, horizontal rules and table borders follow the text color, and printed output drops backgrounds and the fixed 12pt font size, rendering at the 11pt print size used by other Quarto HTML themes. Pandoc 3.13's automatic dark mode is not enabled for `theme: pandoc`.
14+
- ([jgm/pandoc#11845](https://github.com/jgm/pandoc/issues/11845)): In Word output, cross-reference targets are now hidden bookmarks with generated names instead of their Quarto id (`fig-plot`). Cross-reference links inside the document still work, but a link or script that looks a bookmark up by its Quarto id from outside the document, such as `report.docx#fig-plot` or `officer`, VBA or `python-docx` code, no longer finds it.
15+
- ([jgm/pandoc 3.13](https://github.com/jgm/pandoc/releases/tag/3.13)): A YAML bibliography file with a duplicated key, such as two `title` fields in one reference, now stops the render with an error giving the file, line and column. Before, the last value was kept silently. Remove the duplicate key to render again.
1016

1117
## Accessibility
1218

‎src/command/check/check.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ async function checkVersions(conf: CheckConfiguration) {
300300
// file is in an awkward format and it is not packaged
301301
// with our installers
302302
const versionConstraints: [string | undefined, string, string][] = [
303-
[pandocVersion, "3.10.0", "Pandoc"],
303+
[pandocVersion, "3.13.0", "Pandoc"],
304304
[sassVersion, "1.107.1", "Dart Sass"],
305305
[denoVersion, "2.9.8", "Deno"],
306306
[typstVersion, "0.15.1", "Typst"],

‎src/core/bibliography.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ export async function renderToCSLJSON(
111111
// Pandoc has no reader for a YAML bibliography: read as markdown, it
112112
// only works when wrapped in --- delimiters. Like --bibliography, use
113113
// the first YAML document, either a references: map or a bare array.
114-
// json: true lets a duplicate key win last, as pandoc does.
114+
// json: true lets a duplicate key win last instead of throwing here;
115+
// pandoc itself rejects duplicate keys when it reads the bibliography.
115116
const firstDoc = loadAll(Deno.readTextFileSync(absBiblioPath), null, {
116117
schema: kBibliographyYamlSchema,
117118
json: true,

‎src/core/typst.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export async function validateRequiredTypstVersion() {
261261
if (Deno.env.get("QUARTO_TYPST")) {
262262
const version = await typstVersion();
263263
if (version) {
264-
const required = ">=0.8";
264+
const required = ">=0.15";
265265
if (!satisfies(version, required)) {
266266
error(
267267
"An updated version of the Typst CLI is required for rendering typst documents.\n",

0 commit comments

Comments
 (0)