Repository navigation
Conversation
…dent, bold label)
`description` was missing from the four hard-coded lists of list environments
in `adapter.rs` (`list_stack_at`, `list_env_after_begin`, `gap_has_list_end`,
`list_end_adjust`/`list_end_skip`), so an `\item[...]` of one got no `\list`
treatment at all: no `\partopsep` when the environment opened in vertical mode,
no `\@endparenv` skip at `\end{description}`, no `\leftmargin` hanging indent,
no `\itemindent`, and a medium-weight label.
article.cls builds it exactly like `itemize`:
\newenvironment{description}
{\list{}{\labelwidth\z@ \itemindent-\leftmargin
\let\makelabel\descriptionlabel}}{\endlist}
\newcommand*\descriptionlabel[1]{\hspace\labelsep \normalfont\bfseries #1}
so the four things that follow are now all implemented: the class list skips,
`\labelwidth\z@` (a short label is never padded out), `\itemindent-\leftmargin`
(the item's first line is flush at the margin, continuation lines hang in), and
`\descriptionlabel`'s `\labelsep` + `\bfseries`.
Oracle evidence (TeX Live 2025 pdflatex, oracle only). A probe with two
wrapping items and a one-line item, before -> after, against the reference:
first item baseline -2.99 bp (the missing \partopsep, 3 pt) -> 0.00
paragraph after the list -14.95 bp (that plus the whole
missing \@endparenv skip, 12 pt) -> 0.00
label x -5.46 bp (no \descriptionlabel \labelsep) -> 0.00
continuation line x -27.27 bp (no \leftmargin) -> 0.00
The same -2.99 bp and -27.28 bp are the two largest deltas on page 3 of
`fixtures/real-world/lmodern-report`; that page is now exact.
A second defect surfaced while measuring: a multi-word label was shaped as one
run, so the gap between its words was the **T1 visible-space glyph's** advance
(6.27 bp for `\bfseries` Latin Modern at 11 pt) rather than `\fontdimen2`
(4.18 bp), pushing everything after the label 2.1 bp right. `label_box` now
builds the label the way `number_box` already built amsmath tags — one shaped
run per word, joined by TeX's interword glue — and the two share `word_box`.
Real-world corpus (22 documents, `tools/visual-oracle/rank.py`), on top of the
`\brokenpenalty` fix:
dy <= 0.5 bp 70.4% -> 72.0%
both <= 0.5 bp 63.8% -> 65.3%
dx <= 0.5 bp 84.5% -> 85.2%
Per fixture, only the four `description` documents move: lmodern-report
dy 81.8 -> 100.0 / both 81.1 -> 98.9, enumitem-worksheet dx 49.5 -> 51.3,
listings-manual dx 42.7 -> 43.6, plain-article dx 83.4 -> 89.6. plain-article's
dy reads 50.3 -> 47.9: its page 2 already carried a pre-existing glue-shrink
ramp (our page 2 is over-full and shrinks where pdflatex's is `\raggedbottom`
and stretches, because we break three lines later at `\section{Cost
Comparison}`), and the old `description` skips happened to cancel part of it.
The ramp is unchanged by this commit — measured identical on the previous
binary — and the page-break difference is a separate defect. Page counts are
unchanged everywhere (20/22).
Gates: `cargo test --release --no-fail-fast` on crates/render-pipeline green,
new `tests/description_env.rs`; amsmath 59/59, tabular 106/106, HW1 and HW2
3 pages / 0 errors, zero font-FAILURE diagnostics.
Implementation-Agent: Claude Opus 5 (lane nixos-vertical-drift, linux-primary)
Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Contributor
Author
|
Closed automatically when I deleted its base branch on merging #400 — my mistake, not a judgement on the change. The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #400 (
lane/nixos-vertical-drift-brokenpenalty): the two changes are independent in intent but sharetypeset.rshunks, so this branch contains both commits and the base is #400's branch. Review the second commit only.render-pipeline: description is a \list (topsep/partopsep, hanging indent, bold label)
descriptionwas missing from the four hard-coded lists of list environmentsin
adapter.rs(list_stack_at,list_env_after_begin,gap_has_list_end,list_end_adjust/list_end_skip), so an\item[...]of one got no\listtreatment at all: no
\partopsepwhen the environment opened in vertical mode,no
\@endparenvskip at\end{description}, no\leftmarginhanging indent,no
\itemindent, and a medium-weight label.article.cls builds it exactly like
itemize:so the four things that follow are now all implemented: the class list skips,
\labelwidth\z@(a short label is never padded out),\itemindent-\leftmargin(the item's first line is flush at the margin, continuation lines hang in), and
\descriptionlabel's\labelsep+\bfseries.Oracle evidence (TeX Live 2025 pdflatex, oracle only). A probe with two
wrapping items and a one-line item, before -> after, against the reference:
The same -2.99 bp and -27.28 bp are the two largest deltas on page 3 of
fixtures/real-world/lmodern-report; that page is now exact.A second defect surfaced while measuring: a multi-word label was shaped as one
run, so the gap between its words was the T1 visible-space glyph's advance
(6.27 bp for
\bfseriesLatin Modern at 11 pt) rather than\fontdimen2(4.18 bp), pushing everything after the label 2.1 bp right.
label_boxnowbuilds the label the way
number_boxalready built amsmath tags — one shapedrun per word, joined by TeX's interword glue — and the two share
word_box.Real-world corpus (22 documents,
tools/visual-oracle/rank.py), on top of the\brokenpenaltyfix:Per fixture, only the four
descriptiondocuments move: lmodern-reportdy 81.8 -> 100.0 / both 81.1 -> 98.9, enumitem-worksheet dx 49.5 -> 51.3,
listings-manual dx 42.7 -> 43.6, plain-article dx 83.4 -> 89.6. plain-article's
dy reads 50.3 -> 47.9: its page 2 already carried a pre-existing glue-shrink
ramp (our page 2 is over-full and shrinks where pdflatex's is
\raggedbottomand stretches, because we break three lines later at
\section{Cost Comparison}), and the olddescriptionskips happened to cancel part of it.The ramp is unchanged by this commit — measured identical on the previous
binary — and the page-break difference is a separate defect. Page counts are
unchanged everywhere (20/22).
Gates:
cargo test --release --no-fail-faston crates/render-pipeline green,new
tests/description_env.rs; amsmath 59/59, tabular 106/106, HW1 and HW23 pages / 0 errors, zero font-FAILURE diagnostics.
Implementation-Agent: Claude Opus 5 (lane nixos-vertical-drift, linux-primary)
Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 [email protected]
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu