MathJax

Beautiful math in all browsers  

Table of contents

Start

Include in page front matter as js_absolute

https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML

Highlight renders

.mjx-chtml { background-color: oldlace; }

Hide until render is done

article { visibility: hidden; }
<script type="text/x-mathjax-config">
  MathJax.Hub.Queue(function () { document.querySelector("article").style.visibility = "initial"; });
</script>

Syntax $$

  • Inline mode $$...$$ or \\(...\\) .
  • Display mode (no numbering)
    • Newline before and after $$...$$
    • \\[...\\]
    • \begin{equation\*}...\end{equation\*} \begin{equation*}z=\pi\end{equation*}

Equations automatic numbering

Works with \begin{equation}...\end{equation}

  • \label{...} used to reference.
  • \ref{...} replaced with equation number anchor link .
  • \eqref{...} replaced with parenthesis equation number anchor link .

Configuration

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({ TeX: { equationNumbers: {autoNumber: "AMS"} } });
</script>

Example

\begin{equation}w=\delta\label{ciao}\end{equation}

Greek letters

  • Lowercase \alpha, \beta, …, \omega:
  • Uppercase \Gamma, \Delta, …, \Omega:

Superscripts ^ and Subscripts _

  • x_i^2 gives
  • \log_2 x gives

Groups {...}

Single symbol or formula inside curly braces.

  • x_{i^2} gives

Fractions

frac applies to the next two groups.

  • \frac ab
  • \frac{a+1}{b+1}
  • {a+1 \over b+1}

Fonts

  • Sans serif
  • Typewriter

Spaces

quad is space equal to the current font size.

  • Negative \! -3/18 of a quad
  • Default
  • Small \, 3/18 of a quad
  • Medium \: 4/18 of a quad
  • Big \; 5/18 of a quad
  • \quad
  • \qquad two quads

Boxed

$$\boxed{\operatorname{I'm\,boxed}}$$ gives