Repository navigation
math-layout: size \big..\Bigg by the kernel's fixed lengths without amsmath - #239
Merged
Merged
Conversation
…msmath
`make_big_delimiter` implemented only amsmath's `\bBigg@`: `\vcenter to
<factor>\big@size` with `\big@size` = 1.2 x the math strut. That is the
right rule *when amsmath is loaded*. The LaTeX kernel's own definition
(`fontmath.ltx` 513-520) is a different one, and it is what a document
without amsmath gets:
\big -> \left<d>\vbox to 8.5pt{}\right.
\Big -> \left<d>\vbox to 11.5pt{}\right.
\bigg -> \left<d>\vbox to 14.5pt{}\right.
\Bigg -> \left<d>\vbox to 17.5pt{}\right.
Two differences, not one. The lengths are absolute, so they do not follow
the body size; and the box is a `\vbox` (height `pt`, depth 0), not a
`\vcenter`, so Rule 19's delta is `max(pt - axis, axis)` rather than half
the target, and the result is floored at the vbox's own height.
The two rules coincide at 10pt and diverge everywhere else, which is why
this survived: every 10pt comparison agrees.
`\showbox` under pdfTeX 3.141592653-2.6-1.40.27 (TeX Live 2025),
`\hbox{$\displaystyle\Big[$}` in an `article`, as the box's height+depth:
| body | no amsmath | amsmath | before (either) |
|---|---|---|---|
| 10pt | 18.00017 | 18.00017 | 18.00017 |
| 11pt | 18.00017 | 19.71019 | 19.71019 |
| 12pt | 18.00017 | 21.60021 | 21.60021 |
So a 12pt document without amsmath set `\Big[` 6.00pt too tall, and
`\bigg[`/`\Bigg[` one cmex variant too far up the chain as well.
`Nucleus::BigDelimiter` now carries a `BigSizing` naming which definition
is in force instead of a bare `factor`. `Atom::big_delimiter` keeps its
signature and its meaning (the amsmath rule); `Atom::big_delimiter_kernel`
is the new one. Nothing selects the kernel rule yet -- that is the caller's
decision from the package list, and it belongs to the pipeline, which
builds against `vendor/math-layout` and so needs a re-pin first.
Measured: `tests/big_delimiters.rs` pins all 24 pdfTeX boxes (4 commands x
3 body sizes x both rules) to 1e-4pt. `cargo test --release` on
`crates/math-layout`: 65 passed, 0 failed (control on this base: 61 passed,
0 failed; the 4 new ones are this file).
`crates/render-pipeline` is untouched and builds against its pinned
`vendor/math-layout`, so the pipeline gates cannot move: HW1 3 pages /
0 errors / 6 warnings and HW2 3 pages / 0 errors / 9 warnings, and all
8 `fixtures/real-world` entries keep their status, page count and error
count, measured through the CLI on this base.
Implementation-Agent: engine-engineer (Claude Opus 5), linux-primary
Commit-Executor: engine-engineer direct git (Cursor usage limit fallback)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar
marked this pull request as ready for review
September 14, 2026 00:46
GoKubar
added a commit
that referenced
this pull request
Sep 14, 2026
vendor: re-pin math-layout to main, and select the kernel \big rule without amsmath (#239's missing pipeline half)
This was referenced Sep 14, 2026
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.
First, a correction to the brief I was given, because it would have cost another lane a day.
I was dispatched to fix the finding in #227's "out of scope" section — "
TexMathMetricsalways buildsCmMathMetricswithExtensionSizing::Fixed…cm::ExtensionSizing::Designsalready models this; nothing selects it," withfixtures/real-world/math-sheet's\left[at 39.42pt in pdfTeX against 42.00pt here.That is already fixed on
main, and it was already fixed in #227's own base. #204 merged as619c192bat 2026-09-13T23:36:42Z; #227 branched froma1c651a2, which contains it (git merge-base --is-ancestor 619c192b a1c651a2→ yes). The note was written against stale code.Verified three ways on
main@eea975c3:style::cmex_designsexists,TexMathMetrics::newtakes it, andmathtex.rs:116appliesExtensionSizing::Designs. Every delimiter path (delimiter_sizes,delimiter_extensible,extension_glyph,radical_sizes,large_operator) delegates to that sameself.cm, so there is no second route.\fontname\textfont3probed over 8 package sets × 3 body sizes under pdfTeX TL2025 reproduces render-pipeline: size family 3 as amsmath declares it, not sfixed*cmex10 #204's table exactly, includinglmodern→lmex10in either load order and[cmex10]{amsmath}→cmex10.math-sheet's\left[is in analign*, i.e. display style; pdfTeX's box is(0.43799+25.84227)x5.77919= 26.28026pt from\OMX/cmex/m/n/10.95. FlashTeX onmainemits that delimiter at 10.95pt with box 26.28000pt, width 5.77919 — already exact, within the display list's 2^-20 bp tick. (39.42 is 2× the text-style box, 19.71019.)So there was no extension-sizing bug left to fix. Sweeping 10/11/12pt × {none, amsmath, amsmath+lmodern} for
\left[ ( \{ |,\Big/\Biggand\sqrtagainst\showboxto find what is still wrong turned up the following instead.What this PR fixes
make_big_delimiterimplemented only amsmath's\bBigg@(amsmath.sty721-738):\vcenter to <factor>\big@size{}with\big@size= 1.2 ×\Mathstrutbox@. That is correct when amsmath is loaded. The LaTeX kernel has its own, different definition (fontmath.ltx513-520), and it is what a document without amsmath gets:Two differences, not one:
\vbox(heightpt, depth 0), not a\vcenter, so Rule 19's δ ismax(pt − axis, axis)rather than half the target, and the result is floored at the vbox's own height.The two rules coincide at 10pt and diverge at every other body size — which is why this survived: every 10pt comparison agrees, and the amsmath corpora load amsmath.
Measured against pdflatex (TeX Live 2025)
\showboxof\hbox{$\displaystyle\Big[$}in anarticle, the box's own height+depth in TeX pt:A 12pt document without amsmath set
\Big[6.00pt too tall;\bigg[likewise (30.00029 where pdfTeX has 24.00022), and\Bigg[ran one variant past the end of the fixed chain into an extensible recipe where pdfTeX uses the plain 30.00029 variant.The kernel rule reproduces pdfTeX's height and depth separately, not just the sum — including the two cases where the
\vboxfloor is what decides the box: at 11pt\big[is(8.50000+2.73750)because the chosen text[is only 10.95pt tall and 8.5 is the floor, and at 12pt it is(9.00000+3.00000).tests/big_delimiters.rspins all 24 boxes (4 commands × 3 body sizes × both rules) to 1e-4pt.What changed
Nucleus::BigDelimitercarries aBigSizingnaming which definition is in force instead of a barefactor.Atom::big_delimiterkeeps its signature and its meaning (the amsmath rule), so every existing caller is unaffected;Atom::big_delimiter_kernelis the new one.Nothing selects the kernel rule yet. Choosing between them is the caller's decision from the package list, and that caller is
render-pipeline, which builds againstvendor/math-layout. Per the brief I may not make vendor commits, so the pipeline half is a separate PR blocked on a re-pin of this commit — that is the math-layout/pipeline split, and it is the one thing here that is not done.Gates
cargo test --releaseoncrates/math-layout: 65 passed, 0 failed; control on this same base 61 passed, 0 failed (the 4 new ones are this file, failing set empty on both).crates/render-pipelineis untouched and builds against its pinnedvendor/math-layout, so the pipeline gates cannot move. Measured on this base through the CLI withFLASHTEX_FONT_DIRS/FLASHTEX_TFM_DIRSatapps/mac/Fonts: HW1 3 pages / 0 errors / 6 warnings, HW2 3 pages / 0 errors / 9 warnings (identical to render-pipeline: paint vertical extensible delimiters from MathVariants assemblies #227's control), and all 8fixtures/real-worldentries keep their status, page count and error count.Still wrong, measured here, not fixed
Each of these is a delimiter-height error I confirmed against
\showboxand left alone; none is this PR's or #204's.\left(is ~0.33% short at every size and package set — 23.92 vs pdfTeX 24.00023 at 10pt, 26.19240 vs 26.28026 at 11pt amsmath, 28.70400 vs 28.80028 at 12pt.[and\{are exact in the same runs, so it is specific to the paren chain.\left|/\Bigg|never grow at all — 12.02pt against pdfTeX's 24.00024 / 30.00030 at 10pt, at every size. This looks like the U+2223-vs-U+2016 mapping render-pipeline: paint vertical extensible delimiters from MathVariants assemblies #227 flagged as out of scope, reaching the layout and not only the painting.\sqrtproduces no radical cluster at all under amsmath at 10/11/12pt, while it is exact (30.00029 vs 30.00000) without amsmath at 11/12pt. I did not chase whether that is a real gap or an artefact of matching the cluster by√.mainwith the font directories it specified: every corpus fixture reportsmath_resource_profile, andmath-sheetadditionally reports the 7math_glyph_unmappedwarnings that render-pipeline: paint vertical extensible delimiters from MathVariants assemblies #227 removes.Draft: the kernel rule is inert until a reviewer takes the vendor re-pin, and the pipeline PR that selects it is not written.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu