-
Notifications
You must be signed in to change notification settings - Fork 18
/
swathesis.cls
141 lines (110 loc) · 3.21 KB
/
swathesis.cls
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
%%
%%
%%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{swathesis}[2014/05/28 v0.5
^^J LaTeX document class for theses at the SWA Group]
% Options.
%
% Language
% en - english (default)
% de - german
%
% Modes
% draft - drafting mode, esp for todos
% fulldraft - drafting mode, also for listings/graphics, faster
% final - final mode
%
% Thesis
% master
% bachelor
% phd
%
% Fonts
% lmodern - Latin Modern, like TeX default (default)
% palatino - Heavier, slightly more readable
% garamond - Lighter than palatino, heavier than latin modern, more readable.
%
% Other
% print - do not color links
%
\RequirePackage{etoolbox}
\newif\if@swa@german
\newif\if@swa@lncs
\providecommand*\@swa@font{}
\providecommand*\printmode{false}
\providecommand*\swa@miscoptions{}
%
\DeclareOption{bachelor}{\@swa@lncstrue\gdef\swa@degree{bachelor}}
\DeclareOption{master}{\@swa@lncsfalse\gdef\swa@degree{master}}
\DeclareOption{phd}{\@swa@lncsfalse\gdef\swa@degree{phd}}
\DeclareOption{draft}{%
\PassOptionsToPackage{final}{graphics}
\PassOptionsToPackage{final}{listings}
\gappto\swa@miscoptions{draft,}}
\DeclareOption{fulldraft}{\gappto\swa@miscoptions{draft,}}
\DeclareOption{en}{\@swa@germanfalse}
\DeclareOption{de}{\@swa@germantrue}
\DeclareOption{palatino}{\renewcommand*\@swa@font{palatino}}
\DeclareOption{garamond}{\renewcommand*\@swa@font{garamond}}
\DeclareOption{lmodern}{\renewcommand*\@swa@font{lmodern}}
\DeclareOption{print}{\renewcommand*\printmode{true}}
\DeclareOption{printmode}{\renewcommand*\printmode{true}}
\DeclareOption{online}{\renewcommand*\printmode{false}}
\DeclareOption*{\gappto\swa@miscoptions{\CurrentOption,}}
\ExecuteOptions{master,en,palatino}
\ProcessOptions\relax
\RequirePackage{expl3}
\RequirePackage{swa-platform}
\newcommand*\location[1]{\renewcommand\@location{#1}}
\providecommand*\@location{}
\ifboolexpr{bool{@swa@lncs}}{%
\gdef\swa@cls{llncs}%
\gappto\swa@miscoptions{a4paper,runningheads,}
}{%
\gdef\swa@cls{scrbook}%
% \gappto\swa@miscoptions{DIV=8,}
}
\ifx\swa@miscoptions\empty\relax\else
\PassOptionsToClass{\swa@miscoptions}{\swa@cls}
\fi
\LoadClass{\swa@cls}
\RequirePackage{swa-language}
\RequirePackage{swa-document}
\RequirePackage{swa-graphics}
\RequirePackage{swa-listings}
\RequirePackage{swa-font}
\ifboolexpr{bool{@swa@lncs}}{
\robustify{\email}
}{%
% only in the koma case
\RequirePackage{swa-abstract}
\RequirePackage{swa-bibliography}
}
\ifthenelse{\equal{\swa@degree}{phd}}{
\PassOptionsToPackage{shortcuts,nopostdot,nonumberlist,nosuper,acronym,xindy}{glossaries}
\AfterPackage*{glossaries}{\setacronymstyle{long-sc-short}}
\BeforeBeginEnvironment{document}{%
% so as to be loaded after hyperref
\RequirePackage{glossaries}
}
\AtEndPreamble{\makeglossaries}
\AtEndDocument{\glsaddallunused}
}{
\RequirePackage{swa-acronyms}
}
\RequirePackage{swa-statement}
\newcommand\hairspace{\ifmmode\mskip1mu\else\kern0.08em\fi}
\RequirePackage{xspace}
%\recalctypearea
\raggedbottom
\BeforeBeginEnvironment{document}{%
\InputIfFileExists {\jobname-names.tex}{
\ClassInfo{swathesis}{Using names-file `\jobname-names.tex'}
}{
\ClassInfo{swathesis}{Not using a names-file.}
}
}
%%% Local Variables:
%%% mode: latex
%%% End: