blob: 29629db352c90ebc7fb66b412d57a70285005a5b (
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
|
% University of Auckland thesis class
%
% aucklandthesis.cls
%
% built on memoir.cls by Peter Wilson, Lars Madsen
%
% Written for broader applicability
% across disciplines by
% Alistair Kwan
% Centre for Learning & Research in Higher Education
% University of Auckland
%
% Version of 2016-06-11
%
% Accommodates theses for the PhD and some other degrees.
%
% This class does not intervene much — font and
% chapter heading customisation are left for
% user to determine, as is the choice to compile
% using XeLaTeX or LuaTeX.
%
% Incorporates code snippets from the Memoir class manual.
%
% This file may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, either version 1.2 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.2 or later is part of all distributions of LaTeX version
% 1999/12/01 or later.
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{aucklandthesis}
[2016/06/11 University of Auckland thesis class]
\newif\ifUa@examcp
\newif\ifUa@singlesp
\newif\ifUa@onehalfsp
\newif\ifUa@doublesp
\newif\ifUa@partialfulfilment
\newif\ifUa@subtitle
\Ua@examcpfalse
\Ua@onehalfspfalse
\Ua@doublespfalse
\Ua@partialfulfilmentfalse
\Ua@subtitlefalse
\DeclareOption{doublespace}{\Ua@doublesptrue}
\DeclareOption{singlespace}{\Ua@singlesptrue}
\DeclareOption{onehalfspace}{\Ua@onehalfsptrue}
\DeclareOption{examcopy}{\Ua@examcptrue}
\DeclareOption{partial}{\Ua@partialfulfilmenttrue}
%\DeclareOption{draft} option already exists
%\DeclareOption{twoside}{\PassOptionsToPackage{twoside}{geometry}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{memoir}}
%\ExecuteOptions{oneside}
\ProcessOptions\relax
\LoadClass{memoir}
% Set page dimensions
\setlrmarginsandblock{4cm}{4cm}{*}
\setulmarginsandblock{3cm}{4cm}{*}
\setheadfoot{\baselineskip}{3\baselineskip}
\setheaderspaces{*}{2\baselineskip}{*}
\setmarginnotes{3mm}{3cm}{6pt}
\checkandfixthelayout
\fixpdflayout
% Typeface: leave the author to choose
\midsloppy % author can override with fussy or sloppy
\sloppybottom % for fewer widows and orphans
% Constrain excessive subdivisional numberings
\setsecnumdepth{subsubsection}
% Title page
\def\@title{}
\def\@subtitle{\relax}
\def\subtitle#1{
\gdef\@subtitle{#1}
\sbox0{#1}%
\ifdim\wd0=0pt %
\Ua@subtitlefalse%
\else%
\Ua@subtitletrue%
\fi%
}
\def\@author{}
\def\degreesought#1{\gdef\@degreesought{#1}}
\def\@degreesought{\@latex@error{No \noexpand\degreesought given}\@ehc}
\def\degreediscipline#1{\gdef\@degreediscipline{#1}}
\def\@degreediscipline{\@latex@error{No \noexpand\degreediscipline given}\@ehc}
\def\degreecompletionyear#1{\gdef\@degreecompletionyear{#1}}
\def\@degreecompletionyear{\@latex@error{No \noexpand\degreecompletionyear given}\@ehc}
\renewcommand{\maketitle}{
\cleardoublepage
\thispagestyle{empty}
\enlargethispage{1cm}
\setcounter{page}{1}
\noindent\hrulefill
\noindent\begin{minipage}[t][0.3\textheight][t]{\textwidth}
\vspace*{\fill}
\begin{center}
\Huge \@title \par
\ifUa@subtitle
\huge \vspace{0.5\baselineskip} \@subtitle \par
\else \relax
\fi
\end{center}
\vspace*{\fill}
\end{minipage}
\vfill
\noindent\begin{minipage}[t][0.3\textheight][t]{\textwidth}
\vspace*{\fill}
\begin{center}
\large
\@author
\end{center}
\vspace*{\fill}
\end{minipage}
\vfill
\noindent\begin{minipage}[t][0.3\textheight][t]{\textwidth}
\vspace*{\fill}
\begin{center}
\normalfont
A thesis submitted in
\ifUa@partialfulfilment
partial
\fi
fulfilment of the requirements for the degree of
\@degreesought\
in
\@degreediscipline,
The University of Auckland,
\@degreecompletionyear.
\ifUa@examcp
\bigskip
\textbf{This thesis is for examination purposes only,}
\textbf{and is confidential to the examination process.}
\fi
\end{center}
\vspace*{\fill}
\end{minipage}
\noindent\hrulefill
\clearpage
\killtitle
\mainmatter
}
% Command for dedication page
\newcommand\thesisdedication[1]{
\cleardoublepage
\thispagestyle{plain}
\vspace*{\fill}
\begin{center}
#1
\end{center}
\vspace*{\fill}
\vspace*{\fill}
}
% line spacing
\renewcommand\mainmatter{
\ifUa@doublesp
\DoubleSpacing%
\else\ifUa@singlesp
\SingleSpacing%
\else
\OnehalfSpacing
\fi%
\fi
}
\renewcommand\backmatter{
\clearpage
\setcounter{page}{0}
}
\frenchspacing
\nouppercaseheads
\createmark{chapter}{both}{nonumber}{}{}
\createmark{section}{right}{nonumber}{}{}
% Pagestyle: Forder
\copypagestyle{Forder}{myheadings}
\makerunningwidth{Forder}{1.2\textwidth}
\makeheadposition{Forder}{flushright}{flushleft}{}{}
\makeoddhead{Forder}{}{}{\itshape{\rightmark}\makebox[0.2\textwidth]{\quad\normalfont\thepage\hfill}}
\makeevenhead{Forder}{\makebox[0.2\textwidth]{\hfill\thepage\quad}\emph{\leftmark}}{}{}
\makepsmarks{Forder}{
\nouppercaseheads
\createmark{chapter}{both}{nonumber}{}{}
\createmark{section}{right}{nonumber}{}{}
}
% Chapter style: Forder
\makechapterstyle{Forder}{%
\renewcommand\chaptername{chapter}
\def\chapterheadstart{\vspace*{\beforechapskip}}
\def\printchaptername{\SingleSpacing\center\chapnamefont --- \@chapapp}
\def\chapternamenum{\space}
\def\printchapternum{\chapnumfont \NumToName{\value{chapter}}}
\def\printchapternum{\chapnumfont \roman{chapter} ---}
\def\afterchapternum{\par\nobreak\vskip\midchapskip}
\def\printchapternonum{}
\def\printchaptertitle##1{\begin{center}\SingleSpace\chaptitlefont ##1\end{center}}
\def\afterchaptertitle{\par\nobreak\vskip \afterchapskip}
\renewcommand*{\chapnamefont}{\normalfont\Large\scshape}
\renewcommand*{\chapnumfont}{\chapnamefont}
\renewcommand*{\chaptitlefont}{\normalfont\Huge\scshape\MakeLowercase}
\setlength{\beforechapskip}{50pt}
\setlength{\midchapskip}{20pt}
\setlength{\afterchapskip}{60pt}
%
\setsecnumdepth{section}
\renewcommand*\thesection{\arabic{section}}
%
\setsechook{\hangsecnum}
\setaftersecskip{3pt}
\setsecheadstyle{\raggedright\Large\scshape}
\setbeforesecskip{-1.5\onelineskip}
\setaftersecskip{0.5\onelineskip}
%
\setsubsechook{\defaultsecnum}
\setsubsecheadstyle{\raggedright\large\bfseries}
\setbeforesubsecskip{-\onelineskip}
\setaftersubsecskip{0.5\onelineskip}
%
\setsubsubsecheadstyle{\raggedright\itshape}
\setbeforesubsubsecskip{-\onelineskip}
\setaftersubsubsecskip{0.5\onelineskip}
%
\pagestyle{Forder}
}
% Page style: Sewell
\copypagestyle{Sewell}{myheadings}
\makeoddhead{Sewell}{\itshape{\rightmark}}{}{\thepage}
\makeevenhead{Sewell}{\thepage}{}{\itshape{\thechapter. \leftmark}}
\makeheadrule{Sewell}{\textwidth}{0.5pt}
\makepsmarks{Sewell}{
\nouppercaseheads
\createmark{chapter}{both}{nonumber}{}{}
\createmark{section}{right}{nonumber}{}{}
}
% Chapter style: Sewell
\makechapterstyle{Sewell}{%
\renewcommand\chaptername{Chapter}
\def\chapterheadstart{\vspace*{\beforechapskip}}
\def\printchaptername{\SingleSpacing\flushright \chapnamefont \@chapapp}
\def\chapternamenum{\space}
\def\printchapternum{\chapnumfont\numtoName{\value{chapter}}}
\def\afterchapternum{\par\nobreak \hrulefill\par\vskip\midchapskip}
\def\printchapternonum{}
\def\printchaptertitle##1{\SingleSpacing\raggedright\chaptitlefont ##1}
\def\afterchaptertitle{\par\nobreak\vskip \afterchapskip}
\renewcommand*{\chapnamefont}{\normalfont\Large\scshape}
\renewcommand*{\chapnumfont}{\chapnamefont}
\renewcommand*{\chaptitlefont}{\normalfont\Huge\itshape}
\setlength{\beforechapskip}{50pt}
\setlength{\midchapskip}{12pt}
\setlength{\afterchapskip}{60pt}
%
\setsecnumdepth{chapter}
%
\setsecheadstyle{\center\Large\scshape\MakeLowercase}
\setbeforesecskip{-1.5\onelineskip}
\setaftersecskip{0.5\onelineskip}
%
\setsubsecheadstyle{\center\large\bfseries}
\setbeforesubsecskip{-\onelineskip}
\setaftersubsecskip{0.01\onelineskip}
%
\setsubsubsecheadstyle{\center\itshape}
\setbeforesubsubsecskip{-\onelineskip}
\setaftersubsubsecskip{0.01\onelineskip}
%
\pagestyle{Sewell}
}
% uppercase chapter entries in ToC, hyperref-friendly
%\makeatletter
%\renewcommand*{\l@chapter}[2]{%
% \l@chapapp{\uppercase{#1}}{#2}{\cftchaptername}}
%\makeatother
\renewcommand\cftchapterfont{\scshape}
\setlength\cftsubsectionindent{6em}
\renewcommand\cftsubsectionfont{\itshape}
\AtBeginDocument{%
% Mark drafts in page footer
\ifdraftdoc
\makeevenfoot{plain}{\textit{Draft}}{\thepage}{\textit\today}
\makeoddfoot{plain}{\textit{Draft}}{\thepage}{\textit\today}
\makeevenfoot{myheadings}{\thepage}{\textit{Draft: \today}}{}
\makeoddfoot{myheadings}{}{\textit{Draft: \today}}{\thepage}
\nouppercaseheads
\createmark{chapter}{both}{nonumber}{}{}
\createmark{section}{right}{nonumber}{}{}
\fi
}
\endinput
|