forked from pvdk/hogent-latex-thesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhogentreport.cls
665 lines (583 loc) · 20.8 KB
/
hogentreport.cls
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
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
%% University College Ghent (HOGENT) report/thesis class
%%
%% hogentreport.cls
%%
%% Based on the TU Delft LaTeX template for reports and theses.
%% (https://www.tudelft.nl/en/tu-delft-corporate-design/downloads/)
%%
%% Inspired by the LaTeX template for the Bachelor of Applied
%% Computer Science of the Faculty of Business and Information Management
%% at the University College Ghent, authored by Bert Van Vreckem.
%% (https://github.com/HoGentTIN/bachproef-latex-sjabloon)
%%
%% Best suited for compiling using XeLaTeX or LuaTeX,
%% but there is support for native fonts, automatically when using
%% LaTeX/PDFLaTeX, or forced by specifying the 'nativefonts' option.
%%
%% Author: Pieter van der Kloet (pvdkloet at gmail.com)
%%
%% License: MIT license
%% (See LICENSE for more information)
%%
\NeedsTeXFormat{LaTeX2e}
\def\@classname{hogentreport}
\ProvidesClass{hogentreport}[2022/06/20 Hogeschool Gent report/thesis class]
\RequirePackage{xkeyval}
\RequirePackage{iflang}
%% Ensure the variables can be checked with \ifx\@variable\@empty
\let\@author\@empty
\let\@title\@empty
\let\@supervisor\@empty
\let\@cosupervisor\@empty
\let\@institution\@empty
\let\@academicyear\@empty
\let\@examperiod\@empty
\let\@degreesought\@empty
\let\@department\@empty
\let\@department@nr\@empty
\newcommand{\supervisor}[1]{\def\@supervisor{#1}}
\newcommand{\cosupervisor}[1]{\def\@cosupervisor{#1}}
\newcommand{\institution}[1]{\def\@institution{#1}}
\newcommand{\academicyear}[1]{\def\@academicyear{#1}}
\newcommand{\examperiod}[1]{\def\@examperiod{#1}}
\newcommand{\degreesought}[1]{\def\@degreesought{#1}}
\define@choicekey*+{hogentreport}{department}[\@department\@department@nr]
{dbo,dbt,dgz,dit,dlo,dog,dsa,soa}{}{%
\ClassError{\@classname}{The department parameter is undefined}
{One of the following options for the department must be added to the class%
options: dbo, dbt, dgz, dit, dlo, dog, dsa, soa}}
\def\@DeclareDept#1{\DeclareOptionX{#1}{\setkeys{hogentreport}{department=#1}}}
\@DeclareDept{dbo}
\@DeclareDept{dbt}
\@DeclareDept{dgz}
\@DeclareDept{dit}
\@DeclareDept{dlo}
\@DeclareDept{dog}
\@DeclareDept{dsa}
\@DeclareDept{soa}
%% Redefine the title command to accept an optional subtitle
\renewcommand*\title[2][]{%
\def\@title{#2}%
\def\@subtitle{#1}%
}
%% Thesis or report?
\newif\if@thesis
\newif\if@report
\DeclareOptionX{thesis}{\@thesistrue\@reportfalse}
\DeclareOptionX{report}{\@thesisfalse\@reporttrue}
\ExecuteOptionsX{report} %% Default document type
%% Check the variables that need to be defined for the title page
\newcommand{\@checkvariables}{%
\ifx\@author\@empty{%
\ClassError{\@classname}{Author is undefined!}%
{Use the \author command to define it}
}\fi
\ifx\@title\@empty{%
\ClassError{\@classname}{Title is undefined!}%
{Use the \title command to define it}
}\fi
\ifx\@academicyear\@empty{%
\ClassError{\@classname}{Academic year is undefined!}%
{Use the \academicyear command to define it}
}\fi
%% The following variables only need to be defined for a thesis
\if@thesis
\ifx\@supervisor\@empty{%
\ClassError{\@classname}{Student supervisor is undefined!}%
{Use the \supervisor command to define it}
}\fi
\ifx\@examperiod\@empty{%
\ClassError{\@classname}{Exam period is undefined!}%
{Use the \examperiod command to define it}
}\fi
\ifx\@degreesought\@empty{%
\ClassError{\@classname}{Degree sought is undefined!}%
{Use the \degreesought command to define it}
}\fi
\fi
%% Since the input is there, set the PDF info
\hypersetup{%
pdftitle=\@title,
pdfauthor=\@author
}
}
\newif\if@dutch
\newif\if@english
\DeclareOptionX{dutch}{\@dutchtrue\@englishfalse}
\DeclareOptionX{english}{\@dutchfalse\@englishtrue}
\ExecuteOptionsX{english} %% Default language
\newif\if@partial
\define@boolkey+{hogentreport}{partial}[false]{%
\ifKV@hogentreport@partial
\@partialtrue
\else
\@partialfalse
\fi
}{%
\ClassWarning{\@classname}{Input not boolean, ignored}
}
\DeclareOptionX{partial}{\setkeys{\@classname}{partial}}
%% Allows the partial boolean to be set with a command
\newcommand{\partialthesis}[1]{\setkeys{\@classname}{partial=#1}}
\newif\if@nativefonts
\DeclareOptionX{nativefonts}{\@nativefontstrue}
\newif\if@print
\DeclareOptionX{print}{\@printtrue}
\DeclareOption{twocolumn}{
\OptionNotUsed
\ClassError{\@classname}{Only single column documents supported!}%
{Please remove the option 'twocolumn'}
}
%% Pass the unknown options to the class
\DeclareOptionX*{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessOptionsX\relax
\LoadClass[11pt]{book}
%% English is the default language, but this can be changed to Dutch by
%% specifying the 'dutch' option to the document class
\if@dutch
\RequirePackage[dutch]{babel}
\RequirePackage[style=apa,natbib,backend=biber]{biblatex}
\DeclareLanguageMapping{dutch}{dutch-apa}
\else
%% We need Dutch for English theses, e.g. on the translated title page
\RequirePackage[main=english,dutch]{babel}
\RequirePackage[backend=biber,style=apa]{biblatex}
\DeclareLanguageMapping{english}{british-apa}
\fi
\RequirePackage{csquotes}
\RequirePackage[small,bf,nooneline,footnotesize]{caption}
\RequirePackage[flushmargin,hang]{footmisc}
\RequirePackage{ifpdf}
\RequirePackage{ifxetex}
\RequirePackage{ifluatex}
\ifxetex
\RequirePackage[xetex]{geometry}
\RequirePackage[xetex]{graphicx}
\RequirePackage[xetex,plainpages=false,breaklinks]{hyperref}
\RequirePackage[no-math]{fontspec}
\RequirePackage[mathrm=sym]{unicode-math}
\unimathsetup{math-style=ISO,bold-style=ISO,sans-style=upright,mathrm=sym}
\RequirePackage{realscripts}
\defaultfontfeatures{Ligatures=TeX}
\else
\ifluatex
\RequirePackage[luatex]{geometry}
\RequirePackage[luatex]{graphicx}
\RequirePackage[luatex,plainpages=false]{hyperref}
\RequirePackage[no-math]{fontspec}
\RequirePackage[mathrm=sym]{unicode-math}
\unimathsetup{math-style=ISO,bold-style=ISO,sans-style=upright,
mathrm=sym}
\RequirePackage{lualatex-math}
\RequirePackage{realscripts}
\else
\@nativefontstrue %% Force native font rendering
\ifpdf
\RequirePackage[pdftex]{geometry}
\RequirePackage[pdftex]{graphicx}
\RequirePackage[pdftex,plainpages=false,breaklinks]{hyperref}
\else
\RequirePackage[dvips]{geometry}
\RequirePackage[dvips]{graphicx}
\RequirePackage[hypertex,plainpages=false,breaklinks]{hyperref}
\fi
\fi
\fi
\if@print
\RequirePackage[gray]{xcolor}
\else
\RequirePackage[dvipsnames]{xcolor}
\fi
% Graphics related packages
\RequirePackage{tikz}
\usetikzlibrary{backgrounds}
\usetikzlibrary{positioning}
\RequirePackage{standalone}
\RequirePackage{wrapfig}
% Page layout & document structure
\RequirePackage{appendix}
\RequirePackage{booktabs}
\RequirePackage{enumitem}
%\setlist{noitemsep}
%\setlist[enumerate]{itemsep=1pt}
%\setlist[itemize]{itemsep=1pt}
%\setlist{parsep=\topskip}
%\setlist{topsep=\topskip}
%\setlist{partopsep=\topskip}
\RequirePackage{fancyhdr}
\RequirePackage{makeidx}
\RequirePackage{makecell}
\RequirePackage{pdfpages}
\RequirePackage{rotating}
\RequirePackage{tabularx}
\RequirePackage{tcolorbox}
\RequirePackage[noindentafter]{titlesec}
\RequirePackage{titletoc}
\RequirePackage[nottoc]{tocbibind}
\RequirePackage{url}
\captionsetup[figure]{labelformat=parens, labelsep=newline}
% Typography & Symbols
\RequirePackage{eurosym}
\RequirePackage{microtype}
\RequirePackage{textcomp}
\RequirePackage{xspace}
\RequirePackage{csquotes}
%% Accent colors:
\definecolor{hogent-darkgreen}{RGB}{22,176,165}
\definecolor{hogent-pink}{RGB}{241,157,160}
\definecolor{hogent-ochre}{RGB}{250,188,50}
\definecolor{hogent-orange}{RGB}{239,135,103}
\definecolor{hogent-purple}{RGB}{187,144,189}
\definecolor{hogent-blue}{RGB}{76,162,213}
\definecolor{hogent-lightgreen}{RGB}{165,202,114}
\definecolor{hogent-brown}{RGB}{216,176,131}
\definecolor{hogent-grey}{RGB}{195,187,175}
\definecolor{hogent-yellow}{RGB}{244,222,0}
\colorlet{links}{hogent-blue} %% The color to be used for urls and references
%% Setting of the department text and title color based on the class option
\ifx\@department\@empty{%
\ClassError{\@classname}{Department parameter is undefined!}%
{One of the following options must be added to the class options:%
dbo, dgz, dit, dlo, dog, dsa, soa}%
}\fi
\ifcase\@department@nr%
\relax
\colorlet{title}{hogent-purple}% dbo
\or
\colorlet{title}{hogent-darkgreen}% dbt
\or
\colorlet{title}{hogent-pink}% dgz
\or
\colorlet{title}{hogent-orange}% dit
\or
\colorlet{title}{hogent-blue}% dlo
\or
\colorlet{title}{hogent-lightgreen}% dog
\or
\colorlet{title}{hogent-grey}% dsa
\else
\colorlet{title}{black}% soa
\fi
\newcommand{\@departmentname}{%
\ifcase\@department@nr%
\relax %dbo
\IfLanguageName{dutch}{Departement Bedrijf en Organisatie}%
{School of Business Management}%
\or % dbt
\IfLanguageName{dutch}{Departement Biowetenschappen en Industriële Technologie}%
{School of Bioscience and Industrial Technology}%
\or %dgz
\IfLanguageName{dutch}{Departement Gezondheidszorg}%
{School of Healthcare}
\or %dit
\IfLanguageName{dutch}{Departement IT en Digitale Innovatie}%
{School of IT and Digital Innovation}
\or %dlo
\IfLanguageName{dutch}{Departement Lerarenopleiding}%
{School of Teacher Training}
\or %dog
\IfLanguageName{dutch}{Departement Omgeving}%
{School of Built Environment}
\or %dsa
\IfLanguageName{dutch}{Departement Sociaal-Agogisch Werk}%
{School of Social Welfare}
\else %soa
School of Arts%
\fi
}
%% No title and link colors in print mode
\if@print
\colorlet{title}{black}
\colorlet{links}{black}
\fi
%% Font setup
\if@nativefonts
\let\titlefont\@undefined
\let\subtitlefont\@undefined
\let\tocfont\@undefined
\ClassInfo{\@classname}{Option 'nativefonts' set or
not running XeLaTeX/LuaLaTeX: using native fonts}
\RequirePackage[defaultfam,tabular,lining]{montserrat}
\RequirePackage{firamath}
\RequirePackage{sfmath} % Fallback sans serif math font
\RequirePackage[T1]{fontenc}
\renewcommand*\oldstylenums[1]{{\fontfamily{Montserrat-TOsF}\selectfont #1}}
\def\titlefont{\fontseries{k}\selectfont} %% Set the black family for titles
\def\subtitlefont{\fontseries{eb}\selectfont}
\def\tocfont{\fontseries{m}\selectfont}
\def\titlestyle{\titlefont\bfseries}
\else
%% Using fontspec for font rendering, first check system paths
%% for font availability, if not fall back to local .otf files
\IfFontExistsTF{Montserrat}{%
\newfontfamily\montserratblack{Montserrat}[BoldFont={Montserrat Black}]
\newfontfamily\montserratextrabold{Montserrat}%
[BoldFont={Montserrat ExtraBold}]
\def\titlefont{\montserratblack\bfseries}
\def\subtitlefont{\montserratextrabold\bfseries}
\def\tocfont{\montserratblack}
\setmainfont{Montserrat}
\setsansfont{Montserrat}
}{%
\newfontfamily\titlefont{Montserrat}[
Path = fonts/Montserrat/,
Extension = .otf,
UprightFont = *-Black, %% Force black
BoldFont=*-Black,
ItalicFont=*-BlackItalic,
BoldItalicFont= *-BlackItalic]
\newfontfamily\subtitlefont{Montserrat}[
Path = fonts/Montserrat/,
Extension = .otf,
UprightFont = *-ExtraBold, %% Force extra bold
BoldFont=*-ExtraBold,
ItalicFont=*-ExtraBoldItalic,
BoldItalicFont= *-ExtraBoldItalic]
\newfontfamily\tocfont{Montserrat}[
Path = fonts/Montserrat/,
Extension = .otf,
UprightFont = *-Regular,
BoldFont=*-Bold,
ItalicFont=*-Italic,
BoldItalicFont= *-BoldItalic]
\setmainfont{Montserrat}[
Path = fonts/Montserrat/,
Extension = .otf,
UprightFont = *-Regular,
BoldFont=*-Bold,
ItalicFont=*-Italic,
BoldItalicFont= *-BoldItalic]
\setsansfont{Montserrat}[
Path = fonts/Montserrat/,
Extension = .otf,
UprightFont = *-Regular,
BoldFont=*-Bold,
ItalicFont=*-Italic,
BoldItalicFont= *-BoldItalic]
}
\IfFontExistsTF{Fira Code}{%
\setmonofont{Fira Code}[StylisticSet={1,3}]
%% Shapely l, upright quotes, striked zeroes
}{%
\setmonofont{Fira Code}[
Path = fonts/FiraCode/,
Extension = .otf,
UprightFont = *-Regular,
BoldFont=*-Bold,
ItalicFeatures = FakeSlant,
BoldItalicFeatures = FakeSlant]
}
% Use a unicode-compliant sans serif math font
\IfFontExistsTF{Fira Math Regular}{%
\setmathfont{Fira Math Regular}[BoldFont=Fira Math Bold]
\setmathfont{Fira Math Regular}[FakeSlant, range={bfit->it}]
}{%
\setmathfont{FiraMath-Regular.otf}[
Path = fonts/FiraMath/,
BoldFont=FiraMath-Bold.otf]
\setmathfont{FiraMath-Regular.otf}[
Path = fonts/FiraMath/,
FakeSlant,
range={bfit->it}]
}
\def\titlestyle{\titlefont\bfseries}
\fi
%% Use the length of the 'HO' part of the logo to set the padding of the logo
\newsavebox{\logopart}
\savebox{\logopart}{\includegraphics[height=2cm]{graphics/logopart}}
%% We use A4 paper with slightly smaller margins than the default (scale = 0.7)
\geometry{a4paper,hscale=0.75,vscale=0.8,headheight=14pt,asymmetric}
%% Page layout settings
\setlength{\parindent}{0cm} %% Don't indent paragraph text
\renewcommand{\baselinestretch}{1.2} %% Increase line height
\raggedbottom %% Don't equalize content on pages
%% Redefine maketitle for our custom title page
\if@titlepage%
\renewcommand{\maketitle}{\thispagestyle{empty}\begin{titlepage}%
\@checkvariables
%% Change the geometry so the notes section doesn't bother us
\newgeometry{top=2cm,bottom=\wd\logopart,left=1.5cm,right=1.5cm}
%% Add whitespace at the top
%\addvspace{10\bigskipamount}
\begingroup
%% Print the title in the faculty color
\titlefont\color{title}\Huge\@title\@addpunct{.}\\
%% Optionally print a subtitle
\ifx\@subtitle\@empty\else
\bigskip
\subtitlefont\LARGE\@subtitle\@addpunct{.}
\fi
\hrule
\endgroup
\bigskip
\begingroup
%% Print the name of the author
\subtitlefont\Large\bfseries \@author\@addpunct{.}
\endgroup
\vfill
\if@thesis
\begingroup
\IfLanguageName{dutch}{%
Scriptie voorgedragen tot het bekomen van de graad van\\
\@degreesought\\
}{%
Thesis submitted in \if@partial{partial }\fi
fulfilment of the requirements for the degree of\\ \@degreesought\\
}
\endgroup
\fi
\bigskip
\bigskip
\if@thesis
\begingroup
\IfLanguageName{dutch}{%
\textbf{Promotor:}}{\textbf{Supervisor:}} \@supervisor\\
\ifx\@cosupervisor\@empty\else
\IfLanguageName{dutch}{%
\textbf{Co-promotor:}}{%
\textbf{Co-Supervisor:}} \@cosupervisor\\
\fi
\ifx\@institution\@empty\else
\IfLanguageName{dutch}{%
\textbf{Instelling:}}{\textbf{Institution:}} \@institution\\
\fi
\IfLanguageName{dutch}{%
\textbf{Academiejaar:}}{\textbf{Academic year:}} \@academicyear\\
\textbf{%
\ifcase\@examperiod
\or
\IfLanguageName{dutch}{Eerste}{First}
\or
\IfLanguageName{dutch}{Tweede}{Second}
\else
\IfLanguageName{dutch}{Derde}{Third}
\fi
\IfLanguageName{dutch}{examenperiode}{exam period} } \\
\endgroup
\bigskip
\else
\IfLanguageName{dutch}{%
\textbf{Academiejaar:}}{\textbf{Academic year:}} \@academicyear\\
\fi
\begingroup
\subtitlefont\bfseries\@departmentname\@addpunct{.}
\endgroup
%% Insert the HoGent logo
\begin{tikzpicture}[remember picture, overlay]
\node [anchor=south east, shift={(-\the\wd\logopart, \the\wd\logopart)}, inner sep=0, outer sep=0] (logo) at (current page.south east)%
{%
\includegraphics[height=\the\ht\logopart]{hogent_logo}%
};%
\end{tikzpicture}
\end{titlepage}%
\thispagestyle{empty}
\null\clearpage\restoregeometry
}
\fi
%% Page style for title pages
\fancypagestyle{plain}{%
\fancyhf{}
\renewcommand*\headrulewidth{0pt}
\renewcommand*\footrulewidth{0pt}
\fancyfoot[C]{\thepage}
}
%% Fancy style for the main matter
\fancypagestyle{mainmatter}{%
\fancyhf{}
%% Page numbers on the top left and top right
\fancyhead[LE,RO]{\thepage}
%% Chapter name on the left (even) page
\fancyhead[RE]{\titlefont\bfseries\nouppercase{\leftmark}}
%% Section name on the right (odd) page
\fancyhead[LO]{\titlefont\bfseries\nouppercase{\rightmark}}
}
%% The mainmatter style is default for normal pages
\pagestyle{mainmatter}
%% Print the current chapter and section at the top of the page
\renewcommand*\chaptermark[1]{\markboth{\thechapter.\ \color{title}#1}{}}
\renewcommand*\sectionmark[1]{\markright{\thesection.\ \color{title}#1}}
%% The setheader command can be used to print the title of unnumbered chapters
%% in the page header
\newcommand*\setheader[1]{\markboth{\color{title}#1}{\color{title}#1}}
%% Change the headrule command (from fancyhdr.sty) to draw the line below the
%% header in the title color
\renewcommand*\headrule{%
\if@fancyplain%
\let\headrulewidth\plainheadrulewidth%
\fi%
{\color{title}\hrule\@height\headrulewidth\@width\headwidth}%
\vskip-\headrulewidth%
}
%% Change the style of paragraphs, normally text comes directly after the
%% paragraph title
\titleformat{\paragraph}[hang]{\normalfont\normalsize\bfseries}{\theparagraph}
{0pt}{}
\titlespacing\paragraph{0pt}{\baselineskip}{0pt}
%% Draw the line above a footnote in the title color as well
\renewcommand*\footnoterule{%
\vspace*{-3pt}%
{\color{title}\hrule width 0.5\textwidth height 0.4pt}%
\vspace*{2.6pt}%
}
%% A part title starts with a huge (96pt) bold black number, flushed to the
%% right, followed by the part name on the next line in the title color
\titleformat{\part}[display]
{\flushright\titlestyle}
{\fontsize{96pt}{96pt}\selectfont\bfseries\thepart}
{0pt}
{\Huge\color{title}}
%% Separate the title from the text by two empty lines
\titlespacing{\part}{0pt}{0pt}{2\baselineskip}
%% In the table of contents, the part name is preceded by an empty line, printed
%% in bold, and not followed by a line of dots
\dottedcontents{part}[0em]{%
\vspace{\baselineskip}\subtitlefont\bfseries}{1.5em}{0pc}
%% Chapter titles have the same layout as parts
\titleformat{\chapter}[display]
{\flushright\titlestyle}
{\fontsize{96pt}{96pt}\selectfont\bfseries\thechapter}
{0pt}
{\Huge\color{title}}
\titlespacing{\chapter}{0pt}{0pt}{2\baselineskip}
%% In the table of contents, a chapter is similar to a part, except that it is
%% preceded by half an empty line
\dottedcontents{chapter}[1.5em]{%
\vspace{0.5\baselineskip}\subtitlefont\bfseries}{1.5em}{0pc}
%% Section titles start with the number in bold, followed by the name printed
%% in the title color
\titleformat{\section}
{\Large\titlestyle}
{\bfseries\thesection.\ }
{0pt}
{\color{title}}
%% Sections are preceded by an empty line.
\titlespacing{\section}{0pt}{\baselineskip}{3pt}
%% In the table of contents, section names are followed by a line of dots 8pt
%% apart
\dottedcontents{section}[3.8em]{\tocfont}{2.3em}{8pt}
%% Subsection titles have the same layout as section titles, except in a smaller
%% font
\titleformat{\subsection}
{\large\titlestyle}
{\bfseries\thesubsection.\ }
{0pt}
{\color{title}}
\titlespacing{\subsection}{0pt}{\baselineskip}{1.5pt}
\dottedcontents{subsection}[7em]{\tocfont}{3.2em}{8pt}
%% Subsubsections have the same font and color as sections and subsections, but
%% are not preceded by a number
\titleformat{\subsubsection}
{\titlestyle}
{}
{0pt}
{\color{title}}
%% Subsubsections are preceded by an empty line and do not appear in the table
%% of contents
\titlespacing{\subsubsection}{0pt}{\bigskipamount}{0pt}
%% Hyperlinks are blue, except in print mode, when they are all black
\hypersetup{%
colorlinks = true,
citecolor = links,
linkcolor = title,
urlcolor = links
}