Latex

15 Nov 2019

Latex is a powerful technology to add mathematical expressions in documents, including websites. Here’s a few tips.

Standard operations

Expressions are surrounded in this markdown script with a dollar ($) symbol, which causes the rendering javascript engine to interpret the internal expression.

ie. $<expression>$

Standard symbols are prefixed with a \ character

Symbol Expression Comment Example Result
$\sum$ \sum sum \sum_{x=1}^{K}(r) $\sum_{x=1}^{K}(r)$
$\int$ \int integral \int_{a}^{b} x^2 dx $\int_{a}^{b} x^2 dx$
$\prod$ \prod product \prod_{i=a}^{b} f(i) $\prod_{i=a}^{b} f(i)$

Further extension of these are also available

Symbol Expression Comment
$\iint$ \iint double integral
$\iiint$ \iiint triple integral
$\oint$ \oint contour integral
$\oiint$ \oiint closed surface integral
$\oiiint$ \oiiint closed volume integral

Superscript and Subscript

Superscript, expressed with the hat ^ character, can be used to express a power function. An example of this is the famous Pythagorean triangle to calculate lengths of the sides of a triangle.

Symbol Expression
$x^2 + y^2 = z^2$ x^2 + y^2 = z^2

Subscript, expressed with the underscore _ character, can be used to express limits or membership of a variable.

Symbol Expression
$y = x_i$ y = x_i

The superscript and subscript can also modify the visual location of several items, by surrounding the argument with curly brackets {}, although support is limited

Symbol Expression
$f(x)=x^{jk}$. x^{i+j}.
$f(x)=x_{i+j}$. x_{i+k}.
$f_{a+b}=g^{a - b}$. f_{a+b} = g^{a - b}.

Brackets and Parenthesis

Type LATEX markup Renders as
Parentheses; round brackets (x+y) $(x+y)$
Brackets; square brackets [x+y] $[x+y]$
Braces; curly brackets \{ x+y \}. ${x+y}$.
Angle brackets \langle x+y \rangle $\langle x+y \rangle$
Pipes vertical bars |x+y| $|x+y|$
Double pipes ||x+y|| $||x+y||$

Latex Greek Characters

Symbol Expression
$\alpha A$ \alpha A
$\beta B$ \beta B
$\gamma \Gamma$ \gamma \Gamma
$\delta \Delta$ \delta \Delta
$\epsilon \varepsilon E$ \epsilon \varepsilon E
$\zeta Z$ \zeta Z
$\eta H$ \eta H
$\theta \vartheta \Theta$ \theta \vartheta \Theta
$\iota I$ \iota I
$\kappa K$ \kappa K
$\lambda \Lambda$ \lambda \Lambda
$\mu M$ \mu M
$\nu N$ \nu N
$\xi \Xi$ \xi \Xi
$o O$ o O
$\pi \Pi$ \pi \Pi
$\rho \varrho P$ \rho \varrho P
$\sigma \Sigma$ \sigma \Sigma
$\tau T$ \tau T
$\upsilon \Upsilon$ \upsilon \Upsilon
$\phi \varphi \Phi$ \phi \varphi \Phi
$\chi X$ \chi X
$\psi \Psi$ \psi \Psi
$\omega \Omega$ \omega \Omega

Arrows

Symbol Expression
$\leftarrow$ \leftarrow
$\Leftarrow$ \Leftarrow
$\rightarrow$ \rightarrow
$\Rightarrow\;$ \Rightarrow
$\leftrightarrow$ \leftrightarrow
$\rightleftharpoons$ \rightleftharpoons
$\uparrow$ \uparrow
$\downarrow$ \downarrow
$\Uparrow\;$ \Uparrow
$\Downarrow$ \Downarrow
$\Leftrightarrow\;$ \Leftrightarrow
$\Updownarrow$ \Updownarrow
$\mapsto$ \mapsto
$\longmapsto\;$ \longmapsto
$\nearrow$ \nearrow
$\searrow$ \searrow
$\swarrow$ \swarrow
$\nwarrow$ \nwarrow
$\leftharpoonup$ \leftharpoonup
$\rightharpoonup$ \rightharpoonup
$\leftharpoondown$ \leftharpoondown
$\rightharpoondown$ \rightharpoondown

Miscellaneous Symbols

Symbol Expression
$\infty\;\;$ \infty
$\forall\;$ \forall
$\Re$ \Re
$\Im$ \Im
$\nabla$ \nabla
$\exists$ \exists
$\partial$ \partial
$\nexists$ \nexists
$\emptyset$ \emptyset
$\varnothing\;$ \varnothing
$\wp$ \wp
$\complement$ \complement
$\neg$ \neg
$\cdots$ \cdots
$\square$ \square
$\surd$ \surd
$\blacksquare$ \blacksquare
$\triangle$ \triangle

Binary Operations and Relation Symbols

Symbol Expression
$\times$ \times
$\div$ \div
$\cap$ \cap
$\cup$ \cup
$\neq\;$ \neq
$\leq$ \leq
$\geq$ \geq
$\in$ \in
$\perp\;$ \perp
$\notin$ \notin
$\subset$ \subset
$\simeq$ \simeq
$\approx$ \approx
$\wedge$ \wedge
$\vee$ \vee
$\oplus\;$ \oplus
$\otimes$ \otimes
$\Box$ \Box
$\boxtimes$ \boxtimes
$\equiv$ \equiv
$\cong$ \cong