MathJax. LaTeX. Math typesetting.

By Xah Lee. Date: . Last updated: .

MathJax for Web Publishing

MathJax is a JavaScript library for displaying math in browsers.

MathJax home page at https://www.mathjax.org/

You can use any of {MathML, LaTeX, ASCIIMathML} markup for input.

Here is a example of using it. Put the following in your HTML page.

<script defer src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

then, in your web page, you can enter this plain text:

$$
\Pr\left(\bigcup_i \Omega_i\right)=\sum_i \Pr(\Omega_i)=\sum_i\Pr(X=u_i)=1
$$

it'll display like this:

$$ \Pr\left(\bigcup_i \Omega_i\right)=\sum_i \Pr(\Omega_i)=\sum_i\Pr(X=u_i)=1 $$

if your math expression has any of & < > symbols, you need to put space on both sides of the symbol. Or, to be absolutely safe, change them to { &amp;, &lt; &gt;, }. 〔see HTML XML Entities

MathJax Examples

here's what your browser shows:

$$ x = \frac{-b + \sqrt{b^2 - 4 a c} }{2 a} $$
$$ \sum_{n = 0}^\infty \frac{(-1)^{n}}{2n+1} = 1 - \frac{1}{3} + \frac{1}{5} - \frac{1}{7} + \cdots = \frac{\pi}{4} $$
$$ \int_a^b \! f(x) dx = F(b) - F(a) $$
$$ f'(a)=\lim_{h\to 0}\frac{f(a+h)-f(a)}{h} $$
$$ \begin{bmatrix} a & b\\ c & d\\ \end{bmatrix} \begin{bmatrix} x \\ y\\ \end{bmatrix} = \begin{bmatrix} a x & b y\\ c x & d y\\ \end{bmatrix} $$

right click on the formula to get its TeX input.