brucemiller / LaTeXML

LaTeXML: a TeX and LaTeX to XML/HTML/ePub/MathML translator.
http://dlmf.nist.gov/LaTeXML/
Other
863 stars 93 forks source link

\overline and MathML Core horizontal stretching (in Chrome) #2317

Open physikerwelt opened 4 months ago

physikerwelt commented 4 months ago

While \overline{abcd} renders fine with Firefox the line is too short in chrome

Screenshot 2024-02-10 at 10 05 03

However, if one replaces the second part of the mover with <mo id="p1.1.m1.1.1.1" xref="p1.1.m1.1.1.1.cmml">&oline;</mo> it renders fine

Screenshot 2024-02-10 at 10 10 40

I am unsure how to fix that (for my own project). Should one use &oline; (which works in both browsers) or &#175; (and ask for a fix in Chrome) or even use another alternative such as &#305;. Does LaTeXML has a clear statement why one solution is better than the other?

related https://phabricator.wikimedia.org/T352698

dginev commented 4 months ago

Thank you for opening the issue!

Here is a codepen reproducing the lack of horizontal stretching (in Chrome): https://codepen.io/dginev/pen/mdozrBr

I am pretty sure this is something I had left a comment for in the Chrome MathML issue tracker, see the still open issue: https://issues.chromium.org/issues/40889045#comment5

Changing to &oline; as a short-term patch would be fine, as long as we are sure we won't be changing back to the macron at a later date.

In the long term I think we need some kind of a browser fix since it is less clear to me why only &oline; works. Or is it even font related?

Overline seems to be the exception more than the rule. For example, its Unicode block also has Dashed Overline (&#xFE49;), Centreline Overline (&#xFE4A;), Wavy Overline (&#xFE4B;), Double Wavy Overline (&#xFE4C;) and none of them stretches horizontally in today's Chrome. Actually those don't stretch horizontally in Firefox either. So this may be tricky to navigate...

Edit: there are also a few open issues related to horizontal stretching in MathML Core, but I am unsure if one of them exactly applies to these characters: https://github.com/w3c/mathml-core/issues?q=is%3Aissue+is%3Aopen+horizontal+stretching