This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
dekker-phd-thesis/assets/packages.tex

207 lines
5.6 KiB
TeX

\hfuzz=1.5pt
\usepackage{fvextra}
\usepackage{csquotes}
\usepackage[australian]{babel}
\usepackage{hyperref}
\hypersetup{bookmarksnumbered}
\usepackage{xspace}
% Fonts
\usepackage{fontspec}
%% Main font
\setmainfont{PlayfairDisplay}[
Path=assets/fonts/PlayfairDisplay/,
Extension=.ttf,
UprightFont=*-Regular,
BoldFont=*-Bold,
ItalicFont=*-Italic,
BoldItalicFont=*-BoldItalic,
SmallCapsFont=*SC-Regular,
]
\setmainfont{Hoefler Text}
%% Title font
\newfontfamily{\inter}{Inter}[
Path=assets/fonts/Inter/,
Extension=.ttf,
UprightFont=*-Regular,
BoldFont=*-Bold,
]
\newfontfamily{\satisfyfont}{Satisfy}[
Path=assets/fonts/Satisfy/,
Extension=.ttf,
UprightFont=*-Regular,
]
%% Monospace font
\setmonofont{VictorMono}[
Ligatures=TeX,
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}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
% References
\usepackage[
style=apa,
]{biblatex}
\usepackage[noabbrev]{cleveref}
% Tables
\usepackage{booktabs}
% Plots
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usetikzlibrary{patterns}
% Glossary / Acronyms
\usepackage[acronym,toc]{glossaries}
\usepackage[stylemods=bookindex]{glossaries-extra}
\usepackage{titlecaps}
\setabbreviationstyle[acronym]{long-short}
\defglsentryfmt[main]{\ifglsused{\glslabel}{\glsgenentryfmt}{\textit{\glsgenentryfmt}}}
\makeglossaries{}
% Graphics
\usepackage{graphicx}
\usepackage{subcaption}
% Algorithms
% \usepackage[ruled,vlined]{algorithm2e}
% % 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{\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}
\setlength{\grammarindent}{8em}
\usepackage{ebproof}
% Half Reif packages (maybe we should get rid of these)
\usepackage[all]{xy}
% Comments
\newcommand{\pjs}[1]{\textcolor{blue}{\Big[\textbf{Peter}: #1\Big]}}
\newcommand{\jip}[1]{\textcolor{red}{\Big[\textbf{Jip}: #1\Big]}}
% Example environment
\usepackage[many]{tcolorbox}
\newcounter{example}[chapter]
\counterwithin{example}{chapter}
\newenvironment{example}[1][]{\refstepcounter{example}\begin{examplebox}#1}{\end{examplebox}}
\newtcolorbox{examplebox}[1][]{
breakable,
enhanced,
% skin=enhancedlast,
attach boxed title to top left={xshift=-4mm,yshift=-0.5mm},
fonttitle=\bfseries\sffamily,
attach boxed title to top center,
boxed title style={empty,arc=0pt,outer arc=0pt,boxrule=0pt},
underlay boxed title={
\draw[#1] (title.north west) -- (title.north east) -- +(\tcboxedtitleheight,-\tcboxedtitleheight)
-- (title.south west) -- +(-\tcboxedtitleheight,0)-- cycle;
},
overlay last={
\draw[#1] ([xshift=-80pt]frame.south) -- ++ (160pt,0pt);
\fill[#1] ([xshift=-30pt,yshift=-1pt]frame.south) rectangle +(60pt,2pt);
},
overlay unbroken={
\draw[#1] ([xshift=-80pt]frame.south) -- ++ (160pt,0pt);
\fill[#1] ([xshift=-30pt,yshift=-1pt]frame.south) rectangle +(60pt,2pt);
},
title={Example \theexample{}},
colback=white,
coltitle=black,
colframe=white,
}
% Code formatting
\usepackage[
chapter,
cachedir=listings,
outputdir=build,
]{minted}
\usemintedstyle{borland}
\newtcolorbox{listingbox}[1][]{
breakable,
enhanced,
arc=0pt,
boxrule=0pt,
outer arc=0pt,
overlay first={
\draw[#1] (frame.north west) -- ++ (0,-5pt);
\draw[#1] (frame.north west) -- ++ (25pt, 0pt);
},
overlay last={
\draw[#1] (frame.south west) -- ++ (0, 5pt);
\draw[#1] (frame.south west) -- ++ (25pt,0pt);
},
overlay unbroken={
\draw[#1] (frame.north west) -- ++ (0,-5pt);
\draw[#1] (frame.north west) -- ++ (25pt, 0pt);
\draw[#1] (frame.south west) -- ++ (0, 5pt);
\draw[#1] (frame.south west) -- ++ (25pt,0pt);
},
colback=white,
colframe=white,
}
\BeforeBeginEnvironment{minted}{\begin{listingbox}}
\AfterEndEnvironment{minted}{\end{listingbox}}
\newcommand{\ptinline}[1]{{\texttt{\small {#1}}}}
\newcommand{\pyfile}[1]{\inputminted[autogobble=true,breaklines,breakindent=4em,numbers=left,escapeinside=@@,fontsize=\scriptsize]{python}{#1}}
\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}}
\newenvironment{mzn}{\VerbatimEnvironment{}\begin{minted}[
autogobble=true,
breaklines,
breakindent=4em,
numbers=none,
escapeinside=@@,
fontsize=\scriptsize,
]{minizinc}}{\end{minted}}
% TODO: Fix the nanozinc sytax highlighting/formatting
\newcommand{\nzninline}[1]{\mintinline[fontsize=\small,escapeinside=@@]{minizinc}{#1}}
\newenvironment{nzn}{\VerbatimEnvironment{}\begin{minted}[
autogobble=true,
breaklines,
breakindent=4em,
numbers=none,
escapeinside=@@,
fontsize=\scriptsize,
]{minizinc}}{\end{minted}}
\newenvironment{plain}{\VerbatimEnvironment{}\begin{minted}[
autogobble=true,
breaklines,
breakindent=4em,
numbers=none,
escapeinside=@@,
fontsize=\scriptsize,
]{text}}{\end{minted}}