Tex

Tex (via Mathjax) can be used to markup math statements.

mdbook supports Mathjax, which is a tex-like flavor for writing math.

This page is a mathjax syntax dump, showing some common use cases.

Matrices

Standard matrix (column vector), 3x1

\begin{bmatrix}1\\\\0\\\\8\end{bmatrix}

\( \begin{bmatrix}1\\0\\8\end{bmatrix} \)

Row vector, 1x3

\begin{bmatrix}1 & 3 & 7\end{bmatrix}

\( \begin{bmatrix}1 & 3 & 7\end{bmatrix} \)

Standard matrix, 3x3

Code:

\begin{bmatrix}4 & 0 & 0\\\\0 & 3 & 0\\\\0 & 0 & 2\end{bmatrix}

\( \begin{bmatrix}4 & 0 & 0\\0 & 3 & 0\\0 & 0 & 2\end{bmatrix} \)

Augmented matrix, 4x4

Code:

[ A | I ] = 
\\\\\\\\\\\\\\\\\
 \left[\begin{array}{cccc|cccc}
   0 & 0 & 0 & 2 & 1 & 0 & 0 & 0 \\\\
   0 & 0 & 3 & 0 & 0 & 1 & 0 & 0 \\\\
   0 & 4 & 0 & 0 & 0 & 0 & 1 & 0 \\\\
   5 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\\\
 \end{array}\right].

\( [ A | I ] = \\\\\\\\
\left[\begin{array}{cccc|cccc} 0 & 0 & 0 & 2 & 1 & 0 & 0 & 0 \\ 0 & 0 & 3 & 0 & 0 & 1 & 0 & 0 \\ 0 & 4 & 0 & 0 & 0 & 0 & 1 & 0 \\ 5 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ \end{array}\right]. \)

Sets

  • \( \lbrace \) \lbrace
  • \( \rbrace \) \rbrace
  • \( \cup \) \cup
  • \( \cap \) \cap
  • \( \setminus \) \setminus
  • \( \subset \) \subset
  • \( \subseteq \) \subseteq
  • \( \subsetneq \) \subsetneq
  • \( \supset \) \supset
  • \( \in \) \in
  • \( \notin \) \notin
  • \( \emptyset \) \emptyset
  • \( \varnothing \) \varnothing

Sums

  • \( \sum_{i=0}^\infty i^2 \) \sum
    • \sum_{i=0}^\infty i^2
  • \( \bigcap \) \bigcap
  • \( \bigcup \) \bigcup
  • \( \prod \) \prod
  • \( \int \) \int

Logic

  • \( \land \) \land
  • \( \lor \) \lor
  • \( \lnot \) \lnot
  • \( \forall \) \forall
  • \( \exists \) \exists
  • \( \top \) \top
  • \( \bot \) \bot
  • \( \vdash \) \vdash
  • \( \vDash \) \vDash

Comparison

  • \( \neq \) \neq

  • \( \lt \) \lt

  • \( \le \) \le

  • \( \leq \) \leq

  • \( \leqq \) \leqq

  • \( \leqslant \) \leqslant

  • \( \gt \) \gt

  • \( \ge \) \ge

  • \( \geq \) \geq

  • \( \geqq \) \geqq

  • \( \geqslant \) \geqslant

Approximate

  • \( \approx \) \approx
  • \( \sim \) \sim
  • \( \thicksim \) \thicksim
  • \( \backsim \) \backsim

Fonts

  • \( \mathcal{RQSZ} \) \mathcal
  • \( \mathfrak{RQSZ} \) \mathfrak
  • \( \mathbb{RQSZ} \) \mathbb
  • \( \mathscr{RQSZ} \) \mathscr

Arrows

  • \( \to \) \to
  • \( \rightarrow \) \rightarrow
  • \( \leftarrow \) \leftarrow
  • \( \Rightarrow \) \Rightarrow
  • \( \Leftarrow \) \Leftarrow
  • \( \mapsto \) \mapsto

Bi-directional

  • \( \leftrightarrow \) \leftrightarrow
  • \( \Leftrightarrow \) \Leftrightarrow
  • \( \longleftrightarrow \) \longleftrightarrow
  • \( \Longleftrightarrow \) \Longleftrightarrow

Diagonal

  • \( \nearrow \) \nearrow
  • \( \searrow \) \searrow
  • \( \nwarrow \) \nwarrow
  • \( \swarrow \) \swarrow

Misc

  • \( \backslash \) \backslash

References