%%%-------------------------------------------------------------------------%%%
% Required packages
\usepackage{amsmath}

% Set up tensor font
\DeclareMathAlphabet{\mathsfit}{\encodingdefault}{\sfdefault}{m}{sl}
\SetMathAlphabet{\mathsfit}{bold}{\encodingdefault}{\sfdefault}{bx}{n}

%%%-------------------------------------------------------------------------%%%
%% Remark
% \em is useful for long texts (\emph e.g. doesn't allow the argument to contain a \par). The commands differ (like the \textit/\itshape) in their handling of the italic correction
% \def is a TeX primitive, \newcommand is a LaTeX overlay on top of \def. The most obvious benefits of \newcommand over \def are:
    % \newcommand checks whether or not the command already exists
    % \newcommand allows you to define an optional argument

%%%-------------------------------------------------------------------------%%%
%% Optional math commands from https://github.com/goodfeli/dlbook_notation/blob/master/math_commands.tex

%% Math Symbols (def)
% Vectors                  % Elements of vectors  % Matrix                   % Entries of a matrix
\newcommand{\va}{{\bm{a}}} \newcommand{\eva}{{a}} \newcommand{\mA}{{\bm{A}}} \newcommand{\emA}{{A}}
\newcommand{\vb}{{\bm{b}}} \newcommand{\evb}{{b}} \newcommand{\mB}{{\bm{B}}} \newcommand{\emB}{{B}}
\newcommand{\vc}{{\bm{c}}} \newcommand{\evc}{{c}} \newcommand{\mC}{{\bm{C}}} \newcommand{\emC}{{C}}
\newcommand{\vd}{{\bm{d}}} \newcommand{\evd}{{d}} \newcommand{\mD}{{\bm{D}}} \newcommand{\emD}{{D}}
\newcommand{\ve}{{\bm{e}}} \newcommand{\eve}{{e}} \newcommand{\mE}{{\bm{E}}} \newcommand{\emE}{{E}}
\newcommand{\vf}{{\bm{f}}} \newcommand{\evf}{{f}} \newcommand{\mF}{{\bm{F}}} \newcommand{\emF}{{F}}
\newcommand{\vg}{{\bm{g}}} \newcommand{\evg}{{g}} \newcommand{\mG}{{\bm{G}}} \newcommand{\emG}{{G}}
\newcommand{\vh}{{\bm{h}}} \newcommand{\evh}{{h}} \newcommand{\mH}{{\bm{H}}} \newcommand{\emH}{{H}}
\newcommand{\vi}{{\bm{i}}} \newcommand{\evi}{{i}} \newcommand{\mI}{{\bm{I}}} \newcommand{\emI}{{I}}
\newcommand{\vj}{{\bm{j}}} \newcommand{\evj}{{j}} \newcommand{\mJ}{{\bm{J}}} \newcommand{\emJ}{{J}}
\newcommand{\vk}{{\bm{k}}} \newcommand{\evk}{{k}} \newcommand{\mK}{{\bm{K}}} \newcommand{\emK}{{K}}
\newcommand{\vl}{{\bm{l}}} \newcommand{\evl}{{l}} \newcommand{\mL}{{\bm{L}}} \newcommand{\emL}{{L}}
\newcommand{\vm}{{\bm{m}}} \newcommand{\evm}{{m}} \newcommand{\mM}{{\bm{M}}} \newcommand{\emM}{{M}}
\newcommand{\vn}{{\bm{n}}} \newcommand{\evn}{{n}} \newcommand{\mN}{{\bm{N}}} \newcommand{\emN}{{N}}
\newcommand{\vo}{{\bm{o}}} \newcommand{\evo}{{o}} \newcommand{\mO}{{\bm{O}}} \newcommand{\emO}{{O}}
\newcommand{\vp}{{\bm{p}}} \newcommand{\evp}{{p}} \newcommand{\mP}{{\bm{P}}} \newcommand{\emP}{{P}}
\newcommand{\vq}{{\bm{q}}} \newcommand{\evq}{{q}} \newcommand{\mQ}{{\bm{Q}}} \newcommand{\emQ}{{Q}}
\newcommand{\vr}{{\bm{r}}} \newcommand{\evr}{{r}} \newcommand{\mR}{{\bm{R}}} \newcommand{\emR}{{R}}
\newcommand{\vs}{{\bm{s}}} \newcommand{\evs}{{s}} \newcommand{\mS}{{\bm{S}}} \newcommand{\emS}{{S}}
\newcommand{\vt}{{\bm{t}}} \newcommand{\evt}{{t}} \newcommand{\mT}{{\bm{T}}} \newcommand{\emT}{{T}}
\newcommand{\vu}{{\bm{u}}} \newcommand{\evu}{{u}} \newcommand{\mU}{{\bm{U}}} \newcommand{\emU}{{U}}
\newcommand{\vv}{{\bm{v}}} \newcommand{\evv}{{v}} \newcommand{\mV}{{\bm{V}}} \newcommand{\emV}{{V}}
\newcommand{\vw}{{\bm{w}}} \newcommand{\evw}{{w}} \newcommand{\mW}{{\bm{W}}} \newcommand{\emW}{{W}}
\newcommand{\vx}{{\bm{x}}} \newcommand{\evx}{{x}} \newcommand{\mX}{{\bm{X}}} \newcommand{\emX}{{X}}
\newcommand{\vy}{{\bm{y}}} \newcommand{\evy}{{y}} \newcommand{\mY}{{\bm{Y}}} \newcommand{\emY}{{Y}}
\newcommand{\vz}{{\bm{z}}} \newcommand{\evz}{{z}} \newcommand{\mZ}{{\bm{Z}}} \newcommand{\emZ}{{Z}}

% Random variables
\newcommand{\ra}{{\textnormal{a}}}
\newcommand{\rb}{{\textnormal{b}}}
\newcommand{\rc}{{\textnormal{c}}}
\newcommand{\rd}{{\textnormal{d}}}
\newcommand{\re}{{\textnormal{e}}}
\newcommand{\rf}{{\textnormal{f}}}
\newcommand{\rg}{{\textnormal{g}}}
\newcommand{\rh}{{\textnormal{h}}}
\newcommand{\ri}{{\textnormal{i}}}
\newcommand{\rj}{{\textnormal{j}}}
\newcommand{\rk}{{\textnormal{k}}}
\newcommand{\rl}{{\textnormal{l}}}
% rm is already a command, just don't name any random variables m
\newcommand{\rmm}{{\textnormal{m}}}
\newcommand{\rn}{{\textnormal{n}}}
\newcommand{\ro}{{\textnormal{o}}}
\newcommand{\rp}{{\textnormal{p}}}
% rq is already a command, just don't name any random variables q
\newcommand{\rqq}{{\textnormal{q}}}
\newcommand{\rr}{{\textnormal{r}}}
\newcommand{\rs}{{\textnormal{s}}}
\newcommand{\rt}{{\textnormal{t}}}
\newcommand{\ru}{{\textnormal{u}}}
\newcommand{\rv}{{\textnormal{v}}}
\newcommand{\rw}{{\textnormal{w}}}
\newcommand{\rx}{{\textnormal{x}}}
\newcommand{\ry}{{\textnormal{y}}}
\newcommand{\rz}{{\textnormal{z}}}

% Random vectors                % Elements of random vectors         % Random matrices               % Elements of random matrices
\newcommand{\rva}{{\mathbf{a}}} \newcommand{\erva}{{\textnormal{a}}} \newcommand{\rmA}{{\mathbf{A}}} \newcommand{\ermA}{{\textnormal{A}}}
\newcommand{\rvb}{{\mathbf{b}}} \newcommand{\ervb}{{\textnormal{b}}} \newcommand{\rmB}{{\mathbf{B}}} \newcommand{\ermB}{{\textnormal{B}}}
\newcommand{\rvc}{{\mathbf{c}}} \newcommand{\ervc}{{\textnormal{c}}} \newcommand{\rmC}{{\mathbf{C}}} \newcommand{\ermC}{{\textnormal{C}}}
\newcommand{\rvd}{{\mathbf{d}}} \newcommand{\ervd}{{\textnormal{d}}} \newcommand{\rmD}{{\mathbf{D}}} \newcommand{\ermD}{{\textnormal{D}}}
\newcommand{\rve}{{\mathbf{e}}} \newcommand{\erve}{{\textnormal{e}}} \newcommand{\rmE}{{\mathbf{E}}} \newcommand{\ermE}{{\textnormal{E}}}
\newcommand{\rvf}{{\mathbf{f}}} \newcommand{\ervf}{{\textnormal{f}}} \newcommand{\rmF}{{\mathbf{F}}} \newcommand{\ermF}{{\textnormal{F}}}
\newcommand{\rvg}{{\mathbf{g}}} \newcommand{\ervg}{{\textnormal{g}}} \newcommand{\rmG}{{\mathbf{G}}} \newcommand{\ermG}{{\textnormal{G}}}
\newcommand{\rvh}{{\mathbf{h}}} \newcommand{\ervh}{{\textnormal{h}}} \newcommand{\rmH}{{\mathbf{H}}} \newcommand{\ermH}{{\textnormal{H}}}
\newcommand{\rvi}{{\mathbf{i}}} \newcommand{\ervi}{{\textnormal{i}}} \newcommand{\rmI}{{\mathbf{I}}} \newcommand{\ermI}{{\textnormal{I}}}
\newcommand{\rvj}{{\mathbf{j}}} \newcommand{\ervj}{{\textnormal{j}}} \newcommand{\rmJ}{{\mathbf{J}}} \newcommand{\ermJ}{{\textnormal{J}}}
\newcommand{\rvk}{{\mathbf{k}}} \newcommand{\ervk}{{\textnormal{k}}} \newcommand{\rmK}{{\mathbf{K}}} \newcommand{\ermK}{{\textnormal{K}}}
\newcommand{\rvl}{{\mathbf{l}}} \newcommand{\ervl}{{\textnormal{l}}} \newcommand{\rmL}{{\mathbf{L}}} \newcommand{\ermL}{{\textnormal{L}}}
\newcommand{\rvm}{{\mathbf{m}}} \newcommand{\ervm}{{\textnormal{m}}} \newcommand{\rmM}{{\mathbf{M}}} \newcommand{\ermM}{{\textnormal{M}}}
\newcommand{\rvn}{{\mathbf{n}}} \newcommand{\ervn}{{\textnormal{n}}} \newcommand{\rmN}{{\mathbf{N}}} \newcommand{\ermN}{{\textnormal{N}}}
\newcommand{\rvo}{{\mathbf{o}}} \newcommand{\ervo}{{\textnormal{o}}} \newcommand{\rmO}{{\mathbf{O}}} \newcommand{\ermO}{{\textnormal{O}}}
\newcommand{\rvp}{{\mathbf{p}}} \newcommand{\ervp}{{\textnormal{p}}} \newcommand{\rmP}{{\mathbf{P}}} \newcommand{\ermP}{{\textnormal{P}}}
\newcommand{\rvq}{{\mathbf{q}}} \newcommand{\ervq}{{\textnormal{q}}} \newcommand{\rmQ}{{\mathbf{Q}}} \newcommand{\ermQ}{{\textnormal{Q}}}
\newcommand{\rvr}{{\mathbf{r}}} \newcommand{\ervr}{{\textnormal{r}}} \newcommand{\rmR}{{\mathbf{R}}} \newcommand{\ermR}{{\textnormal{R}}}
\newcommand{\rvs}{{\mathbf{s}}} \newcommand{\ervs}{{\textnormal{s}}} \newcommand{\rmS}{{\mathbf{S}}} \newcommand{\ermS}{{\textnormal{S}}}
\newcommand{\rvt}{{\mathbf{t}}} \newcommand{\ervt}{{\textnormal{t}}} \newcommand{\rmT}{{\mathbf{T}}} \newcommand{\ermT}{{\textnormal{T}}}
\newcommand{\rvu}{{\mathbf{u}}} \newcommand{\ervu}{{\textnormal{u}}} \newcommand{\rmU}{{\mathbf{U}}} \newcommand{\ermU}{{\textnormal{U}}}
\newcommand{\rvv}{{\mathbf{v}}} \newcommand{\ervv}{{\textnormal{v}}} \newcommand{\rmV}{{\mathbf{V}}} \newcommand{\ermV}{{\textnormal{V}}}
\newcommand{\rvw}{{\mathbf{w}}} \newcommand{\ervw}{{\textnormal{w}}} \newcommand{\rmW}{{\mathbf{W}}} \newcommand{\ermW}{{\textnormal{W}}}
\newcommand{\rvx}{{\mathbf{x}}} \newcommand{\ervx}{{\textnormal{x}}} \newcommand{\rmX}{{\mathbf{X}}} \newcommand{\ermX}{{\textnormal{X}}}
\newcommand{\rvy}{{\mathbf{y}}} \newcommand{\ervy}{{\textnormal{y}}} \newcommand{\rmY}{{\mathbf{Y}}} \newcommand{\ermY}{{\textnormal{Y}}}
\newcommand{\rvz}{{\mathbf{z}}} \newcommand{\ervz}{{\textnormal{z}}} \newcommand{\rmZ}{{\mathbf{Z}}} \newcommand{\ermZ}{{\textnormal{Z}}}

% Don't use a set called E, because this would be the same as our symbol for expectation.
% Set                          % Graph
\newcommand{\sA}{{\mathbb{A}}} \newcommand{\gA}{{\mathcal{A}}}
\newcommand{\sB}{{\mathbb{B}}} \newcommand{\gB}{{\mathcal{B}}}
\newcommand{\sC}{{\mathbb{C}}} \newcommand{\gC}{{\mathcal{C}}}
\newcommand{\sD}{{\mathbb{D}}} \newcommand{\gD}{{\mathcal{D}}}
\newcommand{\sE}{{\mathbb{E}}} \newcommand{\gE}{{\mathcal{E}}}
\newcommand{\sF}{{\mathbb{F}}} \newcommand{\gF}{{\mathcal{F}}}
\newcommand{\sG}{{\mathbb{G}}} \newcommand{\gG}{{\mathcal{G}}}
\newcommand{\sH}{{\mathbb{H}}} \newcommand{\gH}{{\mathcal{H}}}
\newcommand{\sI}{{\mathbb{I}}} \newcommand{\gI}{{\mathcal{I}}}
\newcommand{\sJ}{{\mathbb{J}}} \newcommand{\gJ}{{\mathcal{J}}}
\newcommand{\sK}{{\mathbb{K}}} \newcommand{\gK}{{\mathcal{K}}}
\newcommand{\sL}{{\mathbb{L}}} \newcommand{\gL}{{\mathcal{L}}}
\newcommand{\sM}{{\mathbb{M}}} \newcommand{\gM}{{\mathcal{M}}}
\newcommand{\sN}{{\mathbb{N}}} \newcommand{\gN}{{\mathcal{N}}}
\newcommand{\sO}{{\mathbb{O}}} \newcommand{\gO}{{\mathcal{O}}}
\newcommand{\sP}{{\mathbb{P}}} \newcommand{\gP}{{\mathcal{P}}}
\newcommand{\sQ}{{\mathbb{Q}}} \newcommand{\gQ}{{\mathcal{Q}}}
\newcommand{\sR}{{\mathbb{R}}} \newcommand{\gR}{{\mathcal{R}}}
\newcommand{\sS}{{\mathbb{S}}} \newcommand{\gS}{{\mathcal{S}}}
\newcommand{\sT}{{\mathbb{T}}} \newcommand{\gT}{{\mathcal{T}}}
\newcommand{\sU}{{\mathbb{U}}} \newcommand{\gU}{{\mathcal{U}}}
\newcommand{\sV}{{\mathbb{V}}} \newcommand{\gV}{{\mathcal{V}}}
\newcommand{\sW}{{\mathbb{W}}} \newcommand{\gW}{{\mathcal{W}}}
\newcommand{\sX}{{\mathbb{X}}} \newcommand{\gX}{{\mathcal{X}}}
\newcommand{\sY}{{\mathbb{Y}}} \newcommand{\gY}{{\mathcal{Y}}}
\newcommand{\sZ}{{\mathbb{Z}}} \newcommand{\gZ}{{\mathcal{Z}}}

% Tensor
\newcommand{\tens}[1]{\bm{\mathsfit{#1}}} % Tensor
\newcommand{\etens}[1]{\mathsfit{#1}} % Same font as tensor, without \bm wrapper
% Tensor                     % Entries of a tensor
\newcommand{\tA}{{\tens{A}}} \newcommand{\etA}{{\etens{A}}}
\newcommand{\tB}{{\tens{B}}} \newcommand{\etB}{{\etens{B}}}
\newcommand{\tC}{{\tens{C}}} \newcommand{\etC}{{\etens{C}}}
\newcommand{\tD}{{\tens{D}}} \newcommand{\etD}{{\etens{D}}}
\newcommand{\tE}{{\tens{E}}} \newcommand{\etE}{{\etens{E}}}
\newcommand{\tF}{{\tens{F}}} \newcommand{\etF}{{\etens{F}}}
\newcommand{\tG}{{\tens{G}}} \newcommand{\etG}{{\etens{G}}}
\newcommand{\tH}{{\tens{H}}} \newcommand{\etH}{{\etens{H}}}
\newcommand{\tI}{{\tens{I}}} \newcommand{\etI}{{\etens{I}}}
\newcommand{\tJ}{{\tens{J}}} \newcommand{\etJ}{{\etens{J}}}
\newcommand{\tK}{{\tens{K}}} \newcommand{\etK}{{\etens{K}}}
\newcommand{\tL}{{\tens{L}}} \newcommand{\etL}{{\etens{L}}}
\newcommand{\tM}{{\tens{M}}} \newcommand{\etM}{{\etens{M}}}
\newcommand{\tN}{{\tens{N}}} \newcommand{\etN}{{\etens{N}}}
\newcommand{\tO}{{\tens{O}}} \newcommand{\etO}{{\etens{O}}}
\newcommand{\tP}{{\tens{P}}} \newcommand{\etP}{{\etens{P}}}
\newcommand{\tQ}{{\tens{Q}}} \newcommand{\etQ}{{\etens{Q}}}
\newcommand{\tR}{{\tens{R}}} \newcommand{\etR}{{\etens{R}}}
\newcommand{\tS}{{\tens{S}}} \newcommand{\etS}{{\etens{S}}}
\newcommand{\tT}{{\tens{T}}} \newcommand{\etT}{{\etens{T}}}
\newcommand{\tU}{{\tens{U}}} \newcommand{\etU}{{\etens{U}}}
\newcommand{\tV}{{\tens{V}}} \newcommand{\etV}{{\etens{V}}}
\newcommand{\tW}{{\tens{W}}} \newcommand{\etW}{{\etens{W}}}
\newcommand{\tX}{{\tens{X}}} \newcommand{\etX}{{\etens{X}}}
\newcommand{\tY}{{\tens{Y}}} \newcommand{\etY}{{\etens{Y}}}
\newcommand{\tZ}{{\tens{Z}}} \newcommand{\etZ}{{\etens{Z}}}

%%%-------------------------------------------------------------------------%%%
%% Optional command from author.

% textnormal = $\text{}$
\newcommand{\tnla}{{\textnormal{a}}} \newcommand{\tnlA}{{\textnormal{A}}}
\newcommand{\tnlb}{{\textnormal{b}}} \newcommand{\tnlB}{{\textnormal{B}}}
\newcommand{\tnlc}{{\textnormal{c}}} \newcommand{\tnlC}{{\textnormal{C}}}
\newcommand{\tnld}{{\textnormal{d}}} \newcommand{\tnlD}{{\textnormal{D}}}
\newcommand{\tnle}{{\textnormal{e}}} \newcommand{\tnlE}{{\textnormal{E}}}
\newcommand{\tnlf}{{\textnormal{f}}} \newcommand{\tnlF}{{\textnormal{F}}}
\newcommand{\tnlg}{{\textnormal{g}}} \newcommand{\tnlG}{{\textnormal{G}}}
\newcommand{\tnlh}{{\textnormal{h}}} \newcommand{\tnlH}{{\textnormal{H}}}
\newcommand{\tnli}{{\textnormal{i}}} \newcommand{\tnlI}{{\textnormal{I}}}
\newcommand{\tnlj}{{\textnormal{j}}} \newcommand{\tnlJ}{{\textnormal{J}}}
\newcommand{\tnlk}{{\textnormal{k}}} \newcommand{\tnlK}{{\textnormal{K}}}
\newcommand{\tnll}{{\textnormal{l}}} \newcommand{\tnlL}{{\textnormal{L}}}
\newcommand{\tnlm}{{\textnormal{m}}} \newcommand{\tnlM}{{\textnormal{M}}}
\newcommand{\tnln}{{\textnormal{n}}} \newcommand{\tnlN}{{\textnormal{N}}}
\newcommand{\tnlo}{{\textnormal{o}}} \newcommand{\tnlO}{{\textnormal{O}}}
\newcommand{\tnlp}{{\textnormal{p}}} \newcommand{\tnlP}{{\textnormal{P}}}
\newcommand{\tnlq}{{\textnormal{q}}} \newcommand{\tnlQ}{{\textnormal{Q}}}
\newcommand{\tnlr}{{\textnormal{r}}} \newcommand{\tnlR}{{\textnormal{R}}}
\newcommand{\tnls}{{\textnormal{s}}} \newcommand{\tnlS}{{\textnormal{S}}}
\newcommand{\tnlt}{{\textnormal{t}}} \newcommand{\tnlT}{{\textnormal{T}}}
\newcommand{\tnlu}{{\textnormal{u}}} \newcommand{\tnlU}{{\textnormal{U}}}
\newcommand{\tnlv}{{\textnormal{v}}} \newcommand{\tnlV}{{\textnormal{V}}}
\newcommand{\tnlw}{{\textnormal{w}}} \newcommand{\tnlW}{{\textnormal{W}}}
\newcommand{\tnlx}{{\textnormal{x}}} \newcommand{\tnlX}{{\textnormal{X}}}
\newcommand{\tnly}{{\textnormal{y}}} \newcommand{\tnlY}{{\textnormal{Y}}}
\newcommand{\tnlz}{{\textnormal{z}}} \newcommand{\tnlZ}{{\textnormal{Z}}}

% mathnormal = $$
\newcommand{\mnla}{{\mathnormal{a}}} \newcommand{\mnlA}{{\mathnormal{A}}}
\newcommand{\mnlb}{{\mathnormal{b}}} \newcommand{\mnlB}{{\mathnormal{B}}}
\newcommand{\mnlc}{{\mathnormal{c}}} \newcommand{\mnlC}{{\mathnormal{C}}}
\newcommand{\mnld}{{\mathnormal{d}}} \newcommand{\mnlD}{{\mathnormal{D}}}
\newcommand{\mnle}{{\mathnormal{e}}} \newcommand{\mnlE}{{\mathnormal{E}}}
\newcommand{\mnlf}{{\mathnormal{f}}} \newcommand{\mnlF}{{\mathnormal{F}}}
\newcommand{\mnlg}{{\mathnormal{g}}} \newcommand{\mnlG}{{\mathnormal{G}}}
\newcommand{\mnlh}{{\mathnormal{h}}} \newcommand{\mnlH}{{\mathnormal{H}}}
\newcommand{\mnli}{{\mathnormal{i}}} \newcommand{\mnlI}{{\mathnormal{I}}}
\newcommand{\mnlj}{{\mathnormal{j}}} \newcommand{\mnlJ}{{\mathnormal{J}}}
\newcommand{\mnlk}{{\mathnormal{k}}} \newcommand{\mnlK}{{\mathnormal{K}}}
\newcommand{\mnll}{{\mathnormal{l}}} \newcommand{\mnlL}{{\mathnormal{L}}}
\newcommand{\mnlm}{{\mathnormal{m}}} \newcommand{\mnlM}{{\mathnormal{M}}}
\newcommand{\mnln}{{\mathnormal{n}}} \newcommand{\mnlN}{{\mathnormal{N}}}
\newcommand{\mnlo}{{\mathnormal{o}}} \newcommand{\mnlO}{{\mathnormal{O}}}
\newcommand{\mnlp}{{\mathnormal{p}}} \newcommand{\mnlP}{{\mathnormal{P}}}
\newcommand{\mnlq}{{\mathnormal{q}}} \newcommand{\mnlQ}{{\mathnormal{Q}}}
\newcommand{\mnlr}{{\mathnormal{r}}} \newcommand{\mnlR}{{\mathnormal{R}}}
\newcommand{\mnls}{{\mathnormal{s}}} \newcommand{\mnlS}{{\mathnormal{S}}}
\newcommand{\mnlt}{{\mathnormal{t}}} \newcommand{\mnlT}{{\mathnormal{T}}}
\newcommand{\mnlu}{{\mathnormal{u}}} \newcommand{\mnlU}{{\mathnormal{U}}}
\newcommand{\mnlv}{{\mathnormal{v}}} \newcommand{\mnlV}{{\mathnormal{V}}}
\newcommand{\mnlw}{{\mathnormal{w}}} \newcommand{\mnlW}{{\mathnormal{W}}}
\newcommand{\mnlx}{{\mathnormal{x}}} \newcommand{\mnlX}{{\mathnormal{X}}}
\newcommand{\mnly}{{\mathnormal{y}}} \newcommand{\mnlY}{{\mathnormal{Y}}}
\newcommand{\mnlz}{{\mathnormal{z}}} \newcommand{\mnlZ}{{\mathnormal{Z}}}

% roman font
\newcommand{\mrma}{{\mathrm{a}}} \newcommand{\mrmA}{{\mathrm{A}}}
\newcommand{\mrmb}{{\mathrm{b}}} \newcommand{\mrmB}{{\mathrm{B}}}
\newcommand{\mrmc}{{\mathrm{c}}} \newcommand{\mrmC}{{\mathrm{C}}}
\newcommand{\mrmd}{{\mathrm{d}}} \newcommand{\mrmD}{{\mathrm{D}}}
\newcommand{\mrme}{{\mathrm{e}}} \newcommand{\mrmE}{{\mathrm{E}}}
\newcommand{\mrmf}{{\mathrm{f}}} \newcommand{\mrmF}{{\mathrm{F}}}
\newcommand{\mrmg}{{\mathrm{g}}} \newcommand{\mrmG}{{\mathrm{G}}}
\newcommand{\mrmh}{{\mathrm{h}}} \newcommand{\mrmH}{{\mathrm{H}}}
\newcommand{\mrmi}{{\mathrm{i}}} \newcommand{\mrmI}{{\mathrm{I}}}
\newcommand{\mrmj}{{\mathrm{j}}} \newcommand{\mrmJ}{{\mathrm{J}}}
\newcommand{\mrmk}{{\mathrm{k}}} \newcommand{\mrmK}{{\mathrm{K}}}
\newcommand{\mrml}{{\mathrm{l}}} \newcommand{\mrmL}{{\mathrm{L}}}
\newcommand{\mrmm}{{\mathrm{m}}} \newcommand{\mrmM}{{\mathrm{M}}}
\newcommand{\mrmn}{{\mathrm{n}}} \newcommand{\mrmN}{{\mathrm{N}}}
\newcommand{\mrmo}{{\mathrm{o}}} \newcommand{\mrmO}{{\mathrm{O}}}
\newcommand{\mrmp}{{\mathrm{p}}} \newcommand{\mrmP}{{\mathrm{P}}}
\newcommand{\mrmq}{{\mathrm{q}}} \newcommand{\mrmQ}{{\mathrm{Q}}}
\newcommand{\mrmr}{{\mathrm{r}}} \newcommand{\mrmR}{{\mathrm{R}}}
\newcommand{\mrms}{{\mathrm{s}}} \newcommand{\mrmS}{{\mathrm{S}}}
\newcommand{\mrmt}{{\mathrm{t}}} \newcommand{\mrmT}{{\mathrm{T}}}
\newcommand{\mrmu}{{\mathrm{u}}} \newcommand{\mrmU}{{\mathrm{U}}}
\newcommand{\mrmv}{{\mathrm{v}}} \newcommand{\mrmV}{{\mathrm{V}}}
\newcommand{\mrmw}{{\mathrm{w}}} \newcommand{\mrmW}{{\mathrm{W}}}
\newcommand{\mrmx}{{\mathrm{x}}} \newcommand{\mrmX}{{\mathrm{X}}}
\newcommand{\mrmy}{{\mathrm{y}}} \newcommand{\mrmY}{{\mathrm{Y}}}
\newcommand{\mrmz}{{\mathrm{z}}} \newcommand{\mrmZ}{{\mathrm{Z}}}

% Bold roman font
\newcommand{\mbfa}{{\mathbf{a}}} \newcommand{\mbfA}{{\mathbf{A}}}
\newcommand{\mbfb}{{\mathbf{b}}} \newcommand{\mbfB}{{\mathbf{B}}}
\newcommand{\mbfc}{{\mathbf{c}}} \newcommand{\mbfC}{{\mathbf{C}}}
\newcommand{\mbfd}{{\mathbf{d}}} \newcommand{\mbfD}{{\mathbf{D}}}
\newcommand{\mbfe}{{\mathbf{e}}} \newcommand{\mbfE}{{\mathbf{E}}}
\newcommand{\mbff}{{\mathbf{f}}} \newcommand{\mbfF}{{\mathbf{F}}}
\newcommand{\mbfg}{{\mathbf{g}}} \newcommand{\mbfG}{{\mathbf{G}}}
\newcommand{\mbfh}{{\mathbf{h}}} \newcommand{\mbfH}{{\mathbf{H}}}
\newcommand{\mbfi}{{\mathbf{i}}} \newcommand{\mbfI}{{\mathbf{I}}}
\newcommand{\mbfj}{{\mathbf{j}}} \newcommand{\mbfJ}{{\mathbf{J}}}
\newcommand{\mbfk}{{\mathbf{k}}} \newcommand{\mbfK}{{\mathbf{K}}}
\newcommand{\mbfl}{{\mathbf{l}}} \newcommand{\mbfL}{{\mathbf{L}}}
\newcommand{\mbfm}{{\mathbf{m}}} \newcommand{\mbfM}{{\mathbf{M}}}
\newcommand{\mbfn}{{\mathbf{n}}} \newcommand{\mbfN}{{\mathbf{N}}}
\newcommand{\mbfo}{{\mathbf{o}}} \newcommand{\mbfO}{{\mathbf{O}}}
\newcommand{\mbfp}{{\mathbf{p}}} \newcommand{\mbfP}{{\mathbf{P}}}
\newcommand{\mbfq}{{\mathbf{q}}} \newcommand{\mbfQ}{{\mathbf{Q}}}
\newcommand{\mbfr}{{\mathbf{r}}} \newcommand{\mbfR}{{\mathbf{R}}}
\newcommand{\mbfs}{{\mathbf{s}}} \newcommand{\mbfS}{{\mathbf{S}}}
\newcommand{\mbft}{{\mathbf{t}}} \newcommand{\mbfT}{{\mathbf{T}}}
\newcommand{\mbfu}{{\mathbf{u}}} \newcommand{\mbfU}{{\mathbf{U}}}
\newcommand{\mbfv}{{\mathbf{v}}} \newcommand{\mbfV}{{\mathbf{V}}}
\newcommand{\mbfw}{{\mathbf{w}}} \newcommand{\mbfW}{{\mathbf{W}}}
\newcommand{\mbfx}{{\mathbf{x}}} \newcommand{\mbfX}{{\mathbf{X}}}
\newcommand{\mbfy}{{\mathbf{y}}} \newcommand{\mbfY}{{\mathbf{Y}}}
\newcommand{\mbfz}{{\mathbf{z}}} \newcommand{\mbfZ}{{\mathbf{Z}}}

% sans serif font
\newcommand{\msfa}{{\mathsf{a}}} \newcommand{\msfA}{{\mathsf{A}}}
\newcommand{\msfb}{{\mathsf{b}}} \newcommand{\msfB}{{\mathsf{B}}}
\newcommand{\msfc}{{\mathsf{c}}} \newcommand{\msfC}{{\mathsf{C}}}
\newcommand{\msfd}{{\mathsf{d}}} \newcommand{\msfD}{{\mathsf{D}}}
\newcommand{\msfe}{{\mathsf{e}}} \newcommand{\msfE}{{\mathsf{E}}}
\newcommand{\msff}{{\mathsf{f}}} \newcommand{\msfF}{{\mathsf{F}}}
\newcommand{\msfg}{{\mathsf{g}}} \newcommand{\msfG}{{\mathsf{G}}}
\newcommand{\msfh}{{\mathsf{h}}} \newcommand{\msfH}{{\mathsf{H}}}
\newcommand{\msfi}{{\mathsf{i}}} \newcommand{\msfI}{{\mathsf{I}}}
\newcommand{\msfj}{{\mathsf{j}}} \newcommand{\msfJ}{{\mathsf{J}}}
\newcommand{\msfk}{{\mathsf{k}}} \newcommand{\msfK}{{\mathsf{K}}}
\newcommand{\msfl}{{\mathsf{l}}} \newcommand{\msfL}{{\mathsf{L}}}
\newcommand{\msfm}{{\mathsf{m}}} \newcommand{\msfM}{{\mathsf{M}}}
\newcommand{\msfn}{{\mathsf{n}}} \newcommand{\msfN}{{\mathsf{N}}}
\newcommand{\msfo}{{\mathsf{o}}} \newcommand{\msfO}{{\mathsf{O}}}
\newcommand{\msfp}{{\mathsf{p}}} \newcommand{\msfP}{{\mathsf{P}}}
\newcommand{\msfq}{{\mathsf{q}}} \newcommand{\msfQ}{{\mathsf{Q}}}
\newcommand{\msfr}{{\mathsf{r}}} \newcommand{\msfR}{{\mathsf{R}}}
\newcommand{\msfs}{{\mathsf{s}}} \newcommand{\msfS}{{\mathsf{S}}}
\newcommand{\msft}{{\mathsf{t}}} \newcommand{\msfT}{{\mathsf{T}}}
\newcommand{\msfu}{{\mathsf{u}}} \newcommand{\msfU}{{\mathsf{U}}}
\newcommand{\msfv}{{\mathsf{v}}} \newcommand{\msfV}{{\mathsf{V}}}
\newcommand{\msfw}{{\mathsf{w}}} \newcommand{\msfW}{{\mathsf{W}}}
\newcommand{\msfx}{{\mathsf{x}}} \newcommand{\msfX}{{\mathsf{X}}}
\newcommand{\msfy}{{\mathsf{y}}} \newcommand{\msfY}{{\mathsf{Y}}}
\newcommand{\msfz}{{\mathsf{z}}} \newcommand{\msfZ}{{\mathsf{Z}}}

% text italic font
\newcommand{\mita}{{\mathit{a}}} \newcommand{\mitA}{{\mathit{A}}}
\newcommand{\mitb}{{\mathit{b}}} \newcommand{\mitB}{{\mathit{B}}}
\newcommand{\mitc}{{\mathit{c}}} \newcommand{\mitC}{{\mathit{C}}}
\newcommand{\mitd}{{\mathit{d}}} \newcommand{\mitD}{{\mathit{D}}}
\newcommand{\mite}{{\mathit{e}}} \newcommand{\mitE}{{\mathit{E}}}
\newcommand{\mitf}{{\mathit{f}}} \newcommand{\mitF}{{\mathit{F}}}
\newcommand{\mitg}{{\mathit{g}}} \newcommand{\mitG}{{\mathit{G}}}
\newcommand{\mith}{{\mathit{h}}} \newcommand{\mitH}{{\mathit{H}}}
\newcommand{\miti}{{\mathit{i}}} \newcommand{\mitI}{{\mathit{I}}}
\newcommand{\mitj}{{\mathit{j}}} \newcommand{\mitJ}{{\mathit{J}}}
\newcommand{\mitk}{{\mathit{k}}} \newcommand{\mitK}{{\mathit{K}}}
\newcommand{\mitl}{{\mathit{l}}} \newcommand{\mitL}{{\mathit{L}}}
\newcommand{\mitm}{{\mathit{m}}} \newcommand{\mitM}{{\mathit{M}}}
\newcommand{\mitn}{{\mathit{n}}} \newcommand{\mitN}{{\mathit{N}}}
\newcommand{\mito}{{\mathit{o}}} \newcommand{\mitO}{{\mathit{O}}}
\newcommand{\mitp}{{\mathit{p}}} \newcommand{\mitP}{{\mathit{P}}}
\newcommand{\mitq}{{\mathit{q}}} \newcommand{\mitQ}{{\mathit{Q}}}
\newcommand{\mitr}{{\mathit{r}}} \newcommand{\mitR}{{\mathit{R}}}
\newcommand{\mits}{{\mathit{s}}} \newcommand{\mitS}{{\mathit{S}}}
\newcommand{\mitt}{{\mathit{t}}} \newcommand{\mitT}{{\mathit{T}}}
\newcommand{\mitu}{{\mathit{u}}} \newcommand{\mitU}{{\mathit{U}}}
\newcommand{\mitv}{{\mathit{v}}} \newcommand{\mitV}{{\mathit{V}}}
\newcommand{\mitw}{{\mathit{w}}} \newcommand{\mitW}{{\mathit{W}}}
\newcommand{\mitx}{{\mathit{x}}} \newcommand{\mitX}{{\mathit{X}}}
\newcommand{\mity}{{\mathit{y}}} \newcommand{\mitY}{{\mathit{Y}}}
\newcommand{\mitz}{{\mathit{z}}} \newcommand{\mitZ}{{\mathit{Z}}}

% typewriter font
\newcommand{\mtta}{{\mathtt{a}}} \newcommand{\mttA}{{\mathtt{A}}}
\newcommand{\mttb}{{\mathtt{b}}} \newcommand{\mttB}{{\mathtt{B}}}
\newcommand{\mttc}{{\mathtt{c}}} \newcommand{\mttC}{{\mathtt{C}}}
\newcommand{\mttd}{{\mathtt{d}}} \newcommand{\mttD}{{\mathtt{D}}}
\newcommand{\mtte}{{\mathtt{e}}} \newcommand{\mttE}{{\mathtt{E}}}
\newcommand{\mttf}{{\mathtt{f}}} \newcommand{\mttF}{{\mathtt{F}}}
\newcommand{\mttg}{{\mathtt{g}}} \newcommand{\mttG}{{\mathtt{G}}}
\newcommand{\mtth}{{\mathtt{h}}} \newcommand{\mttH}{{\mathtt{H}}}
\newcommand{\mtti}{{\mathtt{i}}} \newcommand{\mttI}{{\mathtt{I}}}
\newcommand{\mttj}{{\mathtt{j}}} \newcommand{\mttJ}{{\mathtt{J}}}
\newcommand{\mttk}{{\mathtt{k}}} \newcommand{\mttK}{{\mathtt{K}}}
\newcommand{\mttl}{{\mathtt{l}}} \newcommand{\mttL}{{\mathtt{L}}}
\newcommand{\mttm}{{\mathtt{m}}} \newcommand{\mttM}{{\mathtt{M}}}
\newcommand{\mttn}{{\mathtt{n}}} \newcommand{\mttN}{{\mathtt{N}}}
\newcommand{\mtto}{{\mathtt{o}}} \newcommand{\mttO}{{\mathtt{O}}}
\newcommand{\mttp}{{\mathtt{p}}} \newcommand{\mttP}{{\mathtt{P}}}
\newcommand{\mttq}{{\mathtt{q}}} \newcommand{\mttQ}{{\mathtt{Q}}}
\newcommand{\mttr}{{\mathtt{r}}} \newcommand{\mttR}{{\mathtt{R}}}
\newcommand{\mtts}{{\mathtt{s}}} \newcommand{\mttS}{{\mathtt{S}}}
\newcommand{\mttt}{{\mathtt{t}}} \newcommand{\mttT}{{\mathtt{T}}}
\newcommand{\mttu}{{\mathtt{u}}} \newcommand{\mttU}{{\mathtt{U}}}
\newcommand{\mttv}{{\mathtt{v}}} \newcommand{\mttV}{{\mathtt{V}}}
\newcommand{\mttw}{{\mathtt{w}}} \newcommand{\mttW}{{\mathtt{W}}}
\newcommand{\mttx}{{\mathtt{x}}} \newcommand{\mttX}{{\mathtt{X}}}
\newcommand{\mtty}{{\mathtt{y}}} \newcommand{\mttY}{{\mathtt{Y}}}
\newcommand{\mttz}{{\mathtt{z}}} \newcommand{\mttZ}{{\mathtt{Z}}}

% fraktur font
\newcommand{\mfraka}{{\mathfrak{a}}} \newcommand{\mfrakA}{{\mathfrak{A}}}
\newcommand{\mfrakb}{{\mathfrak{b}}} \newcommand{\mfrakB}{{\mathfrak{B}}}
\newcommand{\mfrakc}{{\mathfrak{c}}} \newcommand{\mfrakC}{{\mathfrak{C}}}
\newcommand{\mfrakd}{{\mathfrak{d}}} \newcommand{\mfrakD}{{\mathfrak{D}}}
\newcommand{\mfrake}{{\mathfrak{e}}} \newcommand{\mfrakE}{{\mathfrak{E}}}
\newcommand{\mfrakf}{{\mathfrak{f}}} \newcommand{\mfrakF}{{\mathfrak{F}}}
\newcommand{\mfrakg}{{\mathfrak{g}}} \newcommand{\mfrakG}{{\mathfrak{G}}}
\newcommand{\mfrakh}{{\mathfrak{h}}} \newcommand{\mfrakH}{{\mathfrak{H}}}
\newcommand{\mfraki}{{\mathfrak{i}}} \newcommand{\mfrakI}{{\mathfrak{I}}}
\newcommand{\mfrakj}{{\mathfrak{j}}} \newcommand{\mfrakJ}{{\mathfrak{J}}}
\newcommand{\mfrakk}{{\mathfrak{k}}} \newcommand{\mfrakK}{{\mathfrak{K}}}
\newcommand{\mfrakl}{{\mathfrak{l}}} \newcommand{\mfrakL}{{\mathfrak{L}}}
\newcommand{\mfrakm}{{\mathfrak{m}}} \newcommand{\mfrakM}{{\mathfrak{M}}}
\newcommand{\mfrakn}{{\mathfrak{n}}} \newcommand{\mfrakN}{{\mathfrak{N}}}
\newcommand{\mfrako}{{\mathfrak{o}}} \newcommand{\mfrakO}{{\mathfrak{O}}}
\newcommand{\mfrakp}{{\mathfrak{p}}} \newcommand{\mfrakP}{{\mathfrak{P}}}
\newcommand{\mfrakq}{{\mathfrak{q}}} \newcommand{\mfrakQ}{{\mathfrak{Q}}}
\newcommand{\mfrakr}{{\mathfrak{r}}} \newcommand{\mfrakR}{{\mathfrak{R}}}
\newcommand{\mfraks}{{\mathfrak{s}}} \newcommand{\mfrakS}{{\mathfrak{S}}}
\newcommand{\mfrakt}{{\mathfrak{t}}} \newcommand{\mfrakT}{{\mathfrak{T}}}
\newcommand{\mfraku}{{\mathfrak{u}}} \newcommand{\mfrakU}{{\mathfrak{U}}}
\newcommand{\mfrakv}{{\mathfrak{v}}} \newcommand{\mfrakV}{{\mathfrak{V}}}
\newcommand{\mfrakw}{{\mathfrak{w}}} \newcommand{\mfrakW}{{\mathfrak{W}}}
\newcommand{\mfrakx}{{\mathfrak{x}}} \newcommand{\mfrakX}{{\mathfrak{X}}}
\newcommand{\mfraky}{{\mathfrak{y}}} \newcommand{\mfrakY}{{\mathfrak{Y}}}
\newcommand{\mfrakz}{{\mathfrak{z}}} \newcommand{\mfrakZ}{{\mathfrak{Z}}}

% Set                            % Graph                            % Group (Algebra)
\newcommand{\mbbA}{{\mathbb{A}}} \newcommand{\mcalA}{{\mathcal{A}}} \newcommand{\mscrA}{{\mathscr{A}}}
\newcommand{\mbbB}{{\mathbb{B}}} \newcommand{\mcalB}{{\mathcal{B}}} \newcommand{\mscrB}{{\mathscr{B}}}
\newcommand{\mbbC}{{\mathbb{C}}} \newcommand{\mcalC}{{\mathcal{C}}} \newcommand{\mscrC}{{\mathscr{C}}}
\newcommand{\mbbD}{{\mathbb{D}}} \newcommand{\mcalD}{{\mathcal{D}}} \newcommand{\mscrD}{{\mathscr{D}}}
\newcommand{\mbbE}{{\mathbb{E}}} \newcommand{\mcalE}{{\mathcal{E}}} \newcommand{\mscrE}{{\mathscr{E}}}
\newcommand{\mbbF}{{\mathbb{F}}} \newcommand{\mcalF}{{\mathcal{F}}} \newcommand{\mscrF}{{\mathscr{F}}}
\newcommand{\mbbG}{{\mathbb{G}}} \newcommand{\mcalG}{{\mathcal{G}}} \newcommand{\mscrG}{{\mathscr{G}}}
\newcommand{\mbbH}{{\mathbb{H}}} \newcommand{\mcalH}{{\mathcal{H}}} \newcommand{\mscrH}{{\mathscr{H}}}
\newcommand{\mbbI}{{\mathbb{I}}} \newcommand{\mcalI}{{\mathcal{I}}} \newcommand{\mscrI}{{\mathscr{I}}}
\newcommand{\mbbJ}{{\mathbb{J}}} \newcommand{\mcalJ}{{\mathcal{J}}} \newcommand{\mscrJ}{{\mathscr{J}}}
\newcommand{\mbbK}{{\mathbb{K}}} \newcommand{\mcalK}{{\mathcal{K}}} \newcommand{\mscrK}{{\mathscr{K}}}
\newcommand{\mbbL}{{\mathbb{L}}} \newcommand{\mcalL}{{\mathcal{L}}} \newcommand{\mscrL}{{\mathscr{L}}}
\newcommand{\mbbM}{{\mathbb{M}}} \newcommand{\mcalM}{{\mathcal{M}}} \newcommand{\mscrM}{{\mathscr{M}}}
\newcommand{\mbbN}{{\mathbb{N}}} \newcommand{\mcalN}{{\mathcal{N}}} \newcommand{\mscrN}{{\mathscr{N}}}
\newcommand{\mbbO}{{\mathbb{O}}} \newcommand{\mcalO}{{\mathcal{O}}} \newcommand{\mscrO}{{\mathscr{O}}}
\newcommand{\mbbP}{{\mathbb{P}}} \newcommand{\mcalP}{{\mathcal{P}}} \newcommand{\mscrP}{{\mathscr{P}}}
\newcommand{\mbbQ}{{\mathbb{Q}}} \newcommand{\mcalQ}{{\mathcal{Q}}} \newcommand{\mscrQ}{{\mathscr{Q}}}
\newcommand{\mbbR}{{\mathbb{R}}} \newcommand{\mcalR}{{\mathcal{R}}} \newcommand{\mscrR}{{\mathscr{R}}}
\newcommand{\mbbS}{{\mathbb{S}}} \newcommand{\mcalS}{{\mathcal{S}}} \newcommand{\mscrS}{{\mathscr{S}}}
\newcommand{\mbbT}{{\mathbb{T}}} \newcommand{\mcalT}{{\mathcal{T}}} \newcommand{\mscrT}{{\mathscr{T}}}
\newcommand{\mbbU}{{\mathbb{U}}} \newcommand{\mcalU}{{\mathcal{U}}} \newcommand{\mscrU}{{\mathscr{U}}}
\newcommand{\mbbV}{{\mathbb{V}}} \newcommand{\mcalV}{{\mathcal{V}}} \newcommand{\mscrV}{{\mathscr{V}}}
\newcommand{\mbbW}{{\mathbb{W}}} \newcommand{\mcalW}{{\mathcal{W}}} \newcommand{\mscrW}{{\mathscr{W}}}
\newcommand{\mbbX}{{\mathbb{X}}} \newcommand{\mcalX}{{\mathcal{X}}} \newcommand{\mscrX}{{\mathscr{X}}}
\newcommand{\mbbY}{{\mathbb{Y}}} \newcommand{\mcalY}{{\mathcal{Y}}} \newcommand{\mscrY}{{\mathscr{Y}}}
\newcommand{\mbbZ}{{\mathbb{Z}}} \newcommand{\mcalZ}{{\mathcal{Z}}} \newcommand{\mscrZ}{{\mathscr{Z}}}

%%%-------------------------------------------------------------------------%%%
%% Some commonly used cases
% Vectors
\newcommand{\vzero}{{\bm{0}}}
\newcommand{\vone}{{\bm{1}}}
\newcommand{\vmu}{{\bm{\mu}}}
\newcommand{\vtheta}{{\bm{\theta}}}
% Elements of vectors
\newcommand{\evalpha}{{\alpha}}
\newcommand{\evbeta}{{\beta}}
\newcommand{\evepsilon}{{\epsilon}}
\newcommand{\evlambda}{{\lambda}}
\newcommand{\evomega}{{\omega}}
\newcommand{\evmu}{{\mu}}
\newcommand{\evpsi}{{\psi}}
\newcommand{\evsigma}{{\sigma}}
\newcommand{\evtheta}{{\theta}}
% Matrix
\newcommand{\mBeta}{{\bm{\Beta}}}
\newcommand{\mPhi}{{\bm{\Phi}}}
\newcommand{\mLambda}{{\bm{\Lambda}}}
\newcommand{\mSigma}{{\bm{\Sigma}}}
% Entries of a matrix
\newcommand{\emLambda}{{\Lambda}}
\newcommand{\emSigma}{{\Sigma}}
% Random variables
\newcommand{\reta}{{\textnormal{\(\eta \)}}}
% Random vectors
\newcommand{\rvepsilon}{{\mathbf{\epsilon}}}
\newcommand{\rvtheta}{{\mathbf{\theta}}}
% Entries of a tensor
\newcommand{\etLambda}{{\etens{\Lambda}}}

%%%-------------------------------------------------------------------------%%%
%% function
\newcommand{\R}{{\mathbb{R}}} % domain

%% probability
\newcommand{\E}{{\mathbb{E}}} % expectation
\newcommand{\Var}{{\mathrm{Var}}} % variance
\newcommand{\Std}{{\mathrm{Std}}} % standard variance
\newcommand{\Cov}{{\mathrm{Cov}}} % covariance
\newcommand{\KL}{{D_{\mathrm{KL}}}} % KL divergence
\newcommand{\standarderror}{{\mathrm{SE}}} % standard error

%% norm
% Wolfram Mathworld says $L^2$ is for function spaces and $\ell^2$ is for vectors
% But then they seem to use $L^2$ for vectors throughout the site, and so does
% wikipedia.
\newcommand{\normLzero}{L^0}
\newcommand{\normLone}{L^1}
\newcommand{\normLtwo}{L^2}
\newcommand{\normLp}{L^p}
\newcommand{\normLinfty}{L^\infty}
\newcommand{\normlzero}{\ell^0}
\newcommand{\normlone}{\ell^1}
\newcommand{\normltwo}{\ell^2}
\newcommand{\normlp}{\ell^p}
\newcommand{\normlinfty}{\ell^\infty}

%% Number
\newcommand{\1}{{\bm{1}}}

%% other
\newcommand{\Ls}{{\mathcal{L}}}
\newcommand{\emp}{{\tilde{p}}}
\newcommand{\lr}{{\alpha}}
\newcommand{\reg}{{\lambda}}
\newcommand{\rect}{{\mathrm{rectifier}}}
\newcommand{\eps}{{\epsilon}}

%%%-------------------------------------------------------------------------%%%
%% Machine Learning
% The true underlying data generating distribution
\newcommand{\pdata}{{p_{\textrm{data}}}}
% The empirical distribution defined by the training set
\newcommand{\ptrain}{{\hat{p}_{\textrm{data}}}}
\newcommand{\Ptrain}{{\hat{P}_{\textrm{data}}}}
% The model distribution
\newcommand{\pmodel}{{p_{\textrm{model}}}}
\newcommand{\Pmodel}{{P_{\textrm{model}}}}
\newcommand{\ptildemodel}{{\tilde{p}_{\textrm{model}}}}
% Stochastic autoencoder distributions
\newcommand{\pencode}{{p_{\textrm{encoder}}}}
\newcommand{\pdecode}{{p_{\textrm{decoder}}}}
\newcommand{\precons}{{p_{\textrm{reconstruct}}}}
% Laplace distribution
\newcommand{\laplace}{{\mathrm{Laplace}}}
%
\newcommand{\train}{\mathcal{D}}
\newcommand{\valid}{\mathcal{D_{\mathrm{valid}}}}
\newcommand{\test}{\mathcal{D_{\mathrm{test}}}}
%
\newcommand{\parents}{Pa} % See usage in notation.tex. Chosen to match Daphne's book.
%
\newcommand{\softmax}{{\mathrm{softmax}}}
\newcommand{\sigmoid}{{\sigma}}
\newcommand{\softplus}{{\zeta}}

%%%-------------------------------------------------------------------------%%%
%% Mark sections of captions for referring to divisions of figures
\newcommand{\figleft}{{\em (Left)\/}}
\newcommand{\figcenter}{{\em (Center)\/}}
\newcommand{\figright}{{\em (Right)\/}}
\newcommand{\figtop}{{\em (Top)\/}}
\newcommand{\figbottom}{{\em (Bottom)\/}}
\newcommand{\captiona}{{\em (a)\/}}
\newcommand{\captionb}{{\em (b)\/}}
\newcommand{\captionc}{{\em (c)\/}}
\newcommand{\captiond}{{\em (d)\/}}

%%%-------------------------------------------------------------------------%%%
%% Figure, Table, Equation, Algorithm, Section, Chapter, Part

% ==================== FIGURE REFERENCES ====================
% Single figure reference (lowercase)
\providecommand{\onefigref}[1]{\hyperref[#1]{figure~\ref*{#1}}}
% Multiple figure references (lowercase)
\providecommand{\twofigrefs}[2]{\hyperref[#1]{figures~\ref*{#1} and~\ref*{#2}}}
\providecommand{\threefigrefs}[3]{\hyperref[#1]{figures~\ref*{#1},~\ref*{#2},~and~\ref*{#3}}}
\providecommand{\fourfigrefs}[4]{\hyperref[#1]{figures~\ref*{#1},~\ref*{#2},~\ref*{#3} and~\ref*{#4}}}

% Single figure reference (sentence start, capitalized)
\providecommand{\oneFigref}[1]{\hyperref[#1]{Figure~\ref*{#1}}}
% Purpose: Creates clickable "Figure X" reference for beginning of sentences
% - Uses \hyperref for clickable link
% - \ref* prevents nested hyperlinks
% - ~ ensures unbreakable space
% Multiple figure references (capitalized)
\providecommand{\twoFigrefs}[2]{\hyperref[#1]{Figures~\ref*{#1} and~\ref*{#2}}}
\providecommand{\threeFigrefs}[3]{\hyperref[#1]{Figures~\ref*{#1},~\ref*{#2}, and~\ref*{#3}}}
\providecommand{\fourFigrefs}[4]{\hyperref[#1]{Figures~\ref*{#1},~\ref*{#2},~\ref*{#3} and~\ref*{#4}}}

% ==================== TABLE REFERENCES ====================
% Table references (lowercase)
\providecommand{\onetableref}[1]{\hyperref[#1]{table~\ref*{#1}}}
\providecommand{\twotablerefs}[2]{\hyperref[#1]{tables~\ref*{#1} and~\ref*{#2}}}
\providecommand{\threetablerefs}[3]{\hyperref[#1]{tables~\ref*{#1},~\ref*{#2}, and~\ref*{#3}}}
\providecommand{\fourtablerefs}[4]{\hyperref[#1]{tables~\ref*{#1},~\ref*{#2},~\ref*{#3} and~\ref*{#4}}}

% Table references (capitalized)
\providecommand{\oneTableref}[1]{\hyperref[#1]{Table~\ref*{#1}}}
\providecommand{\twoTablerefs}[2]{\hyperref[#1]{Tables~\ref*{#1} and~\ref*{#2}}}
\providecommand{\threeTablerefs}[3]{\hyperref[#1]{Tables~\ref*{#1},~\ref*{#2}, and~\ref*{#3}}}
\providecommand{\fourTablerefs}[4]{\hyperref[#1]{Tables~\ref*{#1},~\ref*{#2},~\ref*{#3} and~\ref*{#4}}}

% ==================== EQUATION REFERENCES ====================
% Equation references (lowercase)
\providecommand{\oneeqref}[1]{\hyperref[#1]{equation~\ref*{#1}}}
\providecommand{\twoeqrefs}[2]{\hyperref[#1]{equations~\ref*{#1} and~\ref*{#2}}}
\providecommand{\threeeqrefs}[3]{\hyperref[#1]{equations~\ref*{#1},~\ref*{#2}, and~\ref*{#3}}}
\providecommand{\foureqrefs}[4]{\hyperref[#1]{equations~\ref*{#1},~\ref*{#2},~\ref*{#3} and~\ref*{#4}}}

% Equation references (capitalized)
\providecommand{\oneEqref}[1]{\hyperref[#1]{Equation~\ref*{#1}}}
\providecommand{\twoEqrefs}[2]{\hyperref[#1]{Equations~\ref*{#1} and~\ref*{#2}}}
\providecommand{\threeEqrefs}[3]{\hyperref[#1]{Equations~\ref*{#1},~\ref*{#2}, and~\ref*{#3}}}
\providecommand{\fourEqrefs}[4]{\hyperref[#1]{Equations~\ref*{#1},~\ref*{#2},~\ref*{#3} and~\ref*{#4}}}

% Plain equation reference
\providecommand{\plaineqref}[1]{\hyperref[#1]{\ref*{#1}}}

% ==================== ALGORITHM REFERENCES ====================
% Algorithm references (lowercase)
\providecommand{\onealgref}[1]{\hyperref[#1]{algorithm~\ref*{#1}}}
\providecommand{\twoalgrefs}[2]{\hyperref[#1]{algorithms~\ref*{#1} and~\ref*{#2}}}
\providecommand{\threealgrefs}[3]{\hyperref[#1]{algorithms~\ref*{#1},~\ref*{#2}, and~\ref*{#3}}}
\providecommand{\fouralgrefs}[4]{\hyperref[#1]{algorithms~\ref*{#1},~\ref*{#2},~\ref*{#3} and~\ref*{#4}}}

% Algorithm references (capitalized)
\providecommand{\oneAlgref}[1]{\hyperref[#1]{Algorithm~\ref*{#1}}}
\providecommand{\twoAlgrefs}[2]{\hyperref[#1]{Algorithms~\ref*{#1} and~\ref*{#2}}}
\providecommand{\threeAlgrefs}[3]{\hyperref[#1]{Algorithms~\ref*{#1},~\ref*{#2}, and~\ref*{#3}}}
\providecommand{\fourAlgrefs}[4]{\hyperref[#1]{Algorithms~\ref*{#1},~\ref*{#2},~\ref*{#3} and~\ref*{#4}}}

% ==================== SECTION REFERENCES ====================
% Section references (lowercase)
\providecommand{\onesecref}[1]{\hyperref[#1]{section~\ref*{#1}}}
\providecommand{\twosecrefs}[2]{\hyperref[#1]{sections~\ref*{#1} and~\ref*{#2}}}
\providecommand{\threesecrefs}[3]{\hyperref[#1]{sections~\ref*{#1},~\ref*{#2} and~\ref*{#3}}}
\providecommand{\foursecrefs}[4]{\hyperref[#1]{sections~\ref*{#1},~\ref*{#2},~\ref*{#3} and~\ref*{#4}}}
\providecommand{\rangesecrefs}[2]{\hyperref[#1]{sections~\ref*{#1}--\ref*{#2}}}

% Section references (capitalized)
\providecommand{\oneSecref}[1]{\hyperref[#1]{Section~\ref*{#1}}}
\providecommand{\twoSecrefs}[2]{\hyperref[#1]{Sections~\ref*{#1} and~\ref*{#2}}}
\providecommand{\threeSecrefs}[3]{\hyperref[#1]{Sections~\ref*{#1},~\ref*{#2} and~\ref*{#3}}}
\providecommand{\fourSecrefs}[4]{\hyperref[#1]{Sections~\ref*{#1},~\ref*{#2},~\ref*{#3} and~\ref*{#4}}}
\providecommand{\rangeSecrefs}[2]{\hyperref[#1]{Sections~\ref*{#1}--\ref*{#2}}}

% ==================== CHAPTER REFERENCES ====================
% Chapter references (lowercase)
\providecommand{\onechapref}[1]{\hyperref[#1]{chapter~\ref*{#1}}}
\providecommand{\twochaprefs}[2]{\hyperref[#1]{chapters~\ref*{#1} and~\ref*{#2}}}
\providecommand{\threechaprefs}[3]{\hyperref[#1]{chapters~\ref*{#1},~\ref*{#2} and~\ref*{#3}}}
\providecommand{\fourchaprefs}[4]{\hyperref[#1]{chapters~\ref*{#1},~\ref*{#2},~\ref*{#3} and~\ref*{#4}}}
\providecommand{\rangechaprefs}[2]{\hyperref[#1]{chapters~\ref*{#1}--\ref*{#2}}}

% Chapter references (capitalized)
\providecommand{\oneChapref}[1]{\hyperref[#1]{Chapter~\ref*{#1}}}
\providecommand{\twoChaprefs}[2]{\hyperref[#1]{Chapters~\ref*{#1} and~\ref*{#2}}}
\providecommand{\threeChaprefs}[3]{\hyperref[#1]{Chapters~\ref*{#1},~\ref*{#2} and~\ref*{#3}}}
\providecommand{\fourChaprefs}[4]{\hyperref[#1]{Chapters~\ref*{#1},~\ref*{#2},~\ref*{#3} and~\ref*{#4}}}
\providecommand{\rangeChaprefs}[2]{\hyperref[#1]{Chapters~\ref*{#1}--\ref*{#2}}}

% ==================== PART REFERENCES ====================
% Part references (lowercase)
\providecommand{\onepartref}[1]{\hyperref[#1]{part~\ref*{#1}}}
\providecommand{\twopartrefs}[2]{\hyperref[#1]{parts~\ref*{#1} and~\ref*{#2}}}
\providecommand{\threepartrefs}[3]{\hyperref[#1]{parts~\ref*{#1},~\ref*{#2} and~\ref*{#3}}}
\providecommand{\fourpartrefs}[4]{\hyperref[#1]{parts~\ref*{#1},~\ref*{#2},~\ref*{#3} and~\ref*{#4}}}
\providecommand{\rangepartrefs}[2]{\hyperref[#1]{parts~\ref*{#1}--\ref*{#2}}}

% Part references (capitalized)
\providecommand{\onePartref}[1]{\hyperref[#1]{Part~\ref*{#1}}}
\providecommand{\twoPartrefs}[2]{\hyperref[#1]{Parts~\ref*{#1} and~\ref*{#2}}}
\providecommand{\threePartrefs}[3]{\hyperref[#1]{Parts~\ref*{#1},~\ref*{#2} and~\ref*{#3}}}
\providecommand{\fourPartrefs}[4]{\hyperref[#1]{Parts~\ref*{#1},~\ref*{#2},~\ref*{#3} and~\ref*{#4}}}
\providecommand{\rangePartrefs}[2]{\hyperref[#1]{Parts~\ref*{#1}--\ref*{#2}}}

% ==================== IMPLEMENTATION NOTES ====================
% 1. All commands use \providecommand to prevent redefine errors
% 2. Hyperlinks are attached to the full reference text
% 3. \ref* prevents nested hyperlinks within \hyperref
% 4. Punctuation follows English typesetting conventions
% 5. Requires packages:
% \usepackage{hyperref} % For hyperlink support
% \usepackage{cleveref} % Optional for advanced referencing

% ==================== RECOMMENDED PRACTICES ====================
% 1. Use consistent label prefixes (fig:, tab:, eq:, etc.)
% 2. For advanced features, consider using cleveref instead:
% \crefname{figure}{figure}{figures} % Singular/plural forms
% \Crefname{figure}{Figure}{Figures} % Capitalized versions
% Then use \cref{fig:1} or \Cref{fig:1} for auto-formatting

%%%-------------------------------------------------------------------------%%%
%% newcommand for math
\newcommand{\abs}[1]{\left\vert#1\right\vert}
\newcommand{\norm}[1]{\left\Vert#1\right\Vert}
\newcommand{\ceil}[1]{\lceil#1\rceil}
\newcommand{\floor}[1]{\lfloor#1\rfloor}

%% DeclareMathOperator
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator{\sign}{sign}
\DeclareMathOperator{\Tr}{Tr}

%%%-------------------------------------------------------------------------%%%
%% newcommand for table
\newcommand{\mr}[2]{\multirow{#1}{#2}}
\newcommand{\mc}[2]{\multicolumn{#1}{#2}}

%%%-------------------------------------------------------------------------%%%
%% Highlight a newly defined term
\newcommand{\newterm}[1]{{\textbf #1}}
