use latexmk,
[thesis-skel.git] / preamble.tex
1 \usepackage[
2 inner=25mm,
3 outer=20mm,
4 marginparsep=3mm,
5 marginparwidth=13mm,
6 top=25mm,
7 bottom=20mm,
8 paperwidth=17cm,
9 paperheight=24cm]{geometry} % Papersize
10
11 \usepackage[british]{babel} % Internationalization
12 \usepackage[titletoc]{appendix} % Appendices
13 \usepackage[pagebackref,hidelinks]{hyperref} % Hyperlinks
14 \usepackage{graphicx} % Graphics
15 \usepackage{booktabs} % Better looking tables
16 \usepackage{etoolbox} % Patch chapter command
17 \usepackage[nodayofweek]{datetime} % Use a fixed document date
18 \usepackage{listings} % Code
19 \usepackage[acronym,nonumberlist]{glossaries} % Glossaries and acronyms
20 \usepackage[algochapter]{algorithm2e} % Pseudocode
21 \usepackage{makeidx} % Index
22 \usepackage[inline,shortlabels]{enumitem} % Customized enumerations
23 \setlist{noitemsep}
24 \setlist[description]{leftmargin=\parindent}
25 \usepackage{epigraph}
26
27 \usepackage[
28 height={1.5cm},
29 width={12mm},
30 distance={1.55cm},
31 topthumbmargin={auto},
32 bottomthumbmargin={auto},
33 eventxtindent={.5cm},
34 oddtxtexdent={.3cm}]{thumbs}
35
36 \usepackage{lipsum}
37
38 \usepackage{fancyhdr}
39 \pagestyle{fancy}
40
41 % Have better page numbering in chapters
42 \patchcmd{\chapter}{plain}{headings}{}{}
43
44 % Images directory
45 \graphicspath{{img/}}
46
47 % Fix list of listings title
48 \renewcommand{\lstlistlistingname}{List of Listings}
49
50 % Fix list of listings chapter separator
51 \makeatletter
52 \let\my@chapter\@chapter%
53 \renewcommand*{\@chapter}{%
54 \addtocontents{lol}{\protect\addvspace{10pt}}%
55 \my@chapter}
56 \makeatother
57
58 % Setup pdf parameters
59 \hypersetup{%
60 pdftitle={},
61 pdfauthor={},
62 pdfsubject={},
63 pdfcreator={},
64 pdfproducer={},
65 pdfkeywords={},
66 }
67
68 % Fix gls in hyperlink errors
69 \pdfstringdefDisableCommands{%
70 \def\acrlong#1{}%
71 \def\acrlongpl#1{}%
72 \def\acrshort#1{}%
73 \def\acrshortpl#1{}%
74 \def\acrfull#1{}%
75 \def\acrfullpl#1{}%
76 \def\Acrlong#1{}%
77 \def\Acrlongpl#1{}%
78 \def\Acrshort#1{}%
79 \def\Acrshortpl#1{}%
80 \def\Acrfull#1{}%
81 \def\Acrfullpl#1{}%
82 \def\gls#1{}%
83 \def\glspl#1{}%
84 \def\Gls#1{}%
85 \def\Glspl#1{}%
86 }
87
88 % General listings settings
89 \lstset{%
90 breakatwhitespace=false,
91 breaklines=true,
92 captionpos=b,
93 keepspaces=true,
94 basicstyle=\ttfamily\fontseries{l}\footnotesize,
95 commentstyle=\slshape\fontseries{m},
96 keywordstyle=\bfseries\fontseries{b},
97 stringstyle=\ttfamily,
98 showspaces=false,
99 showstringspaces=false,
100 showtabs=false,
101 tabsize=4,
102 frame=L,
103 }
104
105 % Increase the depth for the table of contenst
106 \setcounter{secnumdepth}{3}
107
108 % Fix the algorithm font
109 \renewcommand\AlCapFnt{\normalfont}
110
111 \renewcommand{\contentsname}{Table of Contents} % change the name of the TOC
112 \AtBeginDocument{\addtocontents{toc}{\protect\thispagestyle{empty}}} % to remove page numbering from the TOC
113
114 % Initialize the glossaries
115 \makeglossaries%
116 \input{glossaries}
117
118 % Enable the index
119 \makeindex%