-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreamble.tex
More file actions
322 lines (275 loc) · 9.53 KB
/
preamble.tex
File metadata and controls
322 lines (275 loc) · 9.53 KB
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
% ##################################################
% ENCODING
% ##################################################
\usepackage{cmap} % PDF character encoding
\usepackage[T1]{fontenc} % 8-bit font encoding
\usepackage[utf8]{inputenc} % UTF-8 input encoding
% ##################################################
% LANGUAGE
% ##################################################
% \usepackage[ngerman]{babel} % Uncomment if you write in German
\usepackage{csquotes}
\usepackage{blindtext}
% ##################################################
% DOCUMENT VARIABLES
% ##################################################
% -------------
% Document data
% -------------
\newcommand{\docDeadline}{Submission Date}
\newcommand{\docKeywords}{These, Are, Your, Keywords}
% ---------------
% University Data
% ---------------
\newcommand{\uniName}{Your University}
\newcommand{\uniPostalCode}{12345}
\newcommand{\uniCity}{Fantasy City}
\newcommand{\uniStreet}{Fantasy Street 123}
% -------
% Authors
% -------
\newcommand{\docAuthors}{John Doe, Jane Doe, Catherine Parr}
% ##################################################
% PDF SETTINGS
% ##################################################
% Do this as the last step beause the variables are set above
\usepackage[
colorlinks=true,
linkcolor=black,
citecolor=black,
filecolor=black,
urlcolor=black,
bookmarks=true,
bookmarksopen=true,
bookmarksopenlevel=3,
bookmarksnumbered,
plainpages=false,
pdfpagelabels=true,
hyperfootnotes
% pdftitle ={\docTitle},
% pdfauthor={\docAuthors},
% pdfcreator={\docAuthors}
]{hyperref}
% ##################################################
% PAGE FORMATTING
% ##################################################
% -----------
% Page layout
% -----------
\usepackage[
paper=a4paper,
inner=1cm,
outer=1cm,
top=1cm,
bottom=1.5cm,
]{geometry}
% See https://ctan.mc1.root.project-creative.net/macros/latex/required/tools/multicol.pdf
\usepackage{multicol}
% ------------------
% Section formatting
% ------------------
% See https://ctan.kako-dev.de/macros/latex/contrib/titlesec/titlesec.pdf
\usepackage{titlesec}
% Adjust Section style and spacing
\titleformat{\section}{\bfseries\sffamily\raggedright}{\thesection .}{0.5em}{}
\titlespacing\section{0pt}{12pt plus 4pt minus 2pt}{1pt plus 1pt minus 1pt}
% Adjust Subsection style and spacing
\titleformat{\subsection}{\bfseries\sffamily\raggedright}{\thesubsection}{0.5em}{}
\titlespacing\subsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 1pt}
% Adjust Subsubsection style and spacing
\titleformat{\subsubsection}[runin]{\bfseries\sffamily}{\thesubsubsection}{0.5em}{}[.\hspace*{0.5em}]
\titlespacing\subsubsection{\parindent}{6pt plus 3pt minus 2pt}{0pt plus 2pt minus 1pt}
% ---------------
% Footer / Header
% ---------------
% See https://ftp.agdsn.de/pub/mirrors/latex/dante/macros/latex/contrib/fancyhdr/fancyhdr.pdf
\usepackage{fancyhdr} % Use fancyhdr package
\pagestyle{fancy} % Activate custom styling
\fancyhf{} % Clear everything
\fancyfoot[L]{ % Display university name on the right side in the footer
\begin{minipage}{0.33\textwidth}
\uniName
\end{minipage}
}
\fancyfoot[R]{\thepage} % Display page number on the right side in the footer
\renewcommand{\footrulewidth}{1pt} % Display thin footer line
\renewcommand{\headrulewidth}{0pt} % Display no header line
% ##################################################
% BIBLIOGRAPHY
% ##################################################
% ---------
% Citations
% ---------
\usepackage{biblatex} % Better citation
\addbibresource{bibliography/online.bib} % Include online citations (websites), for articles @article can be used
\addbibresource{bibliography/standards.bib} % Include various web / internet standards
% --------
% Acronyms
% --------
% For glossary styles see: https://www.dickimaw-books.com/gallery/glossaries-styles/
\usepackage[
acronym, % Create glossary of acronyms
nopostdot, % Remove dot after acronym definition
nonumberlist % Disable numbered lists
]{glossaries}
\renewcommand*{\glsnamefont}[1]{\textbf{\sffamily #1}} % Change font to sans-serif
\makeglossaries % Generate glossaries
\input{bibliography/acronyms} % Define input file
% ##################################################
% IMAGES AND FIGURES
% ##################################################
\renewcommand{\thefigure}{\arabic{figure}} % simple numbering without chapter
\usepackage{graphicx} % support for including images
\graphicspath{{img/}} % default path
% ##################################################
% TABLES
% ##################################################
\usepackage{tabularx}
\usepackage{makecell}
% ##################################################
% CUSTOM ENVIROMENTS
% ##################################################
% Paper envioment wraps text in a two-column multicol
\newenvironment{paper}{%
\begin{multicols}{2}%
}{%
\end{multicols}%
}
% Overwrites existing abstract environment
\DeclareDocumentEnvironment{abstract}{}{%
\section*{\abstractname}\itshape
}
{\upshape \sffamily \textbf{Keywords: \docKeywords}
}
% ##################################################
% CUSTOM COMMANDS
% ##################################################
\usepackage{etoolbox} % Multiple tools like loops
\usepackage{intcalc} % Expandable arithmetic operations
\usepackage{xparse} % Parse lists
% -------
% Helpers
% -------
% If the provided string is not blank (empyt or only spaces) parameter #2 is displayed, otherwise #3
\newcommand{\ifnotblank}[3]{
\expandafter\notblank\expandafter{#1}{#2}{#3}%
}
\newcommand{\docTitle}{This is the default title. Plese change me via \textbackslash setTitle\{~\}}
\newcommand{\setTitle}[1]{
\ifnotblank{#1}{%
\renewcommand{\docTitle}{#1}
\hypersetup{
pdftitle ={\docTitle}
}
}{}
}
\newcommand{\docSubTitle}{}
\newcommand{\setSubtitle}[1]{
\ifnotblank{#1}{%
\renewcommand{\docSubTitle}{#1}
}{}
}
\newcommand{\docType}{}
\newcommand{\setDoctype}[1]{
\ifnotblank{#1}{%
\renewcommand{\docType}{#1}
}{}
}
% -------
% Authors
% -------
% Variables
\newcommand{\authorList}{}
\newcommand{\currentAffiliation}{}
\newcounter{totalAuthorCount}
\newcounter{authorCounter}
\setcounter{authorCounter}{1}
\newcounter{authorIndex}
% \setAuthors let's the user set all authors as a comma-separated list
\newcommand{\setAuthors}[1]{
\renewcommand{\authorList}{#1}
\expandafter\forcsvlist\expandafter\countAuthors\expandafter{\authorList}
}
% \countAuthors counts the total amount of authors
\newcommand{\countAuthors}[1]{
\stepcounter{totalAuthorCount}
}
% \printAuthors let's the user print out the author list as a grid table
\newcommand{\printAuthors}{
\begin{center}
\begin{tabularx}{0.9\textwidth}{ X X X }
\expandafter\internalPrintAuthors\expandafter{\authorList}
\end{tabularx}
\end{center}
}
% \internalPrintAuthors iterates the list via \ProcessList
\NewDocumentCommand{\internalPrintAuthors}{ >{\SplitList{,}} m }{%
\ProcessList{#1}{\printAuthorTriple}
}
% \printAuthorTriple prints the <Author, E-Mail, Affiliation> triple
\NewDocumentCommand{\printAuthorTriple}{ >{\SplitList{,}} m }{%
\ifthenelse{\equal{\intcalcMod{\value{authorCounter}}{3}}{0}}{%
\makecell{
\ProcessList{#1}{\splitAuthorTriple}
}
\ifthenelse{\value{authorCounter}<\value{totalAuthorCount}}{\\}{}
}{%
\makecell{
\ProcessList{#1}{\splitAuthorTriple}
}
\ifthenelse{\(\value{totalAuthorCount}>1 \AND \value{authorCounter}<\value{totalAuthorCount}\)}{&}{}
}%
\stepcounter{authorCounter}
}
% \splitAuthorTriple splits up the author, e-mail address and affiliation
\newcommand{\splitAuthorTriple}[1]{
\ifthenelse{\equal{\value{authorIndex}}{0}}{%
\printAuthorName{#1}%
\stepcounter{authorIndex}%
}{%
\ifthenelse{\equal{\value{authorIndex}}{1}}{%
\ifthenelse{\equal{#1}{-}}{\\}{%
\printAuthorAffiliation{#1}%
}
\stepcounter{authorIndex}%
}{%
\printAuthorEmail{#1}
\setcounter{authorIndex}{0}%
}%
}%
}
\newcommand{\printAuthorName}[1]{\sffamily \bfseries #1}
\newcommand{\printAuthorEmail}[1]{\small \mdseries #1}
\newcommand{\printAuthorAffiliation}[1]{\textsuperscript{#1} \\}
% -----------
% Affiliation
% -----------
\newcommand{\affiliationList}{}
\newcounter{totalAffiliations}
\newcounter{affiliationCounter}
\newcommand{\setAffiliations}[1]{%
\renewcommand{\affiliationList}{#1}
\expandafter\forcsvlist\expandafter\countAffiliations\expandafter{\affiliationList}
}
\newcommand{\countAffiliations}[1]{
\stepcounter{totalAffiliations}
}
\newcommand{\printAffiliations}{%
\ifnotblank{\affiliationList}{%
\begin{center}
\begin{tabularx}{0.9\textwidth}{ X }
\expandafter\internalPrintAffiliations\expandafter{\affiliationList}
\end{tabularx}
\end{center}
}{}
}
\NewDocumentCommand{\internalPrintAffiliations}{ >{\SplitList{,}} m }{%
\ProcessList{#1}{\printAffiliation}
}
\newcommand{\printAffiliation}[1]{
\stepcounter{affiliationCounter}
\makecell{
\sffamily \small \textsuperscript{\number\value{affiliationCounter}}#1
}
\ifthenelse{\value{affiliationCounter}<\value{totalAffiliations}}{\\}{}
}