\usepackage[utf8]{inputenc}
\usepackage{url}                                        % simple URL typesetting
\usepackage{booktabs}                                   % professional-quality tables
\usepackage{amsfonts}                                   % blackboard math symbols
\usepackage{nicefrac}                                   % compact symbols for 1/2, etc.
\usepackage{microtype}                                  % microtypography
\usepackage{bookmark}                                   % faster updated bookmarks
\usepackage{amsthm}                                     % For math options
\usepackage{amsmath}
\usepackage{nccmath}
\usepackage{tabulary}                                   % Tables
\usepackage{amssymb}                                    % Some symbols
\usepackage{enumitem}                                   % Alphabet enumeration

\usepackage{enumitem}                                   % Alphabet enumeration
\usepackage{bbm}                                        % Indicator function
\usepackage{xr}
\usepackage{xargs}                                      % Use more than one optional parameter in a new commands
\usepackage[pdftex,dvipsnames]{xcolor}                  % Coloured text etc.
\usepackage{tcolorbox}                                  % boxes around text
\newcommand{\blue}[1]{\textcolor{blue}{ #1}}

\newcommand{\TODO}[1]{\textcolor{red}{\bf [#1]}} % Todos in document

% 
% \usepackage[colorinlistoftodos,prependcaption,textsize=tiny]{todonotes}
% \newcommandx{\unsure}[2][1=]{\todo[linecolor=red,backgroundcolor=red!25,bordercolor=red,#1]{#2}}
% \newcommandx{\change}[2][1=]{\todo[linecolor=blue,backgroundcolor=blue!25,bordercolor=blue,#1]{#2}}
% \newcommandx{\info}[2][1=]{\todo[linecolor=OliveGreen,backgroundcolor=OliveGreen!25,bordercolor=OliveGreen,#1]{#2}}
% \newcommandx{\improvement}[2][1=]{\todo[linecolor=Plum,backgroundcolor=Plum!25,bordercolor=Plum,#1]{#2}}
% \newcommandx{\thiswillnotshow}[2][1=]{\todo[disable,#1]{#2}}

% \newcommandx{\inlinetodo}[2][1=]{\todo[inline, linecolor=Plum,backgroundcolor=Plum!25,bordercolor=Plum,#1]{#2}}
% %

\setlength\parindent{0pt}                               % Sets indent to 0 for the entire file.


\usepackage{pgf,tikz,pgfplots}
\pgfplotsset{compat=1.15}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}

\definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}
\definecolor{ffwwzz}{rgb}{1,0.4,0.6}
\definecolor{zzttff}{rgb}{0.6,0.2,1}

\usepackage{tikz}
\usetikzlibrary{bayesnet}
\usepackage{wrapfig}
\usepackage{caption}

\setcounter{secnumdepth}{6}                             % Set labels for paragraphs

\makeatletter
\newcommand{\pushright}[1]{\ifmeasuring@#1\else\omit\hfill$\displaystyle#1$\fi\ignorespaces}
\newcommand{\pushleft}[1]{\ifmeasuring@#1\else\omit$\displaystyle#1$\hfill\fi\ignorespaces}
\makeatother


\makeatletter
\renewcommand*\env@matrix[1][\arraystretch]{%
  \edef\arraystretch{#1}%
  \hskip -\arraycolsep
  \let\@ifnextchar\new@ifnextchar
  \array{*\c@MaxMatrixCols c}}
\makeatother


\makeatletter
\newcommand*{\addFileDependency}[1]{% argument=file name and extension
  \typeout{(#1)}
  \@addtofilelist{#1}
  \IfFileExists{#1}{}{\typeout{No file #1.}}
}
\makeatother

\newcommand*{\myexternaldocument}[1]{%
    \externaldocument{#1}%
    \addFileDependency{#1.tex}%
    \addFileDependency{#1.aux}%
}