So I'm finally done with the implementation of itex2MML in my mathparser. The current set of patches is available here and can be used in any Mozilla product based on mozilla-central. For those who don't know, itex2MML is a converter from a LaTeX-like syntax to MathML which was originally written, about ten years ago, by Paul Gartside for the Mozilla MathML Project. It has been maintained since then by Jacques Distler, who has made a great work to improve and extend it (and has also reported several bugs that helped us to make our MathML layout engine better ;-). Hence it is a mature tool and it is worth being based on it in order to provide a decent LaTeX-like parser.

You can find a list of itex2MML commands as well as various examples. All itex2MML commands are supported in my mathparser, except inclusion of SVG graphics, XML entities and obsolete maction's commands. There are also some additional features such that support for Unicode characters in the LaTeX input. Below are random demos:

$$\int_M K\;dA+\int_{\partial M}k_g\;ds=2\pi\chi(M), \,$$

${\int }_{M}K\phantom{\rule{thickmathspace}{0ex}}\mathrm{dA}+{\int }_{\partial M}{k}_{g}\phantom{\rule{thickmathspace}{0ex}}\mathrm{ds}=2\pi \chi \left(M\right),\phantom{\rule{thinmathspace}{0ex}}$

$$\oint_S \mathbf{E} \cdot \mathrm{d}\mathbf{A} = \frac{Q}{\varepsilon_0},$$

${\oint }_{S}E\cdot \mathrm{d}A=\frac{Q}{{\epsilon }_{0}},$

$$u = \root{3}{-{q \over 2} \pm \sqrt{{q^2 \over 4} + {p^3 \over 27}}}$$

$u=\sqrt[3]{-\frac{q}{2}±\sqrt{\frac{{q}^{2}}{4}+\frac{{p}^{3}}{27}}}$

$$\frac{a_0}{2} + \sum_{n=1}^\infty \, [a_n \cos(n x) + b_n \sin(n x)]$$

$\frac{{a}_{0}}{2}+\sum _{n=1}^{\infty }\phantom{\rule{thinmathspace}{0ex}}\left[{a}_{n}\mathrm{cos}\left(nx\right)+{b}_{n}\mathrm{sin}\left(nx\right)\right]$