Skip to content

render-pipeline: a description item that opens with a display sets its term flush too - #409

Merged
GoKubar merged 1 commit into
mainfrom
lane/nixos-gfxsec/description-display
Sep 14, 2026
Merged

GoKubar merged 1 commit into
mainfrom
lane/nixos-gfxsec/description-display

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

What

#405 gave description its \list geometry — \labelwidth\z@ \itemindent-\leftmargin, the class \leftmargin, the separations and the bold \descriptionlabel. One path did not get it. When the item's body opens with a display (\item[Term] \[...\]), \@item holds the label in \@labels and \everypar sets it on a line of its own; that line is built by display_opener_block, which still placed the term at \leftmargin - \labelsep.

list_geometry already returns the innermost \leftmargin for exactly this — display_opener_block was discarding it (let (hang, labelwidth, _)).

This is the residual of my #396, which #405 otherwise superseded; #396 is closed in favour of this.

Oracle evidence

pdflatex TeX Live 2025, a two-item description whose first item opens with \[ x + y = z \]:

before after reference
term A x 91.925 (dx +19.925) 72.000 72.000
long / term x +19.928 / +19.930 84.478 / 109.295 84.475 / 109.291
words within 0.5 bp in x and y 55 / 58 58 / 58 —

+19.925 bp is exactly \leftmargin (24.907) − \labelsep (4.981).

Corpus: no movement, and that is the honest reach

No fixture in fixtures/real-world/ has a description item that opens with a display, so the 22-document corpus is unchanged to the last word:

before after
dx 85.74% 85.74%
dy 75.93% 75.93%
both 69.79% 69.79%
aligned words 14054 14054
page counts 21/22 21/22

A probe-verified correctness fix, not a parity gain. Measured against current main (fb79c646), which already carries #405 and #400.

Files touched

  • crates/render-pipeline/src/typeset.rs (display_opener_block)
  • crates/render-pipeline/tests/description_display.rs (new)

No crates/render-pipeline/vendor/* change; no compiler-side change; no vendor re-pin required.

Gates

cargo test --release --no-fail-fast with FLASHTEX_FONT_DIRS/FLASHTEX_TFM_DIRS set:

  • crates/render-pipeline 268 passed / 0 failed / 2 ignored
  • crates/class-geometry 4 passed / 0 failed
  • crates/compiler 581 passed / 0 failed / 4 ignored
  • amsmath 59/59, tabular 106/106
  • HW1 and HW2: 3 pages, 0 errors, 0 font-FAILURE diagnostics

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

…its term flush too

#405 gave `description` its `\list` geometry — `\labelwidth\z@
\itemindent-\leftmargin`, the class `\leftmargin`, the separations and the
bold `\descriptionlabel`. One path did not get it: when the item's body
opens with a display (`\item[Term] \[...\]`), `\@item` holds the label in
`\@labels` and `\everypar` sets it on a line of its own, and that line is
built by `display_opener_block`, which still placed the term at
`\leftmargin - \labelsep`.

`list_geometry` already returns the innermost `\leftmargin` for exactly
this; `display_opener_block` was discarding it (`let (hang, labelwidth, _)`).

Measured against pdflatex (TeX Live 2025) on a two-item `description` whose
first item opens with `\[ x + y = z \]`: the term was at x 91.925 against
the reference's 72.000, dx **+19.925 bp** (= `\leftmargin` 24.907 −
`\labelsep` 4.981) on all three of its words. After, all 58 words on the
page are within 0.005 bp in x and y — the probe is exact, including the
display's own position and the text hanging at `\leftmargin` below it.

**No corpus movement, and that is the honest summary of its reach:** no
fixture in `fixtures/real-world/` has a `description` item that opens with
a display, so the 22-document corpus is unchanged to the last word
(dx 85.74%, dy 75.93%, both 69.79%, 14054 aligned, page counts 21/22, all
identical before and after). This is a probe-verified correctness fix, not
a parity gain.

Gates: `cargo test --release --no-fail-fast` on render-pipeline 268 passed
/ 0 failed / 2 ignored (one new `description_display` test),
class-geometry 4/0, compiler 581/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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant