\hfuzz=1.5pt
\usepackage{fvextra}
\usepackage{csquotes}
\usepackage[australian]{babel}
\usepackage{hyperref}
\hypersetup{bookmarksnumbered}

% Fonts
\usepackage{fontspec}
%% Main font
\setmainfont{ArchivoNarrow}[
Path=assets/fonts/ArchivoNarrow/,
Extension=.ttf,
UprightFont=*-Regular,
BoldFont=*-Bold,
ItalicFont=*-Italic,
BoldItalicFont=*-BoldItalic,
]
%% Title font
\newfontfamily{\norwester}{Norwester}[
Path=assets/fonts/Norwester/,
Extension=.otf,
]
\newfontfamily{\kollektif}{Kollektif}[
Path=assets/fonts/Kollektif/,
Extension=.ttf,
BoldFont=*-Bold,
ItalicFont=*-Italic,
BoldItalicFont=*-BoldItalic,
]
%% Monospace font
\setmonofont{VictorMono}[
Path=assets/fonts/VictorMono/,
Extension=.otf,
UprightFont=*-Regular,
BoldFont=*-Bold,
ItalicFont=*-Italic,
BoldItalicFont=*-BoldItalic,
]
%% Mathmatical font
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{unicode-math}
\setmathfont{GFSNeohellenicMath.otf}

% References
\usepackage[
style=apa,
]{biblatex}
\usepackage{cleveref}

% Glossary / Acronyms
\usepackage[acronym,toc]{glossaries}
\usepackage{titlecaps}
\glsdisablehyper{}
\defglsentryfmt[main]{\ifglsused{\glslabel}{\glsgenentryfmt}{\textit{\glsgenentryfmt}}}
\makeglossaries{}

% Graphics
\usepackage{graphicx}
\usepackage{subcaption}

% Example environment
\newcounter{example}[chapter]
\newenvironment{example}[1][]{\refstepcounter{example}\par\medskip \noindent
  \textbf{Example~\theexample. #1} \rmfamily}{\hfill \ensuremath{\square}}

% Code formatting
\usepackage[
cachedir=listings,
outputdir=build,
]{minted}
\usemintedstyle{borland}

\newenvironment{mzn}{\VerbatimEnvironment\begin{minted}[autogobble=true,breaklines,breakindent=4em,numbers=none,escapeinside=@@,fontsize=\scriptsize]{minizinc}}{\end{minted}}
\newcommand{\mznfile}[1]{\inputminted[autogobble=true,breaklines,breakindent=4em,numbers=left,escapeinside=@@,fontsize=\scriptsize]{minizinc}{#1}}
\newcommand{\mzninline}[1]{\mintinline[fontsize=\small,escapeinside=@@]{minizinc}{#1}}

\newcommand{\pyfile}[1]{\inputminted[autogobble=true,breaklines,breakindent=4em,numbers=left,escapeinside=@@,fontsize=\scriptsize]{python}{#1}}

\newcommand{\ptinline}[1]{{\texttt{\small {#1}}}}

% % TODO: What am I doing with this?
\newcommand*\justify{%
  \fontdimen2\font=0.4em% interword space
  \fontdimen3\font=0.2em% interword stretch
  \fontdimen4\font=0.1em% interword shrink
  \fontdimen7\font=0.1em% extra space
  \hyphenchar\font=`\-% allowing hyphenation
}

\newcommand{\Vlabel}[1]{\label[line]{#1}\hypertarget{#1}{}}
\newcommand{\lref}[1]{\hyperlink{#1}{\FancyVerbLineautorefname~\ref*{#1}}}
\newcommand{\lrefrange}[2]{\FancyVerbLineautorefname{}s~\hyperlink{#1}{\ref*{#1}}--\hyperlink{#2}{\ref*{#2}}}
\newcommand{\Lrefrange}[2]{Lines~\hyperlink{#1}{\ref*{#1}}--\hyperlink{#2}{\ref*{#2}}}

% Proof Tree
\usepackage[nounderscore]{syntax}
\usepackage{bussproofs}

% Half-reification math things

% \DeclareMathOperator{\rules}{\mathit{rules}}
% \DeclareMathOperator{\lazy}{\mathit{lazy}}
% \DeclareMathOperator{\events}{\mathit{events}}
% \DeclareMathOperator{\domain}{\mathit{domain}}
% \DeclareMathOperator{\bc}{\mathit{bc}}
% \DeclareMathOperator{\lbc}{\mathit{lbc}}
% \DeclareMathOperator{\ubc}{\mathit{ubc}}
% \DeclareMathOperator{\dmc}{\mathit{dmc}}
% \DeclareMathOperator{\fix}{\mathit{fix}}
% \DeclareMathOperator{\event}{\mathit{event}}
% \DeclareMathOperator{\minassign}{\mathit{minassign}}
% \DeclareMathOperator{\assign}{\mathit{assign}}
% \DeclareMathOperator{\rep}{\mathit{rep}}
% \DeclareMathOperator{\cl}{\mathit{cl}}
% \DeclareMathOperator{\UP}{\mathit{UP}}
% \DeclareMathOperator{\up}{\mathit{up}}
% \DeclareMathOperator{\DOM}{\mathit{DOM}}
% \DeclareMathOperator{\false}{\mathit{false}}
% \DeclareMathOperator{\true}{\mathit{true}}
% \DeclareMathOperator{\lit}{\mathit{lit}}
% \DeclareMathOperator{\setb}{\mathit{sb}}
% \DeclareMathOperator{\bnd}{\mathit{bnd}}
% \DeclareMathOperator{\dsb}{\mathit{dsb}}
% \DeclareMathOperator{\vars}{\mathit{vars}}
% \DeclareMathOperator{\ivars}{\mathit{input}}
% \DeclareMathOperator{\ovars}{\mathit{output}}
% %\DeclareMathOperator{\supp}{supp}
% \DeclareMathOperator{\solns}{\mathit{solns}}
% \DeclareMathOperator{\solv}{\mathit{solv}}
% \DeclareMathOperator{\isolv}{\mathit{isolv}}
% \DeclareMathOperator{\conv}{\mathit{conv}}
% \DeclareMathOperator{\ran}{\mathit{ran}}
% \DeclareMathOperator{\ite}{\mathit{ite}}
% \DeclareMathOperator{\VAR}{\mathit{VAR}}

% \newcommand{\VV}{{\cal V}}
% \newcommand{\PP}{{\cal P}}
% \newcommand{\range}[2]{\left[\,#1\,..\,#2\,\right]}
% \newcommand{\gfp}{\textup{gfp}}
% \newcommand{\lfp}{\textup{lfp}}
% \newcommand{\iter}{\mathit{iter}}

% \newcommand{\half}{\Rightarrow}
% \newcommand{\full}{\Leftrightarrow}
% \renewcommand{\half}{\rightarrow}
% \renewcommand{\full}{\leftrightarrow}

% \newcommand{\cross}{\times}
% \renewcommand{\cross}{\baucross}
% \renewcommand{\cross}{\ding{54}}
% \newcommand{\entails}{\models}
% \newcommand{\bigsqcap}{\mathop{\lower.1ex\hbox{\Large$\sqcap$}}}

% \newcommand{\mdiv}{\texttt{div}}
% \newcommand{\element}{\texttt{element}}
% \newcommand{\alldiff}{\texttt{all\_different}}
