How to input math formulas using KaTeX plugin.
Common constructs
superscript
a^2 + b^2 = c^2
a2+b2=c2
e^{i\pi} + 1 = 0
eiπ+1=0
subscript
s = a_1 + a_2 + \cdots + a_n
s=a1+a2+⋯+an
A_0 = W_{0,0} + W_{0,1} + W_{0,2} + \cdots + W_{0,n}
A0=W0,0+W0,1+W0,2+⋯+W0,n
square root
y = \sqrt{x}
y=x
y = \sqrt[n]{x}
y=nx
fraction
z = \frac{x}{y}
z=yx
z = \frac{x}{1+\frac{y}{8}}
z=1+8yx
Greek Letters
Example
\alpha, \Alpha
α,A
All Greek letters
| | |
|---|
| α,A | → | \alpha, \Alpha |
| β,B | → | \beta, \Beta |
| γ,Γ | → | \gamma, \Gamma |
| δ,Δ | → | \delta, \Delta |
| ϵ,E,ε | → | \epsilon, \Epsilon, \varepsilon |
| ζ,Z | → | \zeta, \Zeta |
| η,H | → | \eta, \Eta |
| θ,Θ,ϑ | → | \theta, \Theta, \vartheta |
| ι,I | → | \iota, \Iota |
| κ,K | → | \kappa, \Kappa |
| λ,Λ | → | \lambda, \Lambda |
| μ,M | → | \mu, \Mu |
| ν,N | → | \nu, \Nu |
| ξ,Ξ | → | \xi, \Xi |
| o,O | → | o, O |
| π,Π,ϖ | → | \pi, \Pi, \varpi |
| ρ,P,ϱ | → | \rho, \Rho, \varrho |
| σ,Σ,ς | → | \sigma, \Sigma, \varsigma |
| τ,T | → | \tau, \Tau |
| υ,Υ | → | \upsilon, \Upsilon |
| ϕ,Φ,φ | → | \phi, \Phi, \varphi |
| χ,X | → | \chi, \Chi |
| ψ,Ψ | → | \psi, \Psi |
| ω,Ω | → | \omega, \Omega |
Parenthesis and Brackets
| | |
|---|
| (x+y) | → | (x+y) |
| [x+y] | → | [x+y] |
| {x+y} | → | \{x+y\} |
| ⟨x+y⟩ | → | \langle x+y \rangle |
| ∥x+y∥ | → | |x+y| |
To make the parenthesis resize dynamically, put \left and \right before parenthesis.
F = G \left( \frac{m_1 m_2}{r^2} \right)
F=G(r2m1m2)
- without
\left and \right:
F = G ( \frac{m_1 m_2}{r^2} )
F=G(r2m1m2)
To manually control parenthesis size, use \big, \Big, \bigg, \Bigg.
\big( \Big( \bigg( \Bigg(,
\big[ \Big[ \bigg[ \Bigg[
((((,[[[[
Sum and Product
\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
i=1∑ni=2n(n+1)
\prod_{i=1}^{n} i = n!
i=1∏ni=n!
Modulo
c = a \bmod b
c=amodb
a^p \equiv a \pmod{p}
ap≡a(modp)
Decorations
| | |
|---|
| f′ | → | f' |
| f′′ | → | f'' |
| x˙ | → | \dot{x} |
| x¨ | → | \ddot{x} |
| x^ | → | \hat{x} |
| x~ | → | \tilde{x} |
| xˉ | → | \bar{x} |
| x | → | \vec{x} |
\overline{x + y + z}
x+y+z
\underline{x + y + z}
x+y+z
\overbrace{x + y + z}^{|A|}
x+y+z∣A∣
\underbrace{x + y + z}_{|A|}
∣A∣x+y+z
Dots
\{0, 1, 2, \ldots\}
{0,1,2,…}
1 + 2 + \cdots + n
1+2+⋯+n
x_1 \cdot x_2 \cdot x_3 \cdots x_n
x1⋅x2⋅x3⋯xn
Sets
| | |
|---|
| N | → | \mathbb{N} |
| Q | → | \mathbb{Q} |
| R | → | \mathbb{R} |
| Z | → | \mathbb{Z} |
| C | → | \mathbb{C} |
| | |
|---|
| ∅ | → | \emptyset |
| ∪ | → | \cup |
| ∩ | → | \cap |
| ∖ | → | \setminus |
| ⊂ | → | \subset |
| ⊆ | → | \subseteq |
| ⊃ | → | \supset |
| ⊇ | → | \supseteq |
| ∈ | → | \in |
| ∋ | → | \ni |
| ∈/ | → | \notin |
| ∀ | → | \forall |
| ∃ | → | \exists |
| ∄ | → | \nexists |
| ≡ | → | \equiv |
| ¬ | → | \neg |
| ∨ | → | \lor |
| ∧ | → | \land |
Geometry
| | |
|---|
| AB | → | \overline{AB} |
| AB | → | \overrightarrow{AB} |
| ∠A | → | \angle A |
| △ABC | → | \triangle ABC |
| □ABCD | → | \square{ABCD} |
| ≅ | → | \cong |
| ∼ | → | \sim |
| ∥ | → | | |
| ⊥ | → | \perp |
| 45∘ | → | 45^{\circ} |
| | |
|---|
| sin(θ) | → | \sin(\theta) |
| cos(θ) | → | \cos(\theta) |
| tan(θ) | → | \tan(\theta) |
Calculus
v = \frac{ds}{dt}, a = \frac{dv}{dt} = \frac{d^2 s}{dt^2}
v=dtds,a=dtdv=dt2d2s
\frac{\partial^2u}{\partial t^2} = c^2 \frac{\partial^2 u}{\partial x^2}
∂t2∂2u=c2∂x2∂2u
\int udv = uv - \int v du
∫udv=uv−∫vdu
Matrix
bmatrix for bracket, and pmatrix for parenthesis.
M(\theta) =
\begin{bmatrix}
\cos(\theta) & -\sin(\theta) & 0 \\
\sin(\theta) & \cos(\theta) & 0 \\
0 & 0 & 1 \\
\end{bmatrix}
M(θ)=cos(θ)sin(θ)0−sin(θ)cos(θ)0001
Cases
f(x) =
\begin{cases}
1, & x < 0 \\
x + 1, & x >= 0
\end{cases}
f(x)={1,x+1,x<0x>=0