misc

Latex tips & tricks

Nice looking function definitions in math mode.

\usepackage{mathtools}
...
$f \coloneqq \mathbb{R} \rightarrow \mathbb{R}$

Set builder notation.

\newcommand{setbuilder}[2]{\ensuremath{\{#1 \,|\, #2\}}}
...
$A = \setbuilder{w \in \mathbb{R}}{w \geq 0}$

Local (chapter or section) label names.

\newcommand{chplabel}[1]{\label{\thechapter:#1}}
\newcommand{chpref}[1]{\ref{\thechapter:#1}}
\newcommand{seclabel}[1]{\label{\thesection:#1}}
\newcommand{secref}[1]{\ref{\thesection:#1}}