Repository navigation
Conversation
…leftmargin`
The pipeline's list scanners knew `itemize`, `enumerate` and
`thebibliography` only, so a `\begin{description}` item got an *empty*
margin stack: `\@totalleftmargin` 0, no `\topsep`/`\itemsep`, no label
geometry. Its body — first line and continuation lines alike — was set at
the plain text margin.
article.cls lines 400-404 build `description` from the same `\list{}{...}`
with the same class `\leftmargin<i>`; the three differences are
`\labelwidth\z@`, `\itemindent-\leftmargin` and `\descriptionlabel`
(`\hspace\labelsep\normalfont\bfseries #1`). So the continuation lines hang
at `\leftmargin` while the first line is pulled back out and the term sets
flush at the enclosing margin, in bold, with `\descriptionlabel`'s own
`\hspace\labelsep` cancelling `\@item`'s `\hskip-\labelsep`.
`\item` labels are now set the way `\sbox\@tempboxa{\makelabel{#1}}` does:
each word its own text box, the gaps TeX's interword glue at natural width.
Shaping `"A much longer term"` as one run resolves `U+0020` through the
face's cmap, and in T1 that slot is `visiblespace` — 1.91 bp per gap wider
than `\fontdimen2` on `ecbx1000`. `number_box` already avoided this for
amsmath tags; every multi-word `\item[...]` label carried it.
Measured against pdflatex (TeX Live 2025) on
`fixtures/divergence-probes/min-description`: before, the continuation line
was at x 72.000 against the reference's 96.907 (**dx -24.907 bp**) and the
paragraph after the list was **11.955 bp** high. After, all 38 words on the
page are within 0.5 bp in x and y — the probe is exact.
Corpus (22 real documents vs pdflatex, tolerance 0.5 bp):
dx 84.47% -> 85.19%, dy 65.21% -> 66.81%, both 58.67% -> 60.23%, page
counts 20/22 unchanged. The four fixtures that use `description` are the
only ones that move:
enumitem-worksheet dx 49.46 -> 51.25 dy 5.38 -> 5.38
listings-manual dx 42.71 -> 43.59 dy 3.94 -> 3.94
lmodern-report dx 94.99 -> 98.92 dy 26.37 -> 44.76 both 26.37 -> 44.38
plain-article dx 83.44 -> 89.61 dy 50.32 -> 47.89 both 41.23 -> 38.80
`plain-article`'s `dy` is the one number that falls, and it is an artefact
of measuring absolute position on a page that is still wrong for other
reasons. Every *local* spacing on that page improves: the three description
items go from dy +3.17/+2.74/+2.30 to -0.48/-0.74/-1.00, the heading below
the list from +1.93 to -1.23, and the `quote` gap error from -2.18 to
-1.30. What the metric loses is 25 words whose accumulated offset happened
to land inside 0.5 bp before. The residual page-wide vertical constant is
the vertical-drift lane's, not this change's.
Gates: `cargo test --release --no-fail-fast` on render-pipeline 254 passed
/ 0 failed / 2 ignored (plus the new `description_list` test),
class-geometry 4/0, compiler 572/0/4; amsmath 59/59, tabular 106/106, HW1
and HW2 3 pages / 0 errors / 0 font-FAILURE diagnostics.
Implementation-Agent: Claude Opus 5 (lane nixos-graphics-sectioning, linux-primary)
Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)
|
Superseded by #405, which landed the same thing while this was open — and did it more thoroughly. Closing rather than merging twice. I rebased and re-measured against current
One thing was not covered, so I have split it out as #409: a No complaint about the overlap — #405 is the better version of this. |
What
The pipeline's list scanners knew
itemize,enumerateandthebibliographyonly, so a\begin{description}item got an empty margin stack:\@totalleftmargin0, no\topsep/\itemsep, no label geometry. Its body — first line and continuation lines alike — was set at the plain text margin.article.cls lines 400-404 build
descriptionfrom the same\list{}{...}with the same class\leftmargin<i>; the three differences are\labelwidth\z@,\itemindent-\leftmarginand\descriptionlabel(\hspace\labelsep\normalfont\bfseries #1). So continuation lines hang at\leftmarginwhile the first line is pulled back out and the term sets flush at the enclosing margin, in bold.Second fix, required by the first:
\itemlabels are now set the way\sbox\@tempboxa{\makelabel{#1}}does — each word its own text box, the gaps TeX's interword glue at natural width. Shaping"A much longer term"as one run resolvesU+0020through the face's cmap, and in T1 that slot isvisiblespace: 1.91 bp per gap wider than\fontdimen2onecbx1000.number_boxalready avoided this for amsmath tags; every multi-word\item[...]label carried it.Files touched
crates/render-pipeline/src/adapter.rs(LIST_ENVS,ListGeom::description)crates/render-pipeline/src/typeset.rs(ListBox,LabelBox,list_box,label_box)crates/render-pipeline/tests/description_list.rs(new)No
crates/render-pipeline/vendor/*change; no compiler-side change; no vendor re-pin required.Oracle evidence
pdflatex TeX Live 2025 on
fixtures/divergence-probes/min-description:Corpus
22 real documents vs pdflatex, tolerance 0.5 bp:
Only the four fixtures that use
descriptionmove:enumitem-worksheetlistings-manuallmodern-reportplain-articleThe one number that falls
plain-article'sdyis an artefact of measuring absolute position on a page that is still wrong for other reasons. Every local spacing on that page improves:\sectionbelow the listquotegap errorWhat the metric loses is 25 words whose accumulated offset happened to land inside 0.5 bp before. The residual page-wide vertical constant is the vertical-drift lane's, not this change's.
Gates
cargo test --release --no-fail-fastwithFLASHTEX_FONT_DIRS/FLASHTEX_TFM_DIRSset:crates/render-pipeline254 passed / 0 failed / 2 ignored, plus the newdescription_listtestcrates/class-geometry4 passed / 0 failedcrates/compiler572 passed / 0 failed / 4 ignoredCoordination
Another lane is working the vertical origin drift in
lmodern-report/plain-article. This PR touchesadapter.rs,typeset.rsand one new test file. It does not touch the per-page vertical constant; theplain-articledycolumn above is explained in full under "the one number that falls". It is independent of #395 (secnumdepth), which touches only thesecnumdepthbinding inadapter.rs.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu