\usepackage{amsmath}  % needed for \tfrac, \bmatrix, etc.
\usepackage{amsfonts} % needed for bold Greek, Fraktur, and blackboard bold
\usepackage{esdiff}  % for proper derivative styling \diff{x}{t}
\usepackage{graphicx} % needed for figures
\usepackage[utf8]{inputenc}
\usepackage[USenglish]{babel}
\usepackage{amssymb}
\usepackage{color}
\usepackage{hyperref}
\usepackage{catchfilebetweentags}

% COMMONS

\def\tw{\textwidth}
\def\bi{\begin{itemize}}
\def\ei{\end{itemize}}
\def\im{\item}


\def\todo#1{~ \textcolor{red}{{ToDo}:\it #1}}
\def\normalsubformula#1{#1}
\def\text#1{#1}
\def\textsubscript#1{#1}


% DOCS

\newcommand{\LinkToResource}[2]{\graphicspath{{\docroot{}#1/figs/}}\ExecuteMetaData[\docroot{}#1/FullTexts.tex]{#2}}
\def\taskitem#1{\item \LinkToResource{Education}{#1}}
\def\theorypart#1{\LinkToResource{Theory}{#1}}
\def\diagnosticspart#1{\LinkToResource{Diagnostics}{#1}}
\def\golempart#1{\LinkToResource{Golem}{#1}}
\def\methodpart#1{\LinkToResource{Methodology}{#1}}

% fix newline stripping by catchfilebetweentags
% from https://tex.stackexchange.com/a/40704/95108
\usepackage{etoolbox}
\makeatletter
\patchcmd{\CatchFBT@Fin@l}{\endlinechar\m@ne}{}
  {}{\typeout{Unsuccessful patch!}}
\makeatother


% PRESENTATIONS

\newcommand{\LinkToSlide}[2]{\graphicspath{{\docroot{}#1/figs/}}\ExecuteMetaData[\docroot{}#1/slides.tex]{#2}}

\def\slide#1#2{
\begin{frame}\frametitle{#1}
#2
\end{frame}
}

% PHYSICAL QUANTITIES

\def\GMPQ#1{\ExecuteMetaData[\docroot{}PhysicalQuantities/Definitions]{#1}}

\def\GWPhysQuantValueWithName#1{\GMPQ{#1}\name :\ $\quantity = \value$\ \unit}
