% vim: fdm=marker fmr=<<<,>>>
%%
%% Thesis Preamble
%%

%% <<< Packages
%%

% For Bibliography
\usepackage[sorting=none,natbib=true,citestyle=numeric-comp,backend=bibtex]{biblatex}

% Document
\usepackage{amsmath}
\usepackage{mathtools}
%\usepackage{cancel}
\usepackage{todo}

% Graphics
\usepackage{placeins}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{epstopdf}

\usepackage{caption}
\usepackage{subcaption}
\usepackage[colorlinks=true]{hyperref}
\usepackage{cleveref}
\usepackage{grffile}
\usepackage{physics}

\usepackage[english]{babel}       % for proper word breaking at line ends
\usepackage[switch]{lineno}
\usepackage[acronym]{glossaries}
\glsdisablehyper

%\usepackage{listings}
\usepackage{csquotes}
\usepackage[margin=1.0in]{geometry}
\usepackage[nobottomtitles]{titlesec}
\usepackage{subfiles}


%% >>>
%% <<< Layout
%%

\titleformat{\chapter}[hang] % shape
{\normalfont\bfseries\huge} % format
{\thechapter.} % label
{0.5ex} % sep
{
} % before-code
[
] % after-code

\setlength{\parindent}{0cm}

%% Automatic float barriers for section and subsection
\let\Oldsection\section
\renewcommand{\section}{\FloatBarrier\Oldsection}

\let\Oldsubsection\subsection
\renewcommand{\subsection}{\FloatBarrier\Oldsubsection}

%\let\Oldsubsubsection\subsubsection
%\renewcommand{\subsubsection}{\FloatBarrier\Oldsubsubsection}

%% <<<< Thesis titling
%%
\def\thesistitle{Enhancing Timing Accuracy\texorpdfstring{\\[0.3cm]}{ }in Air Shower Radio Detectors}
\def\thesissubtitle{}
\def\thesisauthorfirst{E.T.}
\def\thesisauthorsecond{de Boone}
\def\thesissupervisorfirst{dr. Harm}
\def\thesissupervisorsecond{Schoorlemmer}
\def\thesissecondreaderfirst{dr. Katherine}
\def\thesissecondreadersecond{Mulrey}
\def\thesisdate{July 2023}
\definecolor{radboud}{RGB}{227, 0, 11}

%% >>>>
%% >>>
%% <<< Shortcuts
%%

\newcommand*{\captionsource}[2]{%
  \caption[{#1}]{%
    #1%
    \\\hspace{\linewidth}%
    \textbf{Source:} #2%
  }%
}

% <<<< Math
\newcommand{\dif}[1]{\mathop{}\!\mathrm{d} #1}
\newcommand{\pdif}[1]{\mathop{}\!\mathrm{\partial} #1}
\newcommand{\dbyd}[2]{\ensuremath{\mathrm{d}{#1}/\mathrm{d}{#2}}}

\newcommand{\Corr}{\operatorname{Corr}}
%\newcommand{\erf}{\operatorname{erf}}
\DeclareMathOperator{\arctantwo}{arctan2}

% >>>>
% <<<< Units
\newcommand{\eV}{\text{e\kern-0.15exV}}
\newcommand{\MeV}{\text{M\eV}}
\newcommand{\GeV}{\text{G\eV}}
\newcommand{\TeV}{\text{T\kern-0.1ex\eV}}

\newcommand{\ns}{\text{ns}}
\newcommand{\us}{\text{\textmu s}}

\newcommand{\MHz}{\text{MHz}}
% >>>>
% <<<< Quantities
% Notes:
% \tau is a measured/apparent quantity
% t is true time
% priming is required for moving with the signal / different reference frame

\newcommand{\beaconfreq}{\ensuremath{f_\mathrm{beacon}}}

\newcommand{\Xmax}{\ensuremath{X_\mathrm{max}}}

%% time variables
\newcommand{\tTrue}{t}
\newcommand{\tMeas}{\tau}

\newcommand{\tTrueEmit}{\tTrue_0}
\newcommand{\tTrueArriv}{\tTrueEmit'}
\newcommand{\tMeasArriv}{\tMeas_0}
\newcommand{\tProp}{\tTrue_d}
\newcommand{\tClock}{\tTrue_c}

%% phase variables
\newcommand{\pTrue}{\phi}
\newcommand{\PTrue}{\Phi}
\newcommand{\pMeas}{\varphi}
\newcommand{\phase}{\pMeas} % deprecated

\newcommand{\pTrueEmit}{\pTrue_0}
\newcommand{\pTrueArriv}{\pTrueArriv'}
\newcommand{\pMeasArriv}{\pMeas_0}
\newcommand{\pProp}{\pTrue_d}
\newcommand{\pClock}{\pTrue_c}

%% >>>>
%% >>>
%% <<< Acronyms
%%
\newacronym{GNSS}{GNSS}{Global Navigation Satellite System}

%% <<<< Names
\newacronym{GRAND}{GRAND}{Giant Radio Array for Neutrino Detection}
\newacronym{BEACON}{BEACON}{Beamforming Elevated Array for COsmic Neutrinos}
\newacronym{LOFAR}{LOFAR}{Low-Frequency Array}
\newacronym{PA}{PA}{Pierre~Auger}
\newacronym{PAObs}{PAO}{Pierre~Auger Observatory}
\newacronym{Auger}{Auger}{\acrlong{PAObs}}
\newacronym{AERA}{AERA}{Auger Engineering Radio~Array}

\newacronym{ADC}{ADC}{Analog-to-Digital~Converter}
%% >>>>
%% <<<< Math
\newacronym{DTFT}{DTFT}{Discrete Time Fourier Transform}
\newacronym{DFT}{DFT}{Discrete Fourier Transform}
\newacronym{FFT}{FFT}{Fast Fourier Transform}
\newacronym{FT}{FT}{Fourier Transform}

\newacronym{RMS}{RMS}{root-mean-square}
\newacronym{SNR}{SNR}{signal-to-noise ratio}

%% >>>>
%% >>>
