LaTeX or MathML on the web via MathJax


Vinh Nguyen


May 15, 2011

I recently discovered GmailTeX, a plugin (implemented via javascript) that displays LaTeX markup in my emails viewed through my web-based gmail account. SIDE NOTE: I implement it conkeror by creating a webjump for the bookmarklet code.

GmailTeX renders the LaTeX markup via MathJax, "an open source JavaScript display engine for mathematics that works in all moder browsers." What I like about MathJax is that it displays the math symbols as actual characters as opposed to generating an image with all the math symbols (as implemented in, e.g, wp-latex). The display is really nice. What I REALLY like about it is that you can right-click on the math and export the raw code in LaTeX or MathML; the right-click even works in conkeror. That way, the reader can easily adapt your code without having to re-write them should it become necessary.

For Wordpress, the mathjax-latex implements it finely; the syntax is also described here. To illustrate its power, let me state one version of the most important theorem in all of statistics, the Central Limit Theorem:

Suppose [latex] X_1, …, X_n [/latex] is a sequence of independent and identically random variables with [latex] E(X_i) = μ[/latex] and [latex] var(X_i) = σ\^2 [/latex]. Then

\[ \sqrt{n} \left( \frac{1}{n} \sum_{i=1}\^{n} X_i - \mu \right) \stackrel{\scriptscriptstyle d}{\longrightarrow} \mathcal{N}(0, \\sigma\^2). \]