-
Notifications
You must be signed in to change notification settings - Fork 11
/
style.tex
496 lines (423 loc) · 13.5 KB
/
style.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
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
%
% Smart Thesis LaTeX template
%
% [To underline the amateurish flavour of this template, let's start with some
% nifty ASCII-Art (http://www.network-science.de/ascii/)...]
%
% #######
% / ###
% / ## #
% ## # ##
% ### ##
% ## ### ### /### /### /### ### /### ########
% ### ### ##/ ###/ /## / / ### / ###/ #### / ########
% ### ### ## ###/ ###/ / ###/ ## ###/ ##
% ### /## ## ## ## ## ## ## ##
% #/ /## ## ## ## ## ## ## ##
% #/ ## ## ## ## ## ## ## ##
% # / ## ## ## ## ## ## ##
% /## / ## ## ## ## /# ## ##
% / ########/ ### ### ### ####/ ## ### ##
%/ ##### ### ### ### ### ## ### ##
%|
% \)
%
%
% /### / /
% / ############/ #/ #
%/ ######### ## ###
%# / # ## #
% ## / ## ##
% / ### ## /## /## /### ### /###
% ## ## ## / ### / ### / #### / ### / #### /
% ## ## ##/ ### / ### ## ###/ ## ## ###/
% ## ## ## ## ## ### #### ## ####
% ## ## ## ## ######## ### ## ###
% ## ## ## ## ####### ### ## ###
% ## # / ## ## ## ### ## ###
% ### / ## ## #### / /### ## ## /### ##
% ######/ ## ## ######/ / #### / ### / / #### /
% ### ## ## ##### ###/ ##/ ###/
% /
% /
% /
% /
%
% About:
% ======
%
% This template is a re-implementation of the "classicthesis" template by André
% Miede. However, it uses the "memoir" class as a basis, eliminating most
% of the external packages required by "classicthesis" and thus (hopefully)
% achieving a higher compatibility with other LaTeX packages. Large parts of
% the code have been adapted (ransacked) from André Miedes code.
%
% You can find more information about "classicthesis" at CTAN:
%
% https://www.ctan.org/pkg/classicthesis
%
% More information about the "memoir" package can be found here:
%
% https://www.ctan.org/pkg/memoir
%
%
% Authors:
% ========
%
% Jan Philip Göpfert, Andreas Stöckel
%
%
% License:
% ========
%
% This LaTeX template is published under the Creative Commons Zero license. To
% the extent possible under law, the authors have waived all copyright and
% related neighboring rights to Smart Thesis. This work is published from:
% Germany.
%
%
% EXTERNAL PACKAGES
%
\usepackage[usenames,dvipsnames,svgnames]{xcolor}
\usepackage{ragged2e} % for marginnote
%
% FONT DEFINITIONS
%
% Use the following code for XeLaTeX
\ifxetex
% Setup microtype for XeLaTeX
\usepackage[expansion=false,final]{microtype}
% Load the texgyrepagella font as main font and set the ``mathpazo'' font as
% math font
\usepackage{fontspec}
\usepackage{mathpazo}
\setmainfont%
[%
BoldFont = texgyrepagella-bold.otf,
ItalicFont = texgyrepagella-italic.otf,
BoldItalicFont = texgyrepagella-bolditalic.otf,
Ligatures = TeX
]%
{texgyrepagella-regular.otf}
% Define a new 'widespaced' font that is used in section headings
% or chapter titles. For backwards compatibility reasons this uses
% the old calling convention \newfontfamily\fontname[<options>{font}
% instead of the newer \newfontfamily\fontname{font}[<options>]
\newfontfamily\widespaced[%
LetterSpace=15,%
WordSpace={1.25, 1.25, 1.25}%
]{texgyrepagella-regular.otf}%
\DeclareRobustCommand{\spacedallcaps}[1]{%
{\widespaced\oldstylenums{\MakeTextUppercase{#1}}}%
}%
\DeclareRobustCommand{\spacedlowsmallcaps}[1]{%
{\widespaced\oldstylenums{\textsc{\MakeTextLowercase{#1}}}}%
}%
\fi
% Use the following code for pdfLaTex
\ifpdf
% Setup microtype for pdfLaTex
\usepackage[final,tracking=true,kerning=true,spacing=nonfrench]{microtype}
\usepackage[sc]{mathpazo}
\DeclareRobustCommand{\spacedallcaps}[1]{\textls[160]{\oldstylenums{\textsc{\MakeTextUppercase{#1}}}}}%
\DeclareRobustCommand{\spacedlowsmallcaps}[1]{\textls[80]{\oldstylenums{\textsc{\MakeTextLowercase{#1}}}}}%
\fi
% Increase linespread for Palatino
\renewcommand{\linespread}{1.05}
%
% COLOR DEFINITIONS
%
\definecolor{smartgray}{gray}{0.55}
\definecolor{smartred}{HTML}{800000}
\definecolor{smartplum}{HTML}{47294F}
\definecolor{smartblue}{HTML}{193A6B}
\definecolor{smartorange}{HTML}{AA4C00}
\definecolor{smartgreen}{HTML}{3C7705}
\definecolor{smartbutter}{HTML}{A08300}
\definecolor{tangored}{HTML}{CC0000}
\definecolor{tangoplum}{HTML}{75507B}
\definecolor{tangoblue}{HTML}{3465A4}
\definecolor{tangoorange}{HTML}{F57900}
\definecolor{tangogreen}{HTML}{73D216}
\definecolor{tangobutter}{HTML}{EDD400}
\definecolor{shadecolor}{gray}{0.95}
\colorlet{heading}{smartgray}
\colorlet{ref}{smartblue}
\colorlet{cite}{smartgreen}
\colorlet{url}{smartred}
\colorlet{caption}{black}
\colorlet{margincaption}{caption}
%
% SECTIONING STYLES (toledo)
%
% See http://tex.stackexchange.com/questions/161577/memoir-hangnum-chapter-number-in-right-margin-switch for the inspiration
\setsecnumdepth{subsection}
\makeatletter
\makechapterstyle{toledo}{%
\chapterstyle{default}
\renewcommand*{\chapterheadstart}{\vspace*{0.0cm}}
\renewcommand*{\chapnumfont}{\normalfont\color{heading}\addfontfeature{SizeFeatures={Size=110}}}
\newfont{\chapterNumber}{eurb10 scaled 7000}
\renewcommand*{\chapnumfont}{\chapterNumber\color{heading}}
\renewcommand*{\printchaptername}{}
\renewcommand*{\chapternamenum}{}
\renewcommand*{\printchapternum}{%
\raisebox{0pt}[0pt][0pt]{%
\makebox[0pt][l]{%
\makebox[\dimexpr\textwidth+5.45em\relax][l]{%
\parbox[t]{\textwidth}{\mbox{}}%
\parbox[t]{5.45em}{\hfill\chapnumfont \thechapter}}}}}%
\renewcommand*{\chapternamenum}{}
\renewcommand*{\afterchapternum}{}
\renewcommand*{\afterchaptertitle}{%
\par\parbox{\textwidth}{\hrulefill}\par%
\vspace*{4ex}}
\renewcommand*{\chaptitlefont}{\normalfont\large}
\renewcommand*{\printchaptertitle}[1]{%
\parbox[b]{\textwidth}{%
\raggedright\chaptitlefont\spacedallcaps{##1}%
}%
}
\setsecheadstyle{\spacedlowsmallcaps}
\setsecindent{-3.5ex}
\setbeforesecskip{-4ex plus -1ex minus -.2ex}
\setaftersecskip{4ex plus 1ex minus .2ex}
\setsubsecheadstyle{\itshape}
\setbeforesubsecskip{-4ex plus -1ex minus -.2ex}
\setaftersubsecskip{4ex plus 1ex minus .2ex}
\setsecnumformat{\spacedlowsmallcaps{\csname the##1\endcsname\quad}}
% \setparaheadstyle{\normalsize\itshape}
\renewcommand*{\abstractnamefont}{\spacedlowsmallcaps}
}
\makeatother
\chapterstyle{toledo}
%
% FIGURES
%
\captionstyle{\small}
\captionnamefont{\slshape\color{caption}}
\newsubfloat{figure}% Create subfloat in figure environment
\newsubfloat{table}% Create subfloat in table environment
%
% ACKNOWLEDGEMENT
%
\makeatletter
\newcommand{\acknowledgementname}{Acknowledgements}
\newenvironment{acknowledgement}{%
\setup@bstract
\if@bsrunin\else
\ifnumber@bs \num@bs \else
\begin{\absnamepos}\abstractnamefont\acknowledgementname\end\absnamepos%
\vspace{\abstitleskip}%
\fi
\fi
\put@bsintoc%
\begin{@bstr@ctlist}\if@bsrunin\@bsrunintitle\fi\abstracttextfont}%
{\par\end{@bstr@ctlist}}
\newcommand{\smartcopyright}[1]{\begingroup%
\pagebreak%
\thispagestyle{empty}%
\footnotesize%
\par\vspace*{\fill}%
\hspace{-1.1cm}%
\parbox{10cm}{%
\noindent%
Copyright \textcopyright\ \the\year\ \applytolist[, ]{}{\@author}\\[0.5cm]%
{#1}%
}%
\endgroup}
\newcommand{\smartinitialepigraph}[2]{\begingroup
\cleardoublepage
\thispagestyle{empty}
\vspace*{2cm}
\epigraph{#1}{#2}
\cleardoublepage
\endgroup}
\let\oldepigraph\epigraph
\renewcommand{\epigraph}[2]{\oldepigraph{#1}{\spacedlowsmallcaps{#2}}}
\makeatother
%
% MARGINNOTE
%
%
% There are three commands for placing elements in the margin:
%
% \marginnote{<TEXT>}
% Just like \marginpar but with correct formating
%
% \marginfig{<SHORT CAPTION>}{<FIGURE CONTENT>}{<LONG CAPTION>}{\label{<LABEL>}}
% \margintbl{<SHORT CAPTION>}{<TABLE CONTENT>}{<LONG CAPTION>}{\label{<LABEL>}}
% Places a figure/table in the margin
% - <SHORT CAPTION> is the caption as it occurs in the list of figures/tables
% - <FIGURE CONTENT>/<TABLE CONTENT> is the actual figure/table content
% - <LONG CAPTION> is the caption below the figure
% - <LABEL> is the label -- we decided to let you explicitly type "\label" here
% as this allows LaTeX editors to index the label and provide auto completion.
%
% Define the "marginnote" command. For compatibility reasons
% we do not override marginpar.
\strictpagecheck
\newcommand{\marginnote}[1]{\hspace*{0pt}\marginpar{
\microtypesetup{disable}%
\slshape\footnotesize%
\vspace*{-0.725em}%
\checkoddpage%
\ifoddpage%
\RaggedRight%
\else%
\RaggedLeft%
\fi%
{#1}%
\microtypesetup{enable}%
}\ignorespaces}
\newcommand{\marginfloat}[8]{\marginnote{{#1}%
\par\refstepcounter{#4}\textcolor{margincaption}{#5 #6}: {#2}#3}%
\addcontentsline{#7}{#4}{\protect\numberline {#6}{\ignorespaces #8}}\ignorespaces}
\newcommand{\marginfig}[4]{\marginfloat{#2}{#3}{#4}{figure}{Figure}{\thefigure}{lof}{#1}}
\newcommand{\margintbl}[4]{\marginfloat{#2}{#3}{#4}{table}{Table}{\thetable}{lot}{#1}}
%
% PAGE STYLE (headers, footers)
%
\makeatletter
% Deactivate capitalization of headers.
\nouppercaseheads
% Define the new "berlin" style.
\makepagestyle{berlin}
% Display the page number in the footer.
\makeevenfoot{berlin}{\thepage}{}{}
\makeoddfoot{berlin}{}{}{\thepage}
% Override the chapter style with the unfinished "berlin" style
% to eliminate the header and to make sure a consistent footer
% style is used.
\copypagestyle{chapter}{berlin}
% Define the "berlin" style
\makepsmarks{berlin}{%
\def\chaptermark##1{%
\markboth{\memUChead{%
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\@chapapp\ \thechapter. \ %
\fi
\fi
##1}}{}}%
\def\tocmark{\markboth{\memUChead{\contentsname}}{\memUChead{\contentsname}}}%
\def\lofmark{\markboth{\memUChead{\listfigurename}}{\memUChead{\listfigurename}}}%
\def\lotmark{\markboth{\memUChead{\listtablename}}{\memUChead{\listtablename}}}%
\def\bibmark{\markboth{\memUChead{\bibname}}{\memUChead{\bibname}}}%
\def\indexmark{\markboth{\memUChead{\indexname}}{\memUChead{\indexname}}}%
\def\sectionmark##1{%
\markright{\memUChead{%
\ifnum \c@secnumdepth > \z@
\thesection. \ %
\fi %
##1}}}}
\makepsmarks{berlin}{%
\createmark{chapter}{left}{nonumber}{}{}
\createmark{section}{right}{shownumber}{}{\ }
\createplainmark{toc}{both}{\contentsname}
\createplainmark{lof}{both}{\listfigurename}
\createplainmark{lot}{both}{\listtablename}
\createplainmark{bib}{both}{\bibname}
\createplainmark{index}{both}{\indexname}
\createplainmark{glossary}{both}{\glossaryname}
}
% Discriminate between "oneside" and "twoside" documents.
\if@twoside
\makeevenhead{berlin}{\spacedlowsmallcaps{\leftmark}}{}{}
\makeoddhead{berlin}{}{}{\spacedlowsmallcaps{\rightmark}}
\else
\makeoddhead{berlin}{\spacedlowsmallcaps{\rightmark}}{}{}
\fi
% Use the berlin style.
\pagestyle{berlin}
\makeatother
%
% FOOTNOTES
%
\footmarkstyle{\textsc{#1}}
\setlength{\footmarkwidth}{-0.5em}
\setlength{\footmarksep}{0.5em}
\setlength{\footparindent}{0em}
%
% EPIGRAPHS
%
\makeatletter
% Make the epigraph span two third of the text width
\setlength{\epigraphwidth}{0.66\textwidth}
% Disable the rule below the epigraph
\setlength{\epigraphrule}{0pt}
% Use the normal font size
\epigraphfontsize{\normalsize}
% Style the epigraph itself -- use italic text and
% flush it to the right
\newenvironment{epigraphstyle}{
% \microtypesetup{disable}%
\small\slshape%
% \RaggedLeft%
}{%
% \microtypesetup{enable}%
}
\epigraphtextposition{epigraphstyle}
% Style the epigraph source -- prepend it with a em-dash
% and make sure no indentation is added after the epigraph
\newenvironment{epigraphsourcestyle}%
{%#
--- \small\raggedleft\color{smartred}%
}{%
\@afterindentfalse\@afterheading%
}
\epigraphsourceposition{epigraphsourcestyle}
\makeatother
%
% TITLEPAGE
%
\makeatletter
\newcommand\thesistype[1]{\renewcommand\@thesistype{#1}}
\newcommand\@thesistype{}
\newcommand\discipline[1]{\renewcommand\@discipline{#1}}
\newcommand\@discipline{}
\newcommand\institution[1]{\renewcommand\@institution{#1}}
\newcommand\@institution{}
\newcommand\supervisors[1]{\renewcommand\@supervisors{#1}}
\newcommand\@supervisors{}
\newcommand\internalid[1]{\renewcommand\@internalid{#1}}
\newcommand\@internalid{}
\newcommand{\applytolist}[3][{,\\\vspace{0.1cm}}]{%
\def\nextitem{\def\nextitem{#1}}%
\@for \el:=#3\do{\nextitem{#2{\el}}}%
}
\newcommand{\smarttitle}{
{\begingroup
\thispagestyle{empty}
\makeatletter
\raggedright
\vfill
{\LARGE \spacedallcaps{\@thesistype} \\}
{\Large \spacedlowsmallcaps{\@discipline}\\}
\vfill
{\Huge \textcolor{smartred}{\spacedallcaps{\@title}}\\}
\vfill
{\LARGE \applytolist{\spacedallcaps}{\@author}\\}
\vfill
{\Large \applytolist{\itshape}{\@institution}}
\vfill
{\Large \spacedlowsmallcaps{Supervised by}\\}
\vspace{0.1cm}
{\large \applytolist{\spacedallcaps}{\@supervisors}}
\vfill
\vfill
{\Large \spacedlowsmallcaps{\@date} \hfill \spacedlowsmallcaps{\@internalid}}
\vfill
\makeatother
\endgroup}}
\makeatletter
%
% PAGE LAYOUT
%
\settypeblocksize{23.45cm}{11.85cm}{*}
%\setlength{\textheight}{23.45cm}
%\setlength{\textwidth}{11.85cm}
\setlrmargins{3.141592653589793cm}{*}{*}
\setulmargins{*}{*}{*}
\setmarginnotes{0.8cm}{3.5cm}{1cm}
\checkandfixthelayout