-
Notifications
You must be signed in to change notification settings - Fork 0
/
iuthesis.sty
207 lines (164 loc) · 5.6 KB
/
iuthesis.sty
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
% Package identification.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{iuthesis}[2023/07/15 IU International University LaTeX Package]
% Set the document language to German (e. g. dates).
\RequirePackage[ngerman]{babel}
% Set page size and margins.
\RequirePackage[a4paper,top=2cm,left=2cm,bottom=2cm,right=2cm]{geometry}
% Use the Arial font.
\RequirePackage{fontspec}
\setmainfont[
Path=/usr/share/fonts/truetype/msttcorefonts/,
UprightFont=*,
ItalicFont=*_Italic,
BoldFont=*_Bold,
BoldItalicFont=*_Bold_Italic,
Extension=.ttf
]{Arial}
% Set the line spacing ("1.5-zeilig" for 11pt text size).
% See: https://www.overleaf.com/learn/latex/Articles/How_to_change_paragraph_spacing_in_LaTeX.
\RequirePackage{setspace}
\setstretch{1.399}
% Set size and spacing of headings.
\RequirePackage{titlesec}
\titleformat*{\section}{\LARGE\bfseries}
\titleformat*{\subsection}{\Large\bfseries}
\titleformat*{\subsubsection}{\normalsize\bfseries}
\titlespacing*{\section}{0pt}{6pt}{12pt}
\titlespacing*{\subsection}{0pt}{12pt}{6pt}
\titlespacing*{\subsubsection}{0pt}{12pt}{6pt}
% Remove indentation from paragraphs, set spacing between paragraphs and import the xspace package.
\RequirePackage{parskip}
\setlength{\parskip}{6pt}
\RequirePackage{xspace}
% Configure quotations, graphics and bibliography.
\RequirePackage{csquotes}
\RequirePackage{graphicx}
\RequirePackage[backend=biber,style=apa]{biblatex}
% Allow the positioning of captions next to graphics.
\RequirePackage[raggedleft]{sidecap}
\sidecaptionvpos{figure}{t}
% Enable prettier tables with automatic width and horizontal/vertical spacing.
\RequirePackage{booktabs}
\RequirePackage{tabularx}
\setlength{\tabcolsep}{10pt} % default: 6pt
\renewcommand{\arraystretch}{1.2} % default: 1
% Allow the highlighting of source code.
\RequirePackage[newfloat]{minted}
\setminted{breaklines=true}
\RequirePackage{caption}
% Set up the code environment for source code listings.
\newenvironment{code}{\captionsetup{type=listing}}{}
\SetupFloatingEnvironment{listing}{name=Quellcode}
% PDF options.
\RequirePackage[
colorlinks=true,
linkcolor={black},
citecolor={black},
urlcolor={black},
linktocpage % link page number instead of title in table of contents
]{hyperref}
% Enable using key-value pairs as options.
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
family=iupkg,
prefix=iupkg@
}
% Command to add the bibliography to the table of contents.
\providecommand\phantomsection{}
% Define abbreviations with correct blank space.
\newcommand{\zB}{\mbox{z.\,B.}\xspace}
\newcommand{\dash}{\mbox{d.\,h.}\xspace}
\newcommand{\usw}{\mbox{usw.}\xspace}
\newcommand{\etc}{\mbox{etc.}\xspace}
\newcommand{\bzw}{\mbox{bzw.}\xspace}
\newcommand{\ggf}{\mbox{ggf.}\xspace}
\newcommand{\ua}{\mbox{u.\,a.}\xspace}
\newcommand{\oAE}{\mbox{o.\,Ä.}\xspace}
\newcommand{\etal}{\mbox{et~al.}\xspace}
% Define options for the package.
\DeclareStringOption{bibliographyfile}
\DeclareStringOption{graphicsdir}
\DeclareStringOption{logofile}
\DeclareStringOption{art}
\DeclareStringOption{hochschule}
\DeclareStringOption{studiengang}
\DeclareStringOption{titel}
\DeclareStringOption{untertitel}
\DeclareStringOption{autor}
\DeclareStringOption{matrikelnummer}
\DeclareStringOption{adresse}
\DeclareStringOption{betreuer}
\DeclareStringOption{abgabedatum}
% Provide default values for the options.
\def\iupkg@bibliographyfile{main.bib}
\def\iupkg@graphicsdir{images/}
\def\iupkg@logofile{logo}
\def\iupkg@art{Bachelorarbeit}
\def\iupkg@hochschule{Internationale Hochschule Duales Studium}
\def\iupkg@studiengang{Informatik B.\,Sc.}
\def\iupkg@titel{Titel der Arbeit}
\def\iupkg@untertitel{Untertitel der Arbeit}
\def\iupkg@autor{Vorname~Nachname}
\def\iupkg@matrikelnummer{123456789}
\def\iupkg@adresse{Straße~1\\12345~Stadt}
\def\iupkg@betreuer{Betreuer: Dr.~Vorname~Nachname}
\def\iupkg@abgabedatum{30.09.2023}
% Process the options.
\ProcessKeyvalOptions*
% Load the bibliography file.
\addbibresource{\iupkg@bibliographyfile}
% Set the directory to load graphics from.
\graphicspath{{\iupkg@graphicsdir}}
% Define the cover page.
\newcommand{\makecover}{
% Prevent the creation of anchors before the main content.
\hypersetup{pageanchor=false}
% Don't show the header, print the page number in the footer.
\thispagestyle{plain}
\begin{titlepage}
\begin{center}
\vspace*{.05\textheight}
\includegraphics[height=1.5cm]{\iupkg@logofile}
\vfill{}
\large{\iupkg@art}\\[1cm]
\large{\iupkg@hochschule}\\[0.25cm]
\large{Studiengang: \iupkg@studiengang}
\vfill{}
\Large{\textbf{\iupkg@titel}}\\[0.25cm]
\large{\iupkg@untertitel}
\vfill{}
\large{\iupkg@autor}\\[0.25cm]
\large{Matrikelnummer: \iupkg@matrikelnummer}\\[0.25cm]
\large{\iupkg@adresse}
\vfill{}
\large{\iupkg@betreuer}\\[0.25cm]
\large{Abgabedatum: \iupkg@abgabedatum}
\vspace*{.05\textheight}
\end{center}
\end{titlepage}
% Show roman numbers after the cover page (starting at 2).
\pagenumbering{Roman}
\setcounter{page}{2}
}
% Define the table of contents.
\newcommand{\maketoc}{
% Print the table of contents and add a page break.
\tableofcontents
\clearpage
% Show arabic numbers for the main content.
\pagenumbering{arabic}
% Create anchors for all following sections.
\hypersetup{pageanchor=true}
}
% Define the bibliography.
\newcommand{\makebibliography}{
% Add the bibliography to the table of contents.
\addcontentsline{toc}{section}{Literaturverzeichnis}
% Print the bibliography and add a page break.
\begingroup
\setlength{\emergencystretch}{1em}
\printbibliography[title=Literaturverzeichnis]
\endgroup
\clearpage
}