forked from ttencate/rugscriptie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrugscriptie.sty
181 lines (164 loc) · 5.26 KB
/
rugscriptie.sty
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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{rugscriptie}[2010/04/10 v1.0.3 Package for title pages in the style of the University of Groningen]
% For string comparisons.
\RequirePackage{ifthen}
% Set up fonts.
\RequirePackage[T1]{fontenc}
\font\georgia georgia
% We need this for the logo.
\RequirePackage{graphicx}
% Package option to not override \maketitle.
\DeclareOption{noredef}{\gdef\ifredef{\iffalse}}
\def\ifredef{\iftrue}
% End of options list.
\ProcessOptions
% Set up our language.
% `default' is used if no matching command for the current \languagename exists,
% and should be English (like the rest of LaTeX).
\newcommand\ruglanguage@default{
\gdef\@logolang{EN}
\providecommand\studentname{Student}
\providecommand\primarysupervisorname{Primary supervisor}
\providecommand\secondarysupervisorname{Secondary supervisor}
}
\newcommand\ruglanguage@dutch{
\gdef\@logolang{NL}
\providecommand\studentname{Student}
\providecommand\primarysupervisorname{Eerste begeleider}
\providecommand\secondarysupervisorname{Tweede begeleider}
}
% Command that sets the faculty, used for the logo.
% XXX Support creation of custom logos, built from the main RUG logo
% and boxes with Georgia text, separated by the RUG slash.
\newcommand\faculty[1]{
\@ifundefined{faculty#1}
{\PackageWarning{rugscriptie}{Undefined faculty #1; use for example \noexpand\faculty{fwn}}}
{\csname faculty#1\endcsname}}
% List of people involved. By default, only the author, who is the student who wrote the thesis.
\newcommand\personsep{: }
\newcommand\@person[2]{\if#1\@empty\else#1\personsep\fi#2\par}
\def\@people{
\def\and{\unskip, }
\@person{\studentname}{\@author}\par}
\newcommand\person[2]{
\g@addto@macro\@people{\@person{#1}{#2}}}
% Commands for extra metadata.
\newcommand\@thesistype{\PackageWarning{rugscriptie}{No \noexpand\thesistype given}}
\newcommand\thesistype[1]{\renewcommand\@thesistype{#1}}
\newcommand\supervisor[1]{
\person\primarysupervisorname{#1}
\renewcommand\supervisor{\secondarysupervisor}}
\newcommand\secondarysupervisor[1]{\person\secondarysupervisorname{#1}}
\newcommand\advisor{\supervisor}
\newcommand\secondaryadvisor{\secondarysupervisor}
% Faculty logos.
\newcommand\facultyfeb{\renewcommand\@logo{\@makelogo{FEB}}}
\newcommand\facultyfgg{\renewcommand\@logo{\@makelogo{FGG}}}
\newcommand\facultyfgmw{\renewcommand\@logo{\@makelogo{FGMW}}}
\newcommand\facultyfl{\renewcommand\@logo{\@makelogo{FL}}}
\newcommand\facultyfrg{\renewcommand\@logo{\@makelogo{FRG}}}
\newcommand\facultyfrw{\renewcommand\@logo{\@makelogo{FRW}}}
\newcommand\facultyfw{\renewcommand\@logo{\@makelogo{FW}}}
\newcommand\facultyfwn{\renewcommand\@logo{\@makelogo{FWN}}}
\newcommand\facultyumcg{\renewcommand\@logo{\@makelogo{UMCG}}}
\newcommand\@logo{}
\faculty{fwn}
% Ignore \thanks.
\ifredef
\renewcommand\thanks[1]{\PackageWarning{rugscriptie}{The \noexpand\thanks command is not supported; ignored}}
\fi
% Typesets a logo.
\newcommand\@makelogo[1]{\includegraphics[height=50pt]{ruglogos/RUGR_#1_logo\@logolang_zwart}}
% An minipage-like environment that, when opened at the top of a page, spans the entire page, without margins.
\newenvironment{paperpage}{%
\hsize\paperwidth
\textwidth\hsize
\columnwidth\hsize
\setbox\@tempboxa
\hbox to 0pt\bgroup
\vbox to 0pt\bgroup
\vbox to \paperheight\bgroup
}{%
\par\vfil
\egroup
\vss
\egroup
\hss
\egroup
\vfil
\vspace*{-1in}
\vspace*{-\voffset}
\vspace*{-\topmargin}
\vspace*{-\headheight}
\vspace*{-\headsep}
\vspace*{-\topskip}
\noindent
\hspace*{-1in}%
\hspace*{-\hoffset}%
\hspace*{-\oddsidemargin}%
\raise\topskip\box\@tempboxa
}
% titlepage-like environment that works both with standard LaTeX classes
% and the memoir class.
\@ifundefined{titlingpage}{
\newenvironment{@rugtitlepage}{\begin{titlepage}}{\end{titlepage}}
}{
\newenvironment{@rugtitlepage}{\begin{titlingpage}}{\end{titlingpage}}
}
% Definition of the format of the main title page.
\newcommand\rugmaketitle{
{
\@ifundefined{languagename}{
\def\rug@setlang{\ruglanguage@default}
}{
\def\rug@setlang{\csname ruglanguage@\languagename\endcsname}
}
\if\rug@setlang\relax
\def\rug@setlang{\ruglanguage@default}
\fi
\rug@setlang
\begin{@rugtitlepage}
\begin{paperpage}
\newskip\leftmargin \leftmargin 112pt
\newskip\rightmargin \rightmargin 61pt
\def\inner{
\advance\hsize -\leftmargin
\advance\hsize -\rightmargin
\raggedright}
\parindent=0pt
\fontfamily{georgia}\selectfont
\vskip 27pt
\vbox to 50pt{\hskip 40pt \@logo\par \vfil}
\vskip 90pt
\hskip \leftmargin \vbox{\fontsize{36pt}{48pt}\selectfont \inner \@title\par}
\vfill
\hskip \leftmargin \vbox{
\inner
{\fontsize{14pt}{24pt}\selectfont \@thesistype\par}
{\fontsize{12pt}{24pt}\selectfont
\@date\par
\@people}}
\vskip 99pt
\end{paperpage}
\end{@rugtitlepage}%
}
\setcounter{footnote}{0}%
\global\let\@title\@empty
\global\let\@thesistype\@empty
\global\let\@author\@empty
\global\let\@supervisor\@empty
\global\let\@date\@empty
\global\let\title\relax
\global\let\thesistype\relax
\global\let\author\relax
\global\let\supervisor\relax
\global\let\date\relax
\global\let\and\relax
\ifredef
\global\let\maketitle\relax
\fi
}
\ifredef
\let\maketitle\rugmaketitle
\let\rugmaketitle\relax
\fi