-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKTHEEtitlepage.sty
More file actions
341 lines (323 loc) · 10.3 KB
/
KTHEEtitlepage.sty
File metadata and controls
341 lines (323 loc) · 10.3 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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
%******************************************************************************
%
% DESCRIPTION: Style file to add a title page for masters thesis,
% licentiate, doctoral thesis and internal reports
% according to the central KTH design, but with a EE
% logo.
%%
% OPTIONS:
% eng: English text in the logo
% sve/swe: Swedish text in the logo
% forPrint: Gives a titlepage in black and white
% (without any logo for the thesis formats)
% forWWW: Gives titlepage in color with logo, intended
% for web publishing.
% ireport: Internal report
% exjobb: master thesis report
% lic: licentiate thesis report
% doktor: PhD thesis report
%
% Default is exjobb, eng and forWWW.
%
% COMMANDS: \ititle{}, \isubtitle{}, idate{}, \irefnr{}, \iaddress{}
% and \makeititle.
%
% USAGE: \usepackage{KTHEEtitlepage},
% \usepackage[ireport,sve,forPrint]{KTHEEtitlepage}
% \begin{document}
% \ititle{My Title}
% \isubtitle{My Subtitle} % Optional
% \idate{March 2004}
% \irefnr{}
% \iaddress{} % Only for ireports!
% \makeititle
% ... % The rest of the document
%
% LIMITATIONS: Currently only supports A4 paper size in a reasonable way.
%
% AUTHORS: Elisabet Molin, Mats Bengtsson, S3, KTH
%
% DATE: 040921
%
% Updated: 060503 Support for ireport, lic and doktor /mabe
% 060807 Renamed to KTHEEtitlepage, added \submittedIEEE
% and \publishedIEEE /mabe
% 061006 Fixed problem if \subtitle wasn't set in
% ireport /mabe
% 061010 forPrint now gives B&W logo for ireport and
% the title page is now centered even if the
% remaining document isn't. Check if the babel
% package is used to select swedish. /mabe
%
%******************************************************************************
% Identification
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{KTHEEtitlepage}[2004/09/21 KTH EE titlepage package]
\ProvidesFile{here_the_logos}[2004/09/21 KTH logo English, BW]
\ProvidesFile{here_the_logos}[2004/09/21 KTH logo Swedish, BW]
\ProvidesFile{here_the_logos}[2004/09/21 KTH logo Swedish, colour]
\ProvidesFile{here_the_logos}[2004/09/21 KTH logo Swedish, colour]
% define new booleans for options
\newif\if@eng
\newif\if@sve
\newif\if@colour
\newif\if@ireport
\newif\if@exjobb
\newif\if@lic
\newif\if@doktor
% Default options:
\@engtrue
\@svefalse
\@colourtrue
\@exjobbtrue
% declare options
\DeclareOption{eng}{\@engtrue}
\DeclareOption{sve}{\@svetrue\@engfalse}
\DeclareOption{swe}{\@svetrue\@engfalse}
\DeclareOption{forWWW}{\@colourtrue}
\DeclareOption{forPrint}{\@colourfalse}
\DeclareOption{notitlepage}{\OptionNotUsed}
\DeclareOption{ireport}{\@ireporttrue\@exjobbfalse\@licfalse\@doktorfalse}
\DeclareOption{exjobb}{\@ireportfalse\@exjobbtrue\@licfalse\@doktorfalse}
\DeclareOption{lic}{\@ireportfalse\@exjobbfalse\@lictrue\@doktorfalse}
\DeclareOption{doktor}{\@ireportfalse\@exjobbfalse\@licfalse\@doktortrue}
\ProcessOptions\relax
% babel setting overrides the language set here!
\AtBeginDocument{\@ifpackageloaded{babel}{\iflanguage{swedish}{\@svetrue\@engfalse}{}}{}}
% automatic graphics switching
\RequirePackage{graphicx,color} % for inserting the logos and
% the background
\RequirePackage{calc} % for the layout calculations
\newcommand\@ititle{}
\newcommand\@isubtitle{}
\newcommand\@iauthor{}
\newcommand\@idate{}
\newcommand\@irefnr{}
\newcommand\@iaddress{}
\newcommand\@inotice{}
\newcommand{\ititle}[1]{%
\renewcommand\@ititle{#1}%
}
\newcommand{\isubtitle}[1]{%
\renewcommand\@isubtitle{#1}%
}
\newcommand{\iauthor}[1]{%
\renewcommand\@iauthor{#1}%
}
\newcommand{\idate}[1]{%
\renewcommand\@idate{#1}%
}
\newcommand{\irefnr}[1]{%
\renewcommand\@irefnr{#1}%
}
\newcommand{\iaddress}[1]{%
\renewcommand\@iaddress{#1}%
}
\newcommand{\submittedIEEE}[1]{\renewcommand{\@inotice}{
This work has been submitted to the IEEE for possible
publication. Copyright may be transferred without notice, after
which this version may no longer be accessible.}}
\newcommand{\publishedIEEE}[1]{\renewcommand{\@inotice}{
\copyright{} #1 IEEE. Personal use of this material is
permitted. However, permission to reprint/republish this material
for advertising or promotional purposes or for creating new
collective works for resale or redistribution to servers or lists,
or to reuse any copyrighted component of this work in other works
must be obtained from the IEEE.}}
\newcommand{\displayKTHlogo}{%
\if@eng
\if@colour
\includegraphics[width=32mm]{./figures/kth_cmyk_electr_engine}%
\else
\if@ireport
%% Black white
\includegraphics[width=32mm]{./figures/kth_svv_electr_engine}%
\else% No logotype
\mbox{}
\fi
\fi
\else\if@sve
\if@colour
\includegraphics[width=32mm]{kth_cmyk_elektro_systemtek}%
\else
\if@ireport
%% Black white
\includegraphics[width=32mm]{kth_svv_elektro_systemtek}%
\else% No logotype
\mbox{}
\fi
\fi
\fi\fi
}
% Page layout
%\geometry{left=25mm,right=66mm,top=30mm,bottom=28mm,marginparsep=12mm,includemp=false,noheadfoot}
\newlength{\titlep@getextwidth}
\setlength{\titlep@getextwidth}{12cm}
\newlength{\titlep@gewhitemargin}
\setlength{\titlep@gewhitemargin}{54mm}
\newlength{\titlep@geleftmargin}
\setlength{\titlep@geleftmargin}{27mm}
\newlength{\titlep@gemarginsep}
\setlength{\titlep@gemarginsep}{9mm}
\newlength{\titlep@getextheight}
\setlength{\titlep@getextheight}{240mm}
\newlength{\titlep@getopmargin}
\setlength{\titlep@getopmargin}{35mm}
\newlength{\tmpl@ngth}%
\def\makeititle{
\begingroup
\if@twocolumn
\onecolumn \m@keititle \twocolumn
\else \newpage
\global\@topnum\z@ \m@keititle \fi
\endgroup
\setcounter{footnote}{0}
\thispagestyle{empty}
\setcounter{page}{0} \newpage\pagecolor{white}
\if@twoside
\setcounter{page}{0}\thispagestyle{empty}\cleardoublepage
\fi
% \let\makeititle\relax
% \let\@makeititle\relax
% \gdef\@iauthor{}\gdef\@ititle{}
}
\newcommand{\m@keititle}{%
\if@ireport%
\m@keireportititle%
\else%
\m@kethesisititle%
\fi%
}
% this is the new style for the title page of ireports
\newcommand\m@keireportititle{%
% Move so the minipage of widht linewidth is centered.
% \paperwidth = 1in + \hoffset + "leftmargin" + "rightmargin"
\setlength{\tmpl@ngth}{.5\linewidth-.5\paperwidth+\hoffset+1in}%
\if@twoside%
\addtolength{\tmpl@ngth}{\evensidemargin}%
\else%
\addtolength{\tmpl@ngth}{\oddsidemargin}%
\fi%
\noindent\hspace*{-\tmpl@ngth}%
\makebox[0pt][l]{\begin{minipage}[t][\textheight]{\linewidth}%
\sffamily%
\begin{center}
\displayKTHlogo \vfill
\sffamily%
\fontsize{20}{25}\selectfont\@ititle\\[5mm]
\fontsize{10}{12}\selectfont\mbox{}\@isubtitle\\[5mm]
\textit{\@inotice}\vfill
\fontsize{14}{18}\selectfont\MakeUppercase{\@iauthor}
\vfill\vfill\vfill
\fontsize{14}{18}\selectfont%
Stockholm \@idate\\
\rule{\linewidth}{1pt}
\@iaddress\\[5mm]
\end{center}
\fontsize{14}{18}\selectfont%
\@irefnr
\end{minipage}}
}
% this is the new style for the title page of theses
\newcommand\m@kethesisititle{%
\if@colour%
\if@exjobb%
\pagecolor[cmyk]{0,0.02,0.15,0.02}%
\fi%
\if@lic%
\pagecolor[cmyk]{0,0,0,0.27}%
\fi%
\if@doktor%
\pagecolor[cmyk]{1,0.55,0,0}%
\fi%
\fi%
\def\thefootnote{\fnsymbol{footnote}}%
\def\@makefnmark{\hbox to 0pt{$^{\@thefnmark}$\hss}}%
%
% Move to the top of the page
\setlength{\tmpl@ngth}{-\voffset-\topmargin-\headheight-\headsep-1in-2\baselineskip}%
% \mbox{}\vskip\tmpl@ngth%
\vspace*{\tmpl@ngth}%
%
% Move to \titlep@geleftmargin from the left edge of the paper
\setlength{\tmpl@ngth}{\titlep@geleftmargin-\hoffset-1in}%
\if@twoside%
\addtolength{\tmpl@ngth}{-\evensidemargin}%
\else%
\addtolength{\tmpl@ngth}{-\oddsidemargin}%
\fi%
\noindent\mbox{}\hspace*{\tmpl@ngth}%
%
% Fool LaTeX into beleiving that the contents doesn't
% occupy any space
\raisebox{0pt}[0pt][0pt]{\rlap{\mbox{%
\if@exjobb\relax\else%
\color{white}%
\fi%
% The text
\begin{minipage}[t][296mm]{\titlep@getextwidth}%
\vspace*{\titlep@getopmargin}%
\sffamily%
\raggedleft%
\parbox[b][96mm]{\linewidth}{%
%\raggedleft\fontsize{20}{25}\selectfont\@ititle\vfill
\raggedleft\fontsize{20}{25}\selectfont\@ititle\\[2.5ex]
%
%\fontsize{10}{12}\selectfont\@isubtitle\vfill
\fontsize{12}{14}\selectfont\@isubtitle\vfill
}
{\fontsize{14}{18}\selectfont%
\rightline{\MakeUppercase{\@iauthor}}%
}%
\vfill%
\parbox[b][30mm]{\linewidth}{%
\raggedleft\fontsize{14}{18}\selectfont{}%
\if@eng%
\if@exjobb%
Master's Degree Project\\
Stockholm, Sweden \@idate
\fi
\if@lic
Licentiate Thesis\\
Stockholm, Sweden \@idate
\fi
\if@doktor
Doctoral Thesis\\
Stockholm, Sweden \@idate
\fi
\else\if@sve
\if@exjobb
Examensarbete\\
Stockholm, Sverige \@idate
\fi
\if@lic
Licentiatavhandling\\
Stockholm, Sverige \@idate
\fi
\if@doktor
Doktorsavhandling\\
Stockholm, Sverige \@idate
\fi
\fi\fi
}
%
\vskip1.5cm
{\fontsize{11}{14}\selectfont{}\@irefnr}
\vspace{28mm}
\end{minipage}%
\hspace{\titlep@gemarginsep}%
%
% The margin
%
\begin{minipage}[t]{\titlep@gewhitemargin}%
\raisebox{0pt}[0pt][0pt]{%
\setlength{\fboxsep}{0pt}%
% Add some extra height to avoid a yellow line at the bottom
\colorbox{white}{\parbox[t][310mm]{\linewidth}{%
\vspace*{120mm}
\centering\displayKTHlogo\\
\vfill}}}
\end{minipage}
}}
}
}