Set vertical glue for ragged and flushed pages

This commit is contained in:
gloamxun committed 2026-10-23 04:13:12 +08:00
1 parent 448152cea4
commit 00c23a3511
6 files changed
+143 -14

No files matched your search

+5 -6
View File
@@ -48,7 +48,7 @@ floats (`\floatsep`, `\textfloatsep`, `\intextsep`, `\topfraction`,
`\bottomnumber`, `\totalnumber`), insertion classes (`\skip`, fraction and
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`). 379 workspace tests are green and no oracle
PDF opt-in with `?engine=route-d`). 380 workspace tests are green and no oracle
fixture is ignored.
Known gaps, in dependency order:
@@ -264,7 +264,7 @@ badness from the page goal and accumulated glue, adding the break penalty, and
applying `\topskip` to the first box and `\maxdepth` to the page depth. Seven
unit tests cover overfull avoidance, exact glue filling, forced penalties,
penalty-driven earlier breaks, `\topskip`, `\maxdepth`, marks, insertion
limits and top-float placement.
limits, float placement and vertical glue setting.
`Engine::layout_paged` now feeds it every document whose units are single
vertical items (`Document::max_depth` supplies `\maxdepth`) and materialises the
chosen fragments as hashed pages; ties go to the breakpoint closest to the page
@@ -279,12 +279,11 @@ the source. Insertion classes are placed by the
paged builder with their limits and held-over material, top floats are placed
at the head of a fragment with `\textfloatsep` reserved above the body, and
bottom floats sit at the page bottom with `\floatsep` between them and a
`\bottomfraction` cap; in-text floats flow inline with their `\intextsep` gaps counted as body height. Paged layouts also record the
`\bottomfraction` cap; in-text floats flow inline with their `\intextsep` gaps counted as body height. Vertical glue is set when pages are materialised: `PageBuilder::ragged_bottom` defaults to `\raggedbottom`, while `\flushbottom` stretches `VerticalItem::StretchGlue` proportionally so the page body reaches the goal (`PageFragment::set` records the signed setting amount). Paged layouts also record the
node index starting each page, so `Engine::edit` reuses the sealed prefix and
rebuilds only the pages from the edited unit onward; insertions and interpreted
`\output` keep the full-rebuild fallback. Next: paper margins, then
extend the `\output` interpreter past the
shipout/ifdim/ifnum/ifodd/ifcase subset.
`\output` keep the full-rebuild fallback. Next: extend the `\output`
interpreter past the shipout/ifdim/ifnum/ifodd/ifcase subset.
Acceptance: 10 page fixtures (article text, footnotes, floats, forced breaks);
page counts identical and first/last baselines within 1pt of pdfLaTeX.