summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/hagenberg-thesis/hgbthesis.cls
blob: fbe1a6b29989f871750806ef1ef37cf69ab469d5 (plain)
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
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
%% hgbthesis.cls
%% LaTeX template for creating diploma theses, masters's theses, bachelor's theses and other term papers.
%% This file is part of the Hagenberg Thesis package for creating bachelors's and masters's theses
%% Author: Wilhelm Burger (wilhelm.burger@fh-hagenberg.at)
%% GitHub: https://github.com/Digital-Media/HagenbergThesis
%% File encoding: ASCII

%% Package Information --------------------------------------------------------

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{hgbthesis}[2017/10/28]

\RequirePackage{xifthen}

\RequirePackage{ifpdf}	% for checking PDF mode 
\ifpdf{}% \typeout{hgbthesis: *** LaTeX in PDF mode ***}
\else{\errmessage{hgbthesis: *** LaTeX NOT running in PDF mode ***}}
\fi


%% Commands for Title Pages (used in class options) ---------------------------

\newcommand{\hgb@MainLanguage}{german}	% also referenced in hgb.sty
\newcommand{\@mastertitlepages}{}
\newcommand{\@diplomatitlepages}{}
\newcommand{\@bachelortitlepages}{}
\newcommand{\@internshiptitlepages}{}
\newcommand{\@maketitlepages}{\@mastertitlepages}  %Default: Master's thesis


\newcommand{\@titlepagefont}{\sffamily}

%% Class options --------------------------------------------------------------

\DeclareOption{master}{
	\renewcommand{\@maketitlepages}{\@mastertitlepages}
}

\DeclareOption{diplom}{%
	\renewcommand{\@maketitlepages}{\@diplomatitlepages}
	\ClassWarning{hgbthesis}{Deprecated: Document option '\CurrentOption' is deprecated, use 'diploma' instead.}
}

\DeclareOption{diploma}{%
	\renewcommand{\@maketitlepages}{\@diplomatitlepages}
}

\DeclareOption{bachelor}{%
	\renewcommand{\@maketitlepages}{\@bachelortitlepages}
}

\DeclareOption{praktikum}{%
	\renewcommand{\@maketitlepages}{\@internshiptitlepages}
	\ClassWarning{hgbthesis}{Deprecated: Document option '\CurrentOption' is deprecated, use 'internship' instead.}
}

\DeclareOption{internship}{%
	\renewcommand{\@maketitlepages}{\@internshiptitlepages}
}

\DeclareOption{english}{%
	\renewcommand{\hgb@MainLanguage}{english}
}

\DeclareOption{german}{%
	\renewcommand{\hgb@MainLanguage}{german}
}

\DeclareOption*{%
	\ClassWarning{hgbthesis}{Unknown document option '\CurrentOption'.}
}

\ProcessOptions


%% Paper Options and Style File -----------------------------------------------

\LoadClass[a4paper,11pt,oneside]{book}
\RequirePackage[top=36mm,bottom=40mm,left=32mm,right=32mm]{geometry} %showframe
 
\RequirePackage{hgb}	% load associated style file hgb.sty


%% Setup for Pages in the Front Matter ----------------------------------------

% General Commands

