engine: a table cell keeps its nested environments whole - #171
Merged
Conversation
collectTabularBody tracked brace depth, and a matrix is not braced here — the same fault #153 fixed in the maths alignment scanner, in the scanner next door. So $\begin{matrix} a & b \end{matrix}$ & $\begin{bmatrix} c & d \end{bmatrix}$ became four cells of fragments, and the maths layer refused each one: texmath: unexpected "}" "\begin {matrix} d_{\ell _2}}" 224 of the corpus's dropped formulas are that, all of them tables of matrices. TeX protects a nested alignment with the brace \@array opens (latex.ltx:12101, reached through amsmath's \env@matrix), counted in align_state (tex.web §6738-6742, §7259-7264). This engine never expands \matrix, so the environment is counted instead, and \bgroup/\egroup count as the braces they are (§7492-7493). A nested tabular was broken the same way and is fixed with it: its \end closed the OUTER table, so everything after it was swallowed. Measured over 200 arXiv papers and 200 beamer talks: 15 documents change and 7 repaginate, for +5094 glyphs. One goes 5 -> 14 pages, exactly what tectonic renders; another 41 -> 35 against 34. The page error against the 157 tectonic renders falls 670 -> 656. beamer does not move by one glyph.
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.
collectTabularBodytracked brace depth — and a matrix is not braced here. It is the same fault #153 fixed in the maths alignment scanner, in the scanner next door:became four cells of fragments, and the maths layer refused each one:
224 of the corpus's dropped formulas are that, all of them tables of matrices.
TeX protects a nested alignment with the brace
\@arrayopens (latex.ltx:12101, reached through amsmath's\env@matrix), counted inalign_state(tex.web §6738-6742, §7259-7264). This engine never expands\matrix, so the environment is counted instead, and\bgroup/\egroupcount as the braces they are (§7492-7493).A nested
tabularwas broken the same way and is fixed with it: its\endclosed the outer table, so everything after it was swallowed. Its test fails onmaintoo.Measured — 200 arXiv papers, 200 beamer talks
15 documents change and 7 repaginate, for +5094 glyphs:
The page error against the 157 tectonic renders falls 670 → 656. beamer does not move by one glyph.