X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=preamble.tex;h=49722c2ba04731cb57f3572add99f2861104700f;hb=a944020914b1ddbe8286962e3ea50ee1d3fd7a45;hp=9553aaa1239a384ffafed36574657db639ce5ed7;hpb=8d13b34bbd6121ac0babfc6daca0db4b8b40e561;p=phd-thesis.git diff --git a/preamble.tex b/preamble.tex index 9553aaa..49722c2 100644 --- a/preamble.tex +++ b/preamble.tex @@ -1,4 +1,6 @@ -\usepackage[ +% Papersize +\usepackage{geometry} +\geometry{ inner=25mm, outer=20mm, marginparsep=3mm, @@ -6,32 +8,67 @@ top=25mm, bottom=20mm, paperwidth=17cm, - paperheight=24cm]{geometry} % Papersize -\usepackage[british]{babel} % Internationalization -\usepackage[titletoc]{appendix} % Appendices -\usepackage[pagebackref,hidelinks]{hyperref} % Hyperlinks -\usepackage{graphicx} % Graphics -\usepackage{booktabs} % Better looking tables -\usepackage{etoolbox} % Patch chapter command -\usepackage[nodayofweek]{datetime} % Use a fixed document date -\usepackage{listings} % Code -\usepackage[acronym,nonumberlist]{glossaries} % Glossaries and acronyms -\usepackage[algochapter]{algorithm2e} % Pseudocode -\usepackage{makeidx} % Index -\usepackage[inline,shortlabels]{enumitem} % Customized enumerations -\setlist{noitemsep} -\setlist[description]{leftmargin=\parindent} -\usepackage{epigraph} + paperheight=24cm, +} -% Have better page numbering in chapters -\patchcmd{\chapter}{plain}{headings}{}{} +% Font encoding +\usepackage[T1]{fontenc} + +% Internationalisation +\usepackage[british]{babel} + +% Appendices +% TODO is this necessary? +\usepackage[titletoc]{appendix} + +% Hyperlinks +\usepackage{hyperref} +% Setup pdf parameters: TODO +\hypersetup{% + pdftitle={}, + pdfauthor={M. Lubbers}, + pdfsubject={}, +% pdfcreator={}, +% pdfproducer={}, + pdfkeywords={}, + pagebackref, + hidelinks, +} +% Graphics +\usepackage{graphicx} % Images directory \graphicspath{{img/}} +% Nice tables +\usepackage{booktabs} + +% Automatically wrapping tables +\usepackage{tabularx} + +% Use a fixed document date +\usepackage[nodayofweek]{datetime} + +% Code +\usepackage{listings} +% General listings settings +\lstset{% + breakatwhitespace=false, + breaklines=true, + captionpos=b, + keepspaces=true, + basicstyle=\ttfamily\fontseries{l}\footnotesize, + commentstyle=\slshape\fontseries{m}, + keywordstyle=\bfseries\fontseries{b}, + stringstyle=\ttfamily, + showspaces=false, + showstringspaces=false, + showtabs=false, + tabsize=4, + frame=L, +} % Fix list of listings title \renewcommand{\lstlistlistingname}{List of Listings} - % Fix list of listings chapter separator \makeatletter \let\my@chapter\@chapter% @@ -40,16 +77,8 @@ \my@chapter} \makeatother -% Setup pdf parameters -\hypersetup{% - pdftitle={}, - pdfauthor={}, - pdfsubject={}, - pdfcreator={}, - pdfproducer={}, - pdfkeywords={}, -} - +% Glossaries and acronyms +\usepackage[acronym,nonumberlist]{glossaries} % Fix gls in hyperlink errors \pdfstringdefDisableCommands{% \def\acrlong#1{}% @@ -68,34 +97,58 @@ \def\glspl#1{}% \def\Gls#1{}% \def\Glspl#1{}% + \def\titlecap#1{}% } -% General listings settings -\lstset{% - breakatwhitespace=false, - breaklines=true, - captionpos=b, - keepspaces=true, - basicstyle=\ttfamily\fontseries{l}\footnotesize, - commentstyle=\slshape\fontseries{m}, - keywordstyle=\bfseries\fontseries{b}, - stringstyle=\ttfamily, - showspaces=false, - showstringspaces=false, - showtabs=false, - tabsize=4, - frame=L, -} - -% Increase the depth for the table of contenst -\setcounter{secnumdepth}{3} +% 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% + +% Custom enumerations +\usepackage[inline,shortlabels]{enumitem} +\setlist{noitemsep} +\setlist[description]{leftmargin=\parindent} + +% Epigraph (lovecraft) +\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} + +% 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} - -% Enable the index -\makeindex%