/
bachelor-thesis.cls
210 lines (169 loc) · 6.8 KB
/
bachelor-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
\LoadClass[12pt]{article}
% Subfiles support
\usepackage{subfiles}
% float for figure placement
\usepackage{float}
% A package for setting layout and margins for your thesis
\usepackage[a4paper]{geometry}
% Utf8 for the win!
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
% Use package babel for English or Estonian
% If you use Estonian make sure that Estonian hyphenation is installed
% - hypen-estonian or eehyp packages
\usepackage[estonian, english]{babel}
% \usepackage[english]{babel}
% \usepackage[estonian]{babel}
%
%
% When you write in Estonian then you want to use text with right character set
% By default LaTeX does not know what to do with õäöu letters. You have to specify
% a correct input and font encoding. For that you have to Google the Web
%
% For TexShop under MacOS X. The right lines are
%\usepackage[applemac]{inputenc}
%\usepackage[T1]{fontenc}
%
% For Windows and Linux the right magic lines are
%\usepackage[latin1]{inputenc}
%\usepackage[latin5]{inputenc}
%\usepackage[T1]{fontenc}
% General packages for math in general, theorems and symbols
% Read ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf for further information
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
% Optional calligraphic fonts
% \usepackage[mathscr]{eucal}
% Packages for building tables and tabulars
\usepackage{array}
\usepackage{tabu} % Wide lines in tables
\usepackage{xspace} % Non-eatable spaces in macros
% Including graphical images and setting the figure directory
\usepackage{graphicx}
\graphicspath{{figures/}}
\makeatletter
\providecommand{\bigsqcap}{%
\mathop{%
\mathpalette\@updown\bigsqcup
}%
}
\newcommand*{\@updown}[2]{%
\rotatebox[origin=c]{180}{$\m@th#1#2$}%
}
\makeatother
% Packages for getting clickable links in PDF file
\usepackage{hyperref}
%\usepackage[all]{hypcap}
% Packages for defining colourful text together with some colours
\usepackage{color}
\usepackage{xcolor}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
% Standard package for drawing algorithms
% Since the thesis in article format we must define \chapter for
% the package algorithm2e (otherwise obscure errors occur)
\let\chapter\section
\usepackage[ruled,noline]{algorithm2e}
% Fix a set of keywords which you use inside algorithms
\SetKw{True}{true}
\SetKw{False}{false}
\SetKwData{typeInt}{Int}
\SetKwData{typeRat}{Rat}
\SetKwData{Defined}{Defined}
\SetKwFunction{parseStatement}{parseStatement}
% Proper way to create coloured code listings
\usepackage{listings}
\lstset{
%language=java, % the language of the code,
basicstyle=\footnotesize, % the size of the fonts tat are used for the code
%numbers=left, % where to put the line-numbers
%numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
numberstyle=\tiny\color{gray},
stepnumber=1, % the step between two line-numbers. If it's 1, each line
% will be numbered
numbersep=5pt, % how far the line-numbers are from the code
backgroundcolor=\color{black!3}, % choose the background color. You must add \usepackage{color}
showspaces=false, % show spaces adding particular underscores
showstringspaces=false, % underline spaces within strings
showtabs=false, % show tabs within strings adding particular underscores
%frame = lines,
frame= single, % adds a frame around the code
frameround=tttt,
rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within
% not-black text (e.g. commens (green here))
tabsize=2, % sets default tabsize to 2 spaces
captionpos=b, % sets the caption-position to bottom
breaklines=true, % sets automatic line breaking
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
%title=\lstname, % show the filename of files included with \lstinputlisting;
% also try caption instead of title
% also try caption instead of title
keywordstyle=\color{blue}, % keyword style
commentstyle=\color{dkgreen}, % comment style
stringstyle=\color{mauve}, % string literal style
escapeinside={\%*}{*)}, % if you want to add a comment within your code
morekeywords={*,game, fun}, % if you want to add more keywords to the set
columns=fullflexible
}
\lstdefinestyle{def}{
showstringspaces=false,
language = C,
literate =
{-}{-}{1}
}
\definecolor{darkgreen}{rgb}{0.0, 0.2, 0.13}
% Source: https://github.com/cansik/kotlin-latex-listing
\lstdefinelanguage{Kotlin}{
keywords={package, as, as?, typealias, this, super, val, var, fun, for, null, true, false, is, in, throw, return, break, continue, object, if, try, else, while, do, when, class, interface, enum, object, companion, override, public, private, get, set, import, abstract, vararg, expect, actual, where, suspend, data, internal, dynamic, final, by},
keywordstyle=\color{blue}\bfseries,
ndkeywords={@Deprecated, @JvmName, @JvmStatic, @JvmOverloads, @JvmField, @JvmSynthetic, Iterable, Int, Long, Integer, Short, Byte, Float, Double, String, Runnable, Array},
ndkeywordstyle=\color{BurntOrange}\bfseries,
emph={println, return@, forEach, map, mapNotNull, first, filter, firstOrNull, lazy, delegate},
emphstyle={\color{OrangeRed}},
identifierstyle=\color{black},
sensitive=true,
commentstyle=\color{gray}\ttfamily,
comment=[l]{//},
morecomment=[s]{/*}{*/},
stringstyle=\color{darkgreen}\ttfamily,
morestring=[b]",
morestring=[s]{"""*}{*"""},
}
% doubles-brackets
\usepackage{stmaryrd}
% If you really want to draw figures in LaTeX use packages tikz or pstricks
% However, getting a corresponding illustrations is really painful
% Define your favorite macros that you use inside the thesis
% Name followed by non-removable space
% Macros that make sure that the math mode is set
\newcommand{\typeF}[1] {\ensuremath{\mathsf{type_{#1}}}\xspace}
\newcommand{\opDiv}{\ensuremath{\backslash \mathsf{div}}\xspace}
%todo
\usepackage[disable]{todonotes}
% for comment
\usepackage{verbatim}
% for striked out text
\usepackage[normalem]{ulem}
% to have whitespace between paragraphs
\usepackage[parfill]{parskip}
% tikz libraries
\usepackage{tikz}
\usetikzlibrary{shapes, arrows, chains, scopes, positioning, arrows, fit}
\usepackage{caption}
\captionsetup{%
justification=raggedright,
singlelinecheck=false,
format=plain
}
% table
\usepackage{multirow}
% smart spaces
\usepackage{xspace}
% lists and stuff
\usepackage{enumitem}
% quotation marks
\usepackage{csquotes}
\MakeOuterQuote{"}