forked from malteschmitz/latex-thesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
style.tex
190 lines (155 loc) · 5.1 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
%!TEX root = thesis.tex
% Set german to default language and load english as well
\usepackage[english,ngerman]{babel}
% Set UTF8 as input encoding
\usepackage[utf8]{inputenc}
% Set T1 as font encoding
\usepackage[T1]{fontenc}
% Load a slightly more modern font
\usepackage{lmodern}
% Use the symbol collection textcomp, which is needed by listings.
\usepackage{textcomp}
% Load a better font for monospace.
\usepackage{courier}
% Load package to configure header and footer
\usepackage{scrlayer-scrpage}
% Set some options regarding the document layout. See KOMA guide
\KOMAoptions{%
paper=a4,
fontsize=12pt,
parskip=half,
headings=normal,
BCOR=1cm,
headsepline,
headsepline=0.5pt,
DIV=12}
% do not align bottom of pages
\raggedbottom
% set style of captions
\setcapindent{0pt} % do not indent second line of captions
\setkomafont{caption}{\small}
\setkomafont{captionlabel}{\bfseries}
\setcapwidth[c]{0.9\textwidth}
% set the style of the bibliography
\bibliographystyle{alphadin}
% load extended tabulars used in the list of abbreviation
\usepackage{tabularx}
% load the color package and enable colored tables
\usepackage[table]{xcolor}
% define new environment for zebra tables
\newcommand{\mainrowcolors}{\rowcolors{1}{maincolor!25}{maincolor!5}}
\newenvironment{zebratabular}{\mainrowcolors\begin{tabular}}{\end{tabular}}
\newcommand{\setrownumber}[1]{\global\rownum#1\relax}
\newcommand{\headerrow}{\rowcolor{maincolor!50}\setrownumber1}
% add main color to section headers
\addtokomafont{chapter}{\color{maincolor}}
\addtokomafont{section}{\color{maincolor}}
\addtokomafont{subsection}{\color{maincolor}}
\addtokomafont{subsubsection}{\color{maincolor}}
\addtokomafont{paragraph}{\color{maincolor}}
% do not print numbers next to each formula
\usepackage{mathtools}
\mathtoolsset{showonlyrefs}
% left align formulas
\makeatletter
\@fleqntrue\let\mathindent\@mathmargin \@mathmargin=\leftmargini
\makeatother
% Allow page breaks in align environments
\allowdisplaybreaks
% header and footer
\pagestyle{scrheadings}
\setkomafont{pagenumber}{\normalfont\sffamily\color{maincolor}}
\setkomafont{pageheadfoot}{\normalfont\sffamily}
\setkomafont{headsepline}{\color{maincolor}}
% German guillemets quotes
\usepackage[german=guillemets]{csquotes}
% load TikZ to draw diagrams
\usepackage{tikz}
% load additional libraries for TikZ
\usetikzlibrary{%
automata,%
positioning,%
}
% set some default options for TikZ -- in this case for automata
\tikzset{
every state/.style={
draw=maincolor,
thick,
fill=maincolor!18,
minimum size=0pt
}
}
% load listings package to typeset sourcecode
\usepackage{listings}
% set some options for the listings package
\lstset{%
upquote=true,%
showstringspaces=false,%
captionpos=b,%
basicstyle=\ttfamily,%
keywordstyle=\color{keywordcolor}\slshape,%
commentstyle=\color{commentcolor}\itshape,%
stringstyle=\color{stringcolor}}
\renewcommand{\lstlistingname}{Quelltext}
\renewcommand{\lstlistlistingname}{Quelltextverzeichnis}
% enable german umlauts in listings
\lstset{
literate={ö}{{\"o}}1
{Ö}{{\"O}}1
{ä}{{\"a}}1
{Ä}{{\"A}}1
{ü}{{\"u}}1
{Ü}{{\"U}}1
{ß}{{\ss}}1
}
% define style for pseudo code
\lstdefinestyle{pseudo}{language={},%
basicstyle=\normalfont,%
morecomment=[l]{//},%
morekeywords={for,to,while,do,if,then,else},%
mathescape=true,%
columns=fullflexible}
% load the AMS math library to typeset formulas
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{amssymb}
% load the paralist library to use compactitem and compactenum environment
\usepackage{paralist}
% load varioref and hyperref to create nicer references using vref
\usepackage[ngerman]{varioref}
\PassOptionsToPackage{hyphens}{url} % allow line break at hyphens in URLs
\usepackage{hyperref}
% setup hyperref
\hypersetup{breaklinks=true,
pdfborder={0 0 0},
ngerman,
pdfhighlight={/N},
pdfdisplaydoctitle=true}
% Fix bugs in some package, e.g. listings and hyperref
\usepackage{scrhack}
% Allow todos
\usepackage{todonotes}
% define german names for referenced elements
% (vref automatically inserts these names in front of the references)
\labelformat{figure}{Abbildung\ #1}
\labelformat{table}{Tabelle\ #1}
\labelformat{appendix}{Anhang\ #1}
\labelformat{chapter}{Kapitel\ #1}
\labelformat{section}{Abschnitt\ #1}
\labelformat{subsection}{Unterabschnitt\ #1}
\labelformat{subsubsection}{Unterunterabschnitt\ #1}
\AtBeginDocument{\labelformat{lstlisting}{Quelltext\ #1}}
% define theorem environments
\declaretheorem[numberwithin=chapter,style=plain]{Theorem}
\labelformat{Theorem}{Theorem\ #1}
\declaretheorem[sibling=Theorem,style=plain]{Lemma}
\labelformat{Lemma}{Lemma\ #1}
\declaretheorem[sibling=Theorem,style=plain]{Korollar}
\labelformat{Korollar}{Korollar\ #1}
\declaretheorem[sibling=Theorem,style=definition]{Definition}
\labelformat{Definition}{Definition\ #1}
\declaretheorem[sibling=Theorem,style=definition]{Beispiel}
\labelformat{Beispiel}{Beispiel\ #1}
\declaretheorem[sibling=Theorem,style=definition]{Bemerkung}
\labelformat{Bemerkung}{Bemerkung\ #1}