mathjax / MathJax-docs

MathJax documentation. Beautiful math in all browsers. Beautifully documented.
Apache License 2.0
546 stars 231 forks source link

Is there any way to overwrite MathJax font family for math equation to apply font families like Arial, Tahoma, Courier New etc. #319

Open VSHUK10 opened 1 year ago

VSHUK10 commented 1 year ago

I tried overwriting font family Arial, Tahoma, Courier New, and Times new roman in mathjax class, but it is not changing the font-family, can someone help me on that.

dpvc commented 1 year ago

Is there any way to overwrite math JAX font family for math equation to apply font families like Arial, Tahoma, Courier New etc.

Math layout requires a wide range of specialized characters (parentheses in several sizes and the parts for constructing larger versions, several sizes for square roots, many mathematical symbols, arrows, and accents, greek characters, and characters in double-struck, Fraktur, script, calligraphic and other special forms). Most general-purpose fonts don't include the needed characters (that is true of the three you mention).

Also, MathJax needs to know a lot about the fonts that it uses (for example, the bounding box of each character, and the locations of the larger sized parentheses, which characters are in the fonts, etc.). That information is not something it can look up from the font on the fly, and so it is listed in javascript files that are loaded by MathJax. These files have to be created specifically for any font that MathJax would use. So it is not easy to replace the fonts used by MathJax, and it can not be done by setting CSS properties.

MathJax version 3 only provides one font, but version 4.0 (currently in alpha release) includes data for 11 fonts, so you may need to wait for that. (If you are using v2, there were several font alternatives available as well, so perhaps one of those would work for you.)