MathJax & KaTex

Text

Plain text

{xsx is extra large}\{x\in s\mid x\text{ is extra large}\} \{x\in s\mid x\text{ is extra large}\}

Greek letters

α,β,ω\alpha, \beta, … \omega \alpha, \beta, …, \omega

Γ,Δ,,Ω\Gamma, \Delta, …, \Omega \Gamma, \Delta, …, \Omega

Fonts

Use \mathbb or \Bbb for "blackboard bold"

CHNQRZ\mathbb{CHNQRZ} \mathbb{CHNQRZ}

Escape characters

\\backslash \backslash

_\_ \_


Group

Groups

A “group” is either a single symbol, or any formula surrounded by curly braces {}.

101010^10 10^10

101010^{10} 10^{10}

xi2x_i^2 x_i^2

xi2x_{i^2} x_{i^2}

Parentheses

Ordinary symbols ()[] make parentheses and brackets (2+3)[4+4]. Use \{ and \} for curly braces{}\{\}.

\langle\rangle \langle\rangle

(xy3)(\frac{\sqrt x}{y^3}) (\frac{\sqrt x}{y^3})

(xy3)\left(\frac{\sqrt x}{y^3}\right) \left(\frac{\sqrt x}{y^3}\right)

(((((x)))))\Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr) \Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr)

Braces

(n2)+(n1)+n+(n+1)+(n+2)\overbrace{(n - 2) + \overbrace{(n - 1) + n + (n + 1)} + (n + 2)} \overbrace{(n - 2) + \overbrace{(n - 1) + n + (n + 1)} + (n + 2)}

(n2)+(n1)+n+(n+1)+(n+2)(n \underbrace{- 2) + (n \underbrace{- 1) + n + (n +} 1) + (n +} 2) (n \underbrace{- 2) + (n \underbrace{- 1) + n + (n +} 1) + (n +} 2)

aaab times\underbrace{a\cdot a\cdots a}_{b\text{ times}} \underbrace{a\cdot a\cdots a}_{b\text{ times}}


Special symbols

<>\lt \gt \le \leq \leqq \leqslant \ge \geq \geqq \geqslant \neq \lt \gt \le \leq \leqq \leqslant \ge \geq \geqq \geqslant \neq

xy×÷±x\cdot y \times \div \pm \mp x\cdot y \times \div \pm \mp

\cup \cap \setminus \subset \subseteq \subsetneq \supset \in \notin \emptyset \varnothing \cup \cap \setminus \subset \subseteq \subsetneq \supset \in \notin \emptyset \varnothing

(n+12k)(n+12k){n+1 \choose 2k} \binom{n+1}{2k} {n+1 \choose 2k} \binom{n+1}{2k}

\to \rightarrow \leftarrow \Rightarrow \Leftarrow \mapsto \to \rightarrow \leftarrow \Rightarrow \Leftarrow \mapsto

¬\land \lor \lnot \forall \exists \top \bot \vdash \vDash \land \lor \lnot \forall \exists \top \bot \vdash \vDash

abcabc\xleftarrow{abc} \xrightarrow{abc} \xleftarrow{abc} \xrightarrow{abc}

\star \ast \oplus \circ \bullet \star \ast \oplus \circ \bullet

\approx \sim \simeq \cong \equiv \prec \lhd \therefore \approx \sim \simeq \cong \equiv \prec \lhd \therefore

ab(modn)a\equiv b\pmod n a\equiv b\pmod n

a1,a2,,ana_1, a_2, \ldots ,a_n a_1, a_2, \ldots ,a_n

a1+a2++ana_1+a_2+\cdots+a_n a_1+a_2+\cdots+a_n

x\lceil{x}\rceil \lceil{x}\rceil

x\lfloor{x}\rfloor \lfloor{x}\rfloor

x\underline{x} \underline{x}

    \implies \implies

    \iff \iff

    \impliedby \impliedby

\to \to

