-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththesis.cls
302 lines (250 loc) · 8.16 KB
/
thesis.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
%% LaTeX2e class for student theses
%% thesis.cls
%%
%% Karlsruhe University of Applied Sciences
%% Faculty of Computer Science and Business Information Systems
%% Distributed Systems (vsys) / Datacentric Syoftware Systems (DSS)
%%
%% Prof. Dr. Christian Zirpins
%%
%%
%% Version 0.3, 2022-12-16
%%
%% --------------------------------------------------------
%% | Derived from sdqthesis by Erik Burger [email protected] |
%% --------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{thesis}[2016/06/10 v0.1 Student thesis class]
\DeclareOption{ngerman}{\PassOptionsToPackage{\CurrentOption}{babel}}
% German is also needed in English thesis for the abstract
\DeclareOption{english}{\PassOptionsToPackage{main=\CurrentOption,ngerman}{babel}}
\ProcessOptions\relax
%% ---------------------------------------------------------------
%% | Based on KOMAscript by Markus Kohm http://www.komascript.de |
%% ---------------------------------------------------------------
\LoadClass[12pt,twoside,headsepline,a4paper,titlepage=true,DIV=15,BCOR=20mm]{scrbook}
%% -----------------------
%% | Headers and footers |
%% -----------------------
\RequirePackage[automark]{scrlayer-scrpage}
\clubpenalty=10000 %prevent orphans
\widowpenalty=10000 %prvent widows
%% --------------
%% | Typography |
%% --------------
% T1 font encoding
\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}
% serif type: Linux Libertine
\RequirePackage{libertine}
% Linux Libertine in math mode
\RequirePackage[libertine]{newtxmath}
% grotesque type: Adobe Source Sans Pro
\RequirePackage[scaled=.92]{sourcesanspro}
% monospace type: Bera Mono
\RequirePackage[scaled=.78]{beramono}
% semi-bold type (for subsections and paragraphs)
\newcommand*{\sbdefault}{sb}
\DeclareRobustCommand{\sbseries}{%
\not@math@alphabet\sbseries\relax
\fontseries\sbdefault\selectfont}
\DeclareTextFontCommand{\textsb}{\sbseries}
\addtokomafont{subsection}{\sbseries}
\addtokomafont{subsubsection}{\sbseries}
\addtokomafont{paragraph}{\sbseries}
% microtype for nicer typography
\RequirePackage[protrusion=true,expansion=true]{microtype}
% commands for code and model keywords in text
\newcommand{\code}[1]{\texttt{\hyphenchar\font45\relax #1}}
\newcommand{\model}[1]{\textsf{#1}}
% nicer spacing for enumerations
\RequirePackage{enumitem}
% set ragged text with hyphenation
\usepackage{ragged2e}
%% --------------
%% | Title page |
%% --------------
% Logos
\newcommand{\thegrouplogo}{HKA_IWI_Wortmarke_CMYK}
\newcommand{\grouplogo}[1]{\renewcommand{\thegrouplogo}{#1}}
\newcommand{\theunilogo}{HKA_IWI_Bildmarke_CMYK}
\newcommand{\unilogo}[1]{\renewcommand{\theunilogo}{#1}}
\newcommand{\thelogoscale}{.4}
\newcommand{\printgrouplogo}{\includegraphics[scale=\thelogoscale]{logos/\thegrouplogo}}
\newcommand{\printunilogo}{\includegraphics[scale=\thelogoscale]{logos/\theunilogo}}
\newcommand{\nogrouplogo}{\renewcommand{\printgrouplogo}{}\renewcommand{\printunilogo}{}}
\titlehead{
\parbox[l][7cm][t]{.5\textwidth}{\printgrouplogo}
\parbox[l][7cm][t]{.5\textwidth}{\hfill\printunilogo}
% Raise Title left of vertical HKA logo
\vspace{-4cm}
}
\setkomafont{title}{\huge\sffamily}
\setkomafont{subtitle}{\normalfont\large}
\addtokomafont{title}{\RaggedRight}
\addtokomafont{subtitle}{\RaggedRight}
\addtokomafont{author}{\RaggedRight}
\uppertitleback{Hochschule Karlsruhe -- University of Applied Sciences\\ Fakult\"at f\"ur Informatik und Wirtschaftsinformatik\\ Moltkestr.\ 30, 76133 Karlsruhe, Germany}
%% variables for title page
\newcommand{\thetitle}{}
% \newcommand{\theinstitute}{}
\newcommand{\thethesistype}{}
\newcommand{\thereviewerone}{}
\newcommand{\thereviewertwo}{}
\newcommand{\theadvisorone}{}
\newcommand{\theadvisortwo}{}
\newcommand{\theeditstart}{}
\newcommand{\theeditend}{}
%% formatting commands for titlepage
\newcommand{\mytitle}[1]{\title{\parbox{11cm}{\RaggedRight #1}}%
\renewcommand{\thetitle}{#1}}
\newcommand{\thesistype}[1]{\subtitle{\vskip2em #1 \iflanguage{english}{of}{von}}%
\renewcommand{\thethesistype}{#1}}
% \newcommand{\myinstitute}[1]{\renewcommand{\theinstitute}{#1}}
\newcommand{\reviewerone}[1]{\renewcommand{\thereviewerone}{#1}}
\newcommand{\reviewertwo}[1]{\renewcommand{\thereviewertwo}{#1}}
\newcommand{\advisorone}[1]{\renewcommand{\theadvisorone}{#1}}
\newcommand{\advisortwo}[1]{\renewcommand{\theadvisortwo}{#1}}
\newcommand{\editingtime}[2]{%
\renewcommand{\theeditstart}{#1}%
\renewcommand{\theeditend}{#2}%
%% do not show the date
\date{}
}
\newcommand{\settitle}{%
\publishers{%
\RaggedRight
\large
\iflanguage{english}{at the Faculty of Computer Science and Business Information Systems}%
{an der Fakult\"at f\"ur Informatik und Wirtschaftsinformatik}\\[2em]
% \theinstitute\\[2em]
\begin{tabular}{ll}
\iflanguage{english}{Reviewer}{Erstgutachter}: & \thereviewerone\\
%skip w/o second reviewer
\ifthenelse{\equal{\thereviewertwo}{}}{}{%
\iflanguage{english}{Second reviewer}{Zweitgutachter}: & \thereviewertwo\\
}%
%skip w/o external advisor
\ifthenelse{\equal{\theadvisorone}{}}{}{%
\iflanguage{english}{Advisor}{Betreuer}: & \theadvisorone\\
}%
%skip w/o second external advisor
\ifthenelse{\equal{\theadvisortwo}{}}{}{%
\iflanguage{english}{Second advisor}{Zweiter Betreuer}: & \theadvisortwo\\
}%
\end{tabular}
\vskip2em
\theeditstart{} -- \theeditend
}
}
%% -----------------------------
%% | Abstract/Acknowledgements |
%% -----------------------------
\newcommand{\abstract}[1][\abstractname]{\chapter*{#1}}
\newcommand{\Abstract}[1][\abstractname]{\chapter*{#1}\addcontentsline{toc}{chapter}{#1}}
\def\ackname{Acknowledgments}
\def\abstractname{Abstract}
\def\switcht@deutsch{\svlanginfo
\def\ackname{Danksagung}
\def\abstractname{Kurzfassung}
}
\def\switcht@english{\svlanginfo
\def\ackname{Acknowledgements}
\def\abstractname{Abstract}
}
%% In English theses, an additional German Abstract is needed.
\newcommand{\includeabstract}{
\iflanguage{english}{
% include English and German abstracts
\include{sections/abstracts/abstract_en}
\begin{otherlanguage}{ngerman}
\include{sections/abstracts/abstract_de}
\end{otherlanguage}
}{
% include only German abstract
\include{sections/abstracts/abstract_de}
}
}
%% ------------
%% | Packages |
%% ------------
% draft mode
\RequirePackage{ifdraft}
\RequirePackage{ifthen}
% enumerate subsubsections
\setcounter{secnumdepth}{3}
% subimport of files
\RequirePackage{import}
% languages
\RequirePackage{babel}
\RequirePackage{csquotes}
% hyphenation for compound words
\RequirePackage[shortcuts]{extdash}
% nice tables
\RequirePackage{booktabs}
\RequirePackage{longtable}
\RequirePackage{array}
\RequirePackage{tabularx}
% Listings
\usepackage{listings}
% show graphics in draft mode
\RequirePackage{graphicx}
\setkeys{Gin}{draft=false}
% % Mathematics package
\RequirePackage{amsmath}
% \let\openbox\relax
% \RequirePackage{amsthm}
% \RequirePackage{amssymb}
% \RequirePackage{mathtools}
% appendix
\RequirePackage[toc,title,header]{appendix}
\noappendicestocpagenum
% todo-notes
% \RequirePackage[obeyDraft]{todonotes}
% \presetkeys{todonotes}{inline}{}
% PDF specific packages
\RequirePackage[hyphens]{url}
\RequirePackage[breaklinks,colorlinks=false]{hyperref}
\newcommand\setpdf{\hypersetup{%
pdftitle={\thethesistype},%
pdfsubject={\@title},%
pdfauthor={\@author},%
pdfborder={0 0 0},%
linkcolor=kit-blue100,%
citecolor=kit-green100,%
urlcolor=kit-red100
}%
\let\theauthor\@author
}
%% automatic naming of sections with autoref
\def\sectionautorefname{Section}
\def\subsectionautorefname{Subsection}
\def\subsubsectionautorefname{Subsection}
\def\paragraphautorefname{Paragraph}
%% Glossary
\RequirePackage[%
toc,
nonumberlist,
acronym
]{glossaries}
\renewcommand*{\glspostdescription}{}
% Figures and Subfigures
\RequirePackage{caption}
\RequirePackage{subcaption}
\RequirePackage{wrapfig}
\RequirePackage{cprotect}
\RequirePackage{multicol}
% Colors
\RequirePackage{color}
\RequirePackage{xcolor}
% Venn Diagram
\RequirePackage{tikz}
\usetikzlibrary{calc,trees,positioning,arrows,fit,shapes,calc}
% Icons
\RequirePackage{fontawesome5}
% Table of Content
\RequirePackage[nottoc]{tocbibind}
\renewcommand{\lstlistoflistings}{\begingroup
\tocfile{\lstlistingname}{lol}
\endgroup}