Skip to content

TeX macros for Math

In order to facilitate writing formulas on this website, I wrote these macros. The symbols consistent with the book Deep Learning are used.

Syntax Equals to Display Comment
a ~ z {a~z} a ~ z A scalar (integer or real)
\ra ~ \rz \mathrm{a~z} \ra ~ \rz A scalar random variable
\va ~ \vz \boldsymbol{a~z} \va ~ \vz A vector
\rva ~ \rvz \boldsymbol{\mathrm{a~z}} \rva ~ \rvz A vector-valued random variable
\mA ~ \mZ \boldsymbol{A~Z} \mA ~ \mZ A matrix
\rmA ~ \rmZ \boldsymbol{\mathrm{A~Z}} \rmA ~ \rmZ A matrix-valued random variable
\tA ~ \tZ \mathsf{A~Z} \tA ~ \tZ A tensor
\gA ~ \gZ \mathcal{A~Z} \gA ~ \gZ A graph
\sA ~ \sZ \mathbb{A~Z} \sA ~ \sZ A set
\e \Lambda \e Entries
\g \nabla \g Gradient
\p \partial \p Partial
\E \mathbb{E} \E Expectation
\I \boldsymbol{I} \I Identity matrix
\L \mathcal{L} \L Loss
\N \mathcal{N} \N Gaussian Distriution
\R \mathbb{R} \R Real number set
\sigmoid \sigma \sigmoid Logistic sigmoid
\softplus \zeta \softplus Softplus
\var \text{Var} \var Variance
\cov \text{Cov} \cov Covariance
\cov \text{Cov} \cov Covariance
\diag \text{diag} \diag A square, diagonal matrix
\softmax \text{softmax} \softmax Softmax
\abs{x} \vert{x}\vert \abs{x} Absolute
\norm{x} \Vert{x}\Vert \norm{x} Norm
\ceil{x} \lceil{x}\rceil \ceil{x} Ceil
\floor{x} \lfloor{x}\rfloor \floor{x} Floor
\tred{x} \color{red}{x} \tred{x} Color red
\tblue{x} \color{blue}{x} \tblue{x} Color blue
\dif{x}{y} \frac{d{x}}{d{y}} \dif{x}{y} Differential
\pdif{x}{y} \frac{\partial{x}}{\partial{y}} \pdif{x}{y} Partial