%% PDF-specific things
\newcommand{\qmax}{\ensuremath{Q_{\mathrm{max}}}\xspace}
\newcommand{\qmaxinst}{\ensuremath{Q_{\mathrm{max-inst}}}\xspace}
\newcommand{\qmin}{\ensuremath{Q_{\mathrm{min}}}\xspace}
\newcommand{\qbroad}{\ensuremath{Q_{\mathrm{broad}}}\xspace}
\newcommand{\qdamp}{\ensuremath{Q_{\mathrm{damp}}}\xspace}
\newcommand{\deltatwo}{\ensuremath{\delta_2}\xspace}
\newcommand{\deltaone}{\ensuremath{\delta_1}\xspace}
\newcommand{\spdiameter}{\ensuremath{sp_{\mathrm{diameter}}}\xspace}
\newcommand{\uiso}{\ensuremath{U_{\mathrm{iso}}}\xspace}
\newcommand{\uaniso}{\ensuremath{U_{\mathrm{aniso}}}\xspace}
\newcommand{\sratio}{\ensuremath{sratio}\xspace}
\newcommand{\rpoly}{\ensuremath{rpoly}\xspace}
\newcommand{\rw}{\ensuremath{R_w}\xspace}
\newcommand{\rapdf}{\textit{RA-PDF}\space}
\newcommand{\cif}{{\tt CIF}\xspace}
\newcommand{\rmin}{\ensuremath{r_{\mathrm{min}}}\xspace}
\newcommand{\rmax}{\ensuremath{r_{\mathrm{max}}}\xspace}
\newcommand{\rlim}{\ensuremath{r_{\mathrm{lim}}}\xspace}
\newcommand{\mmax}{\ensuremath{m_{\mathrm{max}}}\xspace}
\newcommand{\delr}{\ensuremath{dr}\xspace}
\newcommand{\delrn}{\ensuremath{dr_N}\xspace}
\newcommand{\delq}{\ensuremath{dQ}\xspace}
\newcommand{\qualp}{\ensuremath{\mathcal{Q}_p}\xspace}
\newcommand{\iq}{\ensuremath{I(Q)}\xspace}
\newcommand{\sq}{\ensuremath{S(Q)}\xspace}
\newcommand{\fq}{\ensuremath{F(Q)}\xspace}
\newcommand{\gr}{\ensuremath{G(r)}\xspace}
\newcommand{\rr}{\ensuremath{R(r)}\xspace}
\newcommand{\q}{\ensuremath{Q}\xspace}
\newcommand{\ir}{\ensuremath{r}\xspace}
\newcommand{\dd}{\mathrm{d}}
\newcommand{\ii}{\mathrm{i}}
% we like our vectors to be bold and not italicised
\renewcommand{\vec}[1]{\mathbf{#1}}

%units
\newcommand{\iaa}{\AA\ensuremath{^{-1}}\xspace}
\newcommand{\iaasquared}{\AA\ensuremath{^{-2}}\xspace}
\newcommand{\aasquared}{\AA\ensuremath{^{2}}\xspace}

% comments
% Add your own here. Pick your own color.
\newcommand{\sjb}[1]{\textcolor{blue}{[sjb:#1]}}
\newcommand{\sjba}[1]{}
\newcommand{\mt}[1]{\textcolor{orange}{[mt:#1]}}
\newcommand{\mta}[1]{}


% referencing figures etc. correctly
%
% when you make the label, use
% \label{fig:<name>} for figures
% \label{eq:<name>} for equations and so on (see below for what to use}
%
% Never use numbers for anything as the numbering always changes.  The point
% is to use a <name> that is descriptive (and preferrably memorable)
%
% when you then reference the item reference it like
% "...as is evident in \fig{<name>}" and will compile as "...as evident in Fig. 4"
\newcommand{\eq}[1]{Eq.~\ref{eq:#1}}
\newcommand{\eqs}[1]{Eqs.~\ref{eq:#1}}
\newcommand{\fig}[1]{Fig.~\ref{fig:#1}}
\newcommand{\figs}[1]{Figs.~\ref{fig:#1}}
\newcommand{\sect}[1]{Section~\ref{sec:#1}}
\newcommand{\apen}[1]{Appendix~\ref{sec:#1}}
\newcommand{\tabl}[1]{Table~\ref{table:#1}}
\newcommand{\bra}[1]{\left<#1\right|}
\newcommand{\ket}[1]{\left|#1\right>}
%\newcommand{\abs}[1]{\left|#1\right|}

% correctly formated latin
\newcommand{\etal}{\textit{et al.}\xspace}
\newcommand{\adhoc}{\textit{ad hoc}\xspace}
\newcommand{\insitu}{\textit{in situ}\xspace}
\newcommand{\operando}{\textit{operando}\xspace}

% place all figures in a sub-folder called figures, located in the folder where
% the main latex file is
%
% then when you include the graphics, do not put any path there
% e.g., \includegraphics[width=0.8\textwidth]{<name>}
% for a figure called <name>.pdf (or <name>.png, or <name>.jpg...latex will do
% its best to choose the extension from known image file types).
%
% as preference use pdf format files.  These are vector graphics and so produce
% higher quality images at all scales.
\graphicspath{ {./figures/} }

% Colored symbols used during editing.
% Also, define new colors here if you like
\definecolor{dgreen}{HTML}{008000}
\newcommand{\done}{\textcolor{dgreen}{{\large{$\checkmark$}}}}
\newcommand{\doing}{\textcolor{blue}{{\large{$\blacklozenge$}}}}
\newcommand{\checkme}{\textcolor{orange}{{\large{$\blacktriangleleft$}}}}
\newcommand{\fixme}{\textcolor{red}{{\large{$\blacktriangleright$}}}}

% some style preferences for code listings
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
\lstdefinestyle{mystyle}{
    backgroundcolor=\color{backcolour},
    commentstyle=\color{codegreen},
    keywordstyle=\color{magenta},
    numberstyle=\tiny\color{codegray},
    stringstyle=\color{codepurple},
    basicstyle=\ttfamily\footnotesize,
    breakatwhitespace=false,
    breaklines=true,
    captionpos=b,
    keepspaces=true,
    numbers=left,
    numbersep=5pt,
    showspaces=false,
    showstringspaces=false,
    showtabs=false,
    tabsize=2
}
\lstset{style=mystyle}

% used for building skels.  If you want to jump out of the list and jump back in later do it this way:
% \be               % begin the enumerated list
% ...
% \seti\ee          % paus the list, saving the counter
% ...
% \be\conti         % continue the list from where we left off
% ...
% \ee               % end the list, it is the end of hte paper
\newcounter{saveenumi}
\newcommand{\seti}{\setcounter{saveenumi}{\value{enumi}}}
\newcommand{\conti}{\setcounter{enumi}{\value{saveenumi}}}
\newcommand{\be}{\begin{enumerate}}
\newcommand{\ee}{\end{enumerate}}
\newcommand{\bes}{\begin{enumerate}[wide, labelwidth=!, labelindent=0pt, label=\textbf{\textcolor{blue}{\arabic*}.}]}
\newcommand{\ees}{\end{enumerate}}

