\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tex/docmacros}[2021/09/27 v0.1 Document Macros]

\RequirePackage{mathtools}
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{bm}

%% MATHEMATICS

% Probability
\DeclareMathOperator{\expectation}{E}
\newcommand{\E}[1]{\expectation \left\{#1\right\}}

\DeclareMathOperator{\variance}{Var}
\newcommand{\Var}[1]{\variance \left\{#1\right\}}

\DeclareMathOperator{\probability}{Pr}
\renewcommand{\Pr}[1]{\probability \left\{#1\right\}}

% Functions
\DeclareMathOperator{\sinc}{sinc}

% Complex numbers
\renewcommand{\Re}[1]{\mathrm{Re} \left\{#1\right\}}
\renewcommand{\Im}[1]{\mathrm{Im} \left\{#1\right\}}

% Linear operators
\DeclareMathOperator{\fourier}{\mathcal{F}}
\DeclareMathOperator{\hilbert}{\mathcal{H}}

% Vectors and matrices
\renewcommand{\vec}[1]{\mathbf{\bm{#1}}}
\newcommand{\uvec}[1]{\vec{\hat{#1}}}

\newcommand{\dotp}{\boldsymbol\cdot}
\newcommand{\crossp}{\boldsymbol\times}

\newcommand{\mx}[1]{\bm{\mathrm{#1}}}

%% TYPESETTING

% Custom command IEEE references for figures and tables
\newcommand{\figref}[1]{Fig.~\ref{#1}}
\newcommand{\tabref}[1]{Tab.~\ref{#1}}
