Post

MathJax Cheat Sheet in LaTeX

The basic usage of MathJax using LaTeX syntax. A MathJax Cheat Sheet

MathJax Cheat Sheet in LaTeX

About MathJax

MathJax is a cross-browser JavaScript library that displays mathematical notation in web browsers, using MathML, LaTeX, and ASCIIMathML markup. MathJax is released as open-source software under the Apache License.

To put mathematics in your web page, you can use TeX and LaTeX notation, MathML notation, AsciiMath notation, or a combination of all three within the same page; the MathJax configuration tells MathJax which you want to use, and how you plan to indicate the mathematics when you are using TeX/LaTeX or AsciiMath notation.

The Basics

Entering mathematical formulas in Markdown uses LaTeX syntax support.

The default math delimiters are $$...$$ and \[...\] for displayed mathematics, and \(...\) for in-line mathematics. Note in particular that the $...$ in-line delimiters are not used by default. That is because dollar signs appear too often in non-mathematical settings, which could cause some text to be treated as mathematics unexpectedly. For example, with single-dollar delimiters, “… the cost is (dollar)2.50 for the first one, and (dollar)2.00 for each additional one …” would cause the phrase “2.50 for the first one, and” to be treated as mathematics since it falls between dollar signs.

Greek Alphabet

$\alpha$ \alpha $\lambda$ \lambda $\chi$ \chi
$\beta$ \beta $\mu$ \mu $\psi$ \psi
$\gamma$ \gamma $\nu$ \nu $\omega$ \omega
$\delta$ \delta $\xi$ \xi    
$\epsilon$ \epsilon $\pi$ \pi    
$\zeta$ \zeta $\rho$ \rho    
$\eta$ \eta $\sigma$ \sigma    
$\theta$ \theta $\tau$ \tau    
$\iota$ \iota $\upsilon$ \upsilon$    
$\kappa$ \kappa $\phi$ \phi$    
  • If uppercase Greek letters are required, just capitalize the first letter of the command. For example, \Sigma is rendered as $\Sigma$.

  • If you need italicized Greek letters, just add var before the command. \varGamma is rendered as $\varGamma$.

Math Alphabets

$\mathrm{ABCDEabcde1234} $ \mathrm{ABCDEabcde1234}
$\mathit{ABCDEabcde1234} $ \mathit{ABCDEabcde1234}
$\mathnormal{ABCDEabcde1234}$ \mathnormal{ABCDEabcde1234}
$\mathcal{ABCDEabcde1234} $ \mathcal{ABCDEabcde1234}

Fonts

  • Typewriter:\mathtt{A} rendered as $\mathtt{A}$

  • Blackboard Bold: \mathbb{A} rendered as $\mathbb{A}$

  • Sans Serif: \mathsf{A} rendered as $\mathsf{A}$

  • Script: \mathscr{A} rendered as $\mathscr{A}$

  • Roman: \mathrm{A} rendered as $\mathrm{A}$

Binary Relations

$\mid $ \mid $\nmid $ \nmid
$\cdot $ \cdot $\leq $ \leq
$\geq $ \geq $\neq $ \neq
$\approx $ \approx $\equiv $ \equiv
$\prec $ \prec $\preceq $ \preceq
$\ll $ \ll $\succ $ \succ
$\succeq $ \succeq $\gg $ \gg
$\sim $ \sim $\simeq $ \simeq
$\asymp $ \asymp $\cong $ \cong
$\doteq $ \doteq $\propto $ \propto
$\models $ \models $\parallel $ \parallel
$\bowtie $ \bowtie $\perp $ \perp
$\circ $ \circ $\ast $ \ast
$\bigodot $ \bigodot $\bigotimes$ \bigotimes
$\bigoplus$ \bigoplus $ $  

Binary Operators

$\pm $ \pm $\mp $ \mp
$\times $ \times $\ast $ \ast
$\star $ \star $\circ $ \circ
$\bullet $ \bullet $\cdot $ \cdot
$\div $ \div $\sum $ sum
$\prod $ \prod $\coprod $ \coprod
$\oplus $ \oplus $\bigoplus $ \bigoplus
$\bigotimes $ \bigotimes $\oslash $ \oslash
$\odot $ \odot $\bigodot $ \bigodot
$\diamond $ \diamond $\bigtriangleup $ \bigtriangleup
$\bigtriangledown$ \bigtriangledown $\triangleleft $ \triangleleft
$\bigcirc $ \bigcirc $\triangleright$ \triangleright

Big Operators

$\sum $ \sum $\bigsqcup $ \bigsqcup
$\bigcup $ \bigcup $\biguplus $ \biguplus
$\bigvee $ \bigvee $\int $ \int
$\prod $ \prod $\oint $ \oint
$\bigcap $ \bigcap $\bigodot $ \bigodot
$\bigwedge$ \bigwedge $\bigoplus $ \bigoplus
$\coprod $ \coprod $\bigotimes$ \bigotimes

Math Mode Accents

$\acute{a}$ \acute{a} $\hat{a} $ \hat{a}
$\bar{a} $ \bar{a} $\mathring{a} $ \mathring{a}
$\breve{a}$ \breve{a} $\tilde{a} $ \tilde{a}
$\check{a}$ \check{a} $\vec{a} $ \vec{a}
$\ddot{a} $ \ddot{a} $\widehat{AAA} $ \widehat{AAA}
$\dot{a} $ \dot{a} $\widetilde{AAA}$ \widetilde{AAA}
$\grave{a}$ \grave{a}    

