summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/uantwerpendocs/uantwerpenbamathesis.cls
blob: 3e742b68d35803a62979e00deb0079e5b2b37716 (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
%%
%% This is file `uantwerpenbamathesis.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% uantwerpendocs.dtx  (with options: `bmt')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2013-2021  by Walter Daems <walter.daems@uantwerpen.be>
%% 
%% This work may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3 of this license
%% or (at your option) any later version.  The latest version of this
%% license is in:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% and version 1.3 or later is part of all distributions of LaTeX version
%% 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status `maintained'.
%% 
%% The Current Maintainer of this work is Walter Daems.
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{uantwerpenbamathesis}
    [2021/11/11 v4.3 .dtx skeleton file]
\newif\if@filled
\DeclareOption{filled}{\@filledtrue}
\input{uantwerpencommonoptions.clo}
\ExecuteOptions{a4paper,11pt,final,oneside,openright}
\ProcessOptions\relax
\LoadClassWithOptions{scrbook}
\setlength{\parindent}{0pt}
\addtolength{\parskip}{0.75\baselineskip}
\setcounter{secnumdepth}{3}
\RequirePackage[top=2.6cm, bottom=2.5cm, left=3.5cm, right=1.6cm]{geometry}
\RequirePackage{expl3}
\RequirePackage{xparse}
\RequirePackage{iftex}
\RequirePackage{xstring}
\RequirePackage{etoolbox}
\RequirePackage{ifthen}
\IfFileExists{shellesc.sty}{\RequirePackage{shellesc}}{}
\RequirePackage{graphicx}
\RequirePackage{soul}
\RequirePackage[export]{adjustbox}
\RequirePackage{color}
\RequirePackage{tikz}
\usetikzlibrary{positioning,calc}
\RequirePackage{eso-pic}
\RequirePackage{uantwerpencolorlogoscheme}

\RequirePackage{fancyhdr}
\definecolor{lightgray}{cmyk}      {0.00,0.00,0.00,0.05}
\definecolor{darkgray}{cmyk}       {0.00,0.00,0.00,0.80}
\definecolor{watermark}{cmyk}      {0.00,0.00,0.00,0.05}
\newcommand\@uantwerpendocshl[1]{\begin{lrbox}{\@tempboxa}#1\end{lrbox}\@uantwerpendocshlbox{\@tempboxa}}
\newcommand{\@uantwerpendocshlbox}[1]{%
  \tikz{%
    \pgfpathrectangle{\pgfpoint{1pt}{0pt}}{\pgfpoint{\wd #1}{\ht #1}}%
    \pgfusepath{use as bounding box}%
    \node[anchor=base
    west,align=center,fill=maincolor,text=white,outer sep=0pt,inner
    xsep=5pt, inner ysep=0pt,minimum height=\ht\strutbox+1pt]{\raisebox{1pt}{\strut}\strut\usebox{#1}};
  }%
}
\newcommand\insettext[1]{
  \textcolor{basecolor}{
    \begin{tabular}{@{\hskip3ex\textcolor{maincolor}{\vrule width 2.5pt}\hskip3ex\large\bfseries}p{0.88\textwidth}}
      \strut #1
    \end{tabular}
  }
}
\newcommand\insetquote[1]{
  \insettext{
    \begin{tikzpicture}[scale=0.65]
      \fill[green!60!black] (0.4,0) -- (0.5,0) -- (0.75,-0.15) -- (0.75,0) --
      (0.9,0) arc(-90:0:0.1) -- (1,0.65) arc(0:90:0.1) -- (0.1,0.75) arc
      (90:180:0.1) -- (0,0.1) arc(-180:-90:0.1) -- cycle;
      \foreach \x in {0.35,0.7} {
        \begin{scope}[shift={(\x,0.425)},scale=0.25]
          \fill[white] (0,0) circle[radius=0.5];
          \fill[white] (0.5,0) arc(0:-90:1) --
          (-0.5,-0.725) arc(-90:0:0.725) -- cycle;
        \end{scope}
      }
    \end{tikzpicture}\\
    #1
  }
}
\ExplSyntaxOn
\prop_new:N \g__uantwerpendocs_data_prop
\NewDocumentCommand{\uantwerpendocsprop}{m}{
  \prop_item:Nn \g__uantwerpendocs_data_prop{#1}
}
\NewDocumentCommand{\uantwerpendocsPROP}{m}{
  \str_uppercase:f { \prop_item:Nn \g__uantwerpendocs_data_prop{#1} }
}
\NewDocumentCommand{\uantwerpendocspropread}{m}{
  \__uantwerpendocs_datareader:n { #1 }
}
\cs_generate_variant:Nn \prop_gput:Nnn{ Nxx }
\cs_new_nopar:Npn \__uantwerpendocs_dataparser:w #1 = #2!! {
  \tl_set:Nn \l_tmpa_tl {#1}
  \tl_set:Nn \l_tmpb_tl {#2}
  \tl_trim_spaces:N \l_tmpa_tl
  \tl_trim_spaces:N \l_tmpb_tl
  \prop_gput:Nxx \g__uantwerpendocs_data_prop { \l_tmpa_tl} { \l_tmpb_tl }
}
\ior_new:N \l__uantwerpendocs_data_ior
\cs_new_nopar:Nn \__uantwerpendocs_datareader:n {
  \ior_open:Nn \l__uantwerpendocs_data_ior { uantwerpendocs-#1.data }
  \ior_str_map_inline:Nn \l__uantwerpendocs_data_ior {
    \regex_match:nnTF {=} {##1} {
      \__uantwerpendocs_dataparser:w ##1!!
    }
    {}
  }
  \ior_close:N \l__uantwerpendocs_data_ior
}
\clist_map_inline:nn {en} {
  \__uantwerpendocs_datareader:n { #1 }
}
\ExplSyntaxOff
\newcommand*\@logo{\logopos}
\AtBeginDocument{
  \makeatother
  \@ifpackageloaded{babel}{
    \addto\captionsenglish{%
      \uantwerpendocspropread{en}
    }
    \addto\captionsdutch{%
      \uantwerpendocspropread{nl}
    }
  }
  {}
  \uantwerpendocspropread{degree}
  \uantwerpendocspropread{doctype}
  \makeatletter
}
\ExplSyntaxOn
\cs_generate_variant:Nn \prop_item:Nn{ Nx }
\NewDocumentCommand{\uantwerpendocsdoctype}{m}{
  \prop_item:Nx \g__uantwerpendocs_data_prop { #1 }
}
\ExplSyntaxOff
\newcommand\disclaimer[1]{
  Disclaimer #1\newline\newline
  This document is an examination document that has not been
  corrected for any errors identified. Without prior written
  permission of both the supervisor(s) and the author(s), any copying,
  copying, using or realizing this publication or parts thereof
  is prohibited. For requests for information regarding the copying
  and/or use and/or realisation of parts of this publication, please
  contact to the university at which the author is registered.
  \newline\newline
  Prior written permission from the supervisor(s) is also
  required for the use for industrial or commercial utility of the
  (original) methods, products, circuits and programs described in this
  thesis,  and for the submission of this publication for participation
  in scientific prizes or competitions.
  \newline\newline
  This document is in accordance with the master thesis regulations and the
  Code of Conduct. It has been reviewed by the supervisor and the attendant.
}
\AtBeginDocument{
  \makeatother
  \@ifpackageloaded{babel}{
    \addto\captionsdutch{%
      \renewcommand\disclaimer[1]{
        Disclaimer #1\newline\newline
        Dit document is een examendocument dat niet werd gecorrigeerd voor
        eventueel vastgestelde fouten. Zonder voorafgaande schriftelijke
        toestemming van zowel de promotor(en) als de auteur(s) is overnemen,
        kopiëren, gebruiken of realiseren van deze uitgave of gedeelten ervan
        verboden. Voor aanvragen tot of informatie i.v.m. het overnemen en/of
        gebruik en/of realisatie van gedeelten uit deze publicatie, wendt u
        tot de universiteit waaraan de auteur is ingeschreven.
        \newline\newline
        Voorafgaande schriftelijke toestemming van de promotor(en) is eveneens
        vereist voor het aanwenden van de in dit afstudeerwerk beschreven
        (originele) methoden, producten, schakelingen en programma's voor
        industrieel of commercieel nut en voor de inzending van deze
        publicatie ter deelname aan wetenschappelijke prijzen of wedstrijden.
        \newline\newline
        Dit document is in overeenstemming met het masterproefreglement en de
        gedragscode en nagekeken door promotor en begeleider.
      }
    }
  }{}
  \makeatletter
}
\ExplSyntaxOn
\NewDocumentCommand{\uantwerpendocsdegree}{m}{
  \prop_item:Nx \g__uantwerpendocs_data_prop { #1 }
}
\ExplSyntaxOff
\newcommand*{\facultyacronym}[1]{
  \PackageError{uantwerpendocs}
  {The '\protect\facultyacronym{}' macro is no longer available. Use
    your faculty abbreviation in lowercase as class options instead}
  {The interface of uantwerpendocs 4.0 has been changed. See
    the uantwerpendocs manual under section '5.2 The class options explained'}
}
\newcommand*{\@companylogo}{}
\newcommand*{\companylogo}[1]{\renewcommand*{\@companylogo}{#1}}
\ExplSyntaxOn
\seq_new:N \g__uantwerpendocs_supervisors
\seq_new:N \g__uantwerpendocs_supervisorswithaffiliation
\cs_new:Nn \__uantwerpendocs_addsupervisor:nn {
  \seq_gpush:Nn \g__uantwerpendocs_supervisors { #1 }
  \seq_gpush:Nn \g__uantwerpendocs_supervisorswithaffiliation { #1,~#2 }
}
\NewDocumentCommand{\supervisor}{mm}{
  \__uantwerpendocs_addsupervisor:nn { #1 } { #2 }
}
\NewDocumentCommand{\jointsupervisors}{mm}{
  \seq_use:Nnnn \g__uantwerpendocs_supervisors { #2 } { #1 } { #2 }
}
\NewDocumentCommand{\jointsupervisorswithaffiliation}{mm}{
  \seq_use:Nnnn \g__uantwerpendocs_supervisorswithaffiliation { #2 } { #1 } { #2 }
}
\NewDocumentCommand{\supervisorsname}{m}{
  \if_int_compare:w \seq_count:N \g__uantwerpendocs_supervisors > 2
  \uantwerpendocsprop{supervisorsname} #1
  \else:
  \if_int_compare:w \seq_count:N \g__uantwerpendocs_supervisors = 2
  \uantwerpendocsprop{supervisorname} #1
  \else:
  \fi:
  \fi:
}
\seq_new:N \g__uantwerpendocs_cosupervisors
\seq_new:N \g__uantwerpendocs_cosupervisorswithaffiliation
\cs_new:Nn \__uantwerpendocs_addcosupervisor:nn {
  \seq_gpush:Nn \g__uantwerpendocs_cosupervisors { #1 }
  \seq_gpush:Nn \g__uantwerpendocs_cosupervisorswithaffiliation { #1,~#2 }
}
\NewDocumentCommand{\cosupervisor}{mm}{
  \__uantwerpendocs_addcosupervisor:nn { #1 } { #2 }
}
\NewDocumentCommand{\jointcosupervisors}{mm}{
  \seq_use:Nnnn \g__uantwerpendocs_cosupervisors { #2 } { #1 } { #2 }
}
\NewDocumentCommand{\jointcosupervisorswithaffiliation}{mm}{
  \seq_use:Nnnn \g__uantwerpendocs_cosupervisorswithaffiliation { #2 } { #1 } { #2 }
}
\NewDocumentCommand{\cosupervisorsname}{m}{
  \if_int_compare:w \seq_count:N \g__uantwerpendocs_cosupervisors > 2
  \uantwerpendocsprop{cosupervisorsname} #1
  \else:
  \if_int_compare:w \seq_count:N \g__uantwerpendocs_cosupervisors = 2
  \uantwerpendocsprop{cosupervisorname} #1
  \else:
  \fi:
  \fi:
}
\seq_new:N \g__uantwerpendocs_extsupervisors
\seq_new:N \g__uantwerpendocs_extsupervisorswithaffiliation
\cs_new:Nn \__uantwerpendocs_addextsupervisor:nn {
  \seq_gpush:Nn \g__uantwerpendocs_extsupervisors { #1 }
  \seq_gpush:Nn \g__uantwerpendocs_extsupervisorswithaffiliation { #1,~#2 }
}
\NewDocumentCommand{\extsupervisor}{mm}{
  \__uantwerpendocs_addextsupervisor:nn { #1 } { #2 }
}
\NewDocumentCommand{\jointextsupervisors}{mm}{
  \seq_use:Nnnn \g__uantwerpendocs_extsupervisors { #2 } { #1 } { #2 }
}
\NewDocumentCommand{\jointextsupervisorswithaffiliation}{mm}{
  \seq_use:Nnnn \g__uantwerpendocs_extsupervisorswithaffiliation { #2 } { #1 } { #2 }
}
\NewDocumentCommand{\extsupervisorsname}{m}{
  \if_int_compare:w \seq_count:N \g__uantwerpendocs_extsupervisors > 2
  \uantwerpendocsprop{extsupervisorsname} #1
  \else:
  \if_int_compare:w \seq_count:N \g__uantwerpendocs_extsupervisors = 2
  \uantwerpendocsprop{extsupervisorname} #1
  \else:
  \fi:
  \fi:
}
\AtBeginDocument{
  \seq_gpush:Nn \g__uantwerpendocs_supervisors {}
  \seq_greverse:N \g__uantwerpendocs_supervisors
  \seq_gpush:Nn \g__uantwerpendocs_supervisorswithaffiliation {}
  \seq_greverse:N \g__uantwerpendocs_supervisorswithaffiliation
  \seq_gpush:Nn \g__uantwerpendocs_cosupervisors {}
  \seq_greverse:N \g__uantwerpendocs_cosupervisors
  \seq_gpush:Nn \g__uantwerpendocs_cosupervisorswithaffiliation {}
  \seq_greverse:N \g__uantwerpendocs_cosupervisorswithaffiliation
  \seq_gpush:Nn \g__uantwerpendocs_extsupervisors {}
  \seq_greverse:N \g__uantwerpendocs_extsupervisors
  \seq_gpush:Nn \g__uantwerpendocs_extsupervisorswithaffiliation {}
  \seq_greverse:N \g__uantwerpendocs_extsupervisorswithaffiliation
}
\ExplSyntaxOff
\newcommand*\@degree{
  \PackageError{uantwerpendocs}
  {Please, specify the offical degree description using
    the '\protect\degree{}'  macro in the preamble of your document.}
  {See the uantwerpendocs manual}
}
\newcommand*\degree[1]{\renewcommand*\@degree{#1}}
\newcommand*\@bamadoctype{
  \PackageError{uantwerpendocs}
  {Please, specify the offical document type, either using
    the '\protect\bamadoctype{}'  macro or the '\protect\bamadegree{}'
    macro in the preamble of your document.}
  {See the uantwerpendocs manual}}
\newcommand*\bamadoctype[1]{
  \renewcommand*\@bamadoctype{\uantwerpendocsdoctype{#1}}
}
\ExplSyntaxOn
\NewDocumentCommand{\bamadegree}{m}{
  \seq_new:N \l__uantwerpendocs_degreechunks
  \regex_extract_all:nnN { [^-]+ } { #1 } \l__uantwerpendocs_degreechunks
  \bamadoctype{\seq_item:Nn\l__uantwerpendocs_degreechunks {2} - \seq_item:Nn\l__uantwerpendocs_degreechunks {3}}
  \degree{\uantwerpendocsdegree{
      \seq_item:Nn\l__uantwerpendocs_degreechunks {1} -
      \seq_item:Nn\l__uantwerpendocs_degreechunks {2} -
      \seq_item:Nn\l__uantwerpendocs_degreechunks {3} -
      \seq_item:Nn\l__uantwerpendocs_degreechunks {4} }}
}
\ExplSyntaxOff
\newcommand*{\diploma}[1]{
  \PackageError{uantwerpendocs}
  {The '\protect\diploma{}' macro is no longer available. Use
    '\protect\degree{}' instead}
  {The interface of uantwerpendocs 4.0 has been changed. Use the
    '\protect\degree' macro to specify your degree in full text (see
    the uantwerpendocs manual)'}
}
\newcommand*{\@academicyear}{XXX-YYYY}
\newcommand*{\academicyear}[1]{\renewcommand*{\@academicyear}{#1}}
\newcommand{\@copyrightnotices}{\disclaimer{\@bamadoctype}}
\ExplSyntaxOn
\seq_new:N \l_title_seq
\cs_generate_variant:Nn \seq_set_split:Nnn { Nnf }
\cs_new_nopar:Npn \__uantwerpendocs_reversevideo:f #1
{
  \seq_set_split:Nnf \l_title_seq {~} { #1 }
  \seq_set_map:NNn \l_title_seq \l_title_seq {\@uantwerpendocshl{##1}}
  \seq_use:Nnnn \l_title_seq { ~ } { ~ } { ~ }
}
\NewDocumentCommand{\reversevideo}{m}{
  \__uantwerpendocs_reversevideo:f { #1 }
}
\ExplSyntaxOff
\AtBeginDocument{
  \setlength{\headheight}{13.7pt}
  \renewcommand*{\headrulewidth}{0pt}
  \renewcommand*{\footrulewidth}{0pt}
  \newsavebox\smallogo
  \savebox\smallogo{\raisebox{-1ex}{\includegraphics[width=2.5cm]{\logopos}}}
  \if@twoside
  \lhead[]{\footnotesize\slshape\rightmark}
  \chead[]{}
  \rhead[\footnotesize\slshape\leftmark]{}
  \lfoot[\footnotesize\thepage~\textcolor{maincolor}{\textbf{|}}]{\usebox\smallogo}
  \cfoot[\footnotesize\@bamadoctype]{\footnotesize\@bamadoctype}
  \rfoot[\usebox\smallogo]{\footnotesize\textcolor{maincolor}{\textbf{|}}~\thepage}
  \else
  \lhead[]{\footnotesize\slshape\leftmark}
  \chead[]{}
  \rhead[]{}
  \lfoot[]{\usebox\smallogo}
  \cfoot[]{\footnotesize\@bamadoctype}
  \rfoot[]{\footnotesize\textcolor{maincolor}{\textbf{|}}~\thepage}
  \fi
  \fancypagestyle{plain}{\pagestyle{fancy}}
  % \patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{}
}

\newcommand{\@crnotice}{
  \@copyrightnotices
}
\addtokomafont{section}{\color{basecolor}}
\addtokomafont{chapter}{\color{basecolor}}
\renewcommand\maketitle{%
  \pagestyle{empty}
  \begin{titlepage}
    \AddToShipoutPicture*{%
      \put(0,0){%
        \begin{tikzpicture}[inner sep=0pt,outer sep=0pt]
          \clip (0,0) rectangle(\paperwidth,\paperheight);
          \node
          [anchor=north east,align=right]
          at (\paperwidth-1.6cm,\paperheight-2.6cm)
          {\bfseries\large
            \uantwerpendocsprop{acyearname}\\[.75ex]\Large\@academicyear};
          \node (title)
          [anchor=north west,align=left,
          text width={\paperwidth-5.1cm},font=\Huge,text=white,
          xshift=1pt]
          at (3.5cm,\paperheight-6.4cm)
          {\sethlcolor{maincolor}%
            \textsf{\textbf{\reversevideo{\@title}}}\\
            \textsf{\reversevideo{\@subtitle}}};
          \node
          [anchor=north west,font=\LARGE,yshift=-1cm,xshift=-1pt]
          at (title.south west)
          {%
            \textsf{\textbf{\@author}}
          };

          \node
          [anchor=west,align=left,
          text width={\paperwidth-5.1cm},font=\normalsize]
          at (3.5cm,12cm)
          {\textsf{\@bamadoctype}\\%
            \textsf{\textbf{\@degree}}
          };

          \node
          [anchor=west,align=left,
          text width={\paperwidth-5.1cm},font=\normalsize]
          at (3.5cm,7.5cm)
          {\supervisorsname{\\}
            \textbf{\jointsupervisorswithaffiliation{\\}{~\\~\\}}%
            \cosupervisorsname{\\}
            \textbf{\jointcosupervisorswithaffiliation{\\}{~\\~\\}}%
            \extsupervisorsname{\\}
            \textbf{\jointextsupervisorswithaffiliation{\\}{}}
          };

          \ifx\@companylogo\@empty
          \else
          \node[anchor=south east] at
          (\pagewidth-1.6cm,1.5cm)
          {\@companylogo};
          \fi

          \node[anchor=south west] at
          (1.6cm,1.5cm)
          {\includegraphics[width=6.2cm]{\logopos}};
        \end{tikzpicture}
      }
    }
  \end{titlepage}%
  ~\par\relax
  \clearpage
  \vspace*{\stretch{1}}
  \@crnotice
  \clearpage
  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@thanks\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
  \pagestyle{fancy}
  \thispagestyle{empty}
}
\newcommand\makefinalpage{
}
\AtBeginDocument{
  \@ifpackageloaded{hyperref}{
    \hypersetup{
      breaklinks=true,
      colorlinks=true,
      citecolor=black,
      filecolor=black,
      linkcolor=black,
      pageanchor=true,
      pdfpagemode=UseOutlines,
      urlcolor=black,
      pdftitle={\@title},
      pdfsubject={\@subtitle},
      pdfauthor={\@author}
    }
  }{}
}
\endinput
%%
%% End of file `uantwerpenbamathesis.cls'.