X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=preamble.tex;h=20ba25a98d872843f62f783fed0f2e756d9d47af;hb=40c364b9de5d27b8afedcfd83d76499acc9e31af;hp=2518545f4bd8ab8549ee986c63fe295454ac22ba;hpb=c45698c752780ef2bf45ae9f8085585e9eee1d18;p=phd-thesis.git diff --git a/preamble.tex b/preamble.tex index 2518545..20ba25a 100644 --- a/preamble.tex +++ b/preamble.tex @@ -15,11 +15,12 @@ \usepackage{relsize} % \smaller command \usepackage{siunitx} % typeset units \usepackage{xcolor} % colors +\usepackage{fnpct} % footnotekerning +\usepackage[all]{nowidow} % Kill widows and orphans \DeclareSIUnit\noop{\relax} \DeclareSIUnit\celcius{{}^{\circ}\kern-\scriptspace\mathsf{C}} \everymath{\it\/} \DeclareMathSymbol{\shortminus}{\mathbin}{AMSa}{"39} %chktex 18 -\newcommand{\dcolon}[0]{\mathbin{::}} % Internationalisation \usepackage[dutch,russian,british]{babel} @@ -40,15 +41,25 @@ } \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 +\usepackage[fit]{truncate} %\pagestyle{headings} \pagestyle{fancy} \fancyhead{} \fancyfoot{} \setlength{\unitlength}{18mm} \newcommand{\blob}{{\color{gray}\rule[-.2\unitlength]{2\unitlength}{.5\unitlength}}} -\fancyhead[RE]{\rightmark} -\fancyhead[LO]{\leftmark} +\fancyhead[RE]{\truncate{.95\headwidth}{\rightmark}} +\fancyhead[LO]{\truncate{.95\headwidth}{\leftmark}} \newcommand{\frontmatterfancy}[0]{ \fancyhead[RO]{\thepage} \fancyhead[LE]{\thepage} @@ -107,7 +118,11 @@ \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 + +\usepackage{framed} +\definecolor{lstbg}{gray}{.95} +\definecolor{shadecolor}{named}{lstbg} +\newenvironment{chapterabstract}{\begin{shaded}\begin{quotation}}{\end{quotation}\end{shaded}} %chktex 6 % Increase the depth for the table of contents \setcounter{secnumdepth}{3} @@ -120,15 +135,16 @@ \usepackage{appendix} % subappendices, appendices per chapter % Bibliography -\usepackage{natbib} % Cite bib entry completely +\usepackage[square]{natbib} % Cite bib entry completely \setlength{\bibsep}{0.0pt} -\def\bibfont{\small} +%\def\bibfont{\small} %\bibliographystyle{alpha} \bibliographystyle{abbrvnat} -\apptocmd{\thebibliography}{\raggedright}{}{} +%\apptocmd{\thebibliography}{\raggedright}{}{} \usepackage{bibentry} % Cite bib entry completely \nobibliography* \newcommand{\citeentry}[1]{\begin{NoHyper}\bibentry{#1}\end{NoHyper}. \citep{#1}} +\newcommand{\refurl}[2]{\url{#1}, accessed on: #2} \makeatletter \newcommand{\citepage}[1]{p.~#1} @@ -141,17 +157,9 @@ %\newcommand{\citesections}[1]{\S\S.~#1} \newcommand{\citeparagraph}[1]{\P.~#1} \newcommand{\citeparagraphs}[1]{\P\P.~#1} +\newcommand{\citelisting}[1]{\cref@listing@name~#1} \makeatother -% Graphics -\usepackage{graphicx} % Images -\graphicspath{{img/},{intro/img},{top/img},{tvt/img}} -\usepackage{caption} % subfigures -\usepackage{subcaption} -\usepackage{rotating} -\newcommand{\orcid}[1]{\href{https://orcid.org/#1}{\hspace{1mm}\includegraphics[width=1em]{orcid}\hspace{2mm} https://orcid.org/#1}} -\usepackage{tikz} - % Tables \usepackage{booktabs} % Nicer tables \usepackage{multirow} % Multirow cells @@ -161,10 +169,11 @@ % Code % Pseudocode -\usepackage[algochapter]{algorithm2e} +\usepackage[algochapter,linesnumbered,lined,boxed]{algorithm2e} % Fix the algorithm font \renewcommand\AlCapFnt{\normalfont} \usepackage{listings} +\newcounter{tmp} % https://tex.stackexchange.com/questions/149056/how-can-i-define-additional-literate-replacements-without-deleting-existing-ones \makeatletter \def\addToLiterate#1{\edef\lst@literate{\unexpanded\expandafter{\lst@literate}\unexpanded{#1}}} @@ -180,7 +189,8 @@ columns=[c]fixed, commentstyle=\sl, escapeinside={[+}{+]}, % chktex 9 - frame=L, + frame=, + backgroundcolor=\color{lstbg}, keepspaces=true, keywordstyle=\bf, postbreak=\mbox{\textcolor{gray}{$\hookrightarrow$}\space}, @@ -206,9 +216,9 @@ \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[escapeinside={/*}{*/},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} @@ -237,7 +247,7 @@ \lstnewenvironment{lstArduino}[1][] {% \lstset{language={[Arduino]C++}, #1} - \renewcommand*{\lstlistingname}{Listing (\gls{ARDUINO})} + \renewcommand*{\lstlistingname}{Listing (\gls{CPP})} } {} \lstnewenvironment{lstHaskell}[1][] @@ -253,8 +263,27 @@ } {} +% Graphics +\usepackage{graphicx} % Images +\graphicspath{{img/},{intro/img},{top/img},{tvt/img}} +\usepackage{caption} % subfigures/captionof +\usepackage{subcaption} +\usepackage{rotating} +\newcommand{\orcid}[1]{\href{https://orcid.org/#1}{\hspace{1mm}\includegraphics[width=1em]{orcid}\hspace{2mm} https://orcid.org/#1}} +\usepackage{tikz} + +% Index +%\usepackage{makeidx} +%\makeindex% Enable the index + +% Custom enumerations +\usepackage[inline,shortlabels]{enumitem} +\setlist{noitemsep} +\setlist[description]{leftmargin=\parindent} + % Hyperlinks and metadata -\usepackage[pdflang={en-GB},pagebackref]{hyperref} % hyperlinks +\usepackage[hyphens]{url} +\usepackage[pdflang={en-GB},pagebackref,breaklinks]{hyperref} % hyperlinks \usepackage{xr} % hyperlinks \renewcommand*{\backref}[1]{} \renewcommand*{\backrefalt}[4]{[{% @@ -270,19 +299,21 @@ \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{}% @@ -304,17 +335,9 @@ \def\Glspl#1{}% \def\Glsentrytext#1{}% \def\titlecap#1{}% + \def\MakeUppercase#1{}% } -% Index -%\usepackage{makeidx} -%\makeindex% Enable the index - -% Custom enumerations -\usepackage[inline,shortlabels]{enumitem} -\setlist{noitemsep} -\setlist[description]{leftmargin=\parindent} - % Initialize the glossaries \makeglossaries% \input{glossaries} @@ -328,18 +351,31 @@ % 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{\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}{+}} +\newcommand{\imtask}{\gls{ITASK}\slash\gls{MTASK}} +\newcommand{\Imtask}{\Gls{ITASK}\slash\gls{MTASK}} +\newcommand{\citask}{\gls{CLEAN}\slash\gls{ITASK}} +\newcommand{\Citask}{\Gls{CLEAN}\slash\gls{ITASK}} +\newcommand{\cimtask}{\gls{CLEAN}\slash\gls{ITASK}\slash\gls{MTASK}} +\newcommand{\Cimtask}{\Gls{CLEAN}\slash\gls{ITASK}\slash\gls{MTASK}} +\newcommand{\ccpp}{\gls{C}\slash\gls{CPP}} +\newcommand{\Ccpp}{\Gls{C}\slash\gls{CPP}} +\newcommand{\stacksize}[1]{\parallel#1\parallel} -\newcommand{\mypart}[3]{ - \part[#2: #3]{#2\\[2ex]\smaller{}#3}% - \label{#1} -} +\makeatletter +\newenvironment{compilationscheme} + {\allowdisplaybreaks\startalign} + {\endalign} +\makeatother