Open jmitsdarfer opened 3 years ago
The placement of the horizontal bar of the square root has been a perennial problem. As you can see from your last image, the issue here is that the bar is not quite in the proper position (the surd extends a bit above it, and it should really be at the top of the surd). The HTML-CSS output jax is the oldest one (at 12 years old at this point), and its output is both browser and operating system dependent, with a lot of fragile hacks. Rounding differences (and bugs) in different browsers can cause such effects. For example, in Firefox on a Mac, I see
which is perfectly fine. The differences can be affected by browser, OS, screen resolution, magnification, font's available, font size on screen, and other variables. Because the output is correct in other browsers and OS, if I tried to fix it for your case, it would likely be off in the other direction for other browsers. it is unlikely that this is going to be resolved in the HTML-CSS output. You might try the SVG output to see if that is better for you.
As for the minus sign, that has to do with the bounding box for the minus sign. It is supposed to be the same height and depth as the plus sign, so that when they are used in superscripts, for things like atomic charges, they line up correctly. It appears that there is some extra depth being added to the minus in the STIX font data (but not the STIX-Web data). There is a comment that this is because the minus is used as an arrow extender, but there is a separate adjustment for that, so it may be that this is left over from an earlier attempt to deal with the arrows (12-year old code has lots of cruft in it).
Here is an adjustment you can use to remove that extra space:
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready", function () {
var FONT = MathJax.OutputJax['HTML-CSS'].FONTDATA.FONTS['STIXGeneral'];
if (FONT) FONT[0x2212][1] -= 100;
});
One possible solution for this particular example would be to add a bit more depth to the expression via something like
<mpadded depth=".2em"></mpadded>
just inside the msqrt
. That should force the next size for the surd, which will give a bit more space. Alternatively, you could add height, but I think the result will look better with a bit more depth instead.
Issue Summary
At 100% zoom, sometimes a superscript w/in an msqrt appears to almost be touching the square root bar, depending on the exact equation. For example, this one looked fine:
`x