mathjax / MathJax

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

\mathcal in Latin-Modern and Neo-Euler #919

Open kasperpeulen opened 10 years ago

kasperpeulen commented 10 years ago

For both webfonts (Latin-Modern and Neo-Euler) \mathcal doesn't seem to work. It just shows a regular A. While \mathscr looks exactly like how \mathcal shoud look.

pkra commented 10 years ago

Thanks. I think this is due to the fonts not having appropriate glyphs (which is odd for Latin Modern at least), so this was missed when those fonts were added in 2.3.

I'm guessing MathJax should default to mathvariant="script" in that case (given that Unicode identifies calligraphic and script). When we implement font fallbacks, we can load another font or do something smarter.

adityam commented 6 years ago

Is there any update on this? \mathcal does not work with Gyre-Pagella and Gyre-Termes either

dpvc commented 6 years ago

The source of the problem is that, while TeX has two forms of "script" characters, \mathcal and \mathscr, Unicode only has one script form in the Math Alphanumeric Symbols block, and MathML (the format used internally by MathJax) only has one script variant. Because the STIX fonts put the \mathscr characters in the Math Alphanumeric Symbols script positions, it put the \mathcal characters in the Private Use Area, which was really the only alternative. The Asana web font also is organized that way, but the other web fonts like LatinModern and Gyre-Pagella only include one script form each. In these cases, the script form was mapped to \mathscr rather than \mathcal (to correspond to MathML's script math variant, since MathML doesn't have a calligraphic variant). For LatinModern and Neo-Euler, the script form more closely resembles the TeX calligraphic font than the script font, so perhaps it would have been better to use \mathcal in those cases, but of consistency , we always used \mathscr.

So you could use \mathscr instead of \mathcal if you are using those fonts. Alternatively, you could redefine \mathcal via \def\mathcal{\mathscr} or its equivalent in the MathJax macros configuration in order to make \mathcal produce the script form.

In MathJax version 3, it will be easier to mix fonts to add missing characters, but that isn't the case for MathJax version 2. It is unlikely that additional work will be done on the version 2 fonts before version 3 is released.

adityam commented 6 years ago

Thanks for the explanation. For now, mapping \mathcal to \mathscr works and that is good enough for me.

JeppeKlitgaard commented 1 year ago

Related: #3045