\newcommand{\@programname}{\@MissingArg{Degree program not specified!}}
\newcommand{\studiengang}[1]{%
	\renewcommand{\@programname}{#1}
	\ClassWarning{hgbthesis}{Deprecated: '\string\studiengang' is deprecated, use '\string\programname' instead.}
}
\newcommand{\programname}[1]{%
	\ifthenelse{\isempty{#1}}{}{\renewcommand{\@programname}{#1}}
}

\newcommand{\@placeofstudy}{\@MissingArg{Place of study not specified!}}
\newcommand{\studienort}[1]{%
	\renewcommand{\@placeofstudy}{#1}
	\ClassWarning{hgbthesis}{Deprecated: '\string\studienort' is deprecated, use '\string\placeofstudy' instead.}
}
\newcommand{\placeofstudy}[1]{%
	\ifthenelse{\isempty{#1}}{}{\renewcommand{\@placeofstudy}{#1}}
}

\newcommand{\@advisor}{\@MissingArg{Advisor not specified!}}
\newcommand{\betreuer}[1]{%
	\renewcommand{\@advisor}{#1}
	\ClassWarning{hgbthesis}{Deprecated: '\string\betreuer' is deprecated, use '\string\advisor' instead.}
}
\newcommand{\betreuerin}[1]{%
	\renewcommand{\@advisor}{#1}
	\ClassWarning{hgbthesis}{Deprecated: '\string\betreuerin' is deprecated, use '\string\advisor' instead.}
}
\newcommand{\advisor}[1]{%
	\ifthenelse{\isempty{#1}}{}{\renewcommand{\@advisor}{#1}}
}

\newcommand{\@thesisnumber}{\@MissingArg{Thesis number not specified!}}
\newcommand{\nummer}[1]{%
	\renewcommand{\@thesisnumber}{#1}
	\ClassWarning{hgbthesis}{Deprecated: '\string\nummer' is deprecated, use '\string\thesisnumber' instead.}
}
\newcommand{\thesisnumber}[1]{%
	\ifthenelse{\isempty{#1}}{}{\renewcommand{\@thesisnumber}{#1}}
}

\newcommand{\@coursetitle}{\@MissingArg{Course not specified!}}
\newcommand{\gegenstand}[1]{%
	\renewcommand{\@coursetitle}{#1}
	\ClassWarning{hgbthesis}{Deprecated: '\string\gegenstand' is deprecated, use '\string\coursetitle' instead.}
}
\newcommand{\coursetitle}[1]{%
	\ifthenelse{\isempty{#1}}{}{\renewcommand{\@coursetitle}{#1}}
}

\newcommand{\@semester}{\@MissingArg{Semester not specified!}}
\newcommand{\semester}[1]{%
	\ifthenelse{\isempty{#1}}{}{\renewcommand{\@semester}{#1}}
}

\newcommand{\@logofile}[0]{}
\newcommand{\logofile}[1]{%
	\renewcommand{\@logofile}{#1}
}

\newcommand{\makelogo}[0]{%
\ifthenelse{\equal{\@logofile}{}}%
	{\vspace*{30mm}}%
	{\includegraphics[height=30mm]{\@logofile}}%
}

% Submission Commands

\newcounter{@dayofsubmission}
\newcounter{@monthofsubmission}
\newcounter{@yearofsubmission}

\setcounter{@dayofsubmission}{\the\day}
\setcounter{@monthofsubmission}{\the\month}
\setcounter{@yearofsubmission}{\the\year}

\newcommand{\abgabedatum}[3]{%	%\abgabedatum{yyyy}{mm}{dd}
	\setcounter{@yearofsubmission}{#1}
	\setcounter{@monthofsubmission}{#2}
	\setcounter{@dayofsubmission}{#3}
	\ClassWarning{hgbthesis}{Deprecated: '\string\abgabedatum' is deprecated, use '\string\dateofsubmission{yyyy}{mm}{dd}' instead.}
}
\newcommand{\dateofsubmission}[3]{%	%\dateofsubmission{yyyy}{mm}{dd}
	\setcounter{@yearofsubmission}{#1}
	\setcounter{@monthofsubmission}{#2}
	\setcounter{@dayofsubmission}{#3}
}

\newcommand{\abgabemonat}[1]{%
	\ClassWarning{hgbthesis}{Deprecated: '\string\abgabemonat' is deprecated, use '\string\dateofsubmission{yyyy}{mm}{dd}' instead.}
}

\newcommand{\abgabejahr}[1]{%
	\ClassWarning{hgbthesis}{Deprecated: '\string\abgabejahr' is deprecated, use '\string\dateofsubmission{yyyy}{mm}{dd}' instead.}
}

% Internship Report Commands

\newcommand{\@companyName}{\@MissingArg{Company not specified!}}
\newcommand{\firma}[1]{%
	\renewcommand{\@companyName}{#1}
	\ClassWarning{hgbthesis}{Deprecated: '\string\firma' is deprecated, use '\string\companyName' instead.}
}
\newcommand{\companyName}[1]{%
	\ifthenelse{\isempty{#1}}{}{\renewcommand{\@companyName}{#1}}
}

\newcommand{\@companyUrl}{\@MissingArg{Company URL not specified!}}
\newcommand{\firmenUrl}[1]{%
	\renewcommand{\@companyUrl}{#1}
	\ClassWarning{hgbthesis}{Deprecated: '\string\firmenUrl' is deprecated, use '\string\companyUrl' instead.}
}
\newcommand{\companyUrl}[1]{%
	\ifthenelse{\isempty{#1}}{}{\renewcommand{\@companyUrl}{#1}}
}

\newcommand{\@companyPhone}{\@MissingArg{Company phone number not specified!}}
\newcommand{\firmenTel}[1]{%
	\renewcommand{\@companyPhone}{#1}
	\ClassWarning{hgbthesis}{Deprecated: '\string\firmenTel' is deprecated, use '\string\companyPhone' instead.}
}
\newcommand{\companyPhone}[1]{%
	\ifthenelse{\isempty{#1}}{}{\renewcommand{\@companyPhone}{#1}}
	\renewcommand{\@companyPhone}{#1}
}

\newcommand{\@license}{\@MissingArg{License information is missing!}}
\newcommand{\license}[1]{%
	\renewcommand{\@license}{#1}
}


%% Commands for Creating the Title Pages --------------------------------------

\newcommand{\titelseite}{%
	\maketitle
	\ClassWarning{hgbthesis}{Deprecated: '\string\titelseite' is deprecated, use '\string\maketitle' instead.}
}

%% adds blank space after each letter (http://stackoverflow.com/a/3951837)
\newcommand{\@addspaces}[1]{%  
  \@tfor\letter:=#1\do{%
    \letter\thinspace%	%\space
  }%
}

\newcommand{\@bachelortitle}{%
\begin{titlepage}%
	\begin{german}
		\rule{0mm}{1mm}
		\vspace*{0mm}
		\begin{center}%
			\@titlepagefont %\normalfont
			\setlength{\unitlength}{1cm}
			\parbox[c][5cm][c]{12cm}{%
				\centering\LARGE\bfseries%
				\setlength{\baselineskip}{25pt}%
				\@title%
			}
			\vskip 15mm%
			{\large\@author}%{\large\scshape\@author}%
			\vskip 15mm%
			\makelogo%
			\vskip 15mm%
			{\Large\uppercase{\@addspaces{Bachelorarbeit}}}%
			\vskip 4mm%
			{\large Nr.~\@thesisnumber}
			\vskip 4mm%
			{\large eingereicht am} \vskip 1mm {Fachhochschul-Bachelorstudiengang}%
			\vskip 4mm%
			{\large\@programname}%
			\vskip 4mm%
			{\large in \@placeofstudy}%
			\vskip 16mm%
			{\large im \monthname[\value{@monthofsubmission}] \arabic{@yearofsubmission}}%
		\end{center}%
		\vfil%
	\end{german}
\end{titlepage}%
}

\newcommand{\@mastertitle}{%
\begin{titlepage}%
	\begin{german}
		\rule{0mm}{1mm}
		\vspace*{0mm}
		\begin{center}%
			\@titlepagefont %\normalfont
			\setlength{\unitlength}{1cm}
			\parbox[c][5cm][c]{12cm}{%
				\centering\LARGE\bfseries%%
				\setlength{\baselineskip}{25pt}%
				\@title%
			}
			\vskip 15mm%
			{\large\@author}%{\large\scshape\@author}%
			\vskip 15mm%
			\makelogo%
			\vskip 15mm%
			{\Large\uppercase{\@addspaces{Masterarbeit}}}%
			\vskip 4mm%
			{\large eingereicht am} \vskip 1mm {Fachhochschul-Masterstudiengang}%
			\vskip 4mm%
			{\large\@programname}%
			\vskip 4mm%
			{\large in \@placeofstudy}%
			\vskip 16mm%
			{\large im \monthname[\value{@monthofsubmission}] \arabic{@yearofsubmission}}%
		\end{center}%
		\vfil%
	\end{german}
\end{titlepage}%
}

\newcommand{\@diplomatitle}{%
\begin{titlepage}%
	\begin{german}
		\rule{0mm}{1mm}
		\vspace*{0mm}
		\begin{center}%
			\@titlepagefont %\normalfont
			\setlength{\unitlength}{1cm}
			\parbox[c][5cm][c]{12cm}{%
				\centering\LARGE\bfseries%
				\setlength{\baselineskip}{25pt}%
				\@title%
			}
			\vskip 15mm%
			{\large\@author}%{\large\scshape\@author}%
			\vskip 15mm%
			\makelogo%
			\vskip 15mm%
			{\Large\uppercase{\@addspaces{Diplomarbeit}}}%
			\vskip 4mm%
			{\large eingereicht am} \vskip 1mm {Fachhochschul-Diplomstudiengang}%
			\vskip 4mm%
			{\large\@programname}%
			\vskip 4mm%
			{\large in \@placeofstudy}%
			\vskip 16mm%
			{\large im \monthname[\value{@monthofsubmission}] \arabic{@yearofsubmission}}%
		\end{center}%
		\vfil%
	\end{german}
\end{titlepage}%
}

\newcommand{\@internshiptitle}{%
\begin{titlepage}%
	\begin{german}
		\rule{0mm}{1mm}
		\vspace*{0mm}
		\begin{center}%
			\@titlepagefont %\normalfont
			\setlength{\unitlength}{1cm}
			\parbox[c][5cm][c]{12cm}{%
				\centering\LARGE\bfseries%
				\setlength{\baselineskip}{25pt}%
				Endbericht zum Berufspraktikum%
			}
			\vskip 15mm%
			{\large\@author}%{\large\scshape\@author}%
			\vskip 15mm%
			\makelogo%
			\vskip 15mm%
			{\Large\uppercase{\@addspaces{Bachelorarbeit}}}%
			\vskip 4mm%
			{\large Nr.~\@thesisnumber}
			\vskip 4mm%
			{\large eingereicht am} \vskip 1mm {Fachhochschul-Bachelorstudiengang}%
			\vskip 4mm%
			{\large\@programname}%
			\vskip 4mm%
			{\large in \@placeofstudy}%
			\vskip 16mm%
			{\large im \monthname[\value{@monthofsubmission}] \arabic{@yearofsubmission}}%
		\end{center}%
		\vfil%
	\end{german}
\end{titlepage}%
}


% Copyright and License Page --------------------------------------------------

\newcommand{\strictlicense}{%
\ifthenelse{\equal{\hgb@MainLanguage}{german}}%
	{\license{Alle Rechte vorbehalten}}%
	{\license{All Rights Reserved}}
}

\newcommand{\@ccLicenseAt}{%
Diese Arbeit wird unter den Bedingungen der 
\textsf{Creative Commons Lizenz} 
\emph{Attribution-NonCommercial-NoDerivatives 4.0 International} 
(CC BY-NC-ND 4.0) ver\"offentlicht --
siehe \url{https://creativecommons.org/licenses/by-nc-nd/4.0/}.}

\newcommand{\@ccLicenseEn}{%
This work is published under the conditions of the 
\textsf{Creative Commons License} 
\emph{Attribution-NonCommercial-NoDerivatives 4.0 International} 
(CC BY-NC-ND 4.0)---see
\url{https://creativecommons.org/licenses/by-nc-nd/4.0/}.}

\newcommand{\cclicense}{%
\ifthenelse{\equal{\hgb@MainLanguage}{german}}%
	{\license{\@ccLicenseAt}} % german CC license text
	{\license{\@ccLicenseEn}} % english CC license text (default)
}
	
\cclicense	% Creative Commons License (default)

\newcommand{\@makelicense}{ 
	\sbox\@tempboxa{\@license}%
	\ifdim \wd\@tempboxa >\hsize
		\begin{sloppypar}\noindent\@license\end{sloppypar}
	\else
		\global \@minipagefalse
		\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
	\fi
}

\newcommand{\@copyrightpage}{%
\newpage
\setcounter{page}{2}
\thispagestyle{plain}
\rule{0mm}{1mm}
\vspace*{75mm}
\begin{center}
\textsf{\copyright\ Copyright\ \arabic{@yearofsubmission}\ \@author}
\end{center}
\vspace{8mm}
\@makelicense
}


%% Company Page for Internship Report -----------------------------------------

\newcommand{\@companypage}{%
\newpage
\setcounter{page}{2}
\thispagestyle{plain}
\rule{0mm}{1mm}
\begin{center}
\vspace{25mm} 
{Praktikumsstelle:}
\\
\vspace{3mm}
{\Large\sf\@companyName\\ \mbox{}}
\\
{\sf \@companyPhone}
\\
{\sf \@companyUrl}
\\
\vspace{45mm} 
{Kontaktperson:}
\\
\vspace{3mm} 
{\Large\sf\@advisor\\ \mbox{}}
\end{center}
}


%% Advisor Pages in German and English ----------------------------------------

% German

\newcommand{\@advisorpageDe}{%
	\newpage
	\setcounter{page}{2}
	\thispagestyle{plain}
	\rule{0mm}{1mm}
	\begin{center}
		%
		\vspace{40mm} 
		{Diese Arbeit entstand im Rahmen des Gegenstands}\\
		\vspace{6mm} 
		{\Large\sf \@coursetitle\\ \mbox{}}\\
		\medskip
		im\\
		\bigskip
		{\@semester}\\
		%
		\vspace{45mm} 
		{Betreuung:}\\
		\vspace{3mm} 
		{\Large\sf \@advisor\\ \mbox{}}
	\end{center}
}

% English

\newcommand{\@advisorpageEn}{%
	\newpage
	\setcounter{page}{2}
	\thispagestyle{plain}
	\rule{0mm}{1mm}
	\begin{center}
		%
		\vspace{40mm} 
		{This thesis was created as part of the course}\\
		\vspace{6mm} 
		{\Large\sf \@coursetitle\\ \mbox{}}\\
		\medskip
		during\\
		\bigskip
		{\@semester}\\
		%
		\vspace{45mm} 
		{Advisor:}\\
		\vspace{3mm} 
		{\Large\sf \@advisor\\ \mbox{}}
	\end{center}
}

\newcommand{\@advisorpage}{%
\ifthenelse{\equal{\hgb@MainLanguage}{german}}%
	{\@advisorpageDe}%
	{\@advisorpageEn}
}


%% Declaration Pages in German and English ------------------------------------

% German

\newcommand{\@declarationpageDe}{%
	\begin{german}
		\chapter{Erkl\"arung}
		\noindent
		%Standardfassung der FH-OOe ab 04.04.2012:
		Ich erkl\"are eidesstattlich, dass ich die vorliegende Arbeit selbstst\"andig und ohne fremde Hilfe verfasst, 
		andere als die angegebenen Quellen nicht benutzt und die den benutzten Quellen entnommenen Stellen als 
		solche gekennzeichnet habe. Die Arbeit wurde bisher in gleicher oder \"ahnlicher Form keiner anderen 
		Pr\"ufungsbeh\"orde vorgelegt.
		\par
		\vspace{10mm}
		\noindent
		\@placeofstudy, am \formatdate{\value{@dayofsubmission}}{\value{@monthofsubmission}}{\value{@yearofsubmission}}
		\par
		\vspace{12mm}
		\noindent
		\@author
	\end{german}
}

% English

\newcommand{\leadingzero}[1]{\ifnum #1<10 0\the#1\else\the#1\fi}

\newcommand{\@declarationpageEn}{%
	\begin{english}
		\chapter{Declaration}
		\noindent
		I hereby declare and confirm that this thesis is entirely the result of my own original work. 
		Where other sources of information have been used, they have been indicated as such and properly 
		acknowledged. I further declare that this or similar work has not been submitted for credit elsewhere.
		\par
		\vspace{10mm}
		\noindent
		%\@placeofstudy, \the\year-\leadingzero{\month}-\leadingzero{\day} %http://de.wikibooks.org/wiki/LaTeX-W%F6rterbuch:_today 
		\@placeofstudy, {\usdate\formatdate{\value{@dayofsubmission}}{\value{@monthofsubmission}}{\value{@yearofsubmission}}}
		\par
		\vspace{12mm}
		\noindent
		\@author
	\end{english}
}

\newcommand{\@declarationpage}{%
\ifthenelse{\equal{\hgb@MainLanguage}{german}}%
	{\@declarationpageDe}%
	{\@declarationpageEn}
}


%% Assembly of title pages ----------------------------------------------------

\renewcommand{\@mastertitlepages}{
	\@mastertitle
	\@copyrightpage
	\@declarationpage
}
     
\renewcommand{\@diplomatitlepages}{
	\@diplomatitle
	\@copyrightpage
	\@declarationpage
}

\renewcommand{\@bachelortitlepages}{
	\@bachelortitle
	\@advisorpage
	\@declarationpage
}

\renewcommand{\@internshiptitlepages}{
	\@internshiptitle
	\@companypage
	\@declarationpage
}


% Add PDF meta data and create title pages

\renewcommand{\maketitle}{	%replace standard LaTeX-command
	\hypersetup{
			pdftitle={\@title},
			pdfauthor={\@author},
			pdfsubject={\@programname, \@placeofstudy},
			pdfcreator={LaTeX using class hgbthesis [\hgbDate]},
			pdfproducer={pdflatex},
			pdfkeywords={}
	}%

	\@maketitlepages
}

%% Additional Hagenberg packages ----------------------------------------------

\RequirePackage{hgbmath}
\RequirePackage{hgbheadings}
\RequirePackage{hgbabbrev}
\RequirePackage{hgblistings}
\RequirePackage{hgbbib}

\endinput