\gets \gets

Superscripts and Subscripts

xi2x_i^2 x_i^2

log2x\log_2 x \log_2 x

Sums and integrals

1n\sum_1^n \sum_1^n

i=0i2\sum_{i=0}^\infty i^2 \sum_{i=0}^\infty i^2

\prod \prod

\int \int

\bigcup \bigcup

\bigcap \bigcap

\iint \iint

Fractions

ab\frac ab \frac ab

a+1b+1\frac{a+1}{b+1} \frac{a+1}{b+1}

a+1b+1{a+1\over b+1} {a+1\over b+1}

ab\cfrac{a}{b} \cfrac{a}{b}

Radical signs

x3\sqrt{x^3} \sqrt{x^3}

xy3\sqrt[3]{\frac xy} \sqrt[3]{\frac xy}

Accents and diacritical marks

x^\hat x \hat x

xy^\widehat{xy} \widehat{xy}

xˉ\bar x \bar x

xyz\overline{xyz} \overline{xyz}

x\vec x \vec x

xy\overrightarrow{xy} \overrightarrow{xy}

ddxxx˙=x˙2+xx¨\frac d{dx}x\dot x = \dot x^2 + x\ddot x \frac d{dx}x\dot x = \dot x^2 + x\ddot x

ABC@ x2 T\overset{@}{ABC}\ \overset{x^2}{\longmapsto}\ \overset{\bullet\circ\circ\bullet}{T} \overset{@}{ABC}\ \overset{x^2}{\longmapsto}\ \overset{\bullet\circ\circ\bullet}{T}


Matrix

1xx21yy21zz2\begin{matrix} 1 & x & x^2 \\ 1 & y & y^2 \\ 1 & z & z^2 \\ \end{matrix}
\begin{matrix}
1 & x & x^2 \\
1 & y & y^2 \\
1 & z & z^2 \\
\end{matrix}
(1234)\begin{pmatrix} 1 & 2 \\ 3 & 4 \\ \end{pmatrix}
\begin{pmatrix}
1 & 2 \\
3 & 4 \\
\end{pmatrix}
[1234]\begin{bmatrix} 1 & 2 \\ 3 & 4 \\ \end{bmatrix}
\begin{bmatrix}
1 & 2 \\
3 & 4 \\
\end{bmatrix}
{1234}\begin{Bmatrix} 1 & 2 \\ 3 & 4 \\ \end{Bmatrix}
\begin{Bmatrix}
1 & 2 \\
3 & 4 \\
\end{Bmatrix}
1234\begin{vmatrix} 1 & 2 \\ 3 & 4 \\ \end{vmatrix}
\begin{vmatrix}
1 & 2 \\
3 & 4 \\
\end{vmatrix}
1234\begin{Vmatrix} 1 & 2 \\ 3 & 4 \\ \end{Vmatrix}
\begin{Vmatrix}
1 & 2 \\
3 & 4 \\
\end{Vmatrix}
(1a1a12a1n1a2a22a2n1amam2amn)\begin{pmatrix} 1 & a_1 & a_1^2 & \cdots & a_1^n \\ 1 & a_2 & a_2^2 & \cdots & a_2^n \\ \vdots & \vdots& \vdots & \ddots & \vdots \\ 1 & a_m & a_m^2 & \cdots & a_m^n \end{pmatrix}
\begin{pmatrix}
1 & a_1 & a_1^2 & \cdots & a_1^n \\
1 & a_2 & a_2^2 & \cdots & a_2^n \\
\vdots & \vdots& \vdots & \ddots & \vdots \\
1 & a_m & a_m^2 & \cdots & a_m^n
\end{pmatrix}
[123456]\left[ \begin{array}{cc|c} 1&2&3\\ 4&5&6 \end{array} \right]
\left[
\begin{array}{cc|c}
1&2&3\\
4&5&6
\end{array}
\right]

Array

