[thesis] Added work report. Fixed last thesis mistakes.
[hsd_doku_tool.git] / doc / thesis / hgbthesis.cls
1 %% hgbthesis.cls
2 %% LaTeX template for creating diploma theses, masters's theses, bachelor's theses and other term papers.
3 %% This file is part of the Hagenberg Thesis package for creating bachelors's and masters's theses
4 %% Author: Wilhelm Burger (wilhelm.burger@fh-hagenberg.at)
5 %% GitHub: https://github.com/Digital-Media/HagenbergThesis
6 %% File encoding: ASCII
7
8 %% Package Information --------------------------------------------------------
9
10 \NeedsTeXFormat{LaTeX2e}
11 \ProvidesClass{hgbthesis}[2017/11/04]
12
13 \RequirePackage{xifthen}
14
15 \RequirePackage{ifpdf}  % for checking PDF mode 
16 \ifpdf{}% \typeout{hgbthesis: *** LaTeX in PDF mode ***}
17 \else{\errmessage{hgbthesis: *** LaTeX NOT running in PDF mode ***}}
18 \fi
19
20
21 %% Commands for Title Pages (used in class options) ---------------------------
22
23 \newcommand{\hgb@MainLanguage}{german}  % also referenced in hgb.sty
24 \newcommand{\@mastertitlepages}{}
25 \newcommand{\@diplomatitlepages}{}
26 \newcommand{\@bachelortitlepages}{}
27 \newcommand{\@internshiptitlepages}{}
28 \newcommand{\@maketitlepages}{\@mastertitlepages}  %Default: Master's thesis
29
30
31 \newcommand{\@titlepagefont}{\sffamily}
32
33 %% Class options --------------------------------------------------------------
34
35 \DeclareOption{master}{
36         \renewcommand{\@maketitlepages}{\@mastertitlepages}
37 }
38
39 \DeclareOption{diplom}{%
40         \renewcommand{\@maketitlepages}{\@diplomatitlepages}
41         \ClassWarning{hgbthesis}{Deprecated: Document option '\CurrentOption' is deprecated, use 'diploma' instead.}
42 }
43
44 \DeclareOption{diploma}{%
45         \renewcommand{\@maketitlepages}{\@diplomatitlepages}
46 }
47
48 \DeclareOption{bachelor}{%
49         \renewcommand{\@maketitlepages}{\@bachelortitlepages}
50 }
51
52 \DeclareOption{praktikum}{%
53         \renewcommand{\@maketitlepages}{\@internshiptitlepages}
54         \ClassWarning{hgbthesis}{Deprecated: Document option '\CurrentOption' is deprecated, use 'internship' instead.}
55 }
56
57 \DeclareOption{internship}{%
58         \renewcommand{\@maketitlepages}{\@internshiptitlepages}
59 }
60
61 \DeclareOption{english}{%
62         \renewcommand{\hgb@MainLanguage}{english}
63 }
64
65 \DeclareOption{german}{%
66         \renewcommand{\hgb@MainLanguage}{german}
67 }
68
69 \DeclareOption*{%
70         \ClassWarning{hgbthesis}{Unknown document option '\CurrentOption'.}
71 }
72
73 \ProcessOptions
74
75
76 %% Paper Options and Style File -----------------------------------------------
77
78 \LoadClass[a4paper,11pt,oneside]{book}
79 \RequirePackage[top=36mm,bottom=40mm,left=32mm,right=32mm]{geometry} %showframe
80  
81 \RequirePackage{hgb}    % load associated style file hgb.sty
82
83
84 %% Setup for Pages in the Front Matter ----------------------------------------
85
86 % General Commands
87
88 \newcommand{\@programname}{\@MissingArg{Degree program not specified!}}
89 \newcommand{\studiengang}[1]{%
90         \renewcommand{\@programname}{#1}
91         \ClassWarning{hgbthesis}{Deprecated: '\string\studiengang' is deprecated, use '\string\programname' instead.}
92 }
93 \newcommand{\programname}[1]{%
94         \ifthenelse{\isempty{#1}}{}{\renewcommand{\@programname}{#1}}
95 }
96
97 \newcommand{\@placeofstudy}{\@MissingArg{Place of study not specified!}}
98 \newcommand{\studienort}[1]{%
99         \renewcommand{\@placeofstudy}{#1}
100         \ClassWarning{hgbthesis}{Deprecated: '\string\studienort' is deprecated, use '\string\placeofstudy' instead.}
101 }
102 \newcommand{\placeofstudy}[1]{%
103         \ifthenelse{\isempty{#1}}{}{\renewcommand{\@placeofstudy}{#1}}
104 }
105
106 \newcommand{\@advisor}{\@MissingArg{Advisor not specified!}}
107 \newcommand{\betreuer}[1]{%
108         \renewcommand{\@advisor}{#1}
109         \ClassWarning{hgbthesis}{Deprecated: '\string\betreuer' is deprecated, use '\string\advisor' instead.}
110 }
111 \newcommand{\betreuerin}[1]{%
112         \renewcommand{\@advisor}{#1}
113         \ClassWarning{hgbthesis}{Deprecated: '\string\betreuerin' is deprecated, use '\string\advisor' instead.}
114 }
115 \newcommand{\advisor}[1]{%
116         \ifthenelse{\isempty{#1}}{}{\renewcommand{\@advisor}{#1}}
117 }
118
119 \newcommand{\@thesisnumber}{\@MissingArg{Thesis number not specified!}}
120 \newcommand{\nummer}[1]{%
121         \renewcommand{\@thesisnumber}{#1}
122         \ClassWarning{hgbthesis}{Deprecated: '\string\nummer' is deprecated, use '\string\thesisnumber' instead.}
123 }
124 \newcommand{\thesisnumber}[1]{%
125         \ifthenelse{\isempty{#1}}{}{\renewcommand{\@thesisnumber}{#1}}
126 }
127
128 \newcommand{\@coursetitle}{\@MissingArg{Course not specified!}}
129 \newcommand{\gegenstand}[1]{%
130         \renewcommand{\@coursetitle}{#1}
131         \ClassWarning{hgbthesis}{Deprecated: '\string\gegenstand' is deprecated, use '\string\coursetitle' instead.}
132 }
133 \newcommand{\coursetitle}[1]{%
134         \ifthenelse{\isempty{#1}}{}{\renewcommand{\@coursetitle}{#1}}
135 }
136
137 \newcommand{\@semester}{\@MissingArg{Semester not specified!}}
138 \newcommand{\semester}[1]{%
139         \ifthenelse{\isempty{#1}}{}{\renewcommand{\@semester}{#1}}
140 }
141
142 \newcommand{\@logofile}[0]{}
143 \newcommand{\logofile}[1]{%
144         \renewcommand{\@logofile}{#1}
145 }
146
147 \newcommand{\makelogo}[0]{%
148 \ifthenelse{\equal{\@logofile}{}}%
149         {\vspace*{30mm}}%
150         {\includegraphics[height=30mm]{\@logofile}}%
151 }
152
153 % Submission Commands
154
155 \newcounter{@dayofsubmission}
156 \newcounter{@monthofsubmission}
157 \newcounter{@yearofsubmission}
158
159 \setcounter{@dayofsubmission}{\the\day}
160 \setcounter{@monthofsubmission}{\the\month}
161 \setcounter{@yearofsubmission}{\the\year}
162
163 \newcommand{\abgabedatum}[3]{%  %\abgabedatum{yyyy}{mm}{dd}
164         \setcounter{@yearofsubmission}{#1}
165         \setcounter{@monthofsubmission}{#2}
166         \setcounter{@dayofsubmission}{#3}
167         \ClassWarning{hgbthesis}{Deprecated: '\string\abgabedatum' is deprecated, use '\string\dateofsubmission{yyyy}{mm}{dd}' instead.}
168 }
169 \newcommand{\dateofsubmission}[3]{%     %\dateofsubmission{yyyy}{mm}{dd}
170         \setcounter{@yearofsubmission}{#1}
171         \setcounter{@monthofsubmission}{#2}
172         \setcounter{@dayofsubmission}{#3}
173 }
174
175 \newcommand{\abgabemonat}[1]{%
176         \ClassWarning{hgbthesis}{Deprecated: '\string\abgabemonat' is deprecated, use '\string\dateofsubmission{yyyy}{mm}{dd}' instead.}
177 }
178
179 \newcommand{\abgabejahr}[1]{%
180         \ClassWarning{hgbthesis}{Deprecated: '\string\abgabejahr' is deprecated, use '\string\dateofsubmission{yyyy}{mm}{dd}' instead.}
181 }
182
183 % Internship Report Commands
184
185 \newcommand{\@companyName}{\@MissingArg{Company not specified!}}
186 \newcommand{\firma}[1]{%
187         \renewcommand{\@companyName}{#1}
188         \ClassWarning{hgbthesis}{Deprecated: '\string\firma' is deprecated, use '\string\companyName' instead.}
189 }
190 \newcommand{\companyName}[1]{%
191         \ifthenelse{\isempty{#1}}{}{\renewcommand{\@companyName}{#1}}
192 }
193
194 \newcommand{\@companyUrl}{\@MissingArg{Company URL not specified!}}
195 \newcommand{\firmenUrl}[1]{%
196         \renewcommand{\@companyUrl}{#1}
197         \ClassWarning{hgbthesis}{Deprecated: '\string\firmenUrl' is deprecated, use '\string\companyUrl' instead.}
198 }
199 \newcommand{\companyUrl}[1]{%
200         \ifthenelse{\isempty{#1}}{}{\renewcommand{\@companyUrl}{#1}}
201 }
202
203 \newcommand{\@companyPhone}{\@MissingArg{Company phone number not specified!}}
204 \newcommand{\firmenTel}[1]{%
205         \renewcommand{\@companyPhone}{#1}
206         \ClassWarning{hgbthesis}{Deprecated: '\string\firmenTel' is deprecated, use '\string\companyPhone' instead.}
207 }
208 \newcommand{\companyPhone}[1]{%
209         \ifthenelse{\isempty{#1}}{}{\renewcommand{\@companyPhone}{#1}}
210         \renewcommand{\@companyPhone}{#1}
211 }
212
213 \newcommand{\@license}{\@MissingArg{License information is missing!}}
214 \newcommand{\license}[1]{%
215         \renewcommand{\@license}{#1}
216 }
217
218
219 %% Commands for Creating the Title Pages --------------------------------------
220
221 \newcommand{\titelseite}{%
222         \maketitle
223         \ClassWarning{hgbthesis}{Deprecated: '\string\titelseite' is deprecated, use '\string\maketitle' instead.}
224 }
225
226 %% adds blank space after each letter (http://stackoverflow.com/a/3951837)
227 \newcommand{\@addspaces}[1]{%  
228   \@tfor\letter:=#1\do{%
229     \letter\thinspace%  %\space
230   }%
231 }
232
233 \newcommand{\@bachelortitle}{%
234 \begin{titlepage}%
235         \begin{german}
236                 \rule{0mm}{1mm}
237                 \vspace*{0mm}
238                 \begin{center}%
239                         \@titlepagefont %\normalfont
240                         \setlength{\unitlength}{1cm}
241                         \parbox[c][5cm][c]{12cm}{%
242                                 \centering\LARGE\bfseries%
243                                 \setlength{\baselineskip}{25pt}%
244                                 \@title%
245                         }
246                         \vskip 15mm%
247                         {\large\@author}%{\large\scshape\@author}%
248                         \vskip 15mm%
249                         \makelogo%
250                         \vskip 15mm%
251                         {\Large\uppercase{\@addspaces{Bachelorarbeit}}}%
252                         \vskip 4mm%
253                         {\large Nr.~\@thesisnumber}
254                         \vskip 4mm%
255                         {\large eingereicht am} \vskip 1mm {Fachhochschul-Bachelorstudiengang}%
256                         \vskip 4mm%
257                         {\large\@programname}%
258                         \vskip 4mm%
259                         {\large in \@placeofstudy}%
260                         \vskip 16mm%
261                         {\large im \monthname[\value{@monthofsubmission}] \arabic{@yearofsubmission}}%
262                 \end{center}%
263                 \vfil%
264         \end{german}
265 \end{titlepage}%
266 }
267
268 \newcommand{\@mastertitle}{%
269 \begin{titlepage}%
270         \begin{german}
271                 \rule{0mm}{1mm}
272                 \vspace*{0mm}
273                 \begin{center}%
274                         \@titlepagefont %\normalfont
275                         \setlength{\unitlength}{1cm}
276                         \parbox[c][5cm][c]{12cm}{%
277                                 \centering\LARGE\bfseries%%
278                                 \setlength{\baselineskip}{25pt}%
279                                 \@title%
280                         }
281                         \vskip 15mm%
282                         {\large\@author}%{\large\scshape\@author}%
283                         \vskip 15mm%
284                         \makelogo%
285                         \vskip 15mm%
286                         {\Large\uppercase{\@addspaces{Masterarbeit}}}%
287                         \vskip 4mm%
288                         {\large eingereicht am} \vskip 1mm {Fachhochschul-Masterstudiengang}%
289                         \vskip 4mm%
290                         {\large\@programname}%
291                         \vskip 4mm%
292                         {\large in \@placeofstudy}%
293                         \vskip 16mm%
294                         {\large im \monthname[\value{@monthofsubmission}] \arabic{@yearofsubmission}}%
295                 \end{center}%
296                 \vfil%
297         \end{german}
298 \end{titlepage}%
299 }
300
301 \newcommand{\@diplomatitle}{%
302 \begin{titlepage}%
303         \begin{german}
304                 \rule{0mm}{1mm}
305                 \vspace*{0mm}
306                 \begin{center}%
307                         \@titlepagefont %\normalfont
308                         \setlength{\unitlength}{1cm}
309                         \parbox[c][5cm][c]{12cm}{%
310                                 \centering\LARGE\bfseries%
311                                 \setlength{\baselineskip}{25pt}%
312                                 \@title%
313                         }
314                         \vskip 15mm%
315                         {\large\@author}%{\large\scshape\@author}%
316                         \vskip 15mm%
317                         \makelogo%
318                         \vskip 15mm%
319                         {\Large\uppercase{\@addspaces{Diplomarbeit}}}%
320                         \vskip 4mm%
321                         {\large eingereicht am} \vskip 1mm {Fachhochschul-Diplomstudiengang}%
322                         \vskip 4mm%
323                         {\large\@programname}%
324                         \vskip 4mm%
325                         {\large in \@placeofstudy}%
326                         \vskip 16mm%
327                         {\large im \monthname[\value{@monthofsubmission}] \arabic{@yearofsubmission}}%
328                 \end{center}%
329                 \vfil%
330         \end{german}
331 \end{titlepage}%
332 }
333
334 \newcommand{\@internshiptitle}{%
335 \begin{titlepage}%
336         \begin{german}
337                 \rule{0mm}{1mm}
338                 \vspace*{0mm}
339                 \begin{center}%
340                         \@titlepagefont %\normalfont
341                         \setlength{\unitlength}{1cm}
342                         \parbox[c][5cm][c]{12cm}{%
343                                 \centering\LARGE\bfseries%
344                                 \setlength{\baselineskip}{25pt}%
345                                 Endbericht zum Berufspraktikum%
346                         }
347                         \vskip 15mm%
348                         {\large\@author}%{\large\scshape\@author}%
349                         \vskip 15mm%
350                         \makelogo%
351                         \vskip 15mm%
352                         {\Large\uppercase{\@addspaces{Bachelorarbeit}}}%
353                         \vskip 4mm%
354                         {\large Nr.~\@thesisnumber}
355                         \vskip 4mm%
356                         {\large eingereicht am} \vskip 1mm {Fachhochschul-Bachelorstudiengang}%
357                         \vskip 4mm%
358                         {\large\@programname}%
359                         \vskip 4mm%
360                         {\large in \@placeofstudy}%
361                         \vskip 16mm%
362                         {\large im \monthname[\value{@monthofsubmission}] \arabic{@yearofsubmission}}%
363                 \end{center}%
364                 \vfil%
365         \end{german}
366 \end{titlepage}%
367 }
368
369
370 % Copyright and License Page --------------------------------------------------
371
372 \newcommand{\strictlicense}{%
373 \ifthenelse{\equal{\hgb@MainLanguage}{german}}%
374         {\license{Alle Rechte vorbehalten}}%
375         {\license{All Rights Reserved}}
376 }
377
378 \newcommand{\@ccLicenseAt}{%
379 Diese Arbeit wird unter den Bedingungen der 
380 \textsf{Creative Commons Lizenz} 
381 \emph{Attribution-NonCommercial-NoDerivatives 4.0 International} 
382 (CC BY-NC-ND 4.0) ver\"offentlicht --
383 siehe \url{https://creativecommons.org/licenses/by-nc-nd/4.0/}.}
384
385 \newcommand{\@ccLicenseEn}{%
386 This work is published under the conditions of the 
387 \textsf{Creative Commons License} 
388 \emph{Attribution-NonCommercial-NoDerivatives 4.0 International} 
389 (CC BY-NC-ND 4.0)---see
390 \url{https://creativecommons.org/licenses/by-nc-nd/4.0/}.}
391
392 \newcommand{\cclicense}{%
393 \ifthenelse{\equal{\hgb@MainLanguage}{german}}%
394         {\license{\@ccLicenseAt}} % german CC license text
395         {\license{\@ccLicenseEn}} % english CC license text (default)
396 }
397         
398 \cclicense      % Creative Commons License (default)
399
400 \newcommand{\@makelicense}{ 
401         \sbox\@tempboxa{\@license}%
402         \ifdim \wd\@tempboxa >\hsize
403                 \begin{sloppypar}\noindent\@license\end{sloppypar}
404         \else
405                 \global \@minipagefalse
406                 \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
407         \fi
408 }
409
410 \newcommand{\@copyrightpage}{%
411 \newpage
412 \setcounter{page}{2}
413 \thispagestyle{plain}
414 \rule{0mm}{1mm}
415 \vspace*{75mm}
416 \begin{center}
417 \textsf{\copyright\ Copyright\ \arabic{@yearofsubmission}\ \@author}
418 \end{center}
419 \vspace{8mm}
420 \@makelicense
421 }
422
423
424 %% Company Page for Internship Report -----------------------------------------
425
426 \newcommand{\@companypage}{%
427 \newpage
428 \setcounter{page}{2}
429 \thispagestyle{plain}
430 \rule{0mm}{1mm}
431 \begin{center}
432 \vspace{25mm} 
433 {Praktikumsstelle:}
434 \\
435 \vspace{3mm}
436 {\Large\sf\@companyName\\ \mbox{}}
437 \\
438 {\sf \@companyPhone}
439 \\
440 {\sf \@companyUrl}
441 \\
442 \vspace{45mm} 
443 {Kontaktperson:}
444 \\
445 \vspace{3mm} 
446 {\Large\sf\@advisor\\ \mbox{}}
447 \end{center}
448 }
449
450
451 %% Advisor Pages in German and English ----------------------------------------
452
453 % German
454
455 \newcommand{\@advisorpageDe}{%
456         \newpage
457         \setcounter{page}{2}
458         \thispagestyle{plain}
459         \rule{0mm}{1mm}
460         \begin{center}
461                 %
462                 \vspace{40mm} 
463                 %{Diese Arbeit entstand im Rahmen des Gegenstands}\\
464                 %\vspace{6mm} 
465                 %{\Large\sf \@coursetitle\\ \mbox{}}\\
466                 %\medskip
467                 %im\\
468                 %\bigskip
469                 %{\@semester}\\
470                 %
471                 \vspace{45mm} 
472                 {Betreuung:}\\
473                 \vspace{3mm} 
474                 {\Large\sf \@advisor\\ \mbox{}}
475         \end{center}
476 }
477
478 % English
479
480 \newcommand{\@advisorpageEn}{%
481         \newpage
482         \setcounter{page}{2}
483         \thispagestyle{plain}
484         \rule{0mm}{1mm}
485         \begin{center}
486                 %
487                 \vspace{40mm} 
488                 {This thesis was created as part of the course}\\
489                 \vspace{6mm} 
490                 {\Large\sf \@coursetitle\\ \mbox{}}\\
491                 \medskip
492                 during\\
493                 \bigskip
494                 {\@semester}\\
495                 %
496                 \vspace{45mm} 
497                 {Advisor:}\\
498                 \vspace{3mm} 
499                 {\Large\sf \@advisor\\ \mbox{}}
500         \end{center}
501 }
502
503 \newcommand{\@advisorpage}{%
504 \ifthenelse{\equal{\hgb@MainLanguage}{german}}%
505         {\@advisorpageDe}%
506         {\@advisorpageEn}
507 }
508
509
510 %% Declaration Pages in German and English ------------------------------------
511
512 % German
513
514 \newcommand{\@declarationpageDe}{%
515         \begin{german}
516                 \chapter{Erkl\"arung}
517                 \noindent
518                 %Standardfassung der FH-OOe ab 04.04.2012:
519                 Ich erkl\"are eidesstattlich, dass ich die vorliegende Arbeit selbstst\"andig und ohne fremde Hilfe verfasst, 
520                 andere als die angegebenen Quellen nicht benutzt und die den benutzten Quellen entnommenen Stellen als 
521                 solche gekennzeichnet habe. Die Arbeit wurde bisher in gleicher oder \"ahnlicher Form keiner anderen 
522                 Pr\"ufungsbeh\"orde vorgelegt.
523                 \par
524                 \vspace{10mm}
525                 \noindent
526                 \@placeofstudy, am \formatdate{\value{@dayofsubmission}}{\value{@monthofsubmission}}{\value{@yearofsubmission}}
527                 \par
528                 \vspace{12mm}
529                 \noindent
530                 \@author
531         \end{german}
532 }
533
534 % English
535
536 \newcommand{\leadingzero}[1]{\ifnum #1<10 0\the#1\else\the#1\fi}
537
538 \newcommand{\@declarationpageEn}{%
539         \begin{english}
540                 \chapter{Declaration}
541                 \noindent
542                 I hereby declare and confirm that this thesis is entirely the result of my own original work. 
543                 Where other sources of information have been used, they have been indicated as such and properly 
544                 acknowledged. I further declare that this or similar work has not been submitted for credit elsewhere.
545                 \par
546                 \vspace{10mm}
547                 \noindent
548                 %\@placeofstudy, \the\year-\leadingzero{\month}-\leadingzero{\day} %http://de.wikibooks.org/wiki/LaTeX-W%F6rterbuch:_today 
549                 \@placeofstudy, {\usdate\formatdate{\value{@dayofsubmission}}{\value{@monthofsubmission}}{\value{@yearofsubmission}}}
550                 \par
551                 \vspace{12mm}
552                 \noindent
553                 \@author
554         \end{english}
555 }
556
557 \newcommand{\@declarationpage}{%
558 \ifthenelse{\equal{\hgb@MainLanguage}{german}}%
559         {\@declarationpageDe}%
560         {\@declarationpageEn}
561 }
562
563
564 %% Assembly of title pages ----------------------------------------------------
565
566 \renewcommand{\@mastertitlepages}{
567         \@mastertitle
568         \@copyrightpage
569         \@declarationpage
570 }
571      
572 \renewcommand{\@diplomatitlepages}{
573         \@diplomatitle
574         \@copyrightpage
575         \@declarationpage
576 }
577
578 \renewcommand{\@bachelortitlepages}{
579         \@bachelortitle
580         \@advisorpage
581         \@declarationpage
582 }
583
584 \renewcommand{\@internshiptitlepages}{
585         \@internshiptitle
586         \@companypage
587         \@declarationpage
588 }
589
590
591 % Add PDF meta data and create title pages
592
593 \renewcommand{\maketitle}{      %replace standard LaTeX-command
594         \hypersetup{
595                         pdftitle={\@title},
596                         pdfauthor={\@author},
597                         pdfsubject={\@programname, \@placeofstudy},
598                         pdfcreator={LaTeX using class hgbthesis [\hgbDate]},
599                         pdfproducer={pdflatex},
600                         pdfkeywords={}
601         }%
602
603         \@maketitlepages
604 }
605
606 %% Additional Hagenberg packages ----------------------------------------------
607
608 \RequirePackage{hgbmath}
609 \RequirePackage{hgbheadings}
610 \RequirePackage{hgbabbrev}
611 \RequirePackage{hgblistings}
612 \RequirePackage{hgbbib}
613
614 \endinput