Repository navigation
render-pipeline: contents lists — \part, \caption[short], macros in entries, two-column lists (includes #133) - #141
Merged
Conversation
…like LaTeX
The pipeline set `\tableofcontents` as its heading only. It now keeps
LaTeX's `\contentsline` records in memory and sets every list where its
command stands:
- entries: every numbered heading (`\@sect`, report/book `\@chapter`),
`\addcontentsline{toc|lof|lot}{<level>}{[\numberline{..}]..}` and float
captions (`\thefigure`/`\thetable`, `<chapter>.<n>` with chapters);
`tocdepth` (article 3, report/book 2), `\numberline` up to the class
`secnumdepth`, `\renewcommand\contentsname` (and the LOF/LOT names);
- geometry (typeset/toc.rs): latex.ltx `\@dottedtocline` (leftskip
indent+numwidth, `\rightskip\@tocrmarg`, `\parfillskip -\rightskip`,
hanging wrap), article `\l@section` / report+book `\l@chapter` (bold,
`\@pnumwidth`, `\addpenalty`, `1.0em plus 1pt`), `\leaders` dot boxes
(`\mkern4.5mu . \mkern4.5mu`) aligned to the line's left edge as in
tex.web §626, page numbers flush right; list headings as `\section*`
(article) or `\chapter*` (report/book), `\@mkboth` under `headings`;
- page numbers: each entry carries a synthetic label; `render` reruns the
layout (as for `\pageref`) until the formatted `\thepage` of every entry
settles, so roman front matter shows `i`, `ii`;
- `\appendix`: `\thesection` `\Alph` (article), `\thechapter` `\Alph` and
`\appendixname` chapter heads (report/book).
The compiler's errors for the commands the pipeline now sets
(`\listoffigures`, `\listoftables`, `\addcontentsline`, `\appendix`, the
list-name redefinitions, `\setcounter{tocdepth}`) are superseded. No
compiler or vendor changes.
Oracle: tools/toc-oracle/generate.py writes 23 fixtures
(fixtures/toc) and pdflatex's word and leader-dot positions (three runs,
MacTeX 2026); tests/toc_oracle.rs gates every word before a list-end
marker within 0.5bp. All 23 pass (worst 0.010bp, 3,392 leader dots).
Two entry page numbers follow body pagination the pipeline places
differently (12pt subsection skips; `\clearpage` in two-column mode ends
the column) and are position-gated only.
Implementation-Agent: Claude Opus 5 (subagent kabir-claude toc layout, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…tries, two-column lists Follow-ups to the contents-list work (PR #133): - `\part` (article.cls lines 268-301, report.cls 278-328, book.cls 299-349): `BodyKind::Part`/`Block::Part` from class-geometry's `PartSpec` — article in the flow (`\addvspace{4ex}`, `\Large` "Part I", `\huge` title, `\vskip 3ex`, `\@afterheading`), report/book on a page of its own (`\null\vfil` ... `\vfil\newpage`, centred, `\thispagestyle{plain}`, book's empty page after under openright). Its `\addcontentsline{toc} {part}{\thepart\hspace{1em}#1}` entry is set as `\l@part` (article lines 509-527, report 595-611, book 601-617): `\large\bfseries`, number inline, `\addpenalty`, `\addvspace{2.25em plus 1pt}`, `\nobreak`, and report/book's `\global\@nobreaktrue`; `tocdepth > -2`. - `\caption[<short>]{<long>}`: the float scan keeps the optional argument and the list shows it (latex.ltx `\@caption#1[#2]#3`, `\@dblarg`). - Entry titles taken from source bytes (`\addcontentsline`, `\chapter`, `\part`, captions) are parsed once per render like body text (`toc::entry_items`, the caption route's isolate-and-parse), so `\emph`, `\textbf`, math and user macros come out as in a paragraph. - report/book lists in a two-column document are set at `\textwidth` on pages of their own (`\if@twocolumn \@restonecoltrue\onecolumn` ... `\twocolumn`, report.cls lines 583-594/634-658). - Two-column page builder: `\clearpage`/`\cleardoublepage` (and `\chapter`, `\part`, the class `\clearpage`s) end the page, `\newpage` only the column (latex.ltx `\clearpage` lines 20414-20425); `\cleardoublepage`'s empty page is a whole page (`\if@twocolumn\hbox{}\newpage\fi`). Done after column breaking by inserting empty columns (`align_columns`), mapped for floats like the existing openright pages; one-column documents are untouched. Oracle: 10 new pdflatex fixtures (24-33, MacTeX 2026, three runs); all 33 pass within 0.5bp: 5,321/5,321 words, 4,321/4,321 leader dots (929 new), worst 0.357bp (a math `x` in fixture 29). `11-article-twocolumn`'s page numbers are gated again. The generator tolerates font-less blank pages. Not addressed (outside the contents code): an inline `$x^2$` superscript sets ~1.6bp wider and `$\alpha$` is dropped in headings, in the body as in the list (fixture 29 avoids both); two-column `\chapter` heads (`\@topnewpage`) sit ~20.7bp lower than pdflatex; the 12pt article subsection skips (fixture 14) still move one entry's page. Gates: render-pipeline `cargo test --release` green; HW1/HW2 and 5 more real-world fixtures byte-identical to main; input-bibliography and lecture-notes differ from main only by #133's superseded diagnostics. Implementation-Agent: Claude Opus 5 (subagent kabir-claude toc followups, mac-m5pro-kabir) Commit-Executor: Claude Code direct Git Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
This was referenced Sep 13, 2026
Member
|
Merged to main via integration/2026-09-13k (Commander). |
This was referenced Sep 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Includes and supersedes #133 (unmerged): this branch is
origin/main(85ec30c) + #133's f99a920 (fast-forward) + d7995c8. If #133 merges first, this rebases onto main as the single follow-up commit.Changes (crates/render-pipeline only; no compiler/vendor edits)
\part— article in-flow (article.cls 268-301), report/book own page (report.cls 278-328, book.cls 299-349, empty page after under openright) from class-geometry'sPartSpec; TOC entry as\l@part(article 509-527, report 595-611, book 601-617):\large\bfseries, inline\thepart\hspace{1em},\addpenalty,\addvspace{2.25em plus 1pt}, report/book\global\@nobreaktrue,tocdepth > -2. The compiler's\parterror is superseded.\caption[short]{long}— float scan keeps the optional argument; LOF/LOT show it (latex.ltx\@caption#1[#2]#3). Small, additive change infloats.rs(Piece::Caption.short).\addcontentsline/\chapter/\part/caption titles are parsed once per render as body text (toc::entry_items, same isolate-and-parse route as captions):\emph,\textbf, math, user\newcommands.\textwidthon their own pages (\@restonecoltrue\onecolumn…\twocolumn).\clearpageends the page,\newpagethe column (latex.ltx 20414-20425);\chapter/\part/class clears too;\cleardoublepage's blank is a whole page. Implemented after column breaking by inserting empty columns (align_columns), float columns remapped like the openright pages; one-column documents untouched.Evidence
11-article-twocolumnpage numbers gated again.cargo test --release(render-pipeline): all green (page_frame, floats, tabular, toc, …).flashtex-render --v2: HW1, HW2, article-twocolumn, cv, letter, math-sheet, unicode-accents byte-identical to main; input-bibliography and lecture-notes differ from main only via render-pipeline: \tableofcontents, \listoffigures, \listoftables like LaTeX #133 (branch output byte-identical to render-pipeline: \tableofcontents, \listoffigures, \listoftables like LaTeX #133's build; only render-pipeline: \tableofcontents, \listoffigures, \listoftables like LaTeX #133's superseded diagnostics removed).Known, outside the contents code
$x^2$sets ~1.6bp wide;$\alpha$is dropped. Fixture 29 avoids both.\chapterheads (\@topnewpage) sit ~20.7bp below pdflatex's.\partin two-column documents is set full-width but not oracle-tested.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu