Resolve nameref to heading titles

Section numbering now also records the heading title for each label: a
number_sections_with_titles variant fills a titles table (the existing
number_sections wrapper keeps its signature for tests), and
resolve_section_refs takes that table. \nameref{label} becomes the heading
title, falling back to the number when no title was recorded, while \autoref
keeps producing "Section <number>"; unresolved forms become "??".

A preview test labels a heading inside its braces and renders \ref, \autoref
and \nameref together as "1 and Section 1 and Introduction" with no warnings.
This commit is contained in:
gloamxun committed 2026-10-27 02:15:13 +08:00
1 parent c399481c6a
commit 0728d78b29
4 files changed
+64 -10

No files matched your search

+2 -2
View File
@@ -14,12 +14,12 @@ cargo fmt --all -- --check
cargo test --workspace --offline
```
The workspace currently passes **1024 tests**:
The workspace currently passes **1025 tests**:
| Suite | Tests |
| --- | --- |
| route-D unit (engine) | 437 |
| engine binary unit | 395 |
| engine binary unit | 396 |
| server integration | 63 |
| v1 integration | 71 |
| pdfLaTeX oracle | 42 |