-
Notifications
You must be signed in to change notification settings - Fork 0
/
otagothesis.sty
executable file
·410 lines (366 loc) · 10 KB
/
otagothesis.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
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
%%
%% This is the package ``otagothesis''. Read the file
%% otagothesis.README for information regarding options and usage.
%%
\ifx\ProvidesPackage\undefined
\def\ProvidesPackage#1[#2 #3 #4]{%
\wlog{LaTeX Package `#1' #3 <#2> #4}}
\fi
\ProvidesPackage{otagothesis}
[1998/02/03 v0.99 Otago's A4 based page layout]
\ifx\documentclass\undefined
\else
\DeclareOption{widemargins}{\WideMargins}
\DeclareOption{phd}{\PhD}
\DeclareOption{msc}{\MSc}
\DeclareOption{ma}{\MA}
\DeclareOption{mcom}{\MCom}
\DeclareOption{interimsci}{\IS}
\DeclareOption{interimarts}{\IA}
\DeclareOption{interimcom}{\IC}
\DeclareOption{dipsci}{\DS}
\DeclareOption{diparts}{\DA}
\DeclareOption{dipcom}{\DC}
\DeclareOption{bschons}{\BScHons}
\DeclareOption{bahons}{\BAHons}
\DeclareOption{bcomhons}{\BComHons}
\DeclareOption{notables}{\NoTables}
\DeclareOption{nofigures}{\NoFigures}
\DeclareOption{nolibrary}{\NoLibrary}
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% option processing stuff %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\PhD{%
%%PhD is the default: do nothing
}
\def\MSc{%
\renewcommand{\thesistype}{Master of }
\renewcommand{\faculty}{Science}
}
\def\MA{%
\renewcommand{\thesistype}{Master of }
\renewcommand{\faculty}{Arts}
}
\def\MCom{%
\renewcommand{\thesistype}{Master of }
\renewcommand{\faculty}{Commerce}
}
\def\IS{%
\renewcommand{\fulfilment}{submitted in partial fulfilment of the degree of}
\renewcommand{\thesistype}{Master of }
\renewcommand{\faculty}{Science}
}
\def\IA{%
\renewcommand{\fulfilment}{submitted in partial fulfilment of the degree of}
\renewcommand{\thesistype}{Master of }
\renewcommand{\faculty}{Arts}
}
\def\IC{%
\renewcommand{\fulfilment}{submitted in partial fulfilment of the degree of}
\renewcommand{\thesistype}{Master of }
\renewcommand{\faculty}{Commerce}
}
\def\DS{%
\renewcommand{\fulfilment}{submitted in partial fulfilment of the}
\renewcommand{\thesistype}{Postgraduate Diploma in }
\renewcommand{\faculty}{Science}
}
\def\DA{%
\renewcommand{\fulfilment}{submitted in partial fulfilment of the}
\renewcommand{\thesistype}{Postgraduate Diploma in }
\renewcommand{\faculty}{Arts}
}
\def\DC{%
\renewcommand{\fulfilment}{submitted in partial fulfilment of the}
\renewcommand{\thesistype}{Postgraduate Diploma in }
\renewcommand{\faculty}{Commerce}
}
\def\BScHons{%
\renewcommand{\fulfilment}{submitted in partial fulfilment of the degree of}
\renewcommand{\thesistype}{Bachelor of }
\renewcommand{\faculty}{Science, with Honours}
}
\def\BAHons{%
\renewcommand{\fulfilment}{submitted in partial fulfilment of the degree of}
\renewcommand{\thesistype}{Bachelor of }
\renewcommand{\faculty}{Arts, with Honours}
}
\def\BComHons{%
\renewcommand{\fulfilment}{submitted in partial fulfilment of the degree of}
\renewcommand{\thesistype}{Bachelor of }
\renewcommand{\faculty}{Commerce, with Honours}
}
\def\NoTables{%
\newif\if@notables \@notablestrue
}
\def\NoFigures{%
\newif\if@nofigures \@nofigurestrue
}
\def\NoLibrary{%
\newif\if@nolibrary \@nolibrarytrue
}
%% Define widemargins option for margin notes
\def\WideMargins{%
\newdimen\ExtraWidth
\ifcase \@ptsize
\ExtraWidth = 0.5in
\@widemargins
\or
\ExtraWidth = 0.5in
\@widemargins
\or
\ExtraWidth = 0.7in
\@widemargins
\fi\let\WideMargins\relax\let\@widemargins\relax}
{\def\do{\noexpand\do\noexpand}
\xdef\@preamblecmds{\@preamblecmds \do\WideMargins}
}
\def\@widemargins{%
\global\advance\textwidth by -\ExtraWidth
\global\advance\marginparwidth by \ExtraWidth
\if@twoside
\tw@sidedwidemargins
\else
\@nesidedwidemargins
\fi}
\def\tw@sidedwidemargins{%
\if@reversemargin
\@tempdima=\evensidemargin
\advance\@tempdima by -\oddsidemargin
\advance\oddsidemargin by \ExtraWidth
\advance\oddsidemargin by \@tempdima
\advance\evensidemargin by -\@tempdima
\else
\advance\evensidemargin by \ExtraWidth
\fi}
\def\@nesidedwidemargins{%
\if@reversemargin
\advance\oddsidemargin by \ExtraWidth
\advance\evensidemargin by \ExtraWidth
\fi}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Stuff to be done before option processing %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Default to PhD
%%
\newcommand{\fulfilment}{a thesis submitted for the degree of}
\newcommand{\thesistype}{Doctor of }
\newcommand{\faculty}{Philosophy}
%% default to having a list of tables or figures
\newif\if@notables \@notablesfalse
\newif\if@nofigures \@nofiguresfalse
%% default to having the library decleration form
\newif\if@nolibrary \@nolibraryfalse
%% We always use a4 paper
\paperheight 297mm
\paperwidth 210mm
%% Shift default TeX reference point to top LH corner
\hoffset -1in
\voffset -1in
%% Set top margin to 1.5cm
\topmargin 15.0mm
%% If we use running headers, restrict them to one line of text.
\headheight 12pt
%% Use no more than a double line between header and body.
\headsep 25pt
%% Now set height of text body according to point-size
\ifcase \@ptsize
\textheight 53\baselineskip
\or
\textheight 48\baselineskip
\or
\textheight 45\baselineskip
\fi
\advance\textheight by \topskip
%% we must always have 30mm binding margin
\textwidth 155.0mm
\marginparwidth 0.0mm
\if@twoside
\oddsidemargin 30.0mm
\evensidemargin 25.0mm
\else
\oddsidemargin 30.0mm
\evensidemargin 30.0mm
\fi
%% some stuff for the splash page
\def\dob#1{\gdef\@dob{#1}}
\def\@dob{\@latex@error{No \noexpand\dob (date-of-birth) given}\@ehc}
\def\address#1{\gdef\@address{#1}}
\def\@address{\@latex@error{No \noexpand\address given}\@ehc}
\def\department#1{\gdef\@department{#1}}
\def\@department{\@latex@error{No \noexpand\department given}\@ehc}
\def\fullname#1{\gdef\@fullname{#1}}
\def\@fullname{\@latex@error{No \noexpand\fullname given}\@ehc}
%% Now that we've done all the hard stuff, run the Options code.
\ifx\documentclass\undefined
\else
\ProcessOptions
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Stuff to be done after option processing %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% We need to specify the titlepage exactly
%%
\renewcommand{\maketitle}{%
\begin{titlepage}
\begin{center}
\vspace*{35mm}
\parbox{100mm}{
\center
\linespread{1.5}\LARGE \@title \par
\vspace{10mm}
\large \@author \par
}
\vfill
\linespread{1.5}\normalsize
\fulfilment \large \par
\thesistype \faculty \par
\normalsize at the University of Otago, Dunedin, \par
New Zealand. \par
\bigskip
\@date
\end{center}
\end{titlepage}
\cleardoublepage
}
%%
%% We need a really simple ``Abstract'' environment
%%
\renewenvironment{abstract}{%
\vspace*{45mm} \begin{center} {\bf \abstractname}
\end{center} \begin{quote} \linespread{1.3} \normalsize \par}
{\end{quote} \linespread{1}}
%%
%% And a nice simple ``Acknowledgements'' environment
%%
\newcommand{\ackname}{Acknowledgements}
\newenvironment{acknowledgements}{%
\vspace*{45mm} \begin{center} {\bf \ackname}
\end{center} \begin{quote} \linespread{1.3} \normalsize}
{\end{quote} \linespread{1}}
%%
%% We want ``References'', not ``Bibliography''
%%
\renewcommand{\bibname}{References}
%%
%% We need to redefine thebibliography so as to include
%% it in the contentspage. Otherwise it is exactly as in report.cls
%%
\def\bibliography#1{%
\if@filesw
\immediate\write\@auxout{\string\bibdata{#1}}%
\fi
\addcontentsline{toc}{chapter}{\numberline{}\bibname}%
\@input@{\jobname.bbl}%
}%
\long\def\@makecaption#1#2{%
\vskip\abovecaptionskip
\sbox\@tempboxa{#1: #2}%
\ifdim \wd\@tempboxa > 0.8\hsize
\leftskip = 0.1\hsize
\rightskip = 0.1\hsize
#1: #2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
%%
%% \frontstuff is here to put in the titlepage, list of figures, etc.
%%
\newcommand{\frontstuff}{%
\if@nolibrary
%% do nothing
\else
{\parindent 0pt
\pagestyle{empty}
\begin{center} {\bf Library Declaration Form} \\
\IfFileExists{logo.pdf}{%
\includegraphics[height=2cm]{logo.pdf} \\
}{}
University of Otago Library
\end{center}
\vfill
\begin{tabbing}
\noindent Author's full name and year of birth: \= \kill\\
\noindent Author's full name and year of birth: \@fullname,\\
\hspace*{1cm} (for cataloguing purposes)\>\@dob\\
\end{tabbing}
\vfill
Title of thesis: \@title \\
\vfill
Degree: \thesistype \faculty \\
\vfill
Department: \@department \\
\vfill
Permanent Address: \@address \\
\vfill
I agree that this thesis may be consulted for research and study purposes
and that reasonable quotation may be made from it, provided that proper
acknowledgement of its use is made.\\
\vfill
I consent to this thesis being copied in part or in whole for
\begin{list}{\roman{enumi})}{\usecounter{enumi}}
\item a library
\item an individual
\end{list}
at the discretion of the University of Otago.\\
\vfill
\hspace*{5cm}Signature:\\
\vfill
\hspace*{5cm}Date:
\cleardoublepage
}
\fi
\pagenumbering{roman}
\pagestyle{plain}
\maketitle
\if@twoside
\setcounter{page}{3}
\else
\setcounter{page}{2}
\fi
\IfFileExists{abstract.tex}{%
\begin{abstract}
\input{abstract}
\end{abstract}
}{}
\cleardoublepage
\IfFileExists{acknowledgements.tex}{%
\begin{acknowledgements}
\input{acknowledgements}
\end{acknowledgements}
}{}
\tableofcontents
\if@notables
%% do nothing
\else
\listoftables
\fi
\if@nofigures
%% do nothing
\else
\listoffigures
\fi
\IfFileExists{glossary.tex}{%
%\cleardoublepage
%\addcontentsline{toc}{section}{Glossary}
%\printglossary[style=super]
% Need to set line spacing to single space, otherwise it inserts a blank page for an unknown reason:
%\singlespacing
%\clearpage
%\addcontentsline{toc}{section}{Acronyms}
\printglossary[type=\acronymtype,style=super,title={Abbreviations}]
%\clearpage
% Reset the spacing to 1.5:
%\onehalfspacing
}{}
\cleardoublepage
\pagenumbering{arabic}
\setcounter{page}{1}
}
%%
%% End of file `otagothesis.sty'.