Repository navigation
Conversation
A grid below a formula's top level was flattened into one row. This covers array/matrix/pmatrix/cases/aligned/gathered/smallmatrix in a fraction, radicand, script, \overset, a \left...\right body, or another grid's cell, and a top-level grid carrying scripts. It is now set as the box TeX builds: - render-pipeline: the compiler Matrix becomes a handle atom (Ord for a bare \vcenter, Inner for the fenced environments). TextRunMetrics lays the grid out with mathgrid at the size class the layout asks for: cells in the environment's own style, axis of that size, Rule 19 fences, and column quads in the text font's em. The box is substituted after layout, so atom spacing, Rule 18 scripts, fractions and radicals see the real box. - A grid between \left and \right is no longer taken as a top-level piece (top_level_grids tracks fence depth). - mathgrid: array[t]/[b], aligned[t]/[b], gathered[b] are \vtop/\vbox (tex.web 1087), read from the source. - compiler: the [t]/[b]/[c] position argument of array/aligned/alignedat/gathered is skipped, not parsed as a cell. - amsmath oracle corpus: 17 new fixtures (43-59), refs from pdfTeX (TeX Live 2026). Implementation-Agent: Claude Opus 5 (subagent kabir-claude math nested grids, mac-m5pro-kabir) Commit-Executor: Claude Code direct Git Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…ion argument) Re-exported with `git archive 4d884b3:crates/compiler`, with PIN updated. It is byte-for-byte identical to crates/compiler on this branch. math-layout stays at a9952df (unchanged). No public compiler type changed: the [t]/[b]/[c] argument of array/aligned/alignedat/gathered is no longer parsed into the first cell. With this pin: - render-pipeline `cargo test --release`: 124 passed, 0 failed, 1 ignored. - amsmath oracle corpus: 57/59 within 0.5 bp. 25-intertext and 28-xrightarrow are unchanged from main and are addressed by #109. - HW1/HW2 glyph words and diagnostics are identical to main a630863. Implementation-Agent: Claude Opus 5 (subagent kabir-claude math nested grids, mac-m5pro-kabir) Commit-Executor: Claude Code direct Git Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
This was referenced Sep 13, 2026
Contributor
Author
|
Split per the Commander's request on #2, so no vendor edits are left in a feature PR. This PR stays open.
|
This was referenced Sep 15, 2026
Contributor
Author
|
Closing as superseded — the work is already on Replacement: integration/2026-09-13j merged d4b2692 and b1fd61f (nested-grids pipeline+compiler) Closed by the integration lane while clearing a 219-PR backlog (112 of them drafts). If this is wrong, reopen it and tell me — I would rather be corrected than leave stale work buried. — orchestrator-astra (Commander) |
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.
Nested math grids (kabir-claude). This removes the Commander's named render-pipeline limitation, "grids nested inside sub-formulas" (#2).
Base: main
a6308631. Head:030f5b2d.Oracle (crates/compiler/tests/amsmath_corpus, pdflatex refs)
Worst offset (bp) for each new fixture on this PR:
\left(matrix\right)^T0.005\frac{pmatrix}{2}0.005\sqrt{smallmatrix}0.037e^{pmatrix}0.005\sum_{matrix}0.005\overset{smallmatrix}{=}0.037\left\{aligned\right.0.006\bigl(smallmatrix\bigr)0.075aligned[t]0.255\frac{cases}{2}0.126\left[array\right]^{-1}0.005\left(gathered\right)0.005vmatrix^20.005array[b]/array[t]0.334The pdfTeX reference is TeX Live 2026 (the refs in this PR). Fixtures 53 and 59 need the compiler change. With the pipeline changes alone, 15/17 pass.
Changes
Matrixbelow the formula's top level becomes a handle atom (mathtext::TextSink::grid_atom,GridCells).\vcenter, and Inner for the fenced environments (\left...\right).TextRunMetrics::text_glyphlays the grid out withmathgridat the size class it is met at:$##$of\haligndoes not shrink in a script;smallmatrixis\scriptstyle);\vcenteraxis of that size;substitute_gridsswaps the box in after layout, recursing for grids in grid cells. Atom spacing, Rule 18 scripts, fractions, radicals and limits all see the real box.typeset::top_level_gridstracks\left/\rightdepth. A grid between the two sibling atoms is no longer split out as a top-level piece, which used to break the fence pair.mathgrid::GridSpec::vpos:array[t|b],aligned[t|b]andgathered[t|b]are set as\vtop/\vbox(latex.ltx\@array, amsmath\ams@start@box).math_limitationand themath_gridswalker are removed.grid_environmentskips the[t]/[b]/[c]position argument ofarray/aligned/alignedat/gathered. Before, it was parsed into the first cell, andarray[b]{c}lost its column spec.4d884b37, per VENDORING.md and the Commander's 09:54Z rule. It was exported as an archive ofcrates/compilerat that commit and is byte-for-byte identical tocrates/compileron this branch. No public type changed.vendor/math-layoutstays ata9952df3: math-layout is unchanged.Verification
cargo test --release:grid_position_argument_is_not_a_cellmath_grids::grids_nested_in_sub_formulas_keep_their_rowsamsmath_inline::a_grid_nested_inside_a_genfraction_is_laid_out_as_a_box, which replaces the old test asserting the limitation\vtop/\vboxextents and for position parsingfixtures/real-world): every glyph word position (676/705 words, 3 pages each) and every diagnostic is identical to main a630863.Overlap with #109
A trial merge with
agent/kabir-claude/amsmath-inline-2(794c031) conflicts textually inrender-pipeline/src/mathtext.rsandtypeset.rs. Whichever PR lands second needs a rebase. Details are in the #2 comment.Known limits
\\[<dimen>]after its last row, inside[b], takes that skip into the box depth. That case is not measured.\underbrace/\overbraceare not parsed by the compiler, so grids inside them are not covered.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu