george comments
[phd-thesis.git] / preamble.tex
index 965fc41..2606a8c 100644 (file)
 \usepackage{relsize}        % \smaller command
 \usepackage{siunitx}        % typeset units
 \usepackage{xcolor}         % colors
+\usepackage{fnpct}          % footnotekerning
 \DeclareSIUnit\noop{\relax}
 \DeclareSIUnit\celcius{{}^{\circ}\kern-\scriptspace\mathsf{C}}
 \everymath{\it\/}
 \DeclareMathSymbol{\shortminus}{\mathbin}{AMSa}{"39} %chktex 18
-\newcommand{\dcolon}[0]{\mathbin{::}}
-\newcommand{\refreshrate}[2]{\langle{}#1, #2\rangle{}}
 
 % Internationalisation
 \usepackage[dutch,russian,british]{babel}
 }
 \usepackage{pdflscape}
 \usepackage{float}
+\usepackage{newfloat}
+\DeclareFloatingEnvironment[
+       fileext=loq,
+       listname={List of definitions},
+       name=Definition,
+       placement=tbp,
+       within=chapter,
+       chapterlistsgaps=on,
+       ]{equ}
 \usepackage{fancyhdr} % Custom headers and footers
 %\pagestyle{headings}
 \pagestyle{fancy}
 \def\part@nostar@nopt#1{\NR@gettitle{#1}\titlesec@part{#1}}
 \def\part@nostar@opt[#1]#2{\NR@gettitle{#1}\titlesec@part[#1]{#2}}
 \makeatother
-\newenvironment{chapterabstract}{\begin{quotation}\em\noindent}{\end{quotation}} %chktex 6
+\newenvironment{chapterabstract}{\begin{quotation}\em}{\end{quotation}} %chktex 6
 
 % Increase the depth for the table of contents
 \setcounter{secnumdepth}{3}
 \newcommand{\arduinoinline}[1]{\lstinline[language={[Arduino]C++},postbreak=]|#1|}
 \newcommand{\pythoninline}[1]{\lstinline[language=Python,postbreak=]|#1|}
 \newcommand{\cleaninline}[1]{\lstinline[language=Clean,postbreak=]|#1|}
-\newcommand{\cleaninputlisting}[2][]{\renewcommand*{\lstlistingname}{Listing (\gls{CLEAN})}\lstinputlisting[language=Clean,#1]{#2}}
+\newcommand{\cleaninputlisting}[2][]{\renewcommand*{\lstlistingname}{Listing (\gls{CLEAN})}\lstinputlisting[language=Clean,#1]{\subfix{#2}}}
 \newcommand{\haskellinline}[1]{\lstinline[language={[Regular]Haskell},postbreak=]|#1|}
-\newcommand{\haskellinputlisting}[2][]{\renewcommand*{\lstlistingname}{Listing (\gls{HASKELL})}\lstinputlisting[language={[Regular]Haskell},#1]{#2}}
+\newcommand{\haskellinputlisting}[2][]{\renewcommand*{\lstlistingname}{Listing (\gls{HASKELL})}\lstinputlisting[language={[Regular]Haskell},#1]{\subfix{#2}}}
 \newcommand{\haskelllhstexinline}[1]{\lstinline[language={[Lhs2Tex]Haskell},postbreak=]|#1|}
 %For storing listings in footnotes
 \newsavebox{\LstBox}
 \lstnewenvironment{lstArduino}[1][]
        {% 
                \lstset{language={[Arduino]C++}, #1}
-               \renewcommand*{\lstlistingname}{Listing (\gls{ARDUINO})}
+               \renewcommand*{\lstlistingname}{Listing (\gls{CPP})}
        }
        {}
 \lstnewenvironment{lstHaskell}[1][]
 \urlstyle{same}
 \usepackage{bookmark}
 \usepackage[noabbrev]{cleveref} % Easy references
+\usepackage{crossreftools} % Easy references
+\crefname{equ}{equation}{equations}
 \crefname{part}{episode}{episodes}
 \crefname{lstlisting}{listing}{listings}
+\crefname{equ}{definition}{definition}
 \usepackage{nameref} % to reference names of chapters
-\newcommand{\fullref}[1]{\cref{#1}: \nameref{#1}}
-\newcommand{\Fullref}[1]{\Cref{#1}: \nameref{#1}}
+\newcommand{\fullref}[1]{\crtcref{#1}: \nameref{#1}}
+\newcommand{\Fullref}[1]{\crtCref{#1}: \nameref{#1}}
 \creflabelformat{equation}{#2\textup{#1}#3}
 
 % Glossaries and acronyms
 \usepackage[nolangwarn,abbreviations,nonumberlist,prefix]{glossaries-extra}
-\setabbreviationstyle[acronym]{long-short}
+\setabbreviationstyle{long-short}
+\setabbreviationstyle[noexpand]{short-nolong}
 \Addlcwords{of}
-% Titlecase glossary commands
-\newcommand{\glst}[1]{\titlecap{\glsentrylong{#1}}}
-\newcommand{\Glst}[1]{\glst{#1}}
 \usepackage{glossary-mcols}
 \pdfstringdefDisableCommands{%
        \def\glsxtrlong#1{}%
        \def\Glspl#1{}%
        \def\Glsentrytext#1{}%
        \def\titlecap#1{}%
+       \def\MakeUppercase#1{}%
 }
 
 % Index
 
 % Custom commands
 \newcommand{\GHCmod}[1]{\texttt{#1}}
-\newcommand{\requiresGHCmod}[2][]{\footnote{Requires \GHCmod{#2} to be enabled. #1}}
-%\newcommand{\etc}{{\fontfamily{cmr}\selectfont{\itshape\/\&c}}}
+\newcommand{\aramsingh}{Ramsingh, A.\ (University of Glasgow)}
+\newcommand{\dcolon}[0]{\mathbin{::}}
+\newcommand{\doifmt}[1]{\href{https://doi.org/#1}{#1}}
 \newcommand{\etc}{{\fontfamily{cmr}\selectfont{\itshape\/\&\kern-0.2em c}}}
-\newcommand{\rdmentry}[5]{#1 (#2): #3. #4.\ \href{https://doi.org/#5}{#5}}
+\newcommand{\jsinger}{Singer, dr.\ J.\ (University of Glasgow)}
 \newcommand{\mlubbers}{Lubbers, M.\ (Radboud University)}
 \newcommand{\pkoopman}{Koopman, dr.\ P.\ (Radboud University)}
-\newcommand{\rplasmeijer}{Plasmeijer, prof.\ dr.\ ir.\ R.\ (Radboud University)}
-\newcommand{\aramsingh}{Ramsingh, A.\ (University of Glasgow)}
-\newcommand{\jsinger}{Singer, dr.\ J.\ (University of Glasgow)}
 \newcommand{\ptrinder}{Trinder, prof.~dr.\ P.\ (University of Glasgow)}
-
-\newcommand{\mypart}[3]{
-       \part[#2: #3]{#2\\[2ex]\smaller{}#3}%
-       \label{#1}
-}
+\newcommand{\rdmentry}[5]{#1 (#2): #3. #4.\ \doifmt{#5}}
+\newcommand{\rewriterate}[2]{\langle{}#1, #2\rangle{}}
+\newcommand{\requiresGHCmod}[2][]{\footnote{Requires \GHCmod{#2} to be enabled. #1}}
+\newcommand{\rplasmeijer}{Plasmeijer, prof.\ dr.\ ir.\ R.\ (Radboud University)}
+\newcommand{\erasmusplus}{ERASMUS\raisebox{.25ex}{+}}