forked from maxnoe/tudothesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tudothesis.cls
102 lines (88 loc) · 3.76 KB
/
tudothesis.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
\ProvidesClass{tudothesis}[2015/08/31 v0.9 wrapper to scrbook for thesis at TUDo]
% Option for tu colors:
\newif\if@tucolor\@tucolorfalse
\DeclareOption{tucolor}{\@tucolortrue}
% All other Options go to KOMA-Script
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrbook}}
\PassOptionsToPackage{bibliography=totoc}{biblatex}
\ProcessOptions\relax
\LoadClass[
headsepline, % line between header and text body
bibliography=totoc, % bibliography as unnumbered chapter in toc
numbers=noenddot, % no dot after figure/table number
captions=tableheading, % correct spacing for table headings
titlepage=firstiscover, % symmetrical margins on titlepage
headings=normal % size of chapter headings slightly smaller
]{scrbook}
% Define our beloved tu colour:
\RequirePackage{xcolor}
\xdefinecolor{tugreen}{RGB}{132, 184, 25}
\RequirePackage{caption}
\RequirePackage{subcaption}
% add some Color to structural elements if option tucolor was given
\RequirePackage{scrlayer-scrpage}
\pagestyle{scrheadings}
\KOMAoption{headsepline}{0.5pt}
\if@tucolor%
\addtokomafont{title}{\color{tugreen}} % title on titlepage
\addtokomafont{chapter}{\color{tugreen}} % headlines of the chapters, sections etc.
\addtokomafont{pagenumber}{\color{tugreen}} % page number in the footer
\addtokomafont{chapterentry}{\color{tugreen}} % chapters in the table of contents
\setkomafont{headsepline}{\color{tugreen}} % line between header and text body
\DeclareCaptionFont{tugreen}{\color{tugreen}}
\captionsetup{%
labelfont={bf,tugreen}, % bold label in tu colour
format=plain, % no indentation under the label
width=0.9\textwidth, % slightly smaller width than text
font=small, % font slightly smaller than text
}
\else
\captionsetup{%
labelfont=bf, % bold label
format=plain, % no indentation under the label
width=0.9\textwidth, % slightly smaller width than text
font=small, % font slightly smaller than text
}
\fi
% equation numbers of form chapter.equationnumber
\RequirePackage{amsmath}%
\renewcommand{\theequation}{\thechapter{}.\arabic{equation}}%
\numberwithin{equation}{chapter}%
% store the title in \thetitle, so one can access it in the document
\let\oldtitle\title%
\renewcommand{\title}[1]{\oldtitle{#1}\newcommand{\thetitle}{#1}}
% initialize commands:
\newcommand\thebirthplace{}
\newcommand\thechair{}
\newcommand\thedivision{}
\newcommand\thethesisclass{}
\newcommand\thesubmissiondate{}
\newcommand\thefirstcorrector{}
\newcommand\thesecondcorrector{}
% new commands for information about the thesis
\newcommand\birthplace[1]{\renewcommand\thebirthplace{geboren in #1}}
\newcommand\chair[1]{\renewcommand\thechair{#1}}
\newcommand\division[1]{\renewcommand\thedivision{#1}}
\newcommand\thesisclass[1]{\renewcommand\thethesisclass{#1}}
\newcommand\submissiondate[1]{\renewcommand\thesubmissiondate{#1}}
\newcommand\firstcorrector[1]{\renewcommand\thefirstcorrector{#1}}
\newcommand\secondcorrector[1]{\renewcommand\thesecondcorrector{#1}}
% set title page elements
\subject{Arbeit zur Erlangung des akademischen Grades\\ \thethesisclass}
\publishers{\thechair \\ \thedivision \\ Technische Universität Dortmund}
% page for the correctors
\newcommand{\makecorrectorpage}{%
\thispagestyle{empty}
\vspace*{\fill}
\begin{tabular}{@{}l@{\hspace{2em}}l@{}}
Erstgutachter: & \thefirstcorrector \\
Zweitgutachter: & \thesecondcorrector \\
Abgabedatum: & \thesubmissiondate
\end{tabular}
\newpage
}
% add birthplace to author
\let\oldauthor\author
\renewcommand\author[1]{%
\oldauthor{#1 \\ \thebirthplace}
}