本文作者:傅云贵(网易有道技术团队)
引言
最近,在桌面 web 前端项目中使用了 MathJax 渲染数学公式,遇到一些坑,如今总结之。
MathJax 是什么
在 MathJax 官网 能看到以下的介绍:
A JavaScript display engine for mathematics that works in all browsers.
No more setup for readers. It just works.
在 MathJax 的官方文档 What is MathJax? 中有以下文字:
MathJax is an open-source JavaScript display engine for LaTeX and MathML that works in all modern browsers. …
MathJax uses web-based fonts (in those browsers that support it) to produce high-quality typesetting that scales and prints at full resolution (unlike mathematics included as images)…
MathJax is modular, so it loads components only when necessary, and can be extended to include new capabilities as needed. MathJax is highly configurable, allowing authors to customize it for the special requirements of their web sites. Finally, MathJax has a rich application programming interface (API) that can be used to make the mathematics on your web pages interactive and dyna