nLeftCenterRight10.24112521189832020001+10i\begin{array}{c|lcr} n & \text{Left} & \text{Center} & \text{Right} \\ \hline 1 & 0.24 & 1 & 125 \\ 2 & -1 & 189 & -8 \\ 3 & -20 & 2000 & 1+10i \end{array}
\begin{array}{c|lcr}
n & \text{Left} & \text{Center} & \text{Right} \\
\hline
1 & 0.24 & 1 & 125 \\
2 & -1 & 189 & -8 \\
3 & -20 & 2000 & 1+10i
\end{array}
% outer vertical array of arrays \begin{array}{c} % inner horizontal array of arrays \begin{array}{cc} % inner array of minimum values \begin{array}{c|cccc} \text{min} & 0 & 1 & 2 & 3\\ \hline 0 & 0 & 0 & 0 & 0\\ 1 & 0 & 1 & 1 & 1\\ 2 & 0 & 1 & 2 & 2\\ 3 & 0 & 1 & 2 & 3 \end{array} & % inner array of maximum values \begin{array}{c|cccc} \text{max}&0&1&2&3\\ \hline 0 & 0 & 1 & 2 & 3\\ 1 & 1 & 1 & 2 & 3\\ 2 & 2 & 2 & 2 & 3\\ 3 & 3 & 3 & 3 & 3 \end{array} \end{array} \\ % inner array of delta values \begin{array}{c|cccc} \Delta&0&1&2&3\\ \hline 0 & 0 & 1 & 2 & 3\\ 1 & 1 & 0 & 1 & 2\\ 2 & 2 & 1 & 0 & 1\\ 3 & 3 & 2 & 1 & 0 \end{array} \end{array}
% outer vertical array of arrays
\begin{array}{c}
% inner horizontal array of arrays
\begin{array}{cc}
% inner array of minimum values
\begin{array}{c|cccc}
\text{min} & 0 & 1 & 2 & 3\\
\hline
0 & 0 & 0 & 0 & 0\\
1 & 0 & 1 & 1 & 1\\
2 & 0 & 1 & 2 & 2\\
3 & 0 & 1 & 2 & 3
\end{array}
&
% inner array of maximum values
\begin{array}{c|cccc}
\text{max}&0&1&2&3\\
\hline
0 & 0 & 1 & 2 & 3\\
1 & 1 & 1 & 2 & 3\\
2 & 2 & 2 & 2 & 3\\
3 & 3 & 3 & 3 & 3
\end{array}
\end{array}
\\
% inner array of delta values
\begin{array}{c|cccc}
\Delta&0&1&2&3\\
\hline
0 & 0 & 1 & 2 & 3\\
1 & 1 & 0 & 1 & 2\\
2 & 2 & 1 & 0 & 1\\
3 & 3 & 2 & 1 & 0
\end{array}
\end{array}

Equation

Aligned equations

align is not supported in 'KaTeX`.

37=7321122=7321227321732=7321227321732=7312117327312(112732)\begin{aligned} \sqrt{37} & = \sqrt{\frac{73^2-1}{12^2}} \\ & = \sqrt{\frac{73^2}{12^2}\cdot\frac{73^2-1}{73^2}} \\ & = \sqrt{\frac{73^2}{12^2}}\sqrt{\frac{73^2-1}{73^2}} \\ & = \frac{73}{12}\sqrt{1 - \frac{1}{73^2}} \\ & \approx \frac{73}{12}\left(1 - \frac{1}{2\cdot73^2}\right) \end{aligned}
\begin{aligned}
\sqrt{37} & = \sqrt{\frac{73^2-1}{12^2}} \\
& = \sqrt{\frac{73^2}{12^2}\cdot\frac{73^2-1}{73^2}} \\
& = \sqrt{\frac{73^2}{12^2}}\sqrt{\frac{73^2-1}{73^2}} \\
& = \frac{73}{12}\sqrt{1 - \frac{1}{73^2}} \\
& \approx \frac{73}{12}\left(1 - \frac{1}{2\cdot73^2}\right)
\end{aligned}