Subscript and superscript

Subscripts are typeset with the underscore, while superscripts are made with the caret. Thus X_{ab} produces $X_{ab}$, and X^{ab} produces $X^{ab}$.

Delimiters

$\uparrow $ \uparrow $\Downarrow $ \Downarrow
$\downarrow $ \downarrow $\backslash $ \backslash
$\updownarrow$ \updownarrow $\Updownarrow$ \Updownarrow
$\langle $ \langle $\lfloor $ \lfloor
$\rangle $ \rangle $\rfloor $ \rfloor
$\Uparrow $ \Uparrow $\rceil $ \rceil
$\vert $ \vert $\lceil $ \lceil
$\Vert $ \Vert    

Large Delimiters

$\lgroup $ \lgroup $\Arrowvert $ \Arrowvert
$\rgroup $ \rgroup $\bracevert $ \bracevert
$\lmoustache$ \lmoustache $\rmoustache$ \rmoustache
$\arrowvert $ \arrowvert    

Miscellaneous Symbols

$\dots $ \dots $\emptyset $ \emptyset
$\cdots $ \cdots $\infty $ \infty
$\vdots $ \vdots $\nabla $ \nabla
$\ddots $ \ddots $\triangle $ \triangle
$\hbar $ \hbar $\bot $ \bot
$\imath $ \imath $\top $ \top
$\jmath $ \jmath $\angle $ \angle
$\ell $ \ell $\surd $ \surd
$\Re $ \Re $\diamondsuit$ \diamondsuit
$\Im $ \Im $\heartsuit $ \heartsuit
$\aleph $ \aleph $\clubsuit $ \clubsuit
$\wp $ \wp $\spadesuit $ \spadesuit
$\forall $ \forall $\neg $ \neg
$\exists $ \exists $\flat $ \flat
$\partial$ \partial $\natural $ \natural
$\prime $ \prime $\sharp $ \sharp

Arrows

$\gets $ \gets $\leftharpoonup $ \leftharpoonup
$\longleftarrow $ \longleftarrow $\rightharpoonup $ \rightharpoonup
$\to $ \to $\leftharpoondown $ \leftharpoondown
$\longrightarrow $ \longrightarrow $\rightharpoondown $ \rightharpoondown
$\leftrightarrow $ \leftrightarrow $\rightleftharpoons$ \rightleftharpoons
$\longleftrightarrow$ \longleftrightarrow $\iff $ \iff
$\Leftarrow $ \Leftarrow $\uparrow $ \uparrow
$\Longleftarrow $ \Longleftarrow $\downarrow $ \downarrow
$\Rightarrow $ \Rightarrow $\updownarrow $ \updownarrow
$\Longrightarrow $ \Longrightarrow $\Uparrow $ \Uparrow
$\Leftrightarrow $ \Leftrightarrow $\Downarrow $ \Downarrow
$\Longleftrightarrow$ \Longleftrightarrow $\Updownarrow $ \Updownarrow
$\mapsto $ \mapsto $\nearrow $ \nearrow
$\longmapsto $ \longmapsto $\searrow $ \searrow
$\hookleftarrow $ \hookleftarrow $\swarrow $ \swarrow
$\hookrightarrow $ \hookrightarrow $\nwarrow $ \nwarrow

Fraction & Root

  • \frac{x}{y} is rendered as: $\frac{x}{y}$

  • \sqrt[x]{y} is rendered as: $\sqrt[x]{y}$

Matrix

Start with \begin{matrix}, end with \end{matrix}

  • creates a matrix with parentheses: \begin{pmatrix}

  • creates a matrix with brackets: \begin{bmatrix}

  • creates a matrix with vertical bars: \begin{vmatrix}

  • creates a matrix with double vertical bars: \begin{Vmatrix}

Mark \\ at the end of each line, and elements between lines are separated by &.

For example:

1
2
3
4
5
\begin{matrix}
1&0&0\\
0&1&0\\
0&0&1\\
\end{matrix}

rendered as:

\[\begin{matrix} 1&0&0\\ 0&1&0\\ 0&0&1\\ \end{matrix}\]
1
2
3
4
5
6
\begin{bmatrix}
{a_{11}}&{a_{12}}&{\cdots}&{a_{1n}}\\
{a_{21}}&{a_{22}}&{\cdots}&{a_{2n}}\\
{\vdots}&{\vdots}&{\ddots}&{\vdots}\\
{a_{m1}}&{a_{m2}}&{\cdots}&{a_{mn}}\\
\end{bmatrix}

rendered as:

\[\begin{bmatrix} {a_{11}}&{a_{12}}&{\cdots}&{a_{1n}}\\ {a_{21}}&{a_{22}}&{\cdots}&{a_{2n}}\\ {\vdots}&{\vdots}&{\ddots}&{\vdots}\\ {a_{m1}}&{a_{m2}}&{\cdots}&{a_{mn}}\\ \end{bmatrix}\]

Simultaneous Equations

Start with \begin{cases}, end with \end{cases}

For example:

1
2
3
4
5
\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}

rendered as:

\[\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}\]

Tags

For example: a_1x+b_1y+c_1z=d_1 \tag{1} is rendered as:

\[a_1x+b_1y+c_1z=d_1 \tag{1}\]

Spaces

LaTeX syntax ignores spaces and requires the escape character \ . \quad represents four spaces.

This post is licensed under CC BY 4.0 by the author.