% !TeX root = ./Thesis.tex

\graphicspath{{./Graphics/}}

% need to pass languages explicitly
\PassOptionsToPackage{capitalize, noabbrev, ngerman, english}{cleveref}
\usepackage{cleveref}
\usepackage{datetime} % for formating submission date
\usepackage{lipsum}   % for template text


% include Git commit hash when drafting
\makeatletter
\ifthenelse{\boolean{ct@drafting}}{
	\usepackage{gitinfo2}
	\renewcommand{\PrelimText}{\footnotesize[\,\today\ at \thistime\ -- version \myVersion{} -- git \gitAbbrevHash\,]}
}{}
\makeatother


% nice cv style for PhD theses
\iftoggle{phd}{
	\usepackage[LabelsAligned]{currvita}
}{}


% to enable wide text/floats taking the space of margin notes (435pt instead of 336pt)
% note that this changes the \linewidth (not \textwidth), so follow this example
% to include a wide figure:
%  \begin{figure}
%  \begin{wide}
%  	 \includegraphics[width=\linewidth]{logos/tud-logo}
%  	 \caption{Athene logo of TU Darmstadt.}
%  \end{wide}
%  \end{figure}
\usepackage[strict]{changepage}
\newlength{\fullwidthlen}
\setlength{\fullwidthlen}{\marginparwidth}
\addtolength{\fullwidthlen}{\marginparsep}
\newenvironment{wide}{%
  \begin{adjustwidth*}{}{-\fullwidthlen}\hsize=\linewidth%
}{%
  \end{adjustwidth*}%
}


% TikZ/PGFPlots
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usetikzlibrary{
  chains,
  positioning,
  quotes,
  arrows.meta, 
  shapes.geometric, 
  fit
}

\def\StripPrefix#1>{}
\def\isOverleaf{\fi
    \def\overleafJobname{output}% overleaf defaults to 'output' as \jobname
    \edef\overleafJobname{\expandafter\StripPrefix\meaning\overleafJobname}%
    \edef\job{\jobname}%
    \ifx\job\overleafJobname
}

% To cache tikz pictures you have to run pdflatex with -shell-escape or --enable-write18
\ifnum\pdfshellescape=1
	\usepgfplotslibrary{external}
  \if\isOverleaf
  \tikzexternaldisable
  \else
  \tikzexternalize[prefix=GraphicsCache/]
  \fi
\fi


% Lengths for matlab2tikz
\newlength\figureheight
\newlength\figurewidth 

% SVGs
\usepackage{svg}

% lstlistings
\definecolor{eclipseStrings}{RGB}{42,0.0,255}
\definecolor{eclipseKeywords}{RGB}{127,0,85}
\colorlet{numb}{magenta!60!black}

\lstdefinelanguage{json}{
    basicstyle=\normalfont\ttfamily,
    commentstyle=\color{eclipseStrings}, % style of comment
    stringstyle=\color{eclipseKeywords}, % style of strings
    numbers=left,
    numberstyle=\scriptsize,
    stepnumber=1,
    numbersep=8pt,
    showstringspaces=false,
    breaklines=true,
    frame=lines,
    backgroundcolor=\color{white}, %only if you like
    string=[s]{"}{"},
    comment=[l]{:\ "},
    morecomment=[l]{:"},
    literate=
        *{0}{{{\color{numb}0}}}{1}
         {1}{{{\color{numb}1}}}{1}
         {2}{{{\color{numb}2}}}{1}
         {3}{{{\color{numb}3}}}{1}
         {4}{{{\color{numb}4}}}{1}
         {5}{{{\color{numb}5}}}{1}
         {6}{{{\color{numb}6}}}{1}
         {7}{{{\color{numb}7}}}{1}
         {8}{{{\color{numb}8}}}{1}
         {9}{{{\color{numb}9}}}{1}
}

% forest
\usepackage[edges]{forest}

% TODO
\usepackage{todonotes}
