This collection of commands makes it easy to write mathematical expressions with LaTeX —while automatically respecting the rules of mathematical typography.
View
Features
The commands were developed to write math in economics, but they might also be helpful to write math in other fields. The commands introduce the following functionalities:
- Easily insert brackets (parentheses, absolute values, etc.) that scale automatically
- Easily list arguments of functions (exponential, log, etc.) and operators (expectation, probability, min, max, etc.), with surrounding brackets that scale automatically
- Easily write partial and total derivatives and elasticities, in display and text
- Easily type statistical commands (iid variables, various limits)
- Easily type blackboard letters
- Easily type uppercase calligraphic letters
- Easily type Greek letters
- Easily insert accents that scale automatically
Brackets
- Parentheses:
\bp{x}
gives $\left( x\right)$, where the brackets scale automatically - Square brackets:
\bs{x}
gives $\left[x\right]$, where the brackets scale automatically - Curly brackets:
\bc{x}
gives $\left\lbrace x\right\rbrace$, where the brackets scale automatically - Absolute value:
\abs{x}
gives $\left\lvert x \right\rvert$, where the brackets scale automatically - Norm:
\norm{x}
gives $\left\lVert x \right\rVert$, where the brackets scale automatically - Floor:
\floor{x}
gives $\left\lfloor x\right\rfloor$, where the brackets scale automatically - Ceiling:
\ceil{x}
gives $\left\lceil x\right\rceil$, where the brackets scale automatically - Parentheses for function arguments:
f\of{x}
gives $f(x)$, where the parentheses scale automatically, and where spacing between the functionf
and the argument(x)
is appropriate.f\bp{x}
gives $f\left( x\right)$, which introduces too much space between the functionf
and the argument(x)
.
Functions and operators
- Logarithm:
\ln
gives $\ln$\ln{x}
gives $\ln(x)$, where the parentheses scale automatically
- Exponential:
\exp
gives $\exp$\exp{x}
gives $\exp(x)$, where the parentheses scale automatically
- Indicator:
\ind
gives $\mathbb{1}$\ind{X}
gives $\mathbb{1}(X)$, where the parentheses scale automatically
- Trace:
\tr
gives $\operatorname{tr}$\tr{X}
gives $\operatorname{tr}(X)$, where the parentheses scale automatically
- Variance:
\var
gives $\operatorname{var}$\var[t]
gives $\operatorname{var}_t$\var{X}
gives $\operatorname{var}(X)$, where the parentheses scale automatically\var[t]{X}
gives $\operatorname{var}_t(X)$, where the parentheses scale automatically
- Covariance:
\cov
gives $\operatorname{cov}$\cov[t]
gives $\operatorname{cov}_t$\cov{X}
gives $\operatorname{cov}(X)$, where the parentheses scale automatically\cov[t]{X}
gives $\operatorname{cov}_t(X)$, where the parentheses scale
- Correlation:
\corr
gives $\operatorname{corr}$\corr[t]
gives $\operatorname{corr}_t$\corr{X}
gives $\operatorname{corr}(X)$, where the parentheses scale automatically\corr[t]{X}
gives $\operatorname{corr}_t(X)$, where the parentheses scale
- Standard deviation:
\sd
gives $\operatorname{sd}$\sd[t]
gives $\operatorname{sd}_t$\sd{X}
gives $\operatorname{sd}(X)$, where the parentheses scale automatically\sd[t]{X}
gives $\operatorname{sd}_t(X)$, where the parentheses scale
- Standard error:
\se
gives $\operatorname{se}$\se[t]
gives $\operatorname{se}_t$\se{X}
gives $\operatorname{se}(X)$, where the parentheses scale automatically\se[t]{X}
gives $\operatorname{se}_t(X)$, where the parentheses scale
- Maximum:
\max
gives $\max$\max[x]
gives $\max_x$\max{y}
gives ${\max}{\lbrace y\rbrace}$, where the brackets scale automatically\max[x]{y}
gives ${\max_x}{\lbrace y\rbrace}$, where the brackets scale automatically\argmax
gives $\operatorname{argmax}$
- Minimum:
\min
gives $\min$\min[x]
gives $\min_x$\min{y}
gives ${\min}{\lbrace y\rbrace}$, where the brackets scale automatically\min[x]{y}
gives ${\min_x}{\lbrace y\rbrace}$, where the brackets scale automatically\argmin
gives $\operatorname{argmin}$
- Supremum:
\sup
gives $\sup$\sup[x]
gives $\sup_x$\sup{y}
gives ${\sup}{\lbrace y\rbrace}$, where the brackets scale automatically\sup[x]{y}
gives ${\sup_x}{\lbrace y\rbrace}$, where the brackets scale automatically
- Infimum:
\inf
gives $\inf$\inf[x]
gives $\inf_x$\inf{y}
gives ${\inf}{\lbrace y\rbrace}$, where the brackets scale automatically\inf[x]{y}
gives ${\inf_x}{\lbrace y\rbrace}$, where the brackets scale automatically
- Expectation:
\E
gives $\mathbb{E}$\E[t]
gives $\mathbb{E}_t$\E{X}
gives $\mathbb{E}(X)$, where the brackets scale automatically\E[t]{X}
gives $\mathbb{E}_t(X)$, where the brackets scale automatically
- Probability:
\P
gives $\mathbb{P}$\P[t]
gives $\mathbb{P}_t$\P{X}
gives $\mathbb{P}(X)$, where the brackets scale automatically\P[t]{X}
gives $\mathbb{P}_t(X)$, where the brackets scale automatically
Derivatives
- Ordinary derivative of $x$ with respect to $y$:
- Display:
\od{x}{y}
gives $\frac{d x}{d y}$ - Display, nth order:
\od[n]{x}{y}
gives $\frac{d^n x}{d y^n}$ - Text:
\odx{x}{y}
gives $d x/d y$ - Text, nth order:
\odx[n]{x}{y}
gives $d^n x/d y^n$
- Display:
- Partial derivative of $x$ with respect to $y$:
- Display:
\pd{x}{y}
gives $\frac{\partial x}{\partial y}$ - Display, nth order:
\pd[n]{x}{y}
gives $\frac{\partial^n x}{\partial y^n}$ - Text:
\pdx{x}{y}
gives $\partial x/\partial y$ - Text, nth order:
\pdx[n]{x}{y}
gives $\partial^n x/\partial y^n$ - Display, keeping $z$ constant:
\pd{x}{y}{z}
gives $\left.\frac{\partial x}{\partial y}\right\vert_{z}$ - Text, keeping $z$ constant:
\pdx{x}{y}{z}
gives $\left.\partial x/\partial y\right\vert_{z}$
- Display:
- Ordinary elasticity of $x$ with respect to $y$:
- Display:
\oe{x}{y}
gives $\frac{d\ln x}{d\ln y}$ - Text:
\oex{x}{y}
gives $d\ln(x)/d\ln(y)$
- Display:
- Partial elasticity of $x$ with respect to $y$:
- Display:
\pe{x}{y}
gives $\frac{\partial\ln(x)}{\partial\ln(y)}$ - Text:
\pex{x}{y}
gives $\partial\ln(x)/\partial\ln(y)$ - Display, keeping $z$ constant:
\pe{x}{y}{z}
gives $\left.\frac{\partial\ln(x)}{\partial\ln(y)}\right\vert_{z}$ - Text, keeping $z$ constant:
\pex{x}{y}{z}
gives $\left.\partial\ln(x)/\partial\ln(y)\right\vert_{z}$
- Display:
Statistical commands
- Independent and identically distributed variables:
\iid
gives $\mathbin{\overset{iid}{\sim}}$ - Almost sure convergence:
\asto
gives $\mathbin{\overset{as}{\to}}$ - Convergence in probability:
\pto
gives $\mathbin{\overset{p}{\to}}$ - Convergence in distribution:
\dto
gives $\mathbin{\overset{d}{\to}}$ - Essential infimum and supremum:
\ees
gives $\operatorname{ees}$
Blackboard letters
\R
gives $\mathbb{R}$\N
gives $\mathbb{N}$\Z
gives $\mathbb{Z}$\Q
gives $\mathbb{Q}$\C
gives $\mathbb{C}$\I
gives $\mathbb{I}$
Calligraphic letters
\Ac
gives $\mathcal{A}$\Bc
gives $\mathcal{B}$\Cc
gives $\mathcal{C}$\Dc
gives $\mathcal{D}$\Ec
gives $\mathcal{E}$\Fc
gives $\mathcal{F}$\Gc
gives $\mathcal{G}$\Hc
gives $\mathcal{H}$\Ic
gives $\mathcal{I}$\Jc
gives $\mathcal{J}$\Kc
gives $\mathcal{K}$\Lc
gives $\mathcal{L}$\Mc
gives $\mathcal{M}$\Nc
gives $\mathcal{N}$\Oc
gives $\mathcal{O}$\Pc
gives $\mathcal{P}$\Qc
gives $\mathcal{Q}$\Rc
gives $\mathcal{R}$\Sc
gives $\mathcal{S}$\Tc
gives $\mathcal{T}$\Uc
gives $\mathcal{U}$\Vc
gives $\mathcal{V}$\Wc
gives $\mathcal{W}$\Xc
gives $\mathcal{X}$\Yc
gives $\mathcal{Y}$\Zc
gives $\mathcal{Z}$
Greek letters
\a
gives $\alpha$\b
gives $\beta$\c
gives $\chi$\d
gives $\delta$\D
gives $\Delta$\e
gives $\epsilon$\ve
gives $\varepsilon$\f
gives $\phi$\vf
gives $\varphi$\F
gives $\Phi$\g
gives $\gamma$\G
gives $\Gamma$\h
gives $\eta$\i
gives $\iota$\k
gives $\kappa$\vk
gives $\varkappa$\l
gives $\lambda$\L
gives $\Lambda$\m
gives $\mu$\n
gives $\nu$\o
gives $\omega$\O
gives $\Omega$\vp
gives $\varpi$\p
gives $\psi$\P
gives $\Psi$\r
gives $\rho$\vr
gives $\varrho$\s
gives $\sigma$\vs
gives $\varsigma$\S
gives $\Sigma$\t
gives $\theta$\vt
gives $\vartheta$\T
gives $\Theta$\u
gives $\upsilon$\U
gives $\Upsilon$\x
gives $\xi$\X
gives $\Xi$\z
gives $\zeta$
Accents
- Over line:
\ol{x}
gives $\overline{x}$, where the line scales automatically - Over right arrow:
\oa{x}
gives $\overrightarrow{x}$, where the arrow scales automatically - Under line:
\ul{x}
gives $\underline{x}$, where the line scales automatically - Hat:
\wh{x}
gives $\widehat{x}$, where the hat scales automatically - Tilde:
\wt{x}
gives $\widetilde{x}$, where the tilde scales automatically
Complex numbers
\Re
gives $\operatorname{Re}$\Im
gives $\operatorname{Im}$
Existing math commands
Existing LaTeX commands continue to work as usual, with the exception of a few text commands that do not produce their usual output. These modified text commands are \oe
, \o
, and \P
. These commands used to insert text symbols that are rarely used in scientific writing ($\text{\oe}$, $\text{\o}$, and $\text{\P}$). The commands now insert common mathematical symbols, so hopefully the modification is not problematic.