Support TeX looseness on paragraph final lines

This commit is contained in:
gloamxun committed 2026-10-23 01:26:54 +08:00
1 parent 295c934438
commit 8cb09ea5a8
2 files changed
+27 -20

No files matched your search

+12 -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`). 299 workspace tests are green and no oracle
PDF opt-in with `?engine=route-d`). 305 workspace tests are green and no oracle
fixture is ignored.
Known gaps, in dependency order:
@@ -56,10 +56,10 @@ Known gaps, in dependency order:
1. paragraph breaking reproduces TeX's passes and demerits (including
`\adjdemerits`, `\doublehyphendemerits`, `\finalhyphendemerits`,
`\hyphenpenalty`, `\exhyphenpenalty`, `\hyphenation` exceptions,
`\hangindent`/`\hangafter`/`\parshape` line geometry and `\parfillskip`
with or without `fil` and default `\sfcode` sentence spacing), but not yet
`\looseness`, custom `\sfcode` overrides or generic `fil`/`fill` glue
orders;
`\hangindent`/`\hangafter`/`\parshape` line geometry, `\parfillskip`
with or without `fil`, default `\sfcode` sentence spacing and
`\looseness`), but not yet custom `\sfcode` overrides or generic
`fil`/`fill` glue orders;
2. the page builder is a scrolling builder with fraction policies, not a TeX
page builder with badness and an interpreted `\output`;
3. `\insert` classes are data structures, not TeX registers and an output
@@ -196,9 +196,13 @@ stretch is multiplied and shrink divided by the space factor, `\fontdimen7`
is added from 2000, and `\frenchspacing` switches it off; a 150pt punctuated
oracle fixture matches pdfLaTeX's line breaks and word positions.
Still open: generic `fil`/`fill` glue orders, `\looseness`, custom `\sfcode`
overrides, vertical-list skips (`\baselineskip`, `\lineskip`, `\parskip`),
double/final hyphen demerit oracle fixtures, and more width fixtures.
`\looseness` adjusts the final line count inside TeX's `[1,9]` window and is
reverted when no feasible layout exists; 120pt and 200pt fixtures require one
extra line and match pdfLaTeX exactly.
Still open: generic `fil`/`fill` glue orders, custom `\sfcode` overrides,
vertical-list skips (`\baselineskip`, `\lineskip`, `\parskip`), double/final
hyphen demerit oracle fixtures, and more width fixtures.
### P2 — Vertical list, page builder, `\output` (L2)