
MathJax: Equations for the web
A JavaScript toolkit for displaying equations, formulas & mathematics in all browsers.
Syntax & formatting
- Start an equation with
$$
to trigger MathJax:
1
\$$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$
Rendered as \(\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}\)
- Start with
\$$
to render to a new line: $$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$
Several tests
Let’s test some inline math \(x\), \(y\), \(x_1\), \(y_1\).
1
Let's test some inline math $$x$$, $$y$$, $$x_1$$, $$y_1$$.
Now with special character: $$|\psi_1\rangle$$
1
\$$\|\psi_1\rangle$$
Test a display math: $$ |\psi_1\rangle = a|0\rangle + b|1\rangle $$ Is it O.K.?
Test a display math with equation number: \begin{equation} |\psi_1\rangle = a|0\rangle + b|1\rangle \end{equation} Is it O.K.?
Test a display math with equation number: \(\begin{align} |\psi_1\rangle &= a|0\rangle + b|1\rangle \\ |\psi_2\rangle &= c|0\rangle + d|1\rangle \end{align}\) Is it O.K.?
And test a display math without equaltion number:
$$
\begin{align*}
|\psi_1\rangle &= a|0\rangle + b|1\rangle \
|\psi_2\rangle &= c|0\rangle + d|1\rangle
\end{align*}
$$
Is it O.K.?
Test a display math with equation number:
\begin{align}
|\psi_1\rangle &= a|0\rangle + b|1\rangle \
|\psi_2\rangle &= c|0\rangle + d|1\rangle
\end{align}
Is it O.K.?
And test a display math without equaltion number:
\begin{align*}
|\psi_1\rangle &= a|0\rangle + b|1\rangle \
|\psi_2\rangle &= c|0\rangle + d|1\rangle
\end{align*}
Is it O.K.?
Sources
How to use MathJax in Github pages
Haixing Hu - Github.com
LaTeX/Mathematics - Syntax
Online TeX generator
List of LaTeX mathematical symbols
MathJax TeX and LaTeX Support