Piecewise functions

f(n)={n/2,if n is even3n+1,if n is oddf(n) = \begin{cases} n/2, & \text{if $n$ is even} \\ 3n+1, & \text{if $n$ is odd} \end{cases}
f(n) =
\begin{cases}
n/2, & \text{if $n$ is even} \\
3n+1, & \text{if $n$ is odd}
\end{cases}
if n is even:n/2if n is odd:3n+1}=f(n)\left. \begin{array}{l} \text{if $n$ is even:}&n/2\\ \text{if $n$ is odd:}&3n+1 \end{array} \right\} =f(n)
\left.
\begin{array}{l}
\text{if $n$ is even:}&n/2\\
\text{if $n$ is odd:}&3n+1
\end{array}
\right\}
=f(n)

System of equations

{a1x+b1y+c1z=d1a2x+b2y+c2z=d2a3x+b3y+c3z=d3\begin{cases} a_1x+b_1y+c_1z=d_1 \\ a_2x+b_2y+c_2z=d_2 \\ a_3x+b_3y+c_3z=d_3 \end{cases}
\begin{cases}
a_1x+b_1y+c_1z=d_1 \\
a_2x+b_2y+c_2z=d_2 \\
a_3x+b_3y+c_3z=d_3
\end{cases}
{a1x+b1y+c1z=d1a2x+b2y+c2z=d2a3x+b3y+c3z=d3\left\{ \begin{array}{c} a_1x+b_1y+c_1z=d_1 \\ a_2x+b_2y+c_2z=d_2 \\ a_3x+b_3y+c_3z=d_3 \end{array} \right.
\left\{
\begin{array}{c}
a_1x+b_1y+c_1z=d_1 \\
a_2x+b_2y+c_2z=d_2 \\
a_3x+b_3y+c_3z=d_3
\end{array}
\right.
{a1x+b1y+c1z=d1+e1a2x+b2y=d2a3x+b3y+c3z=d3\left\{ \begin{aligned} a_1x+b_1y+c_1z &=d_1+e_1 \\ a_2x+b_2y&=d_2 \\ a_3x+b_3y+c_3z &=d_3 \end{aligned} \right.
\left\{
\begin{aligned}
a_1x+b_1y+c_1z &=d_1+e_1 \\
a_2x+b_2y&=d_2 \\
a_3x+b_3y+c_3z &=d_3
\end{aligned}
\right.
{a1x+b1y+c1z=d1+e1a2x+b2y=d2a3x+b3y+c3z=d3\left\{ \begin{array}{ll} a_1x+b_1y+c_1z &=d_1+e_1 \\ a_2x+b_2y &=d_2 \\ a_3x+b_3y+c_3z &=d_3 \end{array} \right.
\left\{
\begin{array}{ll}
a_1x+b_1y+c_1z &=d_1+e_1 \\
a_2x+b_2y &=d_2 \\
a_3x+b_3y+c_3z &=d_3
\end{array}
\right.
{a1x+b1y+c1z=d1a2x+b2y+c2z=d2a3x+b3y+c3z=d3\begin{cases} a_1x+b_1y+c_1z=d_1 \\[2ex] a_2x+b_2y+c_2z=d_2 \\[2ex] a_3x+b_3y+c_3z=d_3 \end{cases}
\begin{cases}
a_1x+b_1y+c_1z=d_1 \\[2ex]
a_2x+b_2y+c_2z=d_2 \\[2ex]
a_3x+b_3y+c_3z=d_3
\end{cases}
{a1x+b1y+c1z=p1q1a2x+b2y+c2z=p2q2a3x+b3y+c3z=p3q3\begin{cases} a_1x+b_1y+c_1z=\frac{p_1}{q_1} \\ a_2x+b_2y+c_2z=\frac{p_2}{q_2} \\ a_3x+b_3y+c_3z=\frac{p_3}{q_3} \end{cases}
\begin{cases}
a_1x+b_1y+c_1z=\frac{p_1}{q_1} \\
a_2x+b_2y+c_2z=\frac{p_2}{q_2} \\
a_3x+b_3y+c_3z=\frac{p_3}{q_3}
\end{cases}

Continued fractions

x=a0+12a1+22a2+32a3+44a4+x = a_0 + \cfrac{1^2}{a_1 + \cfrac{2^2}{a_2 + \cfrac{3^2}{a_3 + \cfrac{4^4}{a_4 + \cdots}}}}
x = a_0 + \cfrac{1^2}{a_1
+ \cfrac{2^2}{a_2
+ \cfrac{3^2}{a_3 + \cfrac{4^4}{a_4 + \cdots}}}}

Highlighting equation

bbox is not supported in KaTex

\bbox[yellow]ex=limn(1+xn)n(1)\bbox[yellow] { e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n \qquad (1) }
\bbox[yellow]
{
e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n
\qquad (1)
}
\bbox[yellow,5px]ex=limn(1+xn)n(1)\bbox[yellow,5px] { e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n \qquad (1) }
\bbox[yellow,5px]
{
e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n
\qquad (1)
}
\bbox[5px,border:2pxsolidred]ex=limn(1+xn)n(2)\bbox[5px,border:2px solid red] { e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n \qquad (2) }
\bbox[5px,border:2px solid red]
{
e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n
\qquad (2)
}
\bbox[yellow,5px,border:2pxsolidred]ex=limn(1+xn)n(1)\bbox[yellow,5px,border:2px solid red] { e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n \qquad (1) }
\bbox[yellow,5px,border:2px solid red]
{
e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n
\qquad (1)
}

Fussy spacing issues

BadBettereiπ2eiπ2eiπ/2π2π2sinxdxπ/2π/2sinxdx\begin{array}{cc} \mathrm{Bad} & \mathrm{Better} \\ \hline \\ e^{i\frac{\pi}2} \quad e^{\frac{i\pi}2}& e^{i\pi/2} \\ \int_{-\frac\pi2}^\frac\pi2 \sin x\,dx & \int_{-\pi/2}^{\pi/2}\sin x\,dx \\ \end{array}
\begin{array}{cc}
\mathrm{Bad} & \mathrm{Better} \\
\hline \\
e^{i\frac{\pi}2} \quad e^{\frac{i\pi}2}& e^{i\pi/2} \\
\int_{-\frac\pi2}^\frac\pi2 \sin x\,dx & \int_{-\pi/2}^{\pi/2}\sin x\,dx \\
\end{array}
BadBetter{xx2Z}{xx2Z}\begin{array}{cc} \mathrm{Bad} & \mathrm{Better} \\ \hline \\ \{x|x^2\in\Bbb Z\} & \{x\mid x^2\in\Bbb Z\} \\ \end{array}
\begin{array}{cc}
\mathrm{Bad} & \mathrm{Better} \\
\hline \\
\{x|x^2\in\Bbb Z\} & \{x\mid x^2\in\Bbb Z\} \\
\end{array}
BadBetterSf(x)dydxSf(x)dydxVf(x)dzdydxVf(x)dzdydx\begin{array}{cc} \mathrm{Bad} & \mathrm{Better} \\ \hline \\ \int\int_S f(x)\,dy\,dx & \iint_S f(x)\,dy\,dx \\ \int\int\int_V f(x)\,dz\,dy\,dx & \iiint_V f(x)\,dz\,dy\,dx \end{array}
\begin{array}{cc}
\mathrm{Bad} & \mathrm{Better} \\
\hline \\
\int\int_S f(x)\,dy\,dx & \iint_S f(x)\,dy\,dx \\
\int\int\int_V f(x)\,dz\,dy\,dx & \iiint_V f(x)\,dz\,dy\,dx
\end{array}

Colors

\color{black}{text}text\color{gray}{text}text\color{silver}{text}text\color{white}{text}text\color{maroon}{text}text\color{red}{text}text\color{yellow}{text}text\color{lime}{text}text\color{olive}{text}text\color{green}{text}text\color{teal}{text}text\color{aqua}{text}text\color{blue}{text}text\color{navy}{text}text\color{purple}{text}text\color{fuchsia}{text}text\begin{array}{|rc|} \hline \verb+\color{black}{text}+ & \color{black}{text} \\ \verb+\color{gray}{text}+ & \color{gray}{text} \\ \verb+\color{silver}{text}+ & \color{silver}{text} \\ \verb+\color{white}{text}+ & \color{white}{text} \\ \hline \verb+\color{maroon}{text}+ & \color{maroon}{text} \\ \verb+\color{red}{text}+ & \color{red}{text} \\ \verb+\color{yellow}{text}+ & \color{yellow}{text} \\ \verb+\color{lime}{text}+ & \color{lime}{text} \\ \verb+\color{olive}{text}+ & \color{olive}{text} \\ \verb+\color{green}{text}+ & \color{green}{text} \\ \verb+\color{teal}{text}+ & \color{teal}{text} \\ \verb+\color{aqua}{text}+ & \color{aqua}{text} \\ \verb+\color{blue}{text}+ & \color{blue}{text} \\ \verb+\color{navy}{text}+ & \color{navy}{text} \\ \verb+\color{purple}{text}+ & \color{purple}{text} \\ \verb+\color{fuchsia}{text}+ & \color{magenta}{text} \\ \hline \end{array}
\begin{array}{|rc|}
\hline
\verb+\color{black}{text}+ & \color{black}{text} \\
\verb+\color{gray}{text}+ & \color{gray}{text} \\
\verb+\color{silver}{text}+ & \color{silver}{text} \\
\verb+\color{white}{text}+ & \color{white}{text} \\
\hline
\verb+\color{maroon}{text}+ & \color{maroon}{text} \\
\verb+\color{red}{text}+ & \color{red}{text} \\
\verb+\color{yellow}{text}+ & \color{yellow}{text} \\
\verb+\color{lime}{text}+ & \color{lime}{text} \\
\verb+\color{olive}{text}+ & \color{olive}{text} \\
\verb+\color{green}{text}+ & \color{green}{text} \\
\verb+\color{teal}{text}+ & \color{teal}{text} \\
\verb+\color{aqua}{text}+ & \color{aqua}{text} \\
\verb+\color{blue}{text}+ & \color{blue}{text} \\
\verb+\color{navy}{text}+ & \color{navy}{text} \\
\verb+\color{purple}{text}+ & \color{purple}{text} \\
\verb+\color{fuchsia}{text}+ & \color{magenta}{text} \\
\hline
\end{array}

Commutative diagrams

CD is not supported in KaTex

\require{AMScd} \begin{CD} A @>a>> B\\ @V b V V= @VV c V\\ C @>>d> D \end{CD}
\require{AMScd}
\begin{CD}
A @>a>> B\\
@V b V V= @VV c V\\
C @>>d> D
\end{CD}
\begin{CD} A @>>> B @>{\text{very long label}}>> C \\ @. @AAA @| \\ D @= E @<<< F \end{CD}
\begin{CD}
A @>>> B @>{\text{very long label}}>> C \\
@. @AAA @| \\
D @= E @<<< F
\end{CD}

Pack of cards

\spadesuit\quad\heartsuit\quad\diamondsuit\quad\clubsuit \spadesuit\quad\heartsuit\quad\diamondsuit\quad\clubsuit

\color{red}{\heartsuit}\quad\color{red}{\diamondsuit} \color{red}{\heartsuit}\quad\color{red}{\diamondsuit}

Last updated on