Give standalone labels their heading title

A \label on its own paragraph after a heading resolved \ref and \autoref, but
\nameref fell back to the number because the label-to-title table only recorded
labels taken from heading text. Section numbering now tracks the latest heading
title and records it for label-only paragraphs (and ordinary paragraphs that
carry a label), so \nameref returns the title for those labels too.

A preview test puts \label on its own line after \section, then checks
"Introduction and Section 1" with no warnings.
This commit is contained in:
gloamxun committed 2026-10-27 03:07:12 +08:00
1 parent abf5e90578
commit 4ad15f1f0b
4 files changed
+42 -6

No files matched your search

+1 -1
View File
@@ -51,7 +51,7 @@ floats (`\floatsep`, `\textfloatsep`, `\intextsep`, `\topfraction`,
absolute limits, splitting), marks, Rust output hook, multi-page PDF, and the
route-D service endpoints (`/api/route-d/preview|pdf|edit`, project preview and
PDF opt-in with `?engine=route-d`; flat `/preview` and project previews now
prefer route-D with a v1 fallback). 1040 workspace tests are green and no oracle
prefer route-D with a v1 fallback). 1041 workspace tests are green and no oracle
fixture is ignored. Preview JSON also carries a `warnings` array naming
environments route-D cannot lay out and control words that survived layout, so
unsupported source is reported instead of being silently typeset.