mathjax / MathJax

Beautiful and accessible math in all browsers
http://www.mathjax.org/
Apache License 2.0
10.12k stars 1.16k forks source link

Lowercase Greek letters italicized despite mathvariant="normal" #2123

Closed chrispitude closed 3 years ago

chrispitude commented 5 years ago

For the following MathML code:

<mrow>
  <mi mathvariant="normal">&psi;&Psi;</mi>
  <mi mathvariant="italic">&psi;&Psi;</mi>
</mrow>

the lowercase Greek letters (and all lowercase Greek letters in general) are italicized even when setting mathvariant="normal". This introduces a visual display difference with FireFox native MathML rendering, which italicizes only upon request.

This seems somewhat similar to issue #592 (greek characters in 'mi' with mathvariant="normal" are italicized when using the svg renderer).

In my case, I see the problem with the HTML-CSS, Common HTML, and SVG renderers. Strangely, the Preview HTML renderer does not have this issue!

ZIPped HTML file attached to demonstrate the behavior.

italic.zip

dpvc commented 5 years ago

Yes, this is the same issue as #592. The MathJax TeX font does not include upright lowercase Greek letters, and so it uses the only characters it has when mathvariant="normal", which are italic ones. The MathML specification allows for this:

Renderers have complete freedom in mapping mathematics style attributes to specific rendering properties. ... In principle, any mathvariant value may be used with any character data to define a specific symbolic token. In practice, only certain combinations of character data and mathvariant values will be visually distinguished by a given renderer. For example, there is no clear-cut rendering for a "fraktur alpha" or a "bold italic Kanji" character, and the mathvariant values "initial", "tailed", "looped", and "stretched" are appropriate only for Arabic characters.

The HTML-CSS and SVG renders can use other font sets, and the STIX-Web font does include upright lower-case Greek, so you could specify that if the distinction is critical for you. The CommonHTML output only supports the MathJax TeX font at the moment.

dpvc commented 5 years ago

Duplicate of #592.

chrispitude commented 5 years ago

Thanks dpvc! By the way, it wasn't until I read your description here that the problem made sense. You might want to post a similar explanation on #592.

Thanks!

dpvc commented 3 years ago

MathJax now maps the Greek letters to their Math Alphanumerics positions, when there are one for the given mathvariant. If the fonts don't include the needed character, they are taken from a system font (when possible). I think this was in v3.0.4.