fix alignment-token early return inside nested boxing groups#2775
Conversation
digestNextBody() was prematurely returning on \cr/\lx@hidden@cr tokens
even when deep inside nested hbox/vbox groups within a tabular cell.
This caused cascading errors when \adjustbox{valign=t}{\begin{subfigure}...}
was used inside \tabular, as the \\ inside subfigure leaked out as
\lx@hidden@cr and triggered the alignment early-return check.
Fix: guard the alignment-token check with a boxing-depth comparison
so it only fires at the original alignment nesting level, not inside
deeper boxing groups.
Also includes minor whitespace reformatting by latexmllint.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Note that if this PR looks good, there is a second fix using the same method. I have branched it off from here to ensure there isn't cross-talk between the bugs (there wasn't). If it looks promising I can point the other PR over to the master branch, when this one is merged: |
|
Another curious one. I still had my tentative patch to #2776 (which essentially is fixing |
|
Interesting. Still quite slippery. To salvage the B we likely need to avoid running into the alignment behavior of (Tried the suggestion, |
|
I was pondering along the same lines (rebinding |
Just to be clear -- that sounds completely out of scope for my "arXiv regression patching" sprint I am trying to complete for v0.9. If we recover content but "get bruised" on markup fidelity, that is ok for now. So I'm happy with this kind of PR, if you are :-) |
Summary (generated)
digestNextBody()was prematurely returning on\cr/\lx@hidden@crtokens even when deep inside nested hbox/vbox groups within a tabular cell. This caused cascading errors when\adjustbox{valign=t}{\begin{subfigure}...}was used inside\tabular, as the\\inside subfigure leaked out as\lx@hidden@crand triggered the alignment early-return check.Fix: guard the alignment-token check with a boxing-depth comparison so it only fires at the original alignment nesting level, not inside deeper boxing groups.
Also includes minor whitespace reformatting by latexmllint.
Minimal test
Easy diff
https://github.com/brucemiller/LaTeXML/pull/2775/changes?w=1
Disclosure
Diagnostic and patch via Claude Opus 4.6 "heavy effort".
I have manually verified this patch recovers
arXiv:2401.06604v3out of regression status.