-
Notifications
You must be signed in to change notification settings - Fork 15
/
FormatAndDefsThesisExtra.tex
253 lines (221 loc) · 6.58 KB
/
FormatAndDefsThesisExtra.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Layout
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[left=1.5in,right=1.3in,top=1.1in,bottom=1.1in,includefoot,includehead,headheight=13.6pt]{geometry}
% Use 1.5 line spacing. UCL says
% "Double or one-and-a-half spacing should be used in typescripts,
% except for indented quotations or footnotes where single spacing may
% be used."
\usepackage{setspace}
\onehalfspacing
% Draft note
% No draft note (empty one) by default
\providecommand{\draftnote}{}
% Fancy Header and Footer
\usepackage{fancyhdr}
\pagestyle{fancy} % Sets fancy header and footer
\fancyhf{} % clear all header and footer fields
% line width used to draw the header line
\renewcommand{\headrulewidth}{1.0pt}
\makeatletter
% redefines chapter marks to use
% the chapter number only in mainmatter
\def\chaptermark#1{%
\markboth {\MakeUppercase{%
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\@chapapp\ \thechapter. \ %
\fi
\fi
#1}}
{\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\@chapapp\ \thechapter. \ %
\fi
\fi
#1}}%
\if@twoside
% Page number (boldface) in left on even
% pages and right on odd pages
\fancyhead[LE,RO]{\bfseries\thepage}
% Chapter in the right on even pages
\fancyhead[RE]{\bfseries\nouppercase{\leftmark}}
% Section in the left on odd pages
\fancyhead[LO]{\bfseries\nouppercase{\rightmark}}
% Draft mark
\fancyfoot[LE,RO]{\draftnote}
% Page number and draft mark on plain pages
\fancypagestyle{plain}{
\fancyhf{} % clear all header and footer fields
\fancyfoot[C]{\bfseries\thepage}
\fancyfoot[LE,RO]{\draftnote}
\renewcommand{\headrulewidth}{0pt}
}
% Draft mark on 'empty' pages
\fancypagestyle{empty}{
\fancyhf{} % clear all header and footer fields
\fancyfoot[LE,RO]{\draftnote}
\renewcommand{\headrulewidth}{0pt}
}
\else
\fancyhead[R]{\bfseries\thepage}
\fancyhead[L]{\bfseries\nouppercase{\leftmark}}
\fancyfoot[R]{\draftnote}
\fancypagestyle{plain}{
\fancyhf{} % clear all header and footer fields
\fancyfoot[C]{\bfseries\thepage}
\fancyfoot[R]{\draftnote}
\renewcommand{\headrulewidth}{0pt}
}
\fancypagestyle{empty}{
\fancyhf{} % clear all header and footer fields
\fancyfoot[R]{\draftnote}
\renewcommand{\headrulewidth}{0pt}
}
\fi
\makeatother
% Clear Header Style on the Last Empty Odd pages
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else%
\hbox{}%
\thispagestyle{empty}% % Empty header styles
\newpage%
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
% Define a simple copyright page style
\newcommand{\copyrightpage}[2]{
\thispagestyle{empty}% % Empty header styles
~\\
\vfill
\begin{center}
{\copyright}#1\\
#2\\
All Rights Reserved
\end{center}
\clearpage
}
% Define a simple declaration page style
\newcommand{\declarationpage}[1]{
\thispagestyle{plain}%
I, #1, confirm that the work presented in this thesis is my own. Where
information has been derived from other sources, I confirm that this
has been indicated in the thesis.
\cleardoublepage
}
% Define a simple quotation page style
\newcommand{\quotationpage}[2]{
\thispagestyle{plain}% % Empty header styles
\vspace*{\stretch{1}}
\begin{quotation}
\emph{#1}
\begin{flushright}
#2
\end{flushright}
\end{quotation}
\vspace*{\stretch{3}}
\clearpage
}
\usepackage{fancybox}
\setlength{\shadowsize}{1pt}
\usepackage{wallpaper}
\renewcommand{\contentsname}{Table of contents}
\renewcommand{\listfigurename}{List of figures}
\renewcommand{\listtablename}{List of tables}
% load monitoc with nohints to shut down
% unusefull warnings about hyperref
\usepackage[nohints]{minitoc}
% Set minitoc title to match the document contentsname
\mtcsettitle{minitoc}{\contentsname}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Algorithms and theorems
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[amsmath,thmmarks,hyperref]{ntheorem}
\setlength{\theorempostskipamount}{15pt}
\theoremstyle{break}
\theoremheaderfont{\normalfont\bfseries}
\theoremseparator{}
\theorembodyfont{\normalfont}
\theoremsymbol{\rule{1ex}{1ex}}
\newtheorem{algorithm}{Algorithm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Fonts and Encoding
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Computer modern family
\usepackage{lmodern}
% If you need bold small caps with lmodern, uncomment
% the 2 following lines
%\rmfamily
%\DeclareFontShape{T1}{lmr}{bx}{sc}{<->ssub*cmr/bx/sc}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Bibliography
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[style=alphabetic,maxnames=99,maxcitenames=1,giveninits=false,uniquename=init,backref=true]{biblatex}
% Make parenthical citations the default
\renewcommand\cite{\parencite}
% Need to bypass an error with texcount https://github.com/cai4cai/XCLThesisTemplate/issues/5
%TC:ignore
\DeclareCiteCommand{\citet}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\ifciteindex
{\indexnames{labelname}}
{}%
\printtext[bibhyperref]{\printnames{labelname}~[\printfield{year}]}}
{\multicitedelim}
{\usebibmacro{postnote}}
%TC:endignore
\renewcommand*{\labelalphaothers}{}
\DeclareLabelalphaTemplate{
\labelelement{
\field[final]{shorthand}
\field[names=1]{labelname}
\field{label}
}
\labelelement{
\literal{\addhighpenspace}
}
\labelelement{
\field{year}
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Hyperreferences
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% choose link colors colors
\usepackage{color}
% For pdf
%\definecolor{linkcol}{rgb}{0,0,0.4}
%\definecolor{citecol}{rgb}{0.5,0,0}
%
% For printing
\definecolor{linkcol}{rgb}{0,0,0}
\definecolor{citecol}{rgb}{0,0,0}
\ifpdf
\usepackage[pdfusetitle,pdfpagelabels=true]{hyperref}
\else
\usepackage[dvips,pdfusetitle,pdfpagelabels=true]{hyperref}
\fi
\hypersetup
{
bookmarksdepth=3,
bookmarksopenlevel=0,
bookmarksnumbered=true,
draft=false, % force to use hyperref even in draft mode
%pdftoolbar=false, %barre d'outils non visible
%pdfmenubar=true, %barre de menu visible
plainpages=false,
pdfhighlight=/O, %effet d'un clic sur un lien hypertexte
colorlinks=true, %couleurs sur les liens hypertextes
pdfdisplaydoctitle=true,
pdflang=en-US, % Does not seem to work but does not harm
pdfpagemode=UseOutlines,
%pdfpagelayout=SinglePage, %ouverture en simple page
%pdffitwindow=true, %pages ouvertes entierement dans toute la fenetre
pdfstartview=FitH,
linkcolor=linkcol, %couleur des liens hypertextes internes
citecolor=citecol, %couleur des liens pour les citations
urlcolor=linkcol, %couleur des liens pour les url
pdfkeywords={keyword 1, keyword 2},
pdfsubject={PhD Thesis}
}