-
Notifications
You must be signed in to change notification settings - Fork 0
/
thesisclass.cls
369 lines (309 loc) · 11.3 KB
/
thesisclass.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
%% LaTeX2e class for diploma theses
%% Based on wissdoc.cls by Roland Bless, 1996-2001
%% bless@telematik.informatik.uni-karlsruhe.de
%%
%% Adapted by: Timo Rohrberg, 2009
%% timo.rohrberg@student.kit.edu
%%
%% Additions by: Thorsten Haberecht, IPD - Chair Prof. Böhm, 2010
%% thorsten.haberecht@kit.edu
\NeedsTeXFormat{LaTeX2e} % We do need LaTeX2e
\ProvidesClass{thesisclass}
\LoadClass[a4paper,11pt,numbers=noenddot,titlepage,twoside,openright]{scrbook} % Class based on scrbook
%% -------------------------------
%% | Packages |
%% -------------------------------
%% Make PDF searchable and copyable
\usepackage{cmap}
%% Fonts etc
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{microtype}
\usepackage{lmodern}
%% Suppress clubs and widows
\clubpenalty=100000
\widowpenalty=100000
%% Language
\usepackage[english]{babel}
%% AMS package
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
%% Physical units
\usepackage{siunitx}
\sisetup{range-units = single, range-phrase = {-}, separate-uncertainty = true,multi-part-units=brackets, product-units=brackets, locale=US, detect-weight=true, binary-units=true} % change locale to DE for a German thesis
%% Correct line breaking for hyperlinks
\usepackage[hyphens, obeyspaces]{url}
\usepackage[raiselinks=true,
bookmarks=true,
bookmarksopenlevel=2,
bookmarksopen=true,
bookmarksnumbered=true,
hyperindex=true,
plainpages=false,
pdfpagelabels=true,
pdfpagemode=UseOutlines,
pdfborder={0 0 0.5},
colorlinks=false,
linkbordercolor={0 0.61 0.50},
citebordercolor={0 0.61 0.50}]{hyperref}
%% Nicer tables
\usepackage{booktabs}
\usepackage{multirow} % for multirow and multicolumn
\usepackage{rotating} % for sideways tables
%% For graphics
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{float}
%% For the titlepage and headings
\usepackage[absolute,overlay]{textpos}
\usepackage{tikz}
\usepackage{vmargin} % Adjust margins in a simple way
\usepackage{fancyhdr} % Define simple headings
%% For including code
\usepackage{listings}
\lstset{basicstyle=\footnotesize\ttfamily,breaklines=true,framextopmargin=50pt,frame=sideline,xleftmargin=20pt}
%% BibTex
\usepackage[backend=biber,style=alphabetic,sorting=nyt,maxalphanames=5,minalphanames=3,maxbibnames=10]{biblatex}
\DefineBibliographyStrings{english}{phdthesis = {Ph.D.\@ thesis}}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{\mkbibemph{#1}}
\DeclareFieldFormat{journaltitle}{#1}
\DeclareFieldFormat{issuetitle}{#1}
\DeclareFieldFormat{maintitle}{#1}
\DeclareFieldFormat{booktitle}{#1}
\DefineBibliographyExtras{english}{\renewcommand{\finalandcomma}{}}
% http://tex.stackexchange.com/q/218706/15107
\setcounter{biburlnumpenalty}{400} % allow breaks at numbers
\setcounter{biburlucpenalty}{400} % allow breaks at uppercase letters
\setcounter{biburllcpenalty}{400} % allow breaks at lowercase letters
\bibliography{bibliography}
%% For better enumerations
\usepackage{enumitem}
\usepackage{scrextend} % for labeling - Felix
\addtokomafont{labelinglabel}{\normalfont\bfseries} % for labeling
%% Other packages
\usepackage{xspace} % for better newcommands
\usepackage[autostyle=true, babel=true]{csquotes} % use \enquote{abc} instead of "abc"
\usepackage{nicefrac}
\usepackage[com pat=1.1.0]{tikz-feynman}
\usepackage{physics}
\usepackage{slashed}
\usepackage{upgreek}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{multicol}
\usepackage{hhline}
\usepackage{environ}
\usepackage{longtable}
\usepackage{numprint}
\usepackage{tabularx}
\usepackage{ltxtable}
\usepackage[titletoc,title]{appendix}
%% --- End of Packages ---
%% -------------------------------
%% | Declarations |
%% -------------------------------
\DeclareGraphicsExtensions{.svg}
% arrows
\newcommand{\rar}{\ensuremath{\rightarrow \xspace }}
\newcommand{\Rar}{\ensuremath{\Rightarrow \xspace }}
% particle physics
\newcommand{\Pup}{u\xspace }
\newcommand{\Pdown}{d\xspace }
\newcommand{\Pcharm}{c\xspace }
\newcommand{\Pstrange}{s\xspace }
\newcommand{\Ptop}{t\xspace }
\newcommand{\PtopNOSPACE}{t}
\newcommand{\APtop}{$\overline{\text{t}}$\xspace }
\newcommand{\Pbottom}{b\xspace }
\newcommand{\APbottom}{$\overline{\text{b}}$}
\newcommand{\Pe}{e\xspace }
\newcommand{\Pquark}{q\xspace }
\newcommand{\APquark}{$\overline{\text{q}}$\xspace }
\newcommand{\Pgluon}{g\xspace }
\newcommand{\PgluonNOSPACE}{g}
\newcommand{\Pphoton}{$\upgamma$\xspace }
\newcommand{\Ptau}{$\uptau$}
\newcommand{\Pmuon}{$\upmu$}
\newcommand{\Pelectronneutrino}{$\upnu_\text{e}$}
\newcommand{\Pmuonneutrino}{$\upnu_{\upmu}$}
\newcommand{\Ptauneutrino}{$\upnu_{\uptau}$}
\newcommand{\Ppositron}{$\text{e}^\text{+}$\xspace }
\newcommand{\PZ}{Z\xspace }
\newcommand{\PW}{W\xspace }
\newcommand{\PZzero}{$\text{Z}^{\text{0}}$\xspace }
\newcommand{\PBzero}{$\text{B}^{\text{0}}$\xspace }
\newcommand{\PWplus}{$\text{W}^{\text{+}}$\xspace }
\newcommand{\PWminus}{$\text{W}^{\text{--}}$\xspace }
\newcommand{\PWone}{$\text{W}^{\text{1}}$\xspace }
\newcommand{\PWtwo}{$\text{W}^{\text{2}}$\xspace }
\newcommand{\PWthree}{$\text{W}^{\text{3}}$\xspace }
\newcommand{\PWpm}{$\text{W}^{\text{\pm}}$\xspace }
\newcommand{\qqbar}{q$\overline{\text{q}}$\xspace }
\newcommand{\tbar}{$\overline{\text{t}}$\xspace }
\newcommand{\ttbar}{t$\overline{\text{t}}$\xspace }
\newcommand{\ttbarNOSPACE}{t$\overline{\text{t}}$}
\newcommand{\ttbarH}{t$\overline{\text{t}}$H\xspace }
\newcommand{\ttHbb}{t$\overline{\text{t}}$H(b$\overline{\text{b}}$)\xspace}
\newcommand{\bbbar}{b$\overline{\text{b}}$\xspace }
\newcommand{\pT}{\ensuremath{p_{\text{T}}}\xspace}
\newcommand{\Htobb}{H$\to $ \bbbar}
\newcommand{\Htononbb}{H$\to $ non \bbbar}
\newcommand{\met}{\ensuremath{\vec {\not\mathrel{E}}_{\text{T}}}\xspace}
\newcommand{\akfour}{ak4\xspace }
\newcommand{\akeight}{ak8\xspace }
\newcommand{\kt}{$k_{\text{T}}$\xspace }
\newcommand{\pu}{pileup\xspace }
\newcommand{\ue}{underlying event\xspace }
\newcommand{\madgraphamcatnlo}{MadGraph5\_aMC@NLO\xspace}
\newcommand{\madgraphamcatnloshort}{MG5aMC\space}
\newcommand{\powheg}{Powheg\xspace}
\newcommand{\pythia}{Pythia~8\xspace}
\newcommand{\herwig}{Herwig~7\xspace}
\def\layersep{2.5cm}
%% --- End of Declarations ---
%% -------------------------------
%% | New commands |
%% -------------------------------
\newcommand{\changefont}[3]{\fontfamily{#1} \fontseries{#2} \fontshape{#3} \selectfont}
%\renewcommand*{\headfont}{\slshape}
%\newcommand{\captionfont}{}
\newcommand{\chapterheadfont}{}
\newcommand{\blankpage}{
\clearpage{\pagestyle{empty}\cleardoublepage}
}
\renewcommand{\thesubfigure}{(\alph{subfigure})}
\captionsetup[sub]{labelformat=simple}
%% --- End of New Commands ---
%% -------------------------------
%% | Globale Settings |
%% -------------------------------
\setcounter{secnumdepth}{2} % Numbering also for \subsubsections
\setcounter{tocdepth}{2} % Register \subsubsections in content directory
\setpapersize{A4}
\setmarginsrb{3cm}{1cm}{3cm}{1cm}{6mm}{7mm}{5mm}{15mm}
\renewcommand{\arraystretch}{1.5}
\parindent 0cm % Do not indent beginning of paragraph
\parskip1.5ex plus0.5ex minus0.5ex % Margin between paragraphs
%% --- End of global Settings ---
%% -------------------------------
%% | Headings |
%% -------------------------------
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter\ #1}{}}
\fancyhf{}
\fancyhead[LE,RO]{{\headfont\thepage}} % Left/right header for even/odd pages
\fancyhead[LO]{\headfont\nouppercase{\rightmark}} % Header for left page (odd)
\fancyhead[RE]{\headfont\nouppercase{\leftmark}} % Header for right page (even)
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\fancypagestyle{plain}{%
\fancyhf{} % No Header and Footer fields
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyfoot[C]{\thepage}
}
% removes the dot at the end of the section numbering
\renewcommand{\sectionmark}[1]{\markright{\thesection \ #1}{}}
%% --- End of Headings ---
%% -------------------------------
%% | Style of captions |
%% -------------------------------
\renewcommand{\chaptername}{}
\renewcommand{\section}{%
\@startsection{section}%
{1} % Structure level
{0mm} % Indention
{2ex plus 1ex minus 1ex} % Pre-Margin
{0.5ex plus 0.5ex minus 0.5ex} % Post-Margin
{\chapterheadfont\Large\bfseries} % Style
}
\renewcommand{\subsection}{%
\@startsection{subsection}%
{2} % Structure level
{0mm} % Indention
{1.5ex plus 1ex minus 0.5ex} % Pre-Margin
{0.3ex plus 0.3ex minus 0.3ex} % Post-Margin
{\chapterheadfont\large\bfseries} % Style
}
\renewcommand{\subsubsection}{%
\@startsection{subsubsection}%
{3} % Structure level
{0mm} % Indention
{1.5ex plus 1ex minus 0.5ex} % Pre-Margin
{0.2ex plus 0.2ex minus 0.2ex} % Post-Margin
{\chapterheadfont\normalsize\bfseries} % Style
}
\renewcommand{\paragraph}{%
\@startsection{paragraph}%
{4} % Structure level
{0mm} % Indention
{1.3ex plus 1ex minus 0.3ex} % Pre-Margin
{0.2ex plus 0.2ex minus 0.2ex} % Post-Margin
{\chapterheadfont\normalsize\bfseries} % Style
}
\renewcommand{\subparagraph}{%
\@startsection{subparagraph}%
{5} % Structure level
{0mm} % Indention
{1ex plus 1ex minus 0.2ex} % Pre-Margin
{0.1ex plus 0.1ex minus 0.1ex} % Post-Margin
{\chapterheadfont\normalsize\bfseries} % Style
}
%% --- End of captions style ---
%% ---------------------------------
%% | Style of chapter captions |
%% ---------------------------------
\newlength{\chapnolen}
\newlength{\chapparlen}
\newsavebox{\chapno}
\renewcommand{\@makechapterhead}[1]{
\vspace*{0.2\textheight}
\vskip 15\p@
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\savebox{\chapno}{\chapterheadfont\huge\bfseries \thechapter}
\settowidth{\chapnolen}{\usebox{\chapno}}
\parbox[t]{\chapnolen}{\usebox{\chapno}}\nobreak\leavevmode
\fi
\fi
\interlinepenalty\@MM
\setlength{\chapparlen}{\textwidth}
\addtolength{\chapparlen}{-1.0\chapnolen}
\addtolength{\chapparlen}{-2ex}
\leavevmode\nobreak
\parbox[t]{\chapparlen}{\raggedright\chapterheadfont\huge \bfseries #1\par\nobreak}
\vskip 40\p@
}}
\renewcommand{\@makeschapterhead}[1]{
\vspace*{50\p@}
{\parindent \z@ \raggedright
\normalfont
\interlinepenalty\@M
\chapterheadfont \huge \bfseries #1\par\nobreak
\vskip 40\p@
}
}
%% --- End of chapter captions style ---
%% ---------------------------------
%% | Style of content directory |
%% ---------------------------------
\let\oldtableofcontents\tableofcontents
\renewcommand{\tableofcontents}{{\pdfbookmark{\contentsname}{\contentsname}\chapterheadfont\oldtableofcontents}}
\let\@olddottedtocline\@dottedtocline
\renewcommand{\@dottedtocline}[5]{\@olddottedtocline{#1}{#2}{#3}{#4}{\chapterheadfont #5}}
%% --- End of content directory style ---
%% ----------------------------------
%% | Style of appendix numbering |
%% ----------------------------------
\renewcommand\appendix{\par
\setcounter{section}{0}%
\setcounter{subsection}{0}%
\setcounter{figure}{0}%
\renewcommand\thesection{\Alph{section}}%
\renewcommand\thefigure{\Alph{section}.\arabic{figure}}
\renewcommand\thetable{\Alph{section}.\arabic{table}}}
%% --- End of appenix numbering style ---
%% **** END OF CLASS ****