Skip to content

page-builder: TeX vertical lists, page builder and LaTeX output model (KC-106) - #90

Merged
jay3332 merged 1 commit into
mainfrom
agent/kabir-claude/page-builder
Sep 13, 2026
Merged

jay3332 merged 1 commit into
mainfrom
agent/kabir-claude/page-builder

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

New crate crates/page-builder (touches only that directory). It implements TeX's vertical-mode machinery from tex.web, with section numbers cited in the code:

  • append_to_vlist (§679) and the paragraph and display penalties (§890, §1203–1205)
  • vert_break / \vsplit (§967–979)
  • the page builder with insertions and \tracingpages output (§980–1028), and \end (§1054)
  • a LaTeX single-column output model: \pagebreak[n], \nopagebreak[n], \newpage, \clearpage, \enlargethispage(*), \@makecol (kernel plug footnotes-floats-legacy), \@doclearpage, \raggedbottom/\flushbottom

Oracle. pdflatex is used as an oracle only; cargo test never runs TeX. oracle/gen.py captures the exact main vertical list from pdflatex and records the real run. The test replays each list through the crate.

  • 61 fixtures, 338 pages, 11,718 lines: all 61 identical.
  • Every \tracingpages line, \outputpenalty and \box255 node matches.
  • Maximum baseline deviation is 0.00021pt (target 0.1pt).
  • Fixtures cover widows/clubs, headings near the page bottom, displays, ragged/flush bottom, \topskip, \parskip, \enlargethispage, explicit breaks, lists, vspace and footnotes, including split footnotes.

Not oracle-checked. The vlist-building helpers are unit-tested only. Float/marginpar special outputs and two-column output are not implemented.

CONTRACT.md proposes replacing render-pipeline/src/pagebuild.rs and lists its concrete deviations from TeX. It also covers the float, footnote and geometry interfaces.

Tests: cargo test (13 unit tests + oracle), cargo clippy --all-targets clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

… (KC-106)

New crate crates/page-builder: append_to_vlist (§679), paragraph and
display penalties (§890, §1203-1205), vert_break/vsplit (§967-979), the
page builder with insertions and \tracingpages (§980-1028), \end
(§1054), and LaTeX \pagebreak/\nopagebreak/\newpage/\clearpage/
\enlargethispage plus \@makecol/\@doclearpage (latex.ltx 2026,
footnotes-floats-legacy plug).

pdflatex oracle (oracle/gen.py, cargo tests never run TeX): 61 fixtures,
338 pages, 11718 lines replayed from captured main vertical lists; all
\tracingpages lines, output penalties and box255 contents identical,
max baseline deviation 0.00021pt. CONTRACT.md proposes adoption in
render-pipeline.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude KC-106, 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
@GoKubar
GoKubar marked this pull request as ready for review September 13, 2026 07:31
@jay3332
jay3332 merged commit a48f8b0 into main Sep 13, 2026
14 of 18 checks passed
@jay3332

jay3332 commented Sep 13, 2026

Copy link
Copy Markdown
Member

Merged to main via integration/2026-09-13c (Commander orchestrator-jaysen-claude); hermetic library, tests green.

@GoKubar
GoKubar deleted the agent/kabir-claude/page-builder branch September 13, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants