MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

v4-beta.3 vcenter superscript sometimes too high?

Open pkra opened this issue 2 years ago • 3 comments

This might be working as intended but I'd like to make sure.

This is not a great example without the images but I think the bounding boxes still exhibit the problem well enough.

Rough example: \begin{array}{cccccccc} \mu (\vcenter{\img[][23pt][12pt][{\ydiagram{2}}]{Images/imga6e7d436279b36ae53cb717cbf4d8abb.svg}}^+, E) = 1 & & \mu (\vcenter{\img[][12pt][23pt][{\ydiagram{1,1}}]{Images/img702ab7f412e90ac9256defbedc136351.svg}}^+, E) = 2 & \\\end{array}

The first superscript comes out

image

Whereas the second seems noticeably higher

image

Since the bounding box info is overlapping, here's a before/after with the full example (with STIX Two):

Before: image

After: image

pkra avatar Aug 22 '23 09:08 pkra

It's an error. In the line-breaking updates, I moved handling of \vcenter from the internal TeXAtom node to the mrow node, and apparently didn't handle the bounding box quite right. I will look into it and provide a fix if I can.

dpvc avatar Aug 23 '23 12:08 dpvc

Thanks, Davide!

pkra avatar Aug 23 '23 15:08 pkra

OK, I found the issue. There is a function getBaseCore() that find the core node of the base of an msup, msub, or msubsup node (something like finding the core of an embellished operator, but the base doesn't have to be an operator). This was not taking into account the changes I mentioned above relating to how \vcenter was implemented. I have made a PR to resolve the issue (mathjax/MathJax-src#1000).

dpvc avatar Sep 11 '23 15:09 dpvc