Replay paged layouts from the edited page

This commit is contained in:
gloamxun committed 2026-10-23 03:46:12 +08:00
1 parent 6c3636c7c5
commit 043ae7f072
5 files changed
+236 -31

No files matched your search

+10 -5
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`). 358 workspace tests are green and no oracle
PDF opt-in with `?engine=route-d`). 367 workspace tests are green and no oracle
fixture is ignored.
Known gaps, in dependency order:
@@ -262,7 +262,8 @@ marks) and chooses each page at the cheapest feasible breakpoint, scoring
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` and marks.
penalty-driven earlier breaks, `\topskip`, `\maxdepth`, marks, insertion
limits and top-float placement.
`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
@@ -273,9 +274,13 @@ with `pdftotext -bbox`, and the PDF endpoint reads leading `\hoffset`/`\voffset`
dimension assignments from the source. Insertion classes are placed by the
paged builder with their limits and held-over material, and top floats are
placed at the head of a fragment with `\textfloatsep` reserved above the body;
bottom/in-text floats and checkpoint replay still fall back to the scrolling
builder, which stays the default until it has a paged equivalent. Next: port those paths and paper margins, then extend the `\output`
interpreter past the shipout/ifdim/ifnum/ifodd/ifcase subset.
bottom/in-text floats still fall back to the scrolling builder, which stays
the default until it has a paged equivalent. 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: port bottom/in-text floats and
paper margins, then 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.