start with outline and fill in some data
[phd-thesis.git] / preamble.tex
1 % Papersize
2 \usepackage{geometry}
3 \geometry{
4 inner=25mm,
5 outer=20mm,
6 marginparsep=3mm,
7 marginparwidth=13mm,
8 top=25mm,
9 bottom=20mm,
10 paperwidth=17cm,
11 paperheight=24cm,
12 }
13
14 % Font encoding
15 \usepackage[T1]{fontenc}
16
17 % Internationalisation
18 \usepackage[british]{babel}
19
20 % Appendices
21 % TODO is this necessary?
22 \usepackage[titletoc]{appendix}
23
24 % Hyperlinks
25 \usepackage{hyperref}
26 % Setup pdf parameters: TODO
27 \hypersetup{%
28 pdftitle={},
29 pdfauthor={M. Lubbers},
30 pdfsubject={},
31 % pdfcreator={},
32 % pdfproducer={},
33 pdfkeywords={},
34 pagebackref,
35 hidelinks,
36 }
37
38 % Graphics
39 \usepackage{graphicx}
40 % Images directory
41 \graphicspath{{img/}}
42
43 % Nice tables
44 \usepackage{booktabs}
45
46 % Automatically wrapping tables
47 \usepackage{tabularx}
48
49 % Use a fixed document date
50 \usepackage[nodayofweek]{datetime}
51
52 % Code
53 \usepackage{listings}
54 % General listings settings
55 \lstset{%
56 breakatwhitespace=false,
57 breaklines=true,
58 captionpos=b,
59 keepspaces=true,
60 basicstyle=\ttfamily\fontseries{l}\footnotesize,
61 commentstyle=\slshape\fontseries{m},
62 keywordstyle=\bfseries\fontseries{b},
63 stringstyle=\ttfamily,
64 showspaces=false,
65 showstringspaces=false,
66 showtabs=false,
67 tabsize=4,
68 frame=L,
69 }
70 % Fix list of listings title
71 \renewcommand{\lstlistlistingname}{List of Listings}
72 % Fix list of listings chapter separator
73 \makeatletter
74 \let\my@chapter\@chapter%
75 \renewcommand*{\@chapter}{%
76 \addtocontents{lol}{\protect\addvspace{10pt}}%
77 \my@chapter}
78 \makeatother
79
80 % Glossaries and acronyms
81 \usepackage[acronym,nonumberlist]{glossaries}
82 % Fix gls in hyperlink errors
83 \pdfstringdefDisableCommands{%
84 \def\acrlong#1{}%
85 \def\acrlongpl#1{}%
86 \def\acrshort#1{}%
87 \def\acrshortpl#1{}%
88 \def\acrfull#1{}%
89 \def\acrfullpl#1{}%
90 \def\Acrlong#1{}%
91 \def\Acrlongpl#1{}%
92 \def\Acrshort#1{}%
93 \def\Acrshortpl#1{}%
94 \def\Acrfull#1{}%
95 \def\Acrfullpl#1{}%
96 \def\gls#1{}%
97 \def\glspl#1{}%
98 \def\Gls#1{}%
99 \def\Glspl#1{}%
100 \def\titlecap#1{}%
101 }
102
103 % Titlecase commands
104 \usepackage{titlecaps}
105 \Addlcwords{of}
106 % Titlecase glossary command
107 \newcommand{\glst}[1]{\titlecap{\glsentrylong{#1}}}
108 \newcommand{\Glst}[1]{\glst{#1}}
109
110 % Pseudocode
111 \usepackage[algochapter]{algorithm2e}
112 % Fix the algorithm font
113 \renewcommand\AlCapFnt{\normalfont}
114
115 % Index
116 \usepackage{makeidx}
117 % Enable the index
118 \makeindex%
119
120 % Custom enumerations
121 \usepackage[inline,shortlabels]{enumitem}
122 \setlist{noitemsep}
123 \setlist[description]{leftmargin=\parindent}
124
125 % Epigraph (lovecraft)
126 \usepackage{epigraph}
127
128 % Thumb marks on the page
129 \usepackage[
130 height={1.5cm},
131 width={12mm},
132 distance={1.55cm},
133 topthumbmargin={auto},
134 bottomthumbmargin={auto},
135 eventxtindent={.5cm},
136 oddtxtexdent={.3cm}]{thumbs}
137
138 % Custom headers and footers
139 \usepackage{fancyhdr}
140 \pagestyle{fancy}
141
142 % To patch the chapter command
143 \usepackage{etoolbox}
144 % Have better page numbering in chapters
145 \patchcmd{\chapter}{plain}{headings}{}{}
146
147 % Increase the depth for the table of contents
148 \setcounter{secnumdepth}{3}
149 \renewcommand{\contentsname}{Table of Contents} % change the name of the TOC
150 \AtBeginDocument{\addtocontents{toc}{\protect\thispagestyle{empty}}} % to remove page numbering from the TOC
151
152 % Initialize the glossaries
153 \makeglossaries%
154 \input{glossaries}