-
Notifications
You must be signed in to change notification settings - Fork 0
/
thesisclass.cls
489 lines (439 loc) · 16.5 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
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
%% LaTeX2e class for diploma theses
%% Based on wissdoc.cls by Roland Bless, 1996-2001
%%
%% Adapted by: Timo Rohrberg, 2009
%%
%% Additions by: Thorsten Haberecht, IPD - Chair Prof. Böhm, 2010
%%
%% Fixes by: Max-Gerd Retzlaff, IBDS - Lehrstuhl Computergrafik, KIT, 2012
\NeedsTeXFormat{LaTeX2e} % We do need LaTeX2e
\ProvidesClass{thesisclass}
\LoadClass[a4paper,11pt,titlepage]{scrbook} % Class based on scrbook
% following line removed by M. Retzlaff, 20121114, conflict with Babel and outdated:
%\RequirePackage{ngerman} % New german orthography
%% -------------------------------
%% | Packages |
%% -------------------------------
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} % switched from ISO-8859-1 / Latin1 to UTF-8 (M. Retzlaff)
% M. Retzlaff, 20121114, replaced: (see ftp://ftp.dante.de/pub/tex/info/german/l2tabu/ )
%\usepackage{ae} % Almost european, virtual T1-Font
% by
\usepackage{lmodern}
\usepackage[pdftex]{graphicx}
\usepackage{vmargin} % Adjust margins in a simple way
\usepackage{fancyhdr} % Define simple headings
%\usepackage{subfigure}
\usepackage{url}
\usepackage[absolute,overlay]{textpos}
\usepackage{tikz}
%\usepackage{algorithm} % Code-Listings
%\usepackage{algorithmic} % Code-Listings
% see http://www.ctan.org/tex-archive/macros/latex/contrib/algorithm2e/algorithm2e.pdf
% for more sophisticated algorithm listings
\usepackage[raiselinks=true,
bookmarks=true,
bookmarksopenlevel=1,
bookmarksopen=true,
bookmarksnumbered=true,
hyperindex=true,
plainpages=false,
pdfpagelabels=true,
pdfborder={0 0 0.5},
colorlinks=false,
linkbordercolor={0 0.61 0.50},
citebordercolor={0 0.61 0.50}]{hyperref} %{0.57 0.74 0.57}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=apa]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
%\usepackage[fixlanguage]{babelbib} % sets german style for literature entries
%\selectbiblanguage{english} % for \bibliographystyle{babalpha}
%% --- End of Packages ---
%% --------------------------------
%% | Bugfix for babel/germanb.dtx |
%% --------------------------------
%% see: http://www.macrotron.net/babel-hyphens.txt
%\declare@shorthand{german}{"~}{\textormath{\leavevmode\hbox{-}\bbl@allowhyphens}{-}}
%\declare@shorthand{ngerman}{"~}{\textormath{\leavevmode\hbox{-}\bbl@allowhyphens}{-}}
%% -------------------------------
%% | Declarations |
%% -------------------------------
\DeclareGraphicsExtensions{.svg}
%% --- 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}
}
%% --- End of New Commands ---
%% -------------------------------
%% | Globale Settings |
%% -------------------------------
\setcounter{secnumdepth}{3} % Numbering also for \subsubsections
\setcounter{tocdepth}{3} % Register \subsubsections in content directory
\setpapersize{A4}
\setmarginsrb{3cm}{1cm}{3cm}{1cm}{6mm}{7mm}{5mm}{15mm}
\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}
}
%% --- 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 ---
%% ----------------------------------
%% | Erklärung |
%% ----------------------------------
\def\Erklaerung{
\cleardoubleemptypage
\parindent0pt
\chapter*{Erkl\"arung}
\bigskip
% Ich versichere, dass ich die Arbeit ohne fremde Hilfe und ohne Benutzung
% anderer als der angegebenen Quellen angefertigt habe, und dass die Arbeit in
% gleicher oder \"ahnlicher Form noch keiner anderen Pr\"ufungsbeh\"orde
% vorgelegen hat und von dieser als Teil einer Pr\"ufungsleistung angenommen
% wurde. Alle Ausf\"uhrungen, die w\"ortlich oder sinngem\"a\ss \"ubernommen
% wurden, sind als solche gekennzeichnet. \\[4cm]
% new on 2012-11-19, see http://www.kit.edu/studieren/amtlicheBekanntmachungen_2126.php
Ich versichere, dass ich die Arbeit selbstst\"andig verfasst habe und keine
anderen als die angegebenen Quellen und Hilfsmittel benutzt habe, die
w\"ortlich oder inhaltlich \"ubernommenen Stellen als solche
kenntlich gemacht und die Satzung des KIT zur Sicherung guter wissenschaftlicher
Praxis in der jeweils gültigen Fassung beachtet habe.
Die Arbeit wurde in gleicher oder \"ahnlicher Form noch keiner
anderen Pr\"ufungsbeh\"orde vorgelegt und von dieser als Teil
einer Pr\"ufungsleistung angenommen. \\[4cm]
Karlsruhe, den \today\hfill
\hfill{\vbox{\hrule{\hbox{\small(\myname)}}}}
\thispagestyle{empty}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SPECIAL ZOOM COMMANDS FOR TIKZ SPY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{contour}
\newif\ifblackandwhitecycle
\gdef\patternnumber{0}
\pgfkeys{/tikz/.cd,
zoombox paths/.style={
draw=orange,
very thick
},
black and white/.is choice,
black and white/.default=static,
black and white/static/.style={
draw=white,
zoombox paths/.append style={
draw=black
}
},
black and white/static/.code={
\gdef\patternnumber{1}
},
black and white/cycle/.code={
\blackandwhitecycletrue
\gdef\patternnumber{1}
},
black and white pattern/.is choice,
black and white pattern/0/.style={},
black and white pattern/1/.style={
draw=black
},
black and white pattern/2/.style={
draw=white,
postaction={
draw=black,
dash pattern=on 4pt off 4pt
}
},
black and white pattern/3/.style={
draw=white,
postaction={
draw=black,
dash pattern=on 4pt off 4pt on 1pt off 4pt
}
},
black and white pattern/4/.style={
draw=white,
postaction={
draw=black,
dash pattern=on 4pt off 2pt on 2 pt off 2pt on 2 pt off 2pt
}
},
black and white pattern/5/.style={
draw=white,
postaction={
draw=black,
dash pattern=on 2pt
}
},
black and white pattern/6/.style={
draw=white,
postaction={
draw=black,
dash pattern=off 2pt
}
},
zoomboxarray inner gap/.initial=5pt,
zoomboxarray columns/.initial=2,
zoomboxarray rows/.initial=2,
subfigurename/.initial={},
figurename/.initial={zoombox},
zoomboxarray/.style={
execute at begin picture={
\begin{scope}[
spy using outlines={%
zoombox paths,
width=\imagewidth / \pgfkeysvalueof{/tikz/zoomboxarray columns} - (\pgfkeysvalueof{/tikz/zoomboxarray columns} - 1) / \pgfkeysvalueof{/tikz/zoomboxarray columns} * \pgfkeysvalueof{/tikz/zoomboxarray inner gap} -\pgflinewidth,
height=\imageheight / \pgfkeysvalueof{/tikz/zoomboxarray rows} - (\pgfkeysvalueof{/tikz/zoomboxarray rows} - 1) / \pgfkeysvalueof{/tikz/zoomboxarray rows} * \pgfkeysvalueof{/tikz/zoomboxarray inner gap}-\pgflinewidth,
magnification=3,
every spy on node/.style={
zoombox paths
},
every spy in node/.style={
zoombox paths
}
}
]
},
execute at end picture={
\end{scope}
\node at (image.north) [anchor=north,inner sep=0pt] {\subcaptionbox{\label{\pgfkeysvalueof{/tikz/figurename}-image}}{\phantomimage}};
\node at (zoomboxes container.north) [anchor=north,inner sep=0pt] {\subcaptionbox{\label{\pgfkeysvalueof{/tikz/figurename}-zoom}}{\phantomimage}};
\gdef\patternnumber{0}
},
spymargin/.initial=0.5em,
zoomboxes xshift/.initial=1,
zoomboxes right/.code=\pgfkeys{/tikz/zoomboxes xshift=1},
zoomboxes left/.code=\pgfkeys{/tikz/zoomboxes xshift=-1},
zoomboxes yshift/.initial=0,
zoomboxes above/.code={
\pgfkeys{/tikz/zoomboxes yshift=1},
\pgfkeys{/tikz/zoomboxes xshift=0}
},
zoomboxes below/.code={
\pgfkeys{/tikz/zoomboxes yshift=-1},
\pgfkeys{/tikz/zoomboxes xshift=0}
},
caption margin/.initial=4ex,
},
adjust caption spacing/.code={},
image container/.style={
inner sep=0pt,
at=(image.north),
anchor=north,
adjust caption spacing
},
zoomboxes container/.style={
inner sep=0pt,
at=(image.north),
anchor=north,
name=zoomboxes container,
xshift=\pgfkeysvalueof{/tikz/zoomboxes xshift}*(\imagewidth+\pgfkeysvalueof{/tikz/spymargin}),
yshift=\pgfkeysvalueof{/tikz/zoomboxes yshift}*(\imageheight+\pgfkeysvalueof{/tikz/spymargin}+\pgfkeysvalueof{/tikz/caption margin}),
adjust caption spacing
},
calculate dimensions/.code={
\pgfpointdiff{\pgfpointanchor{image}{south west} }{\pgfpointanchor{image}{north east} }
\pgfgetlastxy{\imagewidth}{\imageheight}
\global\let\imagewidth=\imagewidth
\global\let\imageheight=\imageheight
\gdef\columncount{1}
\gdef\rowcount{1}
\gdef\zoomboxcount{1}
},
image node/.style={
inner sep=0pt,
name=image,
anchor=south west,
append after command={
[calculate dimensions]
node [image container,subfigurename=\pgfkeysvalueof{/tikz/figurename}-image] {\phantomimage}
node [zoomboxes container,subfigurename=\pgfkeysvalueof{/tikz/figurename}-zoom] {\phantomimage}
}
},
color code/.style={
zoombox paths/.append style={draw=#1}
},
connect zoomboxes/.style={
spy connection path={\draw[draw=none,zoombox paths] (tikzspyonnode) -- (tikzspyinnode);}
},
help grid code/.code={
\begin{scope}[
x={(image.south east)},
y={(image.north west)},
font=\footnotesize,
help lines,
overlay
]
\foreach \x in {0,1,...,9} {
\draw(\x/10,0) -- (\x/10,1);
\node [anchor=north] at (\x/10,0) {0.\x};
}
\foreach \y in {0,1,...,9} {
\draw(0,\y/10) -- (1,\y/10); \node [anchor=east] at (0,\y/10) {0.\y};
}
\end{scope}
},
help grid/.style={
append after command={
[help grid code]
}
},
}
\newcommand\phantomimage{%
\phantom{%
\rule{\imagewidth}{\imageheight}%
}%
}
\newcounter{zoombox}
\newcommand\zoombox[2][]{\stepcounter{zoombox}
\begin{scope}[zoombox paths]
\pgfmathsetmacro\xpos{
(\columncount-1)*(\imagewidth / \pgfkeysvalueof{/tikz/zoomboxarray columns} + \pgfkeysvalueof{/tikz/zoomboxarray inner gap} / \pgfkeysvalueof{/tikz/zoomboxarray columns} ) + \pgflinewidth
}
\pgfmathsetmacro\ypos{
(\rowcount-1)*( \imageheight / \pgfkeysvalueof{/tikz/zoomboxarray rows} + \pgfkeysvalueof{/tikz/zoomboxarray inner gap} / \pgfkeysvalueof{/tikz/zoomboxarray rows} ) + 0.5*\pgflinewidth
}
\edef\dospy{\noexpand\spy [
#1,
zoombox paths/.append style={
black and white pattern=\patternnumber
},
every spy on node/.append style={#1},
x=\imagewidth,
y=\imageheight
] on (#2) in node [anchor=north west] (zoombox-\arabic{zoombox}) at ($(zoomboxes container.north west)+(\xpos pt,-\ypos pt)$);}
\dospy
\pgfmathtruncatemacro\pgfmathresult{ifthenelse(\columncount==\pgfkeysvalueof{/tikz/zoomboxarray columns},\rowcount+1,\rowcount)}
\global\let\rowcount=\pgfmathresult
\pgfmathtruncatemacro\pgfmathresult{ifthenelse(\columncount==\pgfkeysvalueof{/tikz/zoomboxarray columns},1,\columncount+1)}
\global\let\columncount=\pgfmathresult
\ifblackandwhitecycle
\pgfmathtruncatemacro{\newpatternnumber}{\patternnumber+1}
\global\edef\patternnumber{\newpatternnumber}
\fi
\end{scope}
}
%% **** END OF CLASS ****