X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=preamble.tex;h=6c3ec94b05f32fb15e9abe2d5064aa981612e305;hb=c15776f71f5efe186708e2604ff8f32115c8ac3d;hp=9f3687776970acc768e70cc4249fbdf9a7dc8d27;hpb=437d98c1ba1c0a184da28f1ea2a87fff2cfb1d7e;p=phd-thesis.git diff --git a/preamble.tex b/preamble.tex index 9f36877..6c3ec94 100644 --- a/preamble.tex +++ b/preamble.tex @@ -1,7 +1,22 @@ -% Input encoding -\usepackage[utf8]{inputenc} +% Fonts +\usepackage[utf8]{inputenc} % Input encoding +\usepackage[T1]{fontenc} % Font encoding +\usepackage{lmodern} % Nicer font +\usepackage{microtype} % Better kerning +\usepackage{tipa} % IPA symbols +\usepackage{stmaryrd} % short arrows +\usepackage{textcomp} % upquote +\usepackage{titlecaps} % titlecase commands +\usepackage{amsmath} % extra math +\usepackage{amssymb} % extra math symbols +\everymath{\it\/} +\DeclareMathSymbol{\shortminus}{\mathbin}{AMSa}{"39} %chktex 18 -% Papersize +% Internationalisation +\usepackage[dutch,russian,british]{babel} +%\babelfont[russian]{rm}{Liberation Serif} + +% Papersize and layout \usepackage{geometry} \geometry{ inner=25mm, @@ -13,87 +28,89 @@ paperwidth=17cm, paperheight=24cm, } +\usepackage[ + height={1.5cm}, + width={12mm}, + distance={1.55cm}, + topthumbmargin={auto}, + bottomthumbmargin={auto}, + eventxtindent={.5cm}, + oddtxtexdent={.3cm}]{thumbs} % thumb marks +\usepackage{fancyhdr} % Custom headers and footers +%\pagestyle{fancy} +\pagestyle{headings} +\usepackage{etoolbox} % To patch the chapter command +% Have better page numbering in chapters +\patchcmd{\chapter}{plain}{headings}{}{} +\usepackage{epigraph} % Epigraph +\renewcommand\partname{Movement} % Rename parts to movements (rhapsody uhu) +\newenvironment{chapterabstract} + {\begin{quote}} + {\end{quote}} -% Font encoding -\usepackage[T1,T2A]{fontenc} - -% standalone figures -\usepackage[subpreambles=true]{standalone} - -% Less bad boxes -\usepackage{microtype} - -% No more room for a new \write -\usepackage{morewrites} - -% Internationalisation -\usepackage[dutch,russian,british]{babel} -%\babelfont[russian]{rm}{Liberation Serif} +% Increase the depth for the table of contents +\setcounter{secnumdepth}{3} +\renewcommand{\contentsname}{Table of Contents} % change the name of the TOC +\AtBeginDocument{\addtocontents{toc}{\protect\thispagestyle{empty}}} % to remove page numbering from the TOC -% Appendices (used for subappendices, appendices per chapter) -\usepackage{appendix} +% (file) structure +\usepackage[subpreambles=true]{standalone} % standalone figures +\usepackage{morewrites} % fix no more room for a new \write +\usepackage{appendix} % subappendices, appendices per chapter -% Cite bib entry completely -\usepackage{bibentry} +% Bibliography +\usepackage{bibentry} % Cite bib entry completely \nobibliography* +\bibliographystyle{alpha} -% Hyperlinks -\usepackage{bookmark,hyperref} -%\usepackage[pagebackref]{bookmark,hyperref} -% Setup pdf parameters: TODO +% Hyperlinks and metadata +\usepackage[pagebackref]{hyperref} % hyperlinks +\renewcommand*{\backref}[1]{} +\renewcommand*{\backrefalt}[4]{[{% + \ifcase #1 not cited.\or p.~#2.\else pp. #2.\fi%chktex 1 +}]} \hypersetup{% pdftitle={\mytitle}, pdfauthor={\myauthor}, - pdfsubject={}, -% pdfcreator={}, -% pdfproducer={}, pdfkeywords={task-oriented programming, functional programming, domain specific languages, internet of things}, hidelinks, } +\usepackage[nodayofweek]{datetime} % Use a fixed document date \urlstyle{same} -\usepackage{xmpincl} -\includexmp{CC_Attribution-NoDerivatives_4.0_International} +\usepackage{bookmark} +\usepackage{cleveref} % Easy references +\crefname{part}{movement}{movements} +\crefname{lstlisting}{listing}{listing} % Graphics -\usepackage{graphicx} -% Images directory -\graphicspath{{img/}} -%subfigures -\usepackage{caption} +\usepackage{graphicx} % Images +\graphicspath{{img/},{introduction/img}} +\usepackage{caption} % subfigures \usepackage{subcaption} - -% Nice tables -\usepackage{booktabs} -% Multirow cells -\usepackage{multirow} - -% orcid icon -\usepackage{academicons} \newcommand{\orcid}[1]{\href{https://orcid.org/#1}{\hspace{1mm}\includegraphics[width=1em]{orcid}\hspace{2mm} https://orcid.org/#1}} -% IPA symbols -\usepackage{tipa} - -% Automatically wrapping tables -\usepackage{tabularx} - -% Use a fixed document date -\usepackage[nodayofweek]{datetime} +% Tables +\usepackage{booktabs} % Nicer tables +\usepackage{multirow} % Multirow cells +\usepackage{tabularx} % Automatically wrapping tables +\usepackage{longtable} % Tables spanning pages % Code -\usepackage{stmaryrd} % Short arrow -\usepackage{textcomp} % upquote +% Pseudocode +\usepackage[algochapter]{algorithm2e} +% Fix the algorithm font +\renewcommand\AlCapFnt{\normalfont} \usepackage{listings} % General listings settings \lstset{% - basewidth=0.45em, + basewidth=0.5em, basicstyle=\tt\small, breakatwhitespace=false, breaklines=true, captionpos=b, columns=[c]fixed, commentstyle=\sl, - escapeinside={(+}{+)}, % chktex 9 +% escapeinside={(+}{+)}, % chktex 9 frame=L, keepspaces=true, keywordstyle=\bf, @@ -108,6 +125,9 @@ \usepackage{lstlangclean} \usepackage{lstlanghaskell} \usepackage{lstlanghaskelllhstex} +\usepackage{lstlangarduino} +\newcommand{\cinline}[1]{\lstinline[language=c,postbreak=]|#1|} +\newcommand{\arduinoinline}[1]{\lstinline[language={[Arduino]C++},postbreak=]|#1|} \newcommand{\cleaninline}[1]{\lstinline[language=Clean,postbreak=]|#1|} \newcommand{\haskellinline}[1]{\lstinline[language=Haskell,style=haskell,postbreak=]|#1|} \newcommand{\haskelllhstexinline}[1]{\lstinline[language=Haskell,style=haskelllhstex,postbreak=]|#1|} @@ -124,24 +144,34 @@ \lstnewenvironment{lstClean}[1][] {% \lstset{language=Clean, #1} - \renewcommand*{\lstlistingname}{Listing (Clean)} + \renewcommand*{\lstlistingname}{Listing (\gls{CLEAN})} + } + {} +\lstnewenvironment{lstArduino}[1][] + {% + \lstset{language={[Arduino]C++}, #1} + \renewcommand*{\lstlistingname}{Listing (\gls{ARDUINO})} } {} \lstnewenvironment{lstHaskell}[1][] {% \lstset{language=Haskell,style=haskell,#1}% - \renewcommand*{\lstlistingname}{Listing (Haskell)} + \renewcommand*{\lstlistingname}{Listing (\gls{HASKELL})} } {} \lstnewenvironment{lstHaskellLhstex}[1][] {% \lstset{language=Haskell,style=haskelllhstex,#1}% - \renewcommand*{\lstlistingname}{Listing (Haskell)} + \renewcommand*{\lstlistingname}{Listing (\gls{HASKELL})} } {} % Glossaries and acronyms \usepackage[acronym,nonumberlist]{glossaries} +\Addlcwords{of} +% Titlecase glossary commands +\newcommand{\glst}[1]{\titlecap{\glsentrylong{#1}}} +\newcommand{\Glst}[1]{\glst{#1}} % Fix gls in hyperlink errors \pdfstringdefDisableCommands{% \def\acrlong#1{}% @@ -165,66 +195,26 @@ \def\titlecap#1{}% } -% Titlecase commands -\usepackage{titlecaps} -\Addlcwords{of} -% Titlecase glossary command -\newcommand{\glst}[1]{\titlecap{\glsentrylong{#1}}} -\newcommand{\Glst}[1]{\glst{#1}} - -% Pseudocode -\usepackage[algochapter]{algorithm2e} -% Fix the algorithm font -\renewcommand\AlCapFnt{\normalfont} - % Index \usepackage{makeidx} -% Enable the index -\makeindex% +\makeindex% Enable the index % Custom enumerations \usepackage[inline,shortlabels]{enumitem} \setlist{noitemsep} \setlist[description]{leftmargin=\parindent} -% Epigraph -\usepackage{epigraph} - -% Thumb marks on the page -\usepackage[ - height={1.5cm}, - width={12mm}, - distance={1.55cm}, - topthumbmargin={auto}, - bottomthumbmargin={auto}, - eventxtindent={.5cm}, - oddtxtexdent={.3cm}]{thumbs} - -% Custom headers and footers -\usepackage{fancyhdr} -%\pagestyle{fancy} -\pagestyle{headings} - -% Tables spanning pages -\usepackage{longtable} - -% Easy references -\usepackage{cleveref} - -% To patch the chapter command -\usepackage{etoolbox} -% Have better page numbering in chapters -\patchcmd{\chapter}{plain}{headings}{}{} - -% Increase the depth for the table of contents -\setcounter{secnumdepth}{3} -\renewcommand{\contentsname}{Table of Contents} % change the name of the TOC -\AtBeginDocument{\addtocontents{toc}{\protect\thispagestyle{empty}}} % to remove page numbering from the TOC - % Initialize the glossaries \makeglossaries% \input{glossaries} +\usepackage{subfiles} + +\ifSubfilesClassLoaded{}{ + \usepackage{xmpincl} + \includexmp{CC_Attribution-NoDerivatives_4.0_International} +} + % Custom commands \newcommand{\GHCmod}[1]{\texttt{#1}} \newcommand{\requiresGHCmod}[1]{\footnote{Requires \GHCmod{#1} to be enabled.}} @@ -233,7 +223,3 @@ \newcommand{\mlubbers}{Lubbers, M.\ (Radboud University)} \newcommand{\pkoopman}{Koopman, dr.\ P.\ (Radboud University)} \newcommand{\rplasmeijer}{Plasmeijer, prof.\ dr.\ ir.\ R.\ (Radboud University)} - -\bibliographystyle{alpha} - -\usepackage{subfiles}