Read output penalty and page number in the output routine

This commit is contained in:
gloamxun committed 2026-10-23 03:04:58 +08:00
1 parent 4bec90cf8c
commit a2a2eafab5
6 files changed
+243 -47

No files matched your search

+10 -8
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`). 344 workspace tests are green and no oracle
PDF opt-in with `?engine=route-d`). 349 workspace tests are green and no oracle
fixture is ignored.
Known gaps, in dependency order:
@@ -69,10 +69,12 @@ yet generic `fil`/`fill` glue
documents made of box/glue/penalty/mark units and insertion classes
(per-class limits with held-over material), but floats and incremental
checkpoint replay still use the scrolling builder, and the interpreted
`\output` subset handles `\shipout`/`\ifdim` only;
`\output` subset handles `\shipout`, `\ifdim` and `\ifnum` over page
registers such as `\pageno`, `\outputpenalty` and `\deadcycles`;
3. `\insert` classes model `\count`/`\dimen`/`\skip` but are not TeX
registers addressed by number; the interpreted output routine covers page
shipping and `\ifdim` comparisons but not the full `\output` machinery;
shipping and `\ifdim`/`\ifnum` comparisons but not the full `\output`
machinery;
4. `\halign` handles spans/omit/templates but not the full TeX column algorithm;
5. math is a compact subset without the CM math fonts (`cmmi`, `cmsy`, `cmex`),
display-math line breaking or `\mathchoice`-level styling;
@@ -242,9 +244,9 @@ Scope:
now modelled by `InsertionClass::multiplier`, `max_height` and `skip`, and
the fitting head stays on the anchor page with the tail held over; TeX's
register arithmetic remains);
- output: `\output` as an interpreted token list (`\shipout\box255`, `\ifdim`
over page registers landed), `\outputpenalty`, `\deadcycles`, page display
list assembly;
- output: `\output` as an interpreted token list (`\shipout\box255`, `\ifdim`,
`\ifnum`, `\outputpenalty`, `\pageno` and `\deadcycles` landed), page
display list assembly;
- floats: TeX-compatible policy module used by the default output routine
(top/bottom fractions and counts already exist).
@@ -266,7 +268,7 @@ dimension assignments from the source. Insertion classes are placed by the
paged builder with their limits and held-over material; 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 subset.
interpreter past the shipout/ifdim/ifnum subset.
Acceptance: 10 page fixtures (article text, footnotes, floats, forced breaks);
page counts identical and first/last baselines within 1pt of pdfLaTeX.
@@ -409,7 +411,7 @@ Acceptance: corpus green or explicitly listed; CI documented.
| goal | phases | deliverable |
| --- | --- | --- |
| G1 (current) | P0, P1, P2 | TeX-exact paragraphs, vertical list, page builder, interpreted `\output` (shipout/ifdim subset landed) |
| G1 (current) | P0, P1, P2 | TeX-exact paragraphs, vertical list, page builder, interpreted `\output` (shipout/ifdim/ifnum subset landed) |
| G2 | P3, P4 | tables and math at L2/L3 |
| G3 | P5 | Computer Modern fonts, NFSS, pixel parity for text/math |
| G4 | P6 | class execution (article, journal) |