summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/udesoftec/udesoftec.cls
blob: 25e3b0997455dd79a97db4a99289b57be8aa5651 (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
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
% !Mode:: "TeX:UTF-8"
%% udesoftec.cls
%% Copyright 2013-2015 J. Peter M. Schuler
%% 2021/02/22 v1.7.1 udesoftec
%
% 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 `author-maintained'.
% 
% The current maintainer of this work is J. Peter M. Schuler
% j.peter.m.schuler@uni-due.de
%
% This work consists of the files 
% * udesoftec.cls 
% * udesoftec.bst
% * udesoftec-bibcommon.sty
% * udesoftec-biblatex.sty
% * udesoftec-bst.sty
% * udesoftec-extra.sty
%
% As this work is based on years of mostly undocumented improvement, 
% it includes parts, for which sources can't be identified anymore. Public postings
% in the LaTeX community were used as an input and if source is known, it is
% mentioned below. If anybody identifies parts of his/her own code,
% feel free to contact the maintainer in order to get listed. 
%
% Special thanks to all contributors and for the help of the tex-live team,
% e.g. Axel K.; Norbert P.; Petra R.; Rainer S.; Reinhard K.; Robin F.
%
% For further information refer to:
% http://mirrors.ctan.org/macros/latex/contrib/udesoftec/README
% and
% http://mirrors.ctan.org/macros/latex/contrib/udesoftec/udesoftec-doc.pdf

\NeedsTeXFormat{LaTeX2e}%
\ProvidesClass{udesoftec}[2021/02/22 v1.7.1 udesoftec.cls Thesis class and bibstyle for UDE SOFTEC]%

% class is based on KOMA-script http://www.ctan.org/pkg/koma-script
\LoadClass{scrbook}
\KOMAoptions{%
    twoside=true,
    headings=openright,                 % same as documentclassoption openany/openright
    numbers=noenddot,                   % section numbering without dot
    bibliography=totoc,
    index=totoc,
    listof=totoc,
    headlines=1.5     % the size of the header in lines (1.5 because of pagemark and sepline); 1.25 is default; 1 would be appropriate if only text and no sepline)
}
%%%% nag %%%%%%%%%%%%%
% purpose: identifies deprecated code and suggests better pckgs
% source:  http://www.ctan.org/pkg/nag
\RequirePackage[l2tabu, orthodox]{nag}
%%%%%%%%%%%%%%%%%%%%%%



%%%%%%%%%%%%%%%%%%%%%%
\usepackage{xstring}
\edef\udesoftecversionstring{\csname ver@udesoftec.cls\endcsname}
\StrLeft{\udesoftecversionstring}{27}[\udesoftecversion]

\pdfminorversion=6
\newif\ifdebugThisClass
\debugThisClassfalse
\newcommand{\classdebug}[1]{\ifdebugThisClass\ClassWarning{udesoftec}{#1}\fi}

\newcommand{\ignoreHbadness}[1]{%
  \let\originalHbadness\hbadness%
    \hbadness 100000%
    #1
    \hbadness \originalHbadness%
}

\newcommand{\chapterWithoutPageBreak}[1]{%
    \let\oldcleardoublepage\cleardoublepage%
    \let\oldclearpage\clearpage%
    \let\clearpage\relax%
    \let\cleardoublepage\relax%
    \let\backupskip\chapterheadstartvskip%
    \renewcommand\chapterheadstartvskip{\vspace*{-\topskip}\vspace*{30pt}}%
    \par\chapter*{#1}%
    \let\cleardoublepage\oldcleardoublepage%
    \let\clearpage\oldclearpage%
    \let\chapterheadstartvskip\backupskip%
}
\newcommand{\udesoftecoverride}{}

%%% all template conditions
\newif\ifdocumentIsFinal
\newif\ifdocumentIsProposal
\newif\iftemplateUseSansSerifFont
\newif\iftemplateUseBookLayout
\newif\iftemplateAddChapterToFigureNumbering
\newif\iftemplateUseCustomMaketitle
\newif\ifdocumentOmitCC
\newif\ifprimaryDocumentLanguageGerman
\newif\iftemplateUseColorfulLinks

\newif\iftemplateVawi
\newif\iftemplateVawiEssen
\newif\iftemplateVawiBamberg

\newif\ifdocumentOmitSD
\newif\ifdocumentOmitLOT
\newif\ifdocumentOmitLOL
\newif\ifdocumentOmitLOF
\newif\ifdocumentOmitLOA
\newif\ifdocumentOmitPageBreaks
\newif\ifdocumentOmitTitle
\newif\ifdocumentOmitTOC
\newif\ifdocumentOmitTodos
\newif\ifdocumentOmitA
\newif\ifdocumentOmitAen
\newif\ifdocumentHasShortA
\newif\ifdocumentUsedTodos
\newif\ifdocumentUsedTodos

\newif\iffallBackToBibtex

%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%
%%% all default values and the options
\fallBackToBibtextrue
\documentIsFinalfalse
\documentIsProposalfalse
\documentOmitLOTfalse
\documentOmitTitlefalse
\documentOmitPageBreaksfalse
\documentOmitSDfalse
\documentOmitLOFfalse
\documentOmitLOAfalse
\documentOmitLOLfalse
\documentOmitTOCfalse
\documentOmitTodosfalse
\documentOmitAfalse
\documentOmitAenfalse
\documentOmitCCtrue
\documentHasShortAtrue
\documentUsedTodosfalse
\templateUseColorfulLinkstrue
\templateUseSansSerifFonttrue
\templateUseBookLayoutfalse
\templateVawifalse
\templateVawiEssenfalse
\templateVawiBambergfalse
\templateAddChapterToFigureNumberingfalse
\templateUseCustomMaketitletrue
\primaryDocumentLanguageGermantrue

%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%
% Document options
\DeclareOption{mwe}{%
    \documentOmitLOTtrue
    \documentOmitSDtrue
    \documentOmitLOFtrue
    \documentOmitLOAtrue
    \documentOmitTOCtrue
    \documentOmitAtrue
    \documentOmitTodostrue
    \documentOmitTitletrue
    \documentOmitPageBreakstrue
}
\DeclareOption{draft}       {\documentIsFinalfalse}
\DeclareOption{final}       {\documentIsFinaltrue}
\DeclareOption{proposal}{%
    \documentIsProposaltrue
    \documentOmitLOTtrue
    \documentOmitSDtrue
    \documentOmitLOFtrue
    \documentOmitLOAfalse
    \documentOmitTOCtrue
    \documentOmitAtrue
    \documentOmitTodosfalse
}

\ifdocumentIsFinal
  \ifdocumentIsProposal
    \documentOmitTodostrue
  \else
    \documentOmitLOTfalse
    \documentOmitLOFfalse
    \documentOmitLOAfalse
    \documentOmitTOCfalse
    \documentOmitTodostrue
  \fi
\else%
\fi%
\def\udesoftec@bblengine{BibTeX}
\DeclareOption{bibtex}      {%
    \fallBackToBibtextrue
    \def\udesoftec@bblengine{BibTeX}
}
\DeclareOption{biber}      {%
    \fallBackToBibtexfalse
    \def\udesoftec@bblengine{BibLaTeX/Biber}
}
\DeclareOption{de}          {\primaryDocumentLanguageGermantrue}
\DeclareOption{en}          {\primaryDocumentLanguageGermanfalse}
\DeclareOption{omit-lot}    {\documentOmitLOTtrue}
\DeclareOption{omit-lof}    {\documentOmitLOFtrue}
\DeclareOption{omit-loa}    {\documentOmitLOAtrue}
\DeclareOption{omit-lol}    {\documentOmitLOLtrue}
\DeclareOption{omit-toc}    {\documentOmitTOCtrue}
\DeclareOption{omit-sd}     {\documentOmitSDtrue}
\DeclareOption{omit-todos}  {\documentOmitTodostrue}
\DeclareOption{omit-a}      {\documentOmitAtrue}
\DeclareOption{long-a}      {\documentHasShortAfalse}
\DeclareOption{omit-aen}      {\documentOmitAentrue}
\DeclareOption{confidential}{\documentOmitCCfalse}

\DeclareOption{printlayout}{%
    \templateUseColorfulLinksfalse
    \templateUseSansSerifFontfalse
    \templateUseBookLayouttrue
}
\DeclareOption{screenlayout}{%
    \templateUseColorfulLinkstrue
    \templateUseSansSerifFonttrue
    \templateUseBookLayoutfalse
}
\DeclareOption{vawiessen}{%
  \templateVawitrue
  \templateVawiEssentrue
}
\DeclareOption{vawibamberg}{%
  \templateVawitrue
  \templateVawiBambergtrue
}
\DeclareOption*{\ClassWarning{udesoftec}{Unknown option \CurrentOption}}
%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%
%Process all document options
\ProcessOptions\relax

% document title page and configuration commands
\newcommand{\city}[1]{\def\udesoftec@city{#1}}
\newcommand{\typeofdoc}[1]{\def\udesoftec@typeofdoc{#1}}
\newcommand{\labelPreTopic}[1]{\def\udesoftec@labelPreTopic{#1}}
\newcommand{\labelRespectConfidentiality}[1]{\def\udesoftec@labelRespectConfidentiality{#1}}
\newcommand{\academicfield}[1]{\def\udesoftec@academicfield{#1}}
\newcommand{\institution}[1]{\def\udesoftec@institution{#1}}
\newcommand{\semester}[1]{\def\udesoftec@semester{#1}}
\newcommand{\entitle}[1]{\def\udesoftec@entitle{#1}}
\newcommand{\confidentialitySource}[1]{\def\udesoftec@confidentialitySource{#1}}
\newcommand{\confidSource}[1]{\def\udesoftec@confidentialitySource{#1}}
\newcommand{\authorbox}[1]{\def\udesoftec@authorbox{#1}}
\newcommand{\abstract}[1]{\def\udesoftec@abstract{#1}}
\newcommand{\abstractEn}[1]{\def\udesoftec@abstracten{#1}}



\title{Komplexer Titel einer Abschlussarbeit f\"ur ein Dokument}
\author{Max Mustermann}
\city{Essen}
\typeofdoc{Masterarbeit}
\labelPreTopic{zum Thema}
\labelRespectConfidentiality{(Sperrvermerk beachten)}
\academicfield{Wirtschaftsinformatik}
\institution{Vorgelegt der Fakult\"at f\"ur Wirtschaftswissenschaften der\par Universit\"at Duisburg-Essen}
\semester{\udesoftec@academicfield -- Sommersemester 2022}
\entitle{Englischer Titel der Arbeit}
\confidentialitySource{Name der Firma, die auf die Vertraulichkeitserkl\"arung besteht}
\date{Dokumentversion: \today \linebreak Templateversion:
\udesoftecversion{} (with \udesoftec@bblengine)}

\authorbox{%
\begin{tabularx}{.7\linewidth}{ll}
  von:&Max Mustermann\\
        &Musterstrasse 123\\
            &12345 Musterstadt\\
    \\
  Gutacher:&Prof. Dr. Stefan Eicker\\
             &Prof. Dr. John Doe\\
    \\
\end{tabularx}
}

\ifprimaryDocumentLanguageGerman
\else
    \abstract{\udesoftec@defaultabstracten}
    \entitle{}
    \abstractEn{}
    \typeofdoc{Masters Thesis}
    \labelPreTopic{about the topic}
    \labelRespectConfidentiality{(Adhere confidentially clause --- Sperrvermerk beachten)}
    \academicfield{Business Information Systems}
    \institution{Presented to the Faculty of Economics and Business Administration of\par University of Duisburg-Essen}
    \semester{\udesoftec@academicfield{} -- Summer semester 2022}
    \confidentialitySource{Name of Company which wants the statutory declaration}
    \date{Document version: \today \linebreak Template version:
\udesoftecversion{} (with \udesoftec@bblengine)}
    \authorbox{%
    \begin{tabularx}{.7\linewidth}{ll}
      Author:&Max Mustermann\\
            &Musterstrasse 123\\
                &12345 Musterstadt\\
        \\
      Examiner:&Prof. Dr. Stefan Eicker\\
                 &Prof. Dr. John Doe\\
        \\
    \end{tabularx}
    }
\fi

\usepackage{libertine}
%% special set font before fontenc!
\fontfamily{LinuxLibertineT-TLF}
\usepackage[T1]{fontenc}

\iftemplateUseSansSerifFont
    \renewcommand*{\familydefault}{\sfdefault}
\else
    \renewcommand*\familydefault{\rmdefault}
\fi
\setkomafont{descriptionlabel}{\normalfont\bfseries}
\setkomafont{dictumtext}{\normalfont\normalcolor\small}
\setkomafont{disposition}{\normalfont\normalcolor\bfseries}
\setkomafont{caption}{\normalfont\normalcolor\scriptsize}

%%%% microtype %%%%%%
% purpose: character protrusion (also known as margin kerning) and font expansion
% purpose-de: optischen Randausgleich verwenden. Beispiele siehe Paket-Doku
% source: http://www.ctan.org/pkg/microtype
\usepackage{microtype}
%%%%%%%%%%%%%%%%%%%%%%

\ifprimaryDocumentLanguageGerman
    \def\udesoftec@documentLanguage{british,ngerman}         %
    % all used languages, primary LAST
\else
    \def\udesoftec@documentLanguage{ngerman,british}
\fi

\def \udesoftec@templatePageMarkPrefix {}      % might be something like "S. "




%%%% l18n %%%%%%%%%%%%%
% purpose: localization and utf-8 config
% babel has primary language last
\usepackage[utf8]{inputenc}
\usepackage[\udesoftec@documentLanguage]{babel}
\usepackage[autostyle,english=british,german=quotes]{csquotes}
\usepackage{hyphenat}  % helps with \nohyphens command, which allows to remove hypens from quotes.
%%%%%%%%%%%%%%%%%%%%%%


%%%% xcolor %%%%%%%%%%
% purpose: define some color names
\usepackage[svgnames]{xcolor}
%%%%%%%%%%%%%%%%%%%%%%
%%%% customcolors %%%%
% purpose: have every color defined in one place
% special: color1!percent!color2 mixes two colors (easier as pseudo-names or rgb)
%          percent * color1 + (100-percent) * color2
\definecolor{UDEblue}{RGB/cmyk}{0,76,147/1,.68,0,.12}
\definecolor{UDEbeige}{RGB/cmyk}{239,228,191/0,.03,.19,.06}
\definecolor{UDEbrightblue}{RGB/cmyk}{223,228,242/.15,.09,0,0}

\definecolor{UDEcustombrightbeige}{RGB}{255,249,229}
\definecolor{UDEcustombrightblue}{RGB}{229,236,255}
\definecolor{UDEcustomdarkgreen}{RGB}{150,179,135}
\definecolor{UDEcustommediumgreen}{RGB}{200,229,185}
\definecolor{UDEcustombrightgreen}{RGB}{238,255,229}
\definecolor{UDEcustomdarkorange}{RGB}{226,173,0}
\definecolor{UDEcustommediumorange}{RGB}{255,204,38}
\definecolor{UDEcustombrightorange}{RGB}{255,249,229}
\definecolor{UDEcustombrightgray}{RGB}{244,244,244}
\definecolor{UDEcustommediumgray}{RGB}{159,159,189}
\definecolor{UDEcustomdarkgray}{RGB}{74,74,74}

\colorlet{UDEVariantsDarkBlue}{UDEblue}
\colorlet{UDEVariantsMediumBlue}{UDEblue!50!UDEbrightblue}
\colorlet{UDEVariantsBrightBlue}{UDEbrightblue}
\colorlet{UDEVariantsDarkBeige}{UDEbeige}
\colorlet{UDEVariantsMediumBeige}{UDEbeige}
\colorlet{UDEVariantsBrightBeige}{UDEcustombrightbeige}
\colorlet{UDEVariantsDarkGreen}{UDEcustomdarkgreen}
\colorlet{UDEVariantsMediumGreen}{UDEcustommediumgreen}
\colorlet{UDEVariantsBrightGreen}{UDEcustombrightgreen}
\colorlet{UDEVariantsDarkOrange}{UDEcustomdarkorange}
\colorlet{UDEVariantsMediumOrange}{UDEcustommediumorange}
\colorlet{UDEVariantsBrightOrange}{UDEcustombrightgreen}

\colorlet{DocumentDark0}{UDEcustomdarkgray}
\colorlet{DocumentMedium0}{UDEcustommediumgray}
\colorlet{DocumentBright0}{UDEcustombrightgray}

\colorlet{DocumentDark1}{UDEVariantsDarkBlue}
\colorlet{DocumentMedium1}{UDEVariantsMediumBlue}
\colorlet{DocumentBright1}{UDEVariantsBrightBlue}

\colorlet{DocumentDark2}{UDEVariantsDarkBeige}
\colorlet{DocumentMedium2}{UDEVariantsMediumBeige}
\colorlet{DocumentBright2}{UDEVariantsBrightBeige}

\colorlet{DocumentDark3}{UDEVariantsDarkGreen}
\colorlet{DocumentMedium3}{UDEVariantsMediumGreen}
\colorlet{DocumentBright3}{UDEVariantsBrightGreen}

\colorlet{DocumentDark4}{UDEVariantsDarkOrange}
\colorlet{DocumentMedium4}{UDEVariantsMediumOrange}
\colorlet{DocumentBright4}{UDEVariantsBrightOrange}


\colorlet{allchaptercolor}{black}


\colorlet{listingBackground}{white!50!UDEbeige}
\colorlet{documentTitle}{black}
\colorlet{parExample}{UDEbrightblue}

\colorlet{chapter}{allchaptercolor}                 % for all chapters, toc etc
\colorlet{section}{allchaptercolor}                 % for all chapters, toc etc
\colorlet{subsection}{allchaptercolor}              % for all chapters, toc etc

\colorlet{ChapterHeadingBigChapterNumber}{allchaptercolor}      % for the special chapter title page design
\colorlet{ChapterHeadingSmallChapterNumer}{allchaptercolor}     % for the special chapter title page design
\colorlet{ChapterHeadingSeperatorLine}{allchaptercolor}     % for the special chapter title page design
\colorlet{Todo}{orange!30!white}                                    %default color for todo notes
\colorlet{Headsepline}{UDEblue}                         % seperator between header and text body
\colorlet{PagemarkBackground}{UDEblue}
\colorlet{PagemarkText}{white}                                      % page number color
\colorlet{HeadmarkText}{black}              % textcolor of header text (chapters, sections)
\colorlet{Good}{DarkGreen}                                      % page number color
\colorlet{Bad}{DarkRed}             % textcolor of header text (chapters, sections)

\iftemplateUseColorfulLinks
    \colorlet{LinkExternal} {black!75!green}                % URLs in text and bibliography
    \colorlet{LinkDoi} {black!75!green}                                     % links to doi in bibliography
    \colorlet{LinkInternal} {black!30!UDEblue}          % internal links are from TOC or references in text
    \colorlet{LinkBibliography} {black!30!UDEblue}  % links in citation
    \colorlet{LinkAnchor} {black}                               % not used
\else
    \colorlet{LinkExternal}{black}              % URLs in text and bibliography
    \colorlet{LinkDoi}{black}                                       % links to doi in bibliography
    \colorlet{LinkInternal}{black}          % internal links are from TOC or references in text
    \colorlet{LinkBibliography}{black!30!UDEblue}   % links in citation
    \colorlet{LinkAnchor}{black}                                % not used
\fi

\providecaptionname{ngerman}{\labelabstracttitle}{Kurzfassung}
\providecaptionname{british}{\labelabstracttitle}{Abstract}
\def\udesoftec@defaultabstractde{Jede wissenschaftliche Arbeit sollte eine Kurzfassung am Anfang aufweisen. Diese Kurzfassung sollte etwa eine halbe Seite lang sein.}
\def\udesoftec@defaultabstractdeen{As all theses have an English title, there should be an English abstract as well.\par Folglich sollten auch deutsche Arbeiten einen englischen Abstract haben. Falls die Abstracts zu lang werden, gibt es im Handbuch eine Hilfestellung.}
\def\udesoftec@defaultabstracten{Every thesis should have an abstract at the beginning. This abstract should be about have an page long. Of course an English thesis doesn't need an German abstract, as it doesn't even have a German title.}
\ifprimaryDocumentLanguageGerman
    \abstract{\udesoftec@defaultabstractde}
    \abstractEn{\udesoftec@defaultabstractdeen}
\else
    \abstract{\udesoftec@defaultabstracten}
    \abstractEn{}
\fi

\newcommand{\printabstract}{%
    \chapter*{\labelabstracttitle}%
    \label{sec:abstract}
    \pdfbookmark[0]{\labelabstracttitle}{sec:abstract}%
    \udesoftec@abstract

    \iflanguage{ngerman}{%
        % German theses should have German and English abstract
        \ifdocumentOmitAen
            % no second abstract here
        \else
            \selectlanguage{british}
            \ifdocumentHasShortA%
                \chapterWithoutPageBreak{\labelabstracttitle}
                \label{sec:abstracten}
            \else
                \chapter*{\labelabstracttitle}
                \label{sec:abstracten}
            \fi
            \udesoftec@abstracten
            \selectlanguage{ngerman}
        \fi
    }{}
}

\newcaptionname{ngerman}{\labelconfidentialityclausetitle}{Sperrvermerk}
\newcaptionname{british}{\labelconfidentialityclausetitle}{Confidentiality Clause}
\def\udesoftec@defaultconfidentialityclause{Die vorliegende \udesoftec@typeofdoc ~enth\"alt vertrauliche Informationen der \emph{\udesoftec@confidentialitySource}, die der Geheimhaltung unterliegen. Ver\"offentlichungen oder Vervielf\"altigungen der \udesoftec@typeofdoc ~-- auch nur auszugsweise -- sind ohne ausdr\"uckliche Genehmigung der \emph{\udesoftec@confidentialitySource} nicht gestattet. Die \udesoftec@typeofdoc ~ist nur den Mitarbeitern des betreuenden Lehrstuhls sowie den Mitgliedern des Pr\"ufungsausschusses zug\"anglich zu machen.\par{} Dieser Sperrvermerk gilt f\"ur die n\"achsten 2 Jahre. Die sich aus diesem Sperrvermerk ergebenden Einschr\"ankungen entfallen nach Ablauf dieses Zeitraums.\par{}}
\def\udesoftec@defaultconfidentialityclauseen{This \udesoftec@typeofdoc ~contains confidential data of \emph{\udesoftec@confidentialitySource}. Any publication or duplication of this \udesoftec@typeofdoc ~-- even in part -- is prohibited, excluding cases with explicit permission by \emph{\udesoftec@confidentialitySource}. The \udesoftec@typeofdoc ~is to be made accessible only to the staff of the research group supervising it and the board of examiners.\par{} This confidentially clause is valid for the next 2 years. Any limitations resulting from this confidentially clause do not apply after this period.\par{}}

% there should always be an additional German cc in English theses
\newcommand{\confidentialityclause}{%
    \iflanguage{british}{%
        \cleardoublepage
        \chapter*{\labelconfidentialityclausetitle}     % English heading
        \udesoftec@defaultconfidentialityclauseen   % English text
        \selectlanguage{ngerman}                        % prepare German
        \chapterWithoutPageBreak{\labelconfidentialityclausetitle} % German heading
        \udesoftec@defaultconfidentialityclause         % German text
        \selectlanguage{british}                        % switching back to English
    }{%
        \cleardoublepage
        \chapter*{\labelconfidentialityclausetitle}
        \udesoftec@defaultconfidentialityclause
    }
}

\newcaptionname{ngerman}{\labelstatutorydeclarationheading}{Eidesstattliche Versicherung}
\newcaptionname{british}{\labelstatutorydeclarationheading}{Statutory Declaration}
\def\udesoftec@defaultstatutorydeclaration{Ich versichere an Eides statt durch meine Unterschrift, dass ich die vorstehende Arbeit selbst\"andig und ohne fremde Hilfe angefertigt und alle Stellen, die ich w\"ortlich oder ann\"ahernd w\"ortlich aus Ver\"offentlichungen entnommen habe, als solche kenntlich gemacht habe, mich auch keiner anderen als der angegebenen Literatur oder sonstiger Hilfsmittel  bedient habe. Die Arbeit hat in dieser oder \"ahnlicher Form noch keiner anderen  Pr\"ufungsbeh\"orde vorgelegen.\par{} \vspace*{40pt}\parbox{4cm}{\udesoftec@city, \today\hrule\strut \footnotesize Ort, Datum} \hfill\parbox{7cm}{\textcolor{white}{Hier wurde im Original unterschrieben}\hrule\strut \footnotesize Unterschrift} \hfill}
\def\udesoftec@defaultstatutorydeclarationenprefix{The statutory declaration needs to be in German, so the following excerpt is in German:}

\newcommand{\statutorydeclaration}{%
    \iflanguage{british}{%
        \cleardoublepage
        \chapter*{\labelstatutorydeclarationheading}
        \udesoftec@defaultstatutorydeclarationenprefix
        \selectlanguage{ngerman}
        \chapterWithoutPageBreak{\labelstatutorydeclarationheading}
        \udesoftec@defaultstatutorydeclaration
        \selectlanguage{british}
    }{%
        \cleardoublepage
        \chapter*{\labelstatutorydeclarationheading}
        \udesoftec@defaultstatutorydeclaration

    }
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% http://www.golatex.de/nummerierung-der-fussnoten-durchgehend-im-gesamten-dokument-t2042.html
% change counters for figures, footnotes, etc
\usepackage{chngcntr}
\counterwithout{footnote}{chapter} % count footnotes for whole document, not per chapter




%%%% graphicx %%%%%%%%
% purpose: allows better graphics import
% special: if we just dont use DeclareGraphicsExtensions and have folders for eps and pdf
%          Latex2dvi will always use eps and Latex2pdf always pdf
\usepackage[pdftex]{graphicx}%
\graphicspath{{Images/pdf/}}
%%%%%%%%%%%%%%%%%%%%%%


%%%% footmisc %%%%%%%%
% purpose: repair footnote indent - first line and second line should start with same space
\usepackage[marginal]{footmisc}
%%%%%%%%%%%%%%%%%%%%%%

%%%% floatbarrier %%%%
% purpose: keep images, tables and other floating stuff in the same section
%
\usepackage[section]{placeins}
%%%%%%%%%%%%%%%%%%%%%%

%%%% tabularx %%%%%%%%
% purpose: Tabularx berechnet in dem Fall drei gleich breite Spalten so, dass die Tabelle insgesamt
%          die Breite textwidth einnimmt. RaggedRight setzt das ganze dann im Flattersatz mit
%          Silbentrennung. Definiert man neue Spaltentypen, so benötigt man den Befehl arraybackslash
%          damit der \\-Befehl zum Beenden der Zeile funktioniert (ganz genau weiß ich's aber auch
%          nicht).
% source:  http://mrunix.de/forums/showthread.php?t=56679
\usepackage{ragged2e, tabularx}
%\usepackage{tabularx}
%\newcolumntype{Y}{>{\RaggedRight\arraybackslash}X}
%%%%%%%%%%%%%%%%%%%%%%



\usepackage{enumitem}


\usepackage{multicol}

%%%%%%%%%%%%%%%%%%%%%%
% title page background
% default
\ifprimaryDocumentLanguageGerman
    \def\udesoftec@templateTitlePageBackground{udesoftec-cover-ude-de}
\else
    \def\udesoftec@templateTitlePageBackground{udesoftec-cover-ude-en}
\fi
% VAWi-Bamberg special (no matter what language)
\iftemplateVawiBamberg
    \def\udesoftec@templateTitlePageBackground{udesoftec-cover-uba}
\fi
%%%%%%%%%%%%%%%%%%%%%%
% VAWi special
\iftemplateVawiEssen
    \institution{Im Virtuellen Weiterbildungsstudiengang Wirtschaftsinformatik\par der Universit\"at Duisburg-Essen}
    \labelPreTopic{}
\fi
\iftemplateVawiBamberg
    \institution{Im Virtuellen Weiterbildungsstudiengang Wirtschaftsinformatik}
    \labelPreTopic{}
\fi


\ifdocumentOmitTitle
    \renewcommand{\maketitle}{}
\else
    \usepackage{wallpaper}
    \newcommand{\udesoftecmaketitle} {%
        \newgeometry{bottom=1cm, inner=0cm,outer=0cm,top=4cm}
        \begin{titlepage}
            \begin{center}
                \ThisCenterWallPaper{1}{\udesoftec@templateTitlePageBackground}
                \vspace*{30pt}
                \begin{minipage}[30em]{.7\linewidth}
                    \begin{center}
                        \Large\udesoftec@typeofdoc\par
                        \normalsize\udesoftec@labelPreTopic\par
                        \vspace*{20pt}
                        {\color{documentTitle}\Huge\textbf{\@title}\par}
                        \vspace*{20pt}
                        {\color{documentTitle}\huge\textbf{\@subtitle}\par}
                        \vspace*{20pt}
                        {\color{documentTitle}\large\textbf{\udesoftec@entitle}\par}
                        \vspace*{50pt}
                        \large\udesoftec@institution
                    \end{center}
                \end{minipage}
                \vfill
                \begin{minipage}{.7\linewidth}
                    \begin{center}
                    \ifdocumentOmitCC
                    \else
                    \udesoftec@labelRespectConfidentiality\par
                    \fi
                    \vspace*{20pt}\Large\@date
                    \end{center}
                    \vspace*{30pt}
                \end{minipage}
                \udesoftec@authorbox\par
                \begin{minipage}{.7\linewidth}
                    \begin{center}
                    \vspace*{40pt}
                    \large\udesoftec@semester\par
                    \end{center}
                \end{minipage}%
            \end{center}%
        \end{titlepage}%
        \restoregeometry
    }

    \newcommand{\udesoftecvawibambergmaketitle}{%
        \newgeometry{bottom=1cm, left=2cm,right=1cm,top=4cm}
        \begin{titlepage}
        \begin{center}
            \ThisCenterWallPaper{1}{\udesoftec@templateTitlePageBackground}
            \vspace*{0pt}
            \begin{minipage}[30em]{.7\linewidth}
                \begin{center}
                {\color{documentTitle}\Huge\textbf{\@title}\par}
                    \vspace*{20pt}
                    {\color{documentTitle}\huge\textbf{\@subtitle}\par}
                    \vspace*{20pt}
                    {\color{documentTitle}\large\textbf{\udesoftec@entitle}\par}
                    \vspace*{50pt}
                    \hrule
                    \vspace*{20pt}
                    \Large\textbf{\udesoftec@typeofdoc}\par
                    \large\udesoftec@institution\par
                    \vspace*{20pt}
                    \hrule
                    \vspace*{20pt}
                    \end{center}
            \end{minipage}
            \vfill
            \begin{minipage}{.7\linewidth}
                \begin{center}
                    \ifdocumentOmitCC
                    \else
                    \udesoftec@labelRespectConfidentiality\par
                    \fi
                    \vspace*{15pt}\Large\@date
                \end{center}
                \vspace*{20pt}
            \end{minipage}
            \udesoftec@authorbox\par
            \begin{minipage}{.7\linewidth}
                \begin{center}
                \vspace{20pt}
                \large\udesoftec@semester\par
                \vspace{20pt}
                \end{center}%
            \end{minipage}%
        \end{center}%
        \end{titlepage}%
        \restoregeometry
    }

    \renewcommand{\maketitle}{\udesoftecmaketitle}
    \iftemplateVawiBamberg
        \renewcommand{\maketitle}{\udesoftecvawibambergmaketitle}
    \fi
    \let\oldmaketitle\maketitle
    \renewcommand{\maketitle}{%
        \let\oldhbadness\hbadness
        \let\oldvbadness\vbadness
        \hbadness=10000
        \vbadness=10000
        \oldmaketitle
        \let\hbadness\oldhbadness
        \let\vbadness\oldvbadness
    }
\fi

%%%% chapterdesign %%%
\addtokomafont{chapter}{\color{chapter}}
\addtokomafont{sectioning}{\color{section}}
\addtokomafont{subsubsection}{\color{subsection}}
%have a section level which doesn't use numbers never and will work no matter how deep secnum is.
\newcommand{\unnumberedsection}[1]{%
    \subparagraph{#1}\hspace{0cm}\\%
}
% Chapter-Numbering for 4 levels, i.e. PART B Chapter 5.7.3.1; in order to have unnumbered headings use \paragraph{}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% purpose: have some nice chapter headings (big number, lines and so on)
% we need type1cm and cm-super for the bigger fonts - else there would be warnings
% source: https://groups.google.com/forum/#!msg/de.comp.text.tex/rVcjvNQI6IA/N-NsfyQzXRwJ
\let\defaultchapterformat\chapterformat
\newcommand{\udesoftec@chapterformat}{%
    \begingroup%
        \setlength{\unitlength}{1mm}%
        \begin{picture}(20,40)(-2,8)%
            \setlength{\fboxsep}{0pt}%
            \put(20,15){\color{ChapterHeadingSeperatorLine}\line(1,0){\dimexpr\textwidth-20\unitlength\relax\@gobble}}%
            \put(-6,4.0){%
                \makebox(20,20)[r]{%
                    \fontsize{19\unitlength}{23\unitlength}\selectfont\color{ChapterHeadingBigChapterNumber}\thechapter
                }%
            }%
                \put(20,15){%
                \makebox(\dimexpr\textwidth-20\unitlength\relax\@gobble,\ht\strutbox\@gobble)[l]{%
                    \ifdefined\chapterAuthor%
                        \normalsize\color{ChapterHeadingSmallChapterNumer}\chapterAuthor%
                    \else
                        \normalsize\color{ChapterHeadingSmallChapterNumer}\chapapp%
                    \fi%
                }
            }%
        \end{picture} % <-- Leerzeichen ist hier beabsichtigt!
    \endgroup
}

\let\chapterformat\udesoftec@chapterformat
%%%%%%%%%%%%%%%%%%%%%%
\ifdocumentOmitPageBreaks
    \let\chapterformat\defaultchapterformat
    \let\cleardoublepage\clearpage%
    \let\clearpage\par%
    \let\appendix\par%
\fi

\renewcommand{\headfont}{\normalfont\small\color{HeadmarkText}} % header text should be small
\renewcommand{\pnumfont}{\normalfont\small\color{PagemarkText}} % pagenumber is in header and should be small too

%%%% scrpage2 %%%%%%%%
% purpose: customize page styles (header, footer)
\usepackage{scrlayer-scrpage}

% default page behaviour: header has line, chap.section left; page right
\pagestyle{scrheadings}
\clearmainofpairofpagestyles
\clearplainofpairofpagestyles
\clearpairofpagestyles
% change color of headsepline
\addtokomafont{headsepline}{\color{Headsepline}}
% deprecating following line
%\setheadsepline{.4pt}%{\color{Headsepline}}
\KOMAoption{headsepline}{.4pt}
% create headermarks so the chapter is shown on left page and section on right
% new pagestyle "chapter": pagenumber top outer, no line no headmark
\iftemplateUseBookLayout
        \ihead[\headmark]{\headmark}
        % clear outer head (where the normale pagemark is in)
        \ohead[]{}
        % add pageMark boxes to leftpage lefthead and rightpage righthead (pagemark box needs to know "r" or "l"
        \rohead[]{\pagemarkBox{\pagemark}{r}}
        \lehead[]{\pagemarkBox{\pagemark}{l}}

        \classdebug{using headline for booklayout}
        \automark[section]{chapter}
        \defpagestyle{chapter}{%
        (0pt,0pt)
            {\pagemarkBox{\pagemark}{l}\hfill}
        {\hfill\pagemarkBox{\pagemark}{r}}
            {\pagemarkBox{\pagemark}{r}\hfill}
        (0pt,0pt)
        }{{}{}{}}
\else
        \ihead[]{}
        \ohead[]{}
        \lehead[\headmark]{\headmark}
        \rehead[]{\pagemarkBox{\pagemark}{r}}
        \lohead[\headmark]{\headmark}
        \rohead[]{\pagemarkBox{\pagemark}{r}}
        \classdebug{using headline for screenlayout}
        \automark[chapter]{chapter}
        \defpagestyle{chapter}{%
        (0pt,0pt)
            {\hfill\pagemarkBox{\pagemark}{r}}
        {\hfill\pagemarkBox{\pagemark}{r}}
            {\hfill\pagemarkBox{\pagemark}{r}}
        (0pt,0pt)
        }{{}{}{}}
\fi
% custom page behavior for title, part and chapter
\renewcommand*{\titlepagestyle}{empty}
\renewcommand*{\partpagestyle}{empty}
\renewcommand*{\chapterpagestyle}{chapter}
%%%%%%%%%%%%%%%%%%%%%%

%%%% custom pagemark %%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\pagemarkBox}[2] {%
  % the picture has height 0 to change clipping behavior, else the clipping box might be higher than the text line
    \begin{picture}(50,0)
    \put(-.55,-5.05) {%
        \put(-2.8,.3){%these relate box to text
        \color{PagemarkBackground}\rule{56.7pt}{16pt}}%
        \put(5,1){%these relate box to text
        \makebox(40,16)[#2]{\textcolor{PagemarkText}\udesoftec@templatePageMarkPrefix\fontseries{b}\fontshape{n}\selectfont #1}}%
        }
    \end{picture}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%% page layout %%%%%
% purpose: set page margins, textbody size etc
% usage:   typearea[BCOR]{DIV}
%          DIV is auto-calculation of all margins in depencedy of font size
%                10pt = DIV 8;11pt = DIV 10;12pt = DIV 12
%            BCOR is additional inner margin (binding correction)
% special: BCOR adds inner margin and reduces text space. As the default margin sum seems fine we use geometry instead
%          to adjust for regular printing (e.g. use in a folder), see below "geometry"
\usepackage[includehead=false,includefoot=false]{geometry}
\iftemplateUseBookLayout
    \KOMAoptions{twoside=true}
    \KOMAoptions{BCOR=12mm,DIV=10} % for helvetica
\else
    \KOMAoptions{twoside=false}
    \KOMAoptions{BCOR=0mm,DIV=10} % for helvetica
\fi

\renewcommand*\chapterheadstartvskip{}

\iffallBackToBibtex
\else
\AtEndDocument{%
        \appendix%
}
\fi
% special: don't change marginpar, else it will create overfuls with package todonotes
\usepackage{marginnote}
\ifx\marginfont\undefined
    \newcommand{\marginfont}[1]{}
    \newcommand{\marginnote}[2][]{\marginpar[#1]{#2}}
\fi


\renewcommand*{\marginfont}[1]{\scriptsize#1}

\providecommand{\marginalText}[2][]{%
\message{LaTeX Warning: \noexpand\marginalText is deprecated, use \noexpand\marginnote on input line \the\inputlineno }
\marginnote[#1]{#2}
}
\providecommand{\marginline}[2][]{%
\message{LaTeX Warning: \noexpand\marginline is deprecated, use \noexpand\marginnote on input line \the\inputlineno }
\marginnote[#1]{#2}
}

%%%%%%%%%%%%%%%%
% allow footnotes in minipage
% from http://stackoverflow.com/questions/3126082/store-a-text-string-in-latex-and-then-add-other-text-to-it-concatenate
% by David Underhill
\newcounter{footnotesinthisminipage}
\stepcounter{footnotesinthisminipage}\addtocounter{footnotesinthisminipage}{-1} % initialize counter to avoid errors
\newcommand{\footnoteNumberInMinipage}{\stepcounter{footnotesinthisminipage}\stepcounter{footnote}\footnotemark[\value{footnote}]}
\newcommand{\footnoteTextAfterMinipage}[1]{%
\addtocounter{footnotesinthisminipage}{-1}%decrease
\addtocounter{footnote}{-\value{footnotesinthisminipage}}%set footnote counter backwards for the number of footnotes
\footnotetext[\value{footnote}]{#1}%output footnotetext
\addtocounter{footnote}{\value{footnotesinthisminipage}}%reset footnote counter to real value
}%
\newcommand{\footnoteCmdForInsideMinipage}[1]{%
\ClassError{udesoftec}{Warning: \protect\footnote\space{}in minipages not implemented, use \protect\footnoteNumberInMinipage and \protect\footnoteTextAfterMinipage instead}%
%\footnoteNumberInMinipage
%\let\executeThisAfterEndOfMinipage aloa
}%

%%%%%%%%%%%%%%%%%%%%%%%%%
% have quote boxes with big quotation marks
% big quotation marks based on, reduced code and used mdframed
% http://tex.stackexchange.com/questions/16964/block-quote-with-big-quotation-marks
\usepackage{tikz}
\usepackage{mdframed}
\newlength{\udesoftec@outerboxmargin}
\setlength{\udesoftec@outerboxmargin}{1ex}
\mdfsetup{%
        innertopmargin=2ex,%
        leftmargin=-\udesoftec@outerboxmargin,%
        rightmargin=-\udesoftec@outerboxmargin,%
        innerleftmargin=\udesoftec@outerboxmargin,%
        innerrightmargin=\udesoftec@outerboxmargin,%
        innerbottommargin=2ex,%
}
\newcommand*\quotefont{\fontfamily{LinuxLibertineT-LF}} % selects Libertine as the quote font
%\newcommand*\quotefont{\normalfont\fontfamily{\sfdefault}} % selects Libertine as the quote font
\newcommand*\quotesize{60} % if quote size changes, need a way to make shifts relative
% Make commands for the quotes
\providecommand{\pictureopenquote}{\tikz[remember picture,overlay,xshift=-3ex,yshift=-.5] \node (OQ) {\quotefont\fontsize{\quotesize}{\quotesize}\selectfont\textooquote};}
%\providecommand{\pictureclosequote}{\tikz[remember picture,overlay,xshift=4ex,yshift=2ex] \node (CQ) {\quotefont\fontsize{\quotesize}{\quotesize}\selectfont\textcoquote};}
\providecommand{\pictureopenquoteen}{\tikz[remember picture,overlay,xshift=-4ex,yshift=-2.5ex] \node (OQ) {\quotefont\fontsize{\quotesize}{\quotesize}\selectfont\textooquote};}

%
%\providecommand{\pictureopenquoteen}{%
%\tikz[remember picture,overlay,xshift=-4ex,yshift=-2.7ex] \node (OQ1) {\quotefont\fontsize{\quotesize}{\quotesize}\selectfont\textooquote};%
%\tikz[remember picture,overlay,xshift=-2ex,yshift=-2.5ex] \node (OQ2) {\quotefont\fontsize{\quotesize}{\quotesize}\selectfont\textcoquote};%
%}
%\providecommand{\pictureclosequoteen}{\tikz[remember picture,overlay,xshift=4ex,yshift=1.5ex] \node (CQ) {\quotefont\fontsize{\quotesize}{\quotesize}\selectfont\textcoquote};}



\newenvironment{citequoteparenv}{%
    \mdfsetup{%
        innerleftmargin=6ex,%
        innerrightmargin=2ex,%
        backgroundcolor=DocumentBright2,%
        linecolor=DocumentMedium2,%
        linewidth=.5pt,
        nobreak=true,
    }
    \begin{mdframed}%
    \iflanguage{ngerman}{\pictureopenquote}{\pictureopenquoteen}%         
}{
    \end{mdframed}%
}
\newcommand{\citequotepar}[3][]{%
    \begin{citequoteparenv}%
        \sloppy{\small\nohyphens{\enquote{#3}}}%
        \par\hfill\small\cite[#1]{#2}%
    \end{citequoteparenv}%
}
\newcommand{\citequoteparnoquote}[3][]{%
    \begin{citequoteparenv}%
        \sloppy{\small\nohyphens{#3}}%
        \par\hfill\small\cite[#1]{#2}%
    \end{citequoteparenv}%
}
\newenvironment{exampleBox}[1][]{%
    \mdfsetup{%
        frametitle={%
            \tikz[baseline=(current bounding box.east),outer sep=0pt]
            \node[anchor=east,rectangle,draw=DocumentMedium1,line width=.5pt,fill=DocumentBright1,font=\small]
            {#1};
        },%
        innertopmargin=.0\udesoftec@outerboxmargin, %due to heading-box
        innerbottommargin=\udesoftec@outerboxmargin,
        linecolor=DocumentMedium1,%
        backgroundcolor=DocumentBright1,%
        linewidth=.5pt,topline=true,
        frametitleaboveskip=\dimexpr-\ht\strutbox\relax,
        }
        \begin{mdframed}%
}{\end{mdframed}}

\newcommand{\parExample}[2][!]{%
\ifx!#1{%
\parExampleWithHeading{Beispiel:}{#2}
}\else{%
\parExampleWithHeading{Beispiel für #1:}{#2}
}\fi
}
\newcommand{\parExampleWithHeading}[2]{%
    \let\defaultCmdFootnote\footnote%
    \let\footnote\footnoteCmdForInsideMinipage%
  \begin{exampleBox}[#1]%
    \small{#2}%
    \end{exampleBox}%
    \let\footnote\defaultCmdFootnote%
}

\usepackage[
ngerman,
textsize=tiny,
backgroundcolor=DocumentBright1,
bordercolor=DocumentMedium1,
linecolor=DocumentBright1,
colorinlistoftodos
]{todonotes}%
%% alternative for deactivation:
%\newcommand*{\todo}[2][]{}
%\newcommand*{\listoftodos}[1][]{}
%\newcommand*{\missingfigure}[2][]{}


\ifdocumentOmitTodos
    \renewcommand{\listoftodos}{}
    \renewcommand{\todo}[2][]{}
    \providecommand{\todoDesign}[1]{}
    \providecommand{\todoText}[1]{}
    \providecommand{\todoFigure}[1]{}
    \providecommand{\inlinetodo}[1]{}
    \providecommand{\todoinline}[1]{}
\else
    \let\defaultTodo\todo
    \renewcommand{\todo}[1]{%
        \documentUsedTodostrue%
        \defaultTodo[]{#1}%
    }
    \providecommand{\todoDesign}[1]{%
      \documentUsedTodostrue%
        \defaultTodo[fancyline,backgroundcolor=DocumentBright2]{#1}%
    }
    \providecommand{\todoText}[1]{%
      \documentUsedTodostrue%
        \defaultTodo[fancyline,backgroundcolor=DocumentBright3]{#1}%
    }
    \providecommand{\todoFigure}[1]{%
      \documentUsedTodostrue%
        \defaultTodo[fancyline,backgroundcolor=DocumentBright4]{#1}%
    }
    \providecommand{\inlinetodo}[1]{\documentUsedTodostrue\defaultTodo[inline]{#1}}
    \providecommand{\todoinline}[1]{\inlinetodo{#1}}

    \let\defaultListoftodos\listoftodos
    \renewcommand{\listoftodos}{%
        \defaultListoftodos
    }

   \ifdocumentUsedTodos
        \listoftodos
    \fi
\fi

%%%% hyperref %%%%%%%%
%% special: hyperref needs to be loaded last! (exception hycap)
%% purpose: make internal and external links working and colored
\usepackage[pdftex,colorlinks=true,
                        linkcolor=LinkInternal,
                        anchorcolor=LinkAnchor,
                        citecolor=LinkBibliography,
                        filecolor=LinkExternal,
                        urlcolor=LinkExternal,
                        hyperindex,linktoc=section,pdfstartview=FitV,
                        pdfpagelabels,
bookmarks=true,bookmarksopen=true,bookmarksopenlevel=1,bookmarksnumbered=true]{hyperref}%
\usepackage[
open,
openlevel=1,
numbered=true
]{bookmark}
\AfterEndPreamble{\def\subsectionautorefname{\sectionautorefname}}
\AfterEndPreamble{\def\subsubsectionautorefname{\sectionautorefname}}
% change url font type to "inherit"
\renewcommand\UrlFont{\color{LinkExternal}}
%%%%%%%%%%%%%%%%%%%%%%

%%%% hycap %%%%%%%%%%%
%% special: directly AFTER hyperref: 
%% purpose: links to figures and tables should link to top of figure and not to top of caption
%%                  (which is below figure, so figure wouldn't show but only caption); no other change necessary
\usepackage[all]{hypcap}
%%%% glossary %%%%%%%%%
% for glossary and acronyms; instead of package acronym
% special: glossary after hyperref
% special:\AtEndDocument{\printglossary} before usepackage to suppress warning of missing printglossary
\AtEndDocument{%
    \printglossary%
}
\usepackage[acronym,nonumberlist,section=chapter,toc,nowarn]{glossaries}
\deftranslation[to=ngerman]{Acronyms}{Abkürzungsverzeichnis}
\deftranslation[to=ngerman]{Glossary}{Glossar}
\GlsSetQuote{+}
\makeglossaries
\newglossarystyle{myAcronymStyle}{%
% put the glossary in the itemize environment:
\renewenvironment{theglossary}{\begin{description}[leftmargin=2.5cm,style=sameline]}{\end{description}}%
% have nothing after \begin{theglossary}:
\renewcommand*{\glossaryheader}{}%
% have nothing between glossary groups:
\renewcommand*{\glsgroupheading}[1]{}%
\renewcommand*{\glsgroupskip}{}%
% set how each entry should appear:
\renewcommand*{\glossaryentryfield}[5]{%
\item[\glstarget{##1}{##2}]{##3}
}%
% set how sub-entries appear:
\renewcommand*{\glossarysubentryfield}[6]{%
\glossaryentryfield{##2}{##3}{##4}{##5}{##6}}%
}


\newcommand{\figref}[1]{\autoref{fig:#1}}
\newcommand{\eng}[1]{engl.: \emph{\english{#1}}}
\newcommand{\entode}[1]{engl. für \emph{\english{#1}}}
\newcommand{\english}[1]{\foreignlanguage{british}{#1}}
\newcommand{\good}[1]{\textcolor{Good}{#1}}
\newcommand{\bad}[1]{\textcolor{Bad}{#1}}
\providecommand{\ctanlink}[1]{\href{http://www.ctan.org/pkg/#1}{#1}}
\usepackage{udesoftec-bibcommon}
\iffallBackToBibtex
    \usepackage{udesoftec-bst}
\else
    \usepackage{udesoftec-biblatex}    
    \AtEndDocument{%
        \printbibliography[heading=udesoftec]%
    }
\fi

% conflict with texlive2016?
%\usepackage[listings]{scrhack}
\usepackage{listings}
\lstset{%
frame=single,%
basicstyle=\scriptsize,%
breaklines=true,%
backgroundcolor=\color{DocumentBright0},%
rulecolor=\color{DocumentMedium0},%
keywordstyle=\color{DocumentDark1},
stringstyle=\color{DocumentDark2},
commentstyle=\color{DocumentMedium0},
}
%add support for german utf-8 umlauts:
% source: http://stackoverflow.com/questions/1116266/listings-in-latex-with-utf-8-or-at-least-german-umlauts
\lstset{
  literate={ö}{{\"o}}1
           {ä}{{\"a}}1
           {ü}{{\"u}}1
           {Ä}{{\"A}}1
           {Ö}{{\"O}}1
           {Ü}{{\"U}}1
           {ß}{{\ss}}1
}
%default design
\lstset{%
    frame=single,%
    basicstyle=\fontfamily{\ttdefault}\tiny,%
    breaklines=true,%
    backgroundcolor=\color{DocumentBright0},%
    rulecolor=\color{DocumentMedium0},% 
    keywordstyle=\color{DocumentDark1},
    stringstyle=\color{DocumentDark2},
    commentstyle=\color{DocumentMedium0},
    framesep=\udesoftec@outerboxmargin,
    rulesep=0ex,
    numberbychapter=true,
    captionpos=b,
}
\lstnewenvironment{lstlistinglatex}[1][]{%
    \lstset{
        language={[LaTeX]TeX},
        breaklines=true,
        moretexcs={\citeauthor,\autoref,\includegraphics,\citet,\citetext,\citealp,\inlinetodo,\todo,\entitle,\authorbox,\city,\typeofdoc,\semester,\confidSource,\confidentialitySource,\academicfield,\institution,\abstract,\abstractEn,\printacronyms},
        morekeywords={figure,document,itemize,enumerate,description,final,omit-todos,tabularx},
        emph={style,leftmargin},
        texcsstyle=*\color{DocumentDark1},
        keywordstyle=\color{DocumentDark3}\textbf,
        emphstyle=\color{DocumentDark4},
    }
    \lstset{#1} %allow options for new listing
}{}
% BibTeX definition from
% http://tex.stackexchange.com/questions/85998/include-bibtex-contents-in-a-listings-block
\lstdefinelanguage{BibTeX}
  {keywords={%
      @article,@book,@collectedbook,@conference,@electronic,@ieeetranbstctl,%
      @inbook,@incollectedbook,@incollection,@injournal,@inproceedings,%
      @manual,@mastersthesis,@misc,@patent,@periodical,@phdthesis,@preamble,%
      @proceedings,@standard,@string,@techreport,@unpublished,@techstandard%
      },
   comment=[l][\itshape]{@comment},
   sensitive=false,
  }
\lstnewenvironment{lstlistingbibtex}[1][]{%
    \lstset{
        language={BibTeX},
        breaklines=true,
        emph={style,leftmargin},
        texcsstyle=*\color{DocumentDark1},
        keywordstyle=\color{DocumentDark3}\textbf,
        emphstyle=\color{DocumentDark4},
    }
    \lstset{#1} %allow options for new listing
}{}
\def\lstinlinelatex{\lstinline[%
language={[LaTeX]TeX},
        breaklines=true,
        moretexcs={\citeauthor,\autoref,\includegraphics,\citet,\citetext,\citealp,\inlinetodo,\todo,\entitle,\authorbox,\city,\typeofdoc,\semester,\confidentialitySource,\academicfield,\institution,\abstract,\abstractEn,\printacronyms},
        morekeywords={figure,document,description,itemize,enumerate,final,omit-todos,tabularx},
        texcsstyle=*\color{DocumentDark1},
        keywordstyle=\color{DocumentDark3}\textbf,
]}
% make list of x conditional due to their usage
% http://tex.stackexchange.com/questions/33193/how-to-determine-whether-a-list-of-figures-is-empty
\AtEndEnvironment{figure}{\gdef\udesoftec@usedlistofitems@figure{}}%
\AtEndDocument{\ifdefined\udesoftec@usedlistofitems@figure\label{udesoftec:needslof}\fi}% 
\newcommand{\udesofteclistoffigures}{\@ifundefined{r@udesoftec:needslof}{}{\cleardoublepage\listoffigures}}%

\AtEndEnvironment{lstlisting}{\gdef\udesoftec@usedlistofitems@listing{}}%
\AtEndEnvironment{lstlisting-latex}{\gdef\udesoftec@usedlistofitems@listing{}}%
\AtEndDocument{\ifdefined\udesoftec@usedlistofitems@listing\label{udesoftec:needslol}\fi}% 
\newcommand{\udesofteclstlistoflistings}{\@ifundefined{r@udesoftec:needslol}{}{\cleardoublepage\lstlistoflistings}}%
              
\AtEndEnvironment{table}{\gdef\udesoftec@usedlistofitems@table{}}%\AtBeginDocument{\ifdefined\udesoftec@usedlistofitems@table\label{udesoftec:needslot}\fi}% 
\AtEndDocument{\ifdefined\udesoftec@usedlistofitems@table\label{udesoftec:needslot}\fi}% 
\newcommand{\udesofteclistoftables}{\@ifundefined{r@udesoftec:needslot}{}{\cleardoublepage\listoftables}}%


\newcommand{\acr}[1]{\gls{#1}\gdef\udesoftec@usedlistofitems@acronyms{}}
\AtEndDocument{\ifdefined\udesoftec@usedlistofitems@acronyms\label{udesoftec:needsloa}\fi}% 

\providecaptionname{ngerman}{\udesoftecAcronymsTitle}{Abkürzungsverzeichnis}%
\providecaptionname{english}{\udesoftecAcronymsTitle}{Acronyms}%
\providecaptionname{british}{\udesoftecAcronymsTitle}{Acronyms}%
\newcommand{\udesoftecprintacronyms}{\@ifundefined{r@udesoftec:needsloa}{}{\printacronyms[style=myAcronymStyle,title=\udesoftecAcronymsTitle]}}%

\AfterEndPreamble{
    \udesoftecoverride%
    \pagenumbering{alph}    % title page is "a" - internal trick to prevent two pages with same name
    \hypertarget{titlepage}{}\pdfbookmark[-1]{\@title}{titlepage} %
    %
    \maketitle%
    \pagenumbering{Roman}   % I,II,III,IV... - all pre-content pages are roman upper
    \ifdocumentOmitCC\else\confidentialityclause\fi%
    \ifdocumentOmitA\else\printabstract\fi%
    \ifdocumentOmitTOC\else%
        \cleardoublepage\hypertarget{tocpage}{}\pdfbookmark{\contentsname}{topage}%
        \tableofcontents%
    \fi%
    \ifdocumentOmitLOF\else\udesofteclistoffigures\fi%
    \ifdocumentOmitLOT\else\udesofteclistoftables\fi%
    \ifdocumentOmitLOL\else\udesofteclstlistoflistings\fi%
    \ifdocumentOmitLOA\else\udesoftecprintacronyms\fi%           
    \newlength{\imagewidth}\setlength\imagewidth\linewidth%
    \mainmatter
}


 

\AtEndDocument{
    \ifdocumentOmitSD\else\statutorydeclaration\fi
}