-
Notifications
You must be signed in to change notification settings - Fork 12
/
thesis.sty
546 lines (501 loc) · 18.5 KB
/
thesis.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
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
% wthesis.sty modified by M hadley from utthesis.sty Sept 96
% is used for all my comments and changes.
% more modifications made in December 1996
%!! modifications made in March 2009 to use setspace to control spacing and to be compatible with pdfLatex
% Modifications by Matthew Bradbury in 2018 to use new warwick branding and updated library deposit form
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
%%% File: utthesis.sty, version 2.0, January 1995
%%% =============================================
%%% Copyright (c) 1995 by Dinesh Das. All rights reserved.
%%% This file is free and can be modified or distributed as long as
%%% you meet the following conditions:
%%%
%%% (1) This copyright notice is kept intact on all modified
% wthesis.sty modified by M hadley from utthesis.sty Sept 96
% warwickthesis.sty modified by Matthew Bradbury from wthesis.sty
%! %! is used for all my comments and changes.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
%%% File: utthesis.sty, version 2.0, January 1995
%%% =============================================
%%% Copyright (c) 1995 by Dinesh Das. All rights reserved.
%%% This file is free and can be modified or distributed as long as
%%% you meet the following conditions:
%%%
%%% (1) This copyright notice is kept intact on all modified copies.
%%% (2) If you modify this file, you MUST NOT use the original file name.
%%%
%%% This file defines macros used for preparing theses for
%%% The University of Texas at Austin. It has been tested with LaTeX2e.
%%% I do NOT guarantee that it will meet all requirements of the
%%% Graduate School; however,
%! neither do I, but I am fairly confident because the university
%regulations are almost minimal.
%! if you find that something violates the
%! specifications, please send me email at <[email protected]>
%! I will try to fix it.
%%%
%%% Usage:
%%% ======
%%%
%%% To use this file with LaTeX2e, make sure your TEXINPUTS environment
%%% variable contains the directory in which this file is located.
%%% Include this file as a package in the preamble:
%%%
%%% \documentclass[...]{report}
%! \usepackage{wnewthesis}
%%%
%%% On non-UNIX systems, there might be different environment variables
%%% that might need to be set. I know nothing about such machines,
%%% however; consult your local guru for details.
%%%
%%% A template for a thesis is provided in the file
%! warwickthesis.tex, available
%%% from the same place where you obtained this file.
%%%
%%% Command Names:
%%% ==============
%%%
%%% ALL command names used in this file that are used to format the
%%% thesis begin with "thesis" (e.g., \thesisauthor). All of these
%%% commands can be changed by the user using \renewcommand, e.g.,
%%%
%%% \renewcommand{\thesisauthor}{First M. Last}
%%%
%%% after loading the package in LaTeX2e.
%%%
%%% The following is a list of all thesis-related variables used together
%%% with their default values:
%! some are not used by Univ Warwick but I have left them in anyway.
%%%
%%% \thesisauthor %% Name of the author; defaults to "Ima Student".
%! \thesisdepartmentname %! Department name; defaults to "mydepartemnt"
%%% \thesismonth %% Month of graduation; defaults to "May".
%%% \thesisyear %% Year of graduation; defaults to "1994".
%%% \thesistitle %% Full title of dissertation; defaults to "Title".
%%% \thesistitletypesize
%%% %% Typesize used to typeset \thesistitle; defaults
%%% %% to \Large.
%%% \thesissupervisor%% Name of thesis supervisor; defaults to "Supervisor"
%%% \thesistype %% Type of thesis; defaults to "Dissertation".
%%% \thesistypetypesize
%%% %% Typesize used to typeset \thesistype; defaults to
%%% %% \large.
%%% \thesisdegree %% Degree for which thesis is submitted; defaults to
%%% %% "Doctor of Philosophy".
%%% \thesisdegreetypesize
%%% %% Typesize used to typeset \thesisdegree; defaults to
%%% %% \large.
%%% \thesisdegreeabbreviation
%%% %% Abbreviation of \thesisdegree; defaults to "Ph.D.".
%! \thesissubmission %! The wording on the frontpage.
%! %! Defaults to:
%! Submitted to the University of Warwick\\
%! for the degree of
%!
%%% \thesisdeclarationhead
%%% %% Title of the declaration page; defaults to
%%% %% "Declaration".
%%% \thesisabstracthead
%%% %% Title of the abstract page; defaults to
%%% %% "Abstract".
%%% \thesisabbreviationhead
%%% %% Title of the abbreviations page; defaults to
%%% %% "Abbreviations".
%%% \thesisacknowledgmenthead
%%% %% Title of the acknowledgments page; defaults to
%%% %% "Acknowledgments".
%%% \thesisacknowledgmentheadtypesize
%%% %% Typesize used to typeset \thesisacknowledgmenthead;
%%% %% unused.
%%% Most of the default values will satisfy the Graduate School's
%%% requirements; however, at a minimum, the user SHOULD redefine the
%%% following commands:
%%%
%%% \thesisauthor
%! \thesisdepartmentname
%%% \thesismonth
%%% \thesisyear
%%% \thesistitle
%%%
%%% In addition to the above variables, the following commands are
%%% provided to generate the optional sections of the thesis:
%%%
%%% \thesiscopyrightpage
%%% %% Generates the copyright page.
%%% \thesistitlepage %% Generates the title page. %! ESSENTIAL
%%%
%%% There are also a few environments to generate paragraph-like text:
%%%
%%% thesisacknowledgments
%%% %% Text of acknowledgments.
%! thesisdeclaration
%! %! Text of declaration of original work: ESSENTIAL
%! thesisabbreviations
%! %! List of abbreviations
%%% thesisabstract %% Text of abstract. %! ESSENTIAL
%%%
%%% Bells and Whistles:
%%% ===================
%%%
%%% The following commands are provided purely for playing around with.
%%% They should be used in the document preamble (before \begin{document}).
%%%
%%% \thesisdraft %% Prints a timestamp at the top of each page. This
%%% %% must be invoked in the document preamble (before
%%% %% \begin{document}).
%%% \leftchapter, \centerchapter, \rightchapter
%%% %% These commands generate left-justified, centered,
%%% %% and right-justified chapter headings, respectively.
%! \singlespacing, \onehalfspacing, \doublespacing
%%% %% These define the line spacing to single-space,
%%% %% one-and-one-half space, and double-space
%%% %% respectively. Note that the minimum spacing
%%% %% required by the Graduate School is \oneandhalfspace,
%%% %% but \singlespace is useful, e.g., when using
%%% %% \thesisdraft.
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{thesis}[2022/03/24 Thesis]
\typeout{*************************************************************}
\typeout{** Thesis Style File Sept 2022 }
\typeout{*************************************************************}
%%%
%%% Set up page layout parameters.
%%%
\usepackage{geometry}
%%%
%%% Set up default values.
%%%
\newcommand{\universityname}{The University of \ldots}
\newcommand{\thesisdepartmentname}{mydepartment}
\newcommand{\thesisauthor}{Ima Student}
\newcommand{\thesisauthordegrees}{BSc (Hons)}
\newcommand{\thesismonth}{May}
\newcommand{\thesisyear}{1994}
\newcommand{\thesistitle}{Title}
\newcommand{\thesissubject}{Thesis Subject}
\newcommand{\thesiskeywords}{Thesis Keywords}
\newcommand{\thesistitletypesize}{\Large}
\newcommand{\thesissupervisor}{Supervisor}
\newcommand{\thesistype}{Thesis}
\newcommand{\thesistypetypesize}{\large}
\newcommand{\thesistypesize}{\large}
\newcommand{\thesisdegree}{Doctor of Philosophy}
\newcommand{\thesisdegreetypesize}{\large}
\newcommand{\thesisdegreeabbreviation}{PhD}
\newcommand{\thesissubmission}{Submitted to \universityname\\for the degree of }
\newcommand{\thesisacknowledgmenthead}{Acknowledgments}
\newcommand{\thesisacknowledgmentheadtypesize}{\Large}
\newcommand{\thesisabbreviationhead}{Abbreviations}
\newcommand{\thesisdeclarationhead}{Declarations}
\newcommand{\thesisdeclarationbody}{}
\newcommand{\thesisabstracthead}{Abstract}
%%%
%%% Command for masters theses. \phdthesis is provided for symmetry.
%%%
\newcommand{\mastersthesis}{
\renewcommand{\thesistype}{Thesis}
\renewcommand{\thesisdegree}{Master of Science}
\renewcommand{\thesisdegreeabbreviation}{MSc}
}
\newcommand{\phdthesis}{
\renewcommand{\thesistype}{Thesis}
\renewcommand{\thesisdegree}{Doctor of Philosophy}
\renewcommand{\thesisdegreeabbreviation}{PhD}
}
%%%
%%% Set up other commands.
%%%
\newcommand{\@defaultbaselinestretch}{1.5}
\newcommand{\@base}[1]{\renewcommand{\baselinestretch}{#1}}
\newcommand{\@thesistitle}{\textbf{\thesistitletypesize \thesistitle}}
\newcommand{\@thesistype}{\textbf{\thesistypetypesize \thesistype}}
\newcommand{\@thesisdegree}{\textbf{\thesisdegreetypesize \thesisdegree}}
\newcommand{\@thesisdegreeabbreviation}{\thesisdegreeabbreviation}
\newcommand{\@thesisacknowledgmenthead}{\thesisacknowledgmenthead}
\newcommand{\@thesisdeclarationhead}{\thesisdeclarationhead}
\newcommand{\@thesisabstracthead}{\thesisabstracthead}
\newcommand{\@thesisabbreviationhead}{\thesisabbreviationhead}
%%%
%%% Indent the first paragraph after a sectioning command.
%%%
%\let\@afterindentfalse\@afterindenttrue
%\@afterindenttrue
%%%
%%% Set up default page numbering and line spacing.
%%%
\newcommand{\@textpagenumbering}{arabic}
\newcommand{\@preamblepagenumbering}{roman}
\newcommand{\@textpagestyle}{plain}
\newcommand{\@preamblepagestyle}{plain}
\pagenumbering{\@preamblepagenumbering}
\@base{\@defaultbaselinestretch}
\newcommand{\@chaptertype}{\chaptername}
\newcommand{\@appendix}{0}
\usepackage{kvoptions}
\usepackage{etoolbox}
% Process parameters
\DeclareStringOption{university}
\ProcessKeyvalOptions*
\ifdefempty{\thesis@university}
{\PackageError{thesis}{university parameter not specified}{You need to provide the university parameter to the package}}
{}
% Inlcude university-specific configuration
\input{Universities/\thesis@university}
% https://tex.stackexchange.com/questions/1676/how-to-get-good-looking-copyright-and-registered-symbols
\usepackage{textcomp}
%%%
%%% Command to generate a copyright page.
%%% This isn't necessary to do.
%%%
\newcommand{\thesisplaincopyrightpage}{
\thispagestyle{empty}
\begin{spacing}{2}
\begin{center}
\vspace{100mm}
Copyright \textcopyright\ \thesisyear\ \thesisauthor
\end{center}
\end{spacing}
\newpage
}
%%%
%%% Environment to generate acknowledgments page.
%%%
\newenvironment{thesisacknowledgments}
{\chapter*{\@thesisacknowledgmenthead
\@mkboth{\uppercase{\@thesisacknowledgmenthead}}
{\uppercase{\@thesisacknowledgmenthead}}}
\addcontentsline{toc}{chapter}{\@thesisacknowledgmenthead}
\begin{spacing}{\@defaultbaselinestretch}}
{\end{spacing}\newpage}
%%%
%%% Environment to generate declarations page.
%%%
\newenvironment{thesisdeclaration}
{\chapter*{\@thesisdeclarationhead
\@mkboth{\uppercase{\@thesisdeclarationhead}}
{\uppercase{\@thesisdeclarationhead}}}
\addcontentsline{toc}{chapter}{\@thesisdeclarationhead}
\begin{spacing}{\@defaultbaselinestretch}
\thesisdeclarationbody}
{\end{spacing}\newpage}
%%%
%%% Environment to generate abstract page.
%%%
\newenvironment{thesisabstract}
{\chapter*{\@thesisabstracthead %!picked up from above
\@mkboth{\uppercase{\@thesisabstracthead}} %!picked up from above
{\uppercase{\@thesisabstracthead}}} %!picked up from above
\addcontentsline{toc}{chapter}{\@thesisabstracthead}
\begin{spacing}{\@defaultbaselinestretch} \noindent}
{\end{spacing}\newpage}
%%%
%%% Environment to generate abbreviations page.
%%%
\newenvironment{thesisabbreviations}
{\chapter*{\@thesisabbreviationhead
\@mkboth{\uppercase{\@thesisabbreviationhead}}
{\uppercase{\@thesisabbreviationhead}}}
\addcontentsline{toc}{chapter}{\@thesisabbreviationhead}
\begin{spacing}{\@defaultbaselinestretch}}
{\end{spacing}\newpage}
\newcommand{\@chapteralignment}{\centering}
\renewcommand{\chapter}{\clearpage
\ifnum\@appendix=1
\renewcommand{\@chaptertype}{\appendixname}
\else
\renewcommand{\@chaptertype}{\chaptername}
\fi
\thispagestyle{plain}%
\global\@topnum\z@
\@afterindentfalse
\secdef\@chapter\@schapter
}
\renewcommand\appendix{\par
\setcounter{chapter}{0}%
\setcounter{section}{0}%
\renewcommand{\@chapapp}{\appendixname}%
\renewcommand{\thechapter}{\Alph{chapter}}
\renewcommand{\@appendix}{1}}
%%%
%%% Define chapter heading placement commands.
%%%
\newcommand{\leftchapter}{
\renewcommand{\@chapteralignment}{\raggedright}}
\newcommand{\centerchapter}{
\renewcommand{\@chapteralignment}{\centering}}
\newcommand{\rightchapter}{
\renewcommand{\@chapteralignment}{\raggedleft}}
%%%
%%% Command from report.cls, (c) LaTeX3 Project.
%%%
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\@chaptertype{} \protect\numberline{\thechapter}#1}%
\else
\addcontentsline{toc}{chapter}{\@chaptertype{} #1}
\fi
\ifnum\value{chapter}=1
\ifnum\@appendix=0
\pagestyle{\@textpagestyle}
\pagenumbering{\@textpagenumbering}
\fi
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi
}
%%%
%%% Command from report.cls, (c) LaTeX3 Project.
%%%
\def\@makechapterhead#1{%
\vspace*{50\p@}%
{\parindent \z@ \@chapteralignment \reset@font
\ifnum \c@secnumdepth >\m@ne
\huge\bfseries \@chapapp{} \thechapter
\par
\vskip 20\p@
\fi
\Huge \bfseries #1\par
\nobreak
\vskip 40\p@
}}
\def\@makeschapterhead#1{%
\vspace*{50\p@}%
{\parindent \z@ \@chapteralignment
\reset@font
\Huge \bfseries #1\par
\nobreak
\vskip 40\p@
}}
%%%
%%% Command from report.cls, (c) LaTeX3 Project.
%%%
\renewcommand\listoftables{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\listtablename
\@mkboth{\uppercase{\listtablename}}{\uppercase{\listtablename}}}%
\addcontentsline{toc}{chapter}{\listtablename}
\@starttoc{lot}%
\if@restonecol\twocolumn\fi
}
\renewcommand\listoffigures{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\listfigurename
\@mkboth{\uppercase{\listfigurename}}%
{\uppercase{\listfigurename}}}%
\addcontentsline{toc}{chapter}{\listfigurename}
\@starttoc{lof}%
\if@restonecol\twocolumn\fi
}
\renewcommand\tableofcontents{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\contentsname
\@mkboth{\uppercase{\contentsname}}{\uppercase{\contentsname}}}%
\@starttoc{toc}%
\if@restonecol\twocolumn\fi
}
%%%
%%% Command to print draft version of the thesis.
%%%
\newcommand{\thesisdraft}{
%\setlength{\topmargin}{0in}
%\setlength{\headheight}{0.2in}
%\setlength{\headsep}{0.25in}
\renewcommand{\@textpagestyle}{myheadings}
\def\ps@myheadings{%
\let\@oddfoot\@empty\let\@evenfoot\@empty
\def\@oddhead{\textsl{Draft of \timestamp}\hfil\thepage}%
\let\@mkboth\@gobbletwo
\let\chaptermark\@gobble
\let\sectionmark\@gobble}
}
%%%
%%% Code to compute current timestamp. Some parts by Martin Minow.
%%%
\newcount\hour \newcount\minute
\hour=\time \divide \hour by 60
\minute=\time
\loop \ifnum \minute > 59 \advance \minute by -60 \repeat
\def\thesistime{\ifnum \hour<13 \number\hour:%
\ifnum \minute<10 0\fi
\number\minute
\ifnum \hour<12 \ am\else \ pm\fi
\else \advance \hour by -12 \number\hour:%
\ifnum \minute<10 0\fi
\number\minute \ pm\fi}
\def\thesisdate{\ifcase\month\or
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi
\space\number\day, \number\year}
\newcount\dow
\newcount\leap
\newcount\x
\newcount\y
%leap = year + (month - 14)/12
\leap=\month \advance\leap by -14 \divide\leap by 12
\advance\leap by \year
%dow = (13 * (month + 10 - (month + 10)/13*12) - 1)/5
\dow=\month \advance\dow by 10
\y=\dow \divide\y by 13 \multiply\y by 12
\advance\dow by -\y \multiply\dow by 13 \advance\dow by -1 \divide\dow by 5
%dow += day + 77 + 5 * (leap % 100)/4
\advance\dow by \day \advance\dow by 77
\x=\leap \y=\x \divide\y by 100 \multiply\y by 100 \advance\x by -\y
\multiply\x by 5 \divide\x by 4 \advance\dow by \x
%dow += leap / 400
\x=\leap \divide\x by 400 \advance\dow by \x
%dow -= leap / 100 * 2;
%dow = (dow % 7)
\x=\leap \divide\x by 100 \multiply\x by 2 \advance\dow by -\x
\x=\dow \divide\x by 7 \multiply\x by 7 \advance\dow by -\x
\def\thesisdayofweek{\ifcase\dow
Sunday\or Monday\or Tuesday\or
Wednesday\or Thursday\or Friday\or Saturday\fi}
\def\timestamp{\thesistime, \thesisdayofweek, \thesisdate}
%%%
%%% Commands for spacing. Some parts from spacing.sty by Stephen Page.
%%%
\ifx\undefined\selectfont
\def\@setsize#1#2#3#4{\@nomath#1
\let\@currsize#1\baselineskip
#2\baselineskip\baselinestretch\baselineskip
\parskip\baselinestretch\parskip
\setbox\strutbox\hbox{\vrule height.7\baselineskip
depth.3\baselineskip width\z@}
\normalbaselineskip\baselineskip#3#4}
\else
\def\@newbaseline{%
\ifx\undefined\setnew@baselineskip
\baselineskip\f@baselineskip\relax
\else
\setnew@baselineskip
\fi
\baselineskip\baselinestretch\baselineskip
\setbox\strutbox\hbox{\vrule\@height.7\baselineskip
\@depth.3\baselineskip \@width\z@}%
\normalbaselineskip\baselineskip}
\fi