MathJax usage guide

1. Inline and displayed formulas

Enclose an inline formula in \$ ... \$. For example, \$\sum_{i=0}^n i^2=\frac{n(n+1)(2n+1)}{6}\$ produces $\sum_{i=0}^n i^2=\frac{n(n+1)(2n+1)}{6}$.

Use \$\$ ... \$\$ to place a formula on a separate line. The \$ ... \$ delimiters are explicitly enabled in QazMath; they are not enabled in MathJax by default.

2. Greek letters

Lowercase letters: \alpha — $\alpha$, \beta — $\beta$, \gamma — $\gamma$, \epsilon — $\epsilon$, \varepsilon — $\varepsilon$, \phi — $\phi$, \varphi — $\varphi$, \omega — $\omega$.

Uppercase letters: \Gamma — $\Gamma$, \Delta — $\Delta$, \Theta — $\Theta$, \Lambda — $\Lambda$, \Pi — $\Pi$, \Omega — $\Omega$.

3. Superscripts and subscripts

Use ^ for a superscript and _ for a subscript. Examples: x_i^2 — $x_i^2$, \log_2 x — $\log_2 x$, a_{n+1} — $a_{n+1}$.

4. Grouping expressions

Place several characters inside braces when they should form one superscript or subscript. In 10^10, the superscript applies only to the first 1; the correct form is 10^{10}: $10^{10}$.

Write nested powers as {x^y}^z — ${x^y}^z$ or x^{y^z} — $x^{y^z}$. Other examples: x_{i^2} — $x_{i^2}$, {x_i}^2 — ${x_i}^2$.

5. Delimiters and brackets

Ordinary brackets can be typed directly: (2+3)[4+4] — $(2+3)[4+4]$. Their size, however, does not change to match the enclosed expression.

Use \left and \right when brackets need to fit a large expression: $\left(\frac{\frac{x+5}{x-3}}{x^2+5}\right)$.

The same approach works for an absolute value, \left|x\right| — $\left|x\right|$, and braces, \left\{x+1\right\} — $\left\{x+1\right\}$.

6. Fractions

Write a fraction as \frac{a+1}{b+1}: $\frac{a+1}{b+1}$. If nested fractions look too small in inline text, use \dfrac: $\dfrac{\dfrac{\dfrac{x+5}{x^3}}{x-3}}{x^2+5}$.

7. Roots

Write a square root as \sqrt{x^3}: $\sqrt{x^3}$. For a cube root or an $n$th root, put the degree in square brackets: \sqrt[3]{\frac{x}{y}} — $\sqrt[3]{\frac{x}{y}}$, \sqrt[n]{a} — $\sqrt[n]{a}$.

8. Functions and limits

Put a backslash before a standard function name so that it appears upright and has the correct spacing before its argument: \sin x — $\sin x$, while sin x — $sin x$.

Common commands include \cos, \tan, \cot, \log, \ln, \max, \min, and \sum. Limit example: \lim_{x\to 0}\frac{\sin x}{x}=1 — $\lim_{x\to 0}\frac{\sin x}{x}=1$.

9. Common symbols

\lt \gt \le \ge \neq — $\lt\; \gt\; \le\; \ge\; \neq$ \times \div \pm \mp \cdot — $\times\; \div\; \pm\; \mp\; \cdot$ \cup \cap \setminus \subset \subseteq \supset \in \notin \varnothing — $\cup\; \cap\; \setminus\; \subset\; \subseteq\; \supset\; \in\; \notin\; \varnothing$ \binom{n+1}{2k} — $\binom{n+1}{2k}$ \to \gets \Rightarrow \Leftarrow \mapsto \implies \iff — $\to\; \gets\; \Rightarrow\; \Leftarrow\; \mapsto\; \implies\; \iff$ \land \lor \lnot \forall \exists \top \bot \vdash \vDash — $\land\; \lor\; \lnot\; \forall\; \exists\; \top\; \bot\; \vdash\; \vDash$ \star \ast \oplus \circ \bullet \infty — $\star\; \ast\; \oplus\; \circ\; \bullet\; \infty$ 90^\circ — $90^\circ$ \approx \sim \simeq \cong \equiv — $\approx\; \sim\; \simeq\; \cong\; \equiv$ \dots \cdots — $a_1,a_2,\dots,a_n$ and $a_1+a_2+\cdots+a_{80}$

10. Spacing in formulas

Most ordinary spaces inside a formula are ignored. Use \,, \;, \quad, and \qquad to add specific amounts of space: a\,b \quad a\;b \qquad a b — $a\,b \quad a\;b \qquad a b$.

11. Systems of equations and matrices

Use \\ to separate rows and & to separate or align columns.

System of equations: \begin{cases} x+y=5 \\ x-y=1 \end{cases} — $\begin{cases}x+y=5\\x-y=1\end{cases}$.

Matrix: \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} — $\begin{pmatrix}1&2\\3&4\end{pmatrix}$.

12. Text and notation inside formulas

Use \text{...} to place ordinary text inside a formula: x>0\text{ when} — $x>0\text{ when}$.

Segments, vectors, and other notation: \overline{AB} — $\overline{AB}$, \vec{a} — $\vec{a}$, \hat{x} — $\hat{x}$, x\in\mathbb{R} — $x\in\mathbb{R}$.

13. Common mistakes

  • Always close an opening formula delimiter: \$...\$ or \$\$...\$\$.
  • Put a multi-character superscript, subscript, or argument inside {...}.
  • Do not omit the \ before a command name: \sin, \sqrt, \frac.
  • Write an ordinary dollar sign in text as \$ so that it is not treated as the start of a formula.

Further reference

Complete command list: https://docs.mathjax.org/en/stable/input/tex/macros/

Short practical examples: https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference