Open fkuehnel opened 8 months ago
A quick diagnostic suggests this is (at least partially) connected to #103
snippet reproducing the problem (in Chrome): https://codepen.io/dginev/pen/xxBreNE
hand-typed snippet avoiding the problem: https://codepen.io/dginev/pen/qBvjwYN
The markup encountering the issue leverages the "sizing trick" of setting the same minsize and maxsize, with em
units:
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-OPEN">
<mo maxsize="2.470em" minsize="2.470em">(</mo>
</mrow>
</mrow>
<!-- ... -->
<msup>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-CLOSE">
<mo maxsize="2.470em" minsize="2.470em">)</mo>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>+</mo>
</mrow>
</msup>
The second potential problem is the parsing avenue which attaches the superscript of the entire expression only on the closing paren. Which I assume may be more fragile, compared to a wrapping mrow that contains the () delimiters as the first and last child.
But yes, I think this connects to the broader discussion of #103
The reported snippet appears to now work well with the latest Chrome. I checked with version 125.0.6422.76, with the previously mentioned codepen.
Is this good enough to close @fkuehnel ?
Just confirming what @dginev wrote: I updated from 124.0.6367.208 to 125.0.6422.77 and the codepen display now looks good, whereas in the previous version it did not.
adding sub/super scripts to delimiters still mis-aligns though see for example
https://w3c.github.io/mathml-docs/intent-examples/#id-1-afbf0c9d54fa697fee15f8c64feda4b2
in chrome 125.0.6422.77 and
in firefox
adding sub/super scripts to delimiters still mis-aligns though see for example
https://w3c.github.io/mathml-docs/intent-examples/#id-1-afbf0c9d54fa697fee15f8c64feda4b2
I wonder if it would be better to open separate issues for each kind of technical misalignment.
I made 3 variations of this example in a new codepen here (tested with Chrome 125): https://codepen.io/dginev/pen/VwOjPzW
It looks like this is an issue encountered due to <mo>
and <msubsup>
being the paired fences, where only one of the two is handled with 3.4.1.4 Base with subscript and superscript.
If we instead lift the <msubsup>
to wrap both fences (2nd example in codepen) or use <msubsup>
for both left and right fence (3rd example in codepen), the alignment appears correct.
Edit: Added a 4th example to the codepen, with both <mo>
elements set to stretchy="false"
. That also aligns correctly, (and leads to a slight variation in horizontal spacing between the fences).
@davidcarlisle 's example is also bad in Chrome Canary 127.0.6494.0 (22/05/2024), so it does seem to be separate and not fixed.
adding sub/super scripts to delimiters still mis-aligns though see for example
https://github.com/w3c/mathml-core/issues/205#issuecomment-2039337765
Still, there are some misalignments in rendering matrices and brackets, i.e.
https://www.wikiwand.com/en/Moore%E2%80%93Penrose_inverse