-
Notifications
You must be signed in to change notification settings - Fork 1
/
haziq_thesis.sty
563 lines (487 loc) · 21.9 KB
/
haziq_thesis.sty
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% PACKAGES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Structure
\usepackage{calc}
\usepackage{geometry}
\newlength{\mytopmargin}
\setlength{\mytopmargin}{30mm + 1.25mm}
\newlength{\mybotmargin}
\setlength{\mybotmargin}{35mm - 1.25mm}
\newlength{\myrightmargin}
\setlength{\myrightmargin}{23mm + 1.5mm}
\newlength{\myleftmargin}
\setlength{\myleftmargin}{40mm - 1.5mm}
\geometry{%
a4paper,
left=\myleftmargin,
right=\myrightmargin,
top=\mytopmargin,
bottom=\mybotmargin,
% footskip=10mm,
marginparwidth=\myrightmargin,
marginparsep=0mm,
bindingoffset=0mm
}
\raggedbottom % https://tex.stackexchange.com/questions/371505/too-large-vertical-space-due-to-twoside
\usepackage{standalone}
\usepackage{subfiles}
\usepackage{import}
\usepackage{morewrites} % https://tex.stackexchange.com/questions/289734/special-package-combination-gives-no-room-for-new-write
\usepackage[all]{nowidow} % https://tex.stackexchange.com/questions/4152/how-do-i-prevent-widow-orphan-lines
% Page numbers
\usepackage{refcount} % to count page numbers
\newcommand{\hsetpagenumstandalone}[1]{%
\ifstandalone
\setcounter{page}{\getpagerefnumber{#1}}
\fi
}
% Git info
\usepackage[maxdepth=8]{gitinfo2}
% Footers
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection~#1}}
\newlength{\numlength}
\setlength{\numlength}{\mybotmargin - \footskip + 3.2254pt}
\newlength{\numwidth}
\setlength{\numwidth}{\myrightmargin - 4.5mm}
\fancyfoot[RO]{\small\nouppercase{\textsc{\rightmark}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
\fancyfoot[LE]{\small\nouppercase{\textsc{\leftmark}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=east,xshift=\numwidth,yshift=\numlength] at (current page.south west) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
%\fancyhead[C]{\color{gray}\small\ttfamily [git] \textbullet{} Branch:\;\gitBranch\,@\,\gitAbbrevHash{}~\textbullet{}~Change:\;\gitAuthorIsoDate~\textbullet{}~haziqj}
\fancypagestyle{plain}{%
% \fancyfoot[RO]{\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
% \fancyfoot[LE]{\begin{tikzpicture}[remember picture,overlay] \node [anchor=east,xshift=\numwidth,yshift=\numlength] at (current page.south west) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
\fancyfoot[RO]{\small\nouppercase{\textsc{\leftmark}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
\fancyfoot[LE]{\small\nouppercase{\textsc{\leftmark}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=east,xshift=\numwidth,yshift=\numlength] at (current page.south west) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
}
% https://tex.stackexchange.com/questions/195106/page-numbers-on-the-side-of-the-page
\fancypagestyle{plainnopagenum}{%
% \fancyfoot[RO]{\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
% \fancyfoot[LE]{\begin{tikzpicture}[remember picture,overlay] \node [anchor=east,xshift=\numwidth,yshift=\numlength] at (current page.south west) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
\fancyfoot[RO]{\small\nouppercase{\textsc{\leftmark}}}
\fancyfoot[LE]{\small\nouppercase{\textsc{\leftmark}}}
}
\fancypagestyle{plainnomark}{%
\fancyfoot[RO]{\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
\fancyfoot[LE]{\begin{tikzpicture}[remember picture,overlay] \node [anchor=east,xshift=\numwidth,yshift=\numlength] at (current page.south west) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
}
\fancypagestyle{chapterone}{%
\fancyfoot[RO]{\small{\textsc{Chapter one}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
}
\fancypagestyle{chaptertwo}{%
\fancyfoot[RO]{\small{\textsc{Chapter two}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
}
\fancypagestyle{chapterthree}{%
\fancyfoot[RO]{\small{\textsc{Chapter three}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
}
\fancypagestyle{chapterfour}{%
\fancyfoot[RO]{\small{\textsc{Chapter four}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
}
\fancypagestyle{chapterfive}{%
\fancyfoot[RO]{\small{\textsc{Chapter five}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
}
\fancypagestyle{chaptersix}{%
\fancyfoot[RO]{\small{\textsc{Chapter six}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
}
\fancypagestyle{chapterseven}{%
\fancyfoot[RO]{\small{\textsc{Chapter seven}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
}
\fancypagestyle{chaptersone}{%
\fancyfoot[RO]{\small{\textsc{Supplementary one}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
}
\fancypagestyle{chapterstwo}{%
\fancyfoot[RO]{\small{\textsc{Supplementary two}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
}
\fancypagestyle{chaptersthree}{%
\fancyfoot[RO]{\small{\textsc{Supplementary three}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
}
\fancypagestyle{chaptersfour}{%
\fancyfoot[RO]{\small{\textsc{Supplementary four}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
}
\fancypagestyle{chapterapx}{%
\fancyfoot[RO]{\small{\textsc{Appendix \thechapter}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
}
\fancypagestyle{chaptererr}{%
\fancyfoot[RO]{\small{\textsc{Errata}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=west,inner sep=0pt,xshift=-\numwidth,yshift=\numlength] at (current page.south east) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
\fancyfoot[LE]{\small{\textsc{Errata}}\begin{tikzpicture}[remember picture,overlay] \node [anchor=east,xshift=\numwidth,yshift=\numlength] at (current page.south west) {\small{\textsc{\thepage}}}; \end{tikzpicture}}
}
% Typeset and appearance
\usepackage{csquotes} % quotes
\usepackage[english]{babel} % manages structure of paper better
\usepackage[]{xcolor} % options: usenames, dvipsnames, svgnames, table
\usepackage{soul} % for highlighting text
\usepackage{url}
\usepackage{footmisc} % ability to reuse footnotes
% https://tex.stackexchange.com/questions/40072/incompatibility-between-footmisc-option-multiple-and-hyperref/62091#62091
\let\oldFootnote\footnote
\newcommand\nextToken\relax
\renewcommand\footnote[1]{%
\oldFootnote{#1}\futurelet\nextToken\isFootnote}
\newcommand\isFootnote{%
\ifx\footnote\nextToken\textsuperscript{,}\fi}
\usepackage[utf8]{inputenc} % To get accents on letters
\usepackage[T1]{fontenc} % e.g. \"a
\usepackage{ifxetex}
\ifxetex
\usepackage{fontspec} % phonetics, needs XeLaTeX or LuaLaTeX
\newfontfamily\dsil{Doulos SIL}
\else
\usepackage{lmodern}
\fi
\usepackage{nicefrac} % To get nice typography for units
\usepackage{units} % and fractions
\usepackage{enumitem} % replacing enumerate
\usepackage{xr} % Cross-referencing between files
% Show labels in margins. See https://tex.stackexchange.com/questions/45634/printing-labels-along-with-equation-numbers
%\usepackage{seqsplit}
%\usepackage{xstring}
%\usepackage[notref,notcite]{showkeys}
%\renewcommand*\showkeyslabelformat[1]{%
%\noexpandarg%
%\StrSubstitute{#1}{ }{~}[\TEMP]%
%\parbox[c]{0.85\marginparwidth}{\raggedright\singlespacing\normalfont\small\ttfamily\expandafter\seqsplit\expandafter{\TEMP}}
%}
% Colour-blind safe pallete
\definecolor{colblu}{RGB}{0,114,178}
\definecolor{colcya}{RGB}{86,180,233}
\definecolor{colgre}{RGB}{0,158,115}
\definecolor{colgyl}{RGB}{204,204,85}
\definecolor{colgry}{RGB}{119,119,119}
\definecolor{colpur}{RGB}{204,121,167}
\definecolor{colred}{RGB}{238,51,51}%{213,94,0}
\definecolor{colora}{RGB}{230,159,0}
\definecolor{colyel}{RGB}{240,228,66}%{255,238,51}
% LSE colour pallete
\definecolor{lsered}{RGB}{244,49,49}
\definecolor{lsegry}{RGB}{167,180,187}
\definecolor{lselgr}{RGB}{217,223,223}
\definecolor{lsecya}{RGB}{124,230,216}
\definecolor{lsepur}{RGB}{134,49,166}
\definecolor{lsedpr}{RGB}{93,49,94}
\definecolor{lseblu}{RGB}{85,172,238}
\definecolor{lsegrn}{HTML}{C1EDCC}
\newcommand{\mycitecolour}{lsedpr}
% Coding
\usepackage{algorithm}
\usepackage{algpseudocode}
\let\proglang=\textsf
\newcommand{\pkg}[1]{{\fontseries{b}\selectfont #1}}
\newcommand{\code}[1]{\texttt{\detokenize{#1}}}
% Bibliography
\usepackage[style=authoryear-comp, firstinits=false, giveninits=false, maxcitenames=2, uniquelist=false,
minnames=1, maxbibnames=99, backend=biber, natbib]{biblatex}
\setlength\bibitemsep{1\itemsep}
\AtEveryCite{\color{\mycitecolour}}
\makeatletter
\AtEveryCitekey{\global\undef\cbx@lastyear} % https://tex.stackexchange.com/questions/309697/multiple-citations-same-author-same-year-using-biblatex-list-year
\makeatother
\setcounter{biburlnumpenalty}{9000}
% https://tex.stackexchange.com/questions/134191/line-breaks-of-long-urls-in-biblatex-bibliography
% Paragraph settings
\usepackage{parskip}
\setlength{\parindent}{15pt} % default indentation
% Line spacing
\usepackage{setspace}\onehalfspacing % or \singlespacing, \onehalfspacing or \doublespacing
% Figures
\usepackage{float}
\usepackage{graphicx}
%\usepackage{subfig}
\usepackage{subcaption} % an alternative package for sub-figures (preferred)
\newcommand{\subfloat}[2][need a sub-caption]{\subcaptionbox{#1}{#2}} % knitr
\usepackage{rotfloat}
\usepackage{tikz}
\usetikzlibrary{fit,positioning,calc,decorations.pathreplacing,shapes.geometric,backgrounds}
\usepackage{forest}
\usetikzlibrary{arrows}
\usetikzlibrary{shapes.callouts}
\usetikzlibrary{patterns,hobby}
\usepackage{pgfplots} % these are for squiggly lines
\pgfplotsset{compat=1.6} % https://tex.stackexchange.com/questions/160237/draw-somewhat-random-function/160274
\usepackage{placeins} % make figure stay within subsections---https://tex.stackexchange.com/questions/118662/use-placeins-for-subsections
\makeatletter
\AtBeginDocument{%
\expandafter\renewcommand\expandafter\subsection\expandafter
{\expandafter\@fb@secFB\subsection}%
\newcommand\@fb@secFB{\FloatBarrier
\gdef\@fb@afterHHook{\@fb@topbarrier \gdef\@fb@afterHHook{}}}%
\g@addto@macro\@afterheading{\@fb@afterHHook}%
\gdef\@fb@afterHHook{}%
}
\makeatother
% Tables
\usepackage{longtable}
\usepackage{tabularx}
\usepackage{multirow}
%\usepackage{dcolumn} % align columns on a decimal point
\newcommand{\Top}{\rule{0pt}{2.6ex}} % Top strut for tables
\newcommand{\Bot}{\rule[-1.2ex]{0pt}{0pt}} % Top strut for tables
\usepackage{booktabs}
\usepackage{colortbl}
\usepackage{lscape} % landscape tables
\usepackage{threeparttable}
\usepackage{tablefootnote}
% Margin notes
\usepackage{marginnote}
\usepackage{mparhack} % these two packages provides some fixes to marginnote
\usepackage{marginfix}
% TOC
\usepackage{tocloft}
\setlength{\cftfigindent}{0pt} % indentations of fig and tab list
\setlength{\cfttabindent}{0pt}
\cftsetindents{figure}{0em}{2.7em}
\cftsetindents{table}{0em}{2.7em}
\usepackage{etoolbox}
\patchcmd{\listof}{1.5em}{0pt}{}{} % indentations of alg list
\patchcmd{\listof}{2.3em}{2.7em}{}{}
% https://tex.stackexchange.com/questions/80430/how-to-prevent-indent-on-listofalgorithms/80432
% Miscellaneous
\usepackage{lipsum}
\usepackage{ifthen}
\usepackage{xparse}
\usepackage[linecolor=yellow, backgroundcolor=yellow!25, bordercolor=yellow, textsize=footnotesize]{todonotes}
\newcounter{todocounter}
\newcommand{\todonum}[2][To-do in Section \thesubsection]{\stepcounter{todocounter}\todo[caption={\thetodocounter. #1}]{\thetodocounter. #2}{}}
\newcommand{\notodo}[1][To-do in Section \thesubsection]{\stepcounter{todocounter}\todo[caption={\thetodocounter. #1},noline,backgroundcolor=white, bordercolor=white]{}{}}
\DeclareDocumentCommand{\hltodo}{omo}{\IfNoValueTF{#1}{\IfNoValueTF{#3}{\hl{#2}\notodo[#2]}{\hl{#2}\notodo[#3]}}{\IfNoValueTF{#3}{\hl{#2}\todonum[#1]{#1}}{\hl{#2}\todonum[#3]{#1}}}}
\usepackage{pifont}
\newcommand{\cmark}{\ding{51}} % check mark
\newcommand{\xmark}{\ding{55}} % x mark
% Glossary, abbreviations and indices
\usepackage{imakeidx}
\usepackage[abbreviations,counter=chapter,nopostdot=false,symbols,autoseeindex=true,indexcrossrefs=true]{glossaries-extra}
%\renewcommand*{\glossarypreamble}{\emph{Numbers refer to the \textbf{chapter} where the entry was referenced.}}
\makeglossaries
\makeindex[columns=2]
% Create new macro \indx and \newabbreviationindex
\newcommand{\indx}[1]{{#1}\index{#1}}
\newcommand{\newabbreviationindex}[4]{
\newabbreviation[#4]{#1}{#2}{#3}
\index{#3|see{#2}}
}
% Automatically index the location of entry in the glossary
% for those entries that are in the "general" category:
%\glssetcategoryattribute{general}{indexname}{textbf}
%\glssetcategoryattribute{general}{dualindex}{true}
% Only index first use for the glossary location lists
% (doesn't affect the indexing from "dualindex" attribute):
%\glssetcategoryattribute{general}{indexonlyfirst}{true}
% Automatically index the location of entry in the glossary
% for those entries that are in the "abbreviation" category
% and use "textbf" as the encap:
%\glssetcategoryattribute{abbreviation}{indexname}{textbf}
%\glssetcategoryattribute{abbreviation}{dualindex}{true}
% Only index first use for the glossary location lists
% (doesn't affect the indexing from "dualindex" attribute):
%\glssetcategoryattribute{abbreviation}{indexonlyfirst}{true}
% Convert the first letter of the name to upper case in the
% glossary for abbreviation entries:
%\glssetcategoryattribute{abbreviation}{glossname}{firstuc}
% Allow "format" key to override "dualindex" attribute.
\GlsXtrEnableIndexFormatOverride
% use first field instead of name field
%\renewcommand*{\glsxtrautoindexentry}[1]{\string\glsentryfirst{#1}}
% use long form for the sort value, if provided:
%\renewcommand*{\glsxtrautoindexassignsort}[2]{%
% \ifglshaslong{#2}%
% {\glsletentryfield{#1}{#2}{long}}%
% {\glsletentryfield{#1}{#2}{sort}}%
%}
% Load everything before hyperref to avoid conflicts
\usepackage{hyperref} % hyperref setup at the bottom
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% MY THESIS SPECIFIC MACROS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For my thesis---adds a chapter heading, including to-do list and TOC (STANDALONE VERSION)
% Textbox freely placed on page. Adapted from https://tex.stackexchange.com/questions/24663/how-to-place-a-floating-text-box-at-a-specified-location-in-page-coordinates
\newcommand{\placetextbox}[3]{% \placetextbox{<horizontal pos>}{<vertical pos>}{<stuff>}
\setbox0=\hbox{#3}% Put <stuff> in a box
\AddToShipoutPictureFG*{\put(\LenToUnit{#1\paperwidth},\LenToUnit{#2\paperheight}){\makebox[0pt][c]{\begin{tabular}{l}#3\end{tabular}}}}
}%
\newcommand{\hChapterStandalone}[2][1]{
\ifstandalone
% % uncomment for final version
% \pagenumbering{roman}
% \begingroup
% \let\clearpage\relax % Don't allow page break
% {\hypersetup{allcolors=.} %pdfborder=0 0 0
% \listoftodos[\vspace{-3.03cm}To-do list] \vspace{-1em}
% \tableofcontents
% }
% \endgroup
\setcounter{chapter}{#1-1}
\chapter{#2}
\placetextbox{0.521}{0.8585}{
{\small Haziq Jamil} \\[-0.4em]
{\it\footnotesize Department of Statistics} \\[-0.45em]
{\it\footnotesize London School of Economics and Political Science} \\[-0.45em]
{\footnotesize PhD thesis: `Regression modelling using priors depending on Fisher information covariance kernels'} \\[-0.45em]
{\footnotesize 29 October 2018 (\code{v1.2@dae7107})}
}
\fi
% \pagenumbering{arabic}
}
% Adds Bibliography to TOC
\newcommand{\hPrintBibliography}{
\cleardoublepage
\phantomsection
\ifstandalone
\renewcommand{\thepage}{}
\else
\addcontentsline{toc}{chapter}{Bibliography}
\fi
\begingroup
\singlespacing
\printbibliography
\endgroup
}
% Change arXiv style
\makeatletter
\DeclareFieldFormat{eprint:arxiv}{%
\textsc{arXiv}\addcolon\space
\ifhyperref
{\href{https://arxiv.org/\abx@arxivpath/#1}{%
\nolinkurl{#1}%
\iffieldundef{eprintclass}
{}
{\addspace\texttt{\mkbibbrackets{\thefield{eprintclass}}}}}}
{\nolinkurl{#1}%
\iffieldundef{eprintclass}
{}
{\addspace\texttt{\mkbibbrackets{\thefield{eprintclass}}}}}}
\makeatother
% List of figures, tables, symbols, and abbreviations
\newcommand{\hLists}{
% \addcontentsline{toc}{chapter}{Lists}
\newpage
\cleardoublepage
\renewcommand{\listfigurename}{Figures}
\listoffigures
\addcontentsline{toc}{chapter}{Figures}
\newpage
\cleardoublepage
\renewcommand{\listtablename}{Tables}
\listoftables
\addcontentsline{toc}{chapter}{Tables}
\newpage
\cleardoublepage
\renewcommand{\listtheoremname}{Theorems}
\listoftheorems[ignoreall,onlynamed={theorem,lemma,corollary,proposition},numwidth=2.7em]
\addcontentsline{toc}{chapter}{Theorems}
\newpage
\cleardoublepage
\renewcommand{\listtheoremname}{Definitions}
\listoftheorems[ignoreall,show={definition}, numwidth=2.7em]
\addcontentsline{toc}{chapter}{Definitions}
\newpage
\cleardoublepage
\renewcommand{\listalgorithmname}{Algorithms}
% {\let\cleardoublepage\clearpage\listofalgorithms}
\listofalgorithms
\addcontentsline{toc}{chapter}{Algorithms}
\begingroup
\cleardoublepage
\singlespacing
\hnomenclature
\addcontentsline{toc}{chapter}{Nomenclature}
\cleardoublepage
\printabbreviations[title={Abbreviations},style=long,nogroupskip, nonumberlist,nopostdot]
\glsaddall[types=abbreviations]
\endgroup
}
% Manual input of nomenclature, depending on individual tex files or main thesis
\newcommand{\hnomenclature}{
\hypersetup{
colorlinks=true,
linkcolor=\mycitecolour,
citecolor=\mycitecolour,
urlcolor=lsepur
}
\ifstandalone
\input{../../nomenclature}
\else
\input{nomenclature}
\fi
}
% Adds the closing stuff (STANDALONE VERSION)
\newcommand{\hClosingStuffStandalone}{
\ifstandalone
\hPrintBibliography
% {\hypersetup{allcolors=.} %pdfborder=0 0 0
% \hLists
% \begingroup
% \singlespacing
% \printindex
% \endgroup
% }
\fi
}
% Adds TOC and lists (MAIN VERSION)
\newcommand{\hTOCandLists}{
{\hypersetup{allcolors=.} %pdfborder=0 0 0
% \listoftodos[To-do list] % uncomment for final version
\tableofcontents
\hLists
}
}
% Adds the closing stuff/print index (MAIN VERSION)
\newcommand{\hPrintIndex}{%
{\hypersetup{allcolors=.}
\begingroup
\singlespacing
\printindex
\endgroup
}
}
% Cleverref needs to be loaded last
\usepackage{nameref}
\usepackage[capitalise,noabbrev,nameinlink]{cleveref}
\Crefname{misc}{Miscellanea}{Miscellanea}
\Crefname{supchap}{Supplementary Chapter}{Supplementary Chapter}
\Crefname{equation}{}{}
\hypersetup{
colorlinks=true,
linkcolor=\mycitecolour,
citecolor=\mycitecolour,
urlcolor=lsepur
}
\newcommand{\mypageref}[1]{{{\color{\mycitecolour}p.} \pageref{#1}}}
\newcommand{\mypagereffull}[1]{{{\color{\mycitecolour}page} \pageref{#1}}}
% Page intentionally left blank
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside%
\ifodd\c@page\else
\vspace*{\fill}
% \vspace{3cm}
\hfill
% \begin{center}
% \emph{This page intentionally left blank.}
% \end{center}
% \vspace{\fill}
\thispagestyle{plainnomark}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi
}
\makeatother
% https://tex.stackexchange.com/questions/290802/page-intentionally-left-blank-with-twoside-openright/308522
%\usepackage[fontsize=10.5]{scrextend} % place here due to conflict
% Coloured parantheses
\newcommand{\colp}[1]{{\color{\mycitecolour}(#1)}}
\makeatletter
\DeclareFieldFormat{eprint:arxiv}{%
\textsc{arXiv}\addcolon\space
\ifhyperref
{\href{https://arxiv.org/\abx@arxivpath/#1}{%
\nolinkurl{#1}%
\iffieldundef{eprintclass}
{}
{\addspace\texttt{\mkbibbrackets{\thefield{eprintclass}}}}}}
{\nolinkurl{#1}%
\iffieldundef{eprintclass}
{}
{\addspace\texttt{\mkbibbrackets{\thefield{eprintclass}}}}}}
\makeatother
\usepackage[nodayofweek]{datetime}