forked from a2s-institute/thesis-report
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mas_report.cls
358 lines (292 loc) · 9.68 KB
/
mas_report.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
%
% LaTeX2e Style for MAS R&D and master thesis reports
% Author: Argentina Ortega Sainz, Hochschule Bonn-Rhein-Sieg, Germany
% Please feel free to send issues, suggestions or pull requests to:
% https://github.com/mas-group/project-report
% Based on the template created by Ronni Hartanto in 2003
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{mas_report}[2018/01/25 The MAS report class]
\RequirePackage{xcolor}
\RequirePackage{ifthen}
\definecolor{slcolor}{HTML}{882B21}
\newcommand*{\project}[1]{\gdef\@project{#1}%
}
\newcommand*{\@project}{\texttt{project} not set. Please select Master's Thesis or R\&D Project}
% Options
\DeclareOption{onecolumn}{\OptionNotUsed}
\DeclareOption{thesis}{\project{Master's Thesis}}
\DeclareOption{rnd}{\project{R\&D Project}}
% Report options
\DeclareOption{twosides}{
\PassOptionsToClass{\CurrentOption}{book}
\PassOptionsToPackage{left=3cm,right=2cm}{geometry}
}
\DeclareOption{oneside}{
\PassOptionsToClass{\CurrentOption}{book}
\PassOptionsToPackage{left=3cm,right=2cm, asymmetric}{geometry}
}
% Execute the default option
\ExecuteOptions{thesis}
\ExecuteOptions{twosides}
% Process other options
\ProcessOptions\relax
% Load class options
\LoadClass[10pt,a4paper]{book}
% \renewcommand{\sfdefault}{phv}
% \renewcommand{\familydefault}{\sfdefault}
%-------------------------------------------------------------------------------
% VARIOUS REQUIRED PACKAGES AND CONFIGURATIONS
%-------------------------------------------------------------------------------
\usepackage{cite}
\usepackage{graphicx} % Required to include images
\usepackage{amsmath,amssymb,theorem} % Math packages
\usepackage{listings} % Required for including snippets of code
\usepackage{booktabs} % Required for better horizontal rules in tables
\usepackage{microtype} % Slightly tweak font spacing for aesthetics
\usepackage[titletoc]{appendix}
\usepackage{setspace}
\usepackage{subfiles}
\usepackage{geometry}
% \usepackage{showframe}
\usepackage{subcaption} % Required for sub-figures
\usepackage{multirow} % Required to enable merging of columns/rows in a table
\usepackage{rotating} % Required to display sideways tables/figures
\usepackage{hyperref} % Enable hyperlinks
\usepackage{titling}
\usepackage[nottoc]{tocbibind}
\usepackage{bm} % Required for showing math symbols in boldface
\usepackage{lipsum} % Used to test
\usepackage{lmodern}%
\onehalfspacing
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Definitions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand\bibname{References} %Change Bibliography to References
\newcommand{\thirdpartylogo}[1]{\def\@thirdpartylogo{#1}}
\thirdpartylogo{}
\newcommand*{\supervisors}[1]{\gdef\@supervisors{#1}%
}
\newcommand*{\@supervisors}{\texttt{\string\supervisors} currently
not set. Please fix this.}
\newcommand*{\phdsupervisor}[1]{\def\@phdsupervisor{#1}%
}
\phdsupervisor{}
\newcommand*{\thephdsupervisor}{\@phdsupervisor}
\newcommand*{\phdproject}[1]{\def\@phdproject{#1}%
}
\phdproject{}
% PDF Metadata
\newcommand*{\keywords}[1]{\def\@keywords{#1}}
\keywords{}
\newcommand*{\subject}[1]{\def\@subject{#1}}
\subject{}
% Acknowledgements
\newcommand{\phdack}[1]{This project was conducted under the supervision of \thephdsupervisor, in the context of their PhD project with the working title `` \@phdproject".}
% Colors
\definecolor{hbrs}{RGB}{1,106,186}
\definecolor{keywords}{RGB}{0,100,0}
\definecolor{comments}{RGB}{0,100,50}
\definecolor{stringred}{RGB}{160,0,0}
\definecolor{codeblue}{RGB}{0,0,150}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Set up hyperlinks and PDF metadata
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\AtBeginDocument{%
\hypersetup{%
colorlinks=true, % Use colored links instead of boxes
linkcolor=black, % Internal link color
citecolor=black, % Citations color
urlcolor=black, % External url color
pagebackref=true, % Enable reference links
pdftitle={\@title},
pdfsubject={\@subject},
pdfauthor={\@author},
pdfkeywords={\@keywords}
}%
}
\RequirePackage{hyperref}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Title page
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand*{\maketitle}{%
\begin{titlepage}
\newgeometry{left=3cm, bottom=3cm}
\begin{minipage}{0.475\textwidth}
\centering
\includegraphics[height=1.3cm]{images/Logo-HBRS-cyan.png}
\end{minipage}
\begin{minipage}{0.475\textwidth}
\centering
\includegraphics[height=1.3cm]{images/b-it.pdf}
\end{minipage}
\centering
\vfill
\ifx\@thirdpartylogo\@empty
\relax
\else
\begin{minipage}{0.4\textwidth}
\centering
\includegraphics[height=1.3cm]{\@thirdpartylogo}
\end{minipage}
\fi%
\vfill
{\Large\@project\unskip\strut\par}
\vspace{1.5cm}
{\huge\bfseries\@title\unskip\strut\par}
\vspace{2cm}
{\Large\itshape\@author\unskip\strut\par}
\vfill
{\normalsize Submitted to Hochschule Bonn-Rhein-Sieg,\\
Department of Computer Science\\
in partial fullfilment of the requirements for the degree\\
of Master of Science in Autonomous Systems}
\vfill
Supervised by\par
\vskip 8pt
{\large
\@supervisors\unskip\strut\par
}
\vfill
{\large \@date\par}
\end{titlepage}
\restoregeometry
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Declaration of authorship
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newenvironment{authorship}{\begin{itemize}}{\end{itemize}}
\newcommand{\caitem}[2]{\item \textbf{#1}: #2}
\newcommand*{\jointwork}[1]{\def\@jointwork{#1}%
}
\jointwork{}
\def\statementpage{%
\thispagestyle{empty}
\hbox{}
\vfill
\noindent
I, the undersigned below, declare that this work has not previously been
submitted to this or any other university and that it is, unless otherwise stated, entirely my own work%
\ifx\@jointwork\@empty
.
\else
, except for the following aspects, which were authored as listed below:
\@jointwork
\fi%
\vskip 60pt
\hrule width 4cm
\hfill \hspace{5cm}
\hrulefill
\vskip -3pt
\leftline{\hspace{1.5cm} Date \hfill \@author \hspace{1.5cm}}
\vskip 60pt
\clearpage
}%
%%%%%%%%%%%%%%%%%%%%
% Copyright page
%%%%%%%%%%%%%%%%%%%%
\def\copyrightpage#1{%
\hbox{ }
\vfill
\begin{center}
\copyright\ #1~\@author
\ifx\@phdsupervisor\@empty
\else
, \@phdsupervisor
\fi%
.~All Rights Reserved \\ [12pt]
\end{center}
\clearpage
}%
%%%%%%%%%%%%%%%%%%%%%
% Abstract
%%%%%%%%%%%%%%%%%%%%%
\newenvironment{abstract}{%
\chapter*{Abstract}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%
% Acknowledgements
%%%%%%%%%%%%%%%%%%%%%%%%%%
\newenvironment{acknowledgements}{%
\chapter*{Acknowledgements}
% \cleardoublepage\thispagestyle{empty}\null\vfill\begin{center}%
% \bfseries Acknowledgements\end{center}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PAGE LAYOUT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% SIDE MARGINS:
% \oddsidemargin 28pt % Left margin on odd-numbered pages.
% \evensidemargin 0pt % Left margin on even-numbered pages.
% \marginparwidth 40pt % Width of marginal notes.
%
% \marginparsep 12pt % Horizontal space between outer margin and
% % marginal note
% \textwidth 15cm % width of text
%
% % VERTICAL SPACING:
% % Top of page:
% \topmargin 10pt % distance from top of page to running head
% \headheight 14pt % Height of box containing running head.
% \headsep 1cm % Space between running head and text.
% \textheight 8.8in % space for text
% \footskip 30pt % Distance from baseline of box containing foot
% % to baseline of last line of text.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Header and footer
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{titlesec}
\let\footruleskip\undefined
\usepackage{fancyhdr}% http://ctan.org/pkg/fancyhdr
%% Page style for title pages.
\fancypagestyle{plain}{%
\fancyhf{}
\renewcommand*\headrulewidth{0pt}
\renewcommand*\footrulewidth{0pt}
\fancyfoot[C]{\thepage}
% \fancyfoot[C]{}
}
%% Fancy style for the main matter.
\fancypagestyle{mainmatter}{%
\fancyhf{}
\renewcommand*\headrulewidth{0.5pt}
%% Page numbers on the top left and top right.
\fancyfoot[C]{\thepage}
%% Chapter name on the left (even) page.
\fancyhead[RE]{\nouppercase{\rightmark}}
%% Section name on the right (odd) page.
\fancyhead[LO]{\nouppercase{\leftmark}}
}
%% Print the current chapter and section at the top of the page in cyan.
\renewcommand*\chaptermark[1]{\markboth{\textcolor{black} {\thechapter.\ } #1}{}}
\renewcommand*\sectionmark[1]{\markright{\textcolor{black}{\thesection.\ } #1}}
%% Chapter titles have the same layout as parts.
\titleformat{\chapter}
[display] % sectioning paragraph shape
{\flushright}% format to be applied to the title, label, and text
{\color{gray}\fontsize{68pt}{68pt}\selectfont\bfseries\thechapter}% sectioning label
{0pt}% horizontal separation between label and title body and it must be a length and not be empty.
{\Huge\color{black}}% code preceding the title body
[\vspace{1cm}] % code following the title body (optional)
\titlespacing{\chapter}{0pt}{-50pt}{\baselineskip}
\titleformat{\section}
[block]
{\flushleft}%format
{}%label
{0pt}%sep
{\bfseries\large\thesection~}%before code
% [\vspace{0.5cm}]
\titlespacing{\section}{0pt}{0pt}{5pt}
\titleformat{\subsection}[display]
{\flushleft}%format
{}%label
{0pt}%sep
{\bfseries\large\thesubsection~}%before code
% [\vspace{0.5cm}]
\titlespacing{\subsection}{0pt}{0pt}{2pt}
%\renewcommand{\cfttoctitlefont}{\color{hbrs}}
%\renewcommand{\cftlottitlefont}{\flushright\color{hbrs}}
%\renewcommand{\cftloftitlefont}{\flushright\color{hbrs}}
\renewcommand{\vec}[1]{\bm{#1}}
\endinput