-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUoKthesis.cls
187 lines (155 loc) · 5.35 KB
/
UoKthesis.cls
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
% UoK Thesis Class File
% Created by M. Lee, 10 February 1995
% Updated by Daniel Knox, September 2013
% Converted to Class by Keith A. Greenhow, 24 September 2013
% --- Class structure: identification part
% ---
\ProvidesClass{UoKthesis}[24/09/2013 version 0.1 University of Kent PhD and Master Thesis]
\NeedsTeXFormat{LaTeX2e}
\newif\ifdraft
\newif\ifmini
\newif\ifshowcopyright
\newif\iflistfig
\newif\iflisttables
\listfigtrue
\listtablestrue
\DeclareOption{mini}{\minitrue} % Modifications required for Mini-thesis.
\DeclareOption{copyright}{\showcopyrighttrue} % Use to add copyright
\DeclareOption{draft}{\drafttrue} % Turn document into full draft mode
\DeclareOption{draftmark}{\drafttrue} % Just add the draft watermark (useful for images)
\DeclareOption{nofig}{\listfigfalse} % Hide list of figures page
\DeclareOption{notab}{\listtablesfalse} % Hide list of tables page
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}} %pass all unknown options to report class
\ProcessOptions % process defined options
\LoadClass{report} % load default Latex report class as basis
% Kent Harvard Referencing Style
\usepackage{natbib}
\setcitestyle{aysep={}} % Needed for correct author year citation style
\bibliographystyle{kentHarvard}
% Add watermark to draft copies
\ifdraft
\usepackage{draftwatermark}
\SetWatermarkLightness{0.9}
\SetWatermarkScale{6.0}
\SetWatermarkFontSize{1cm}
\else
\usepackage[final]{draftwatermark}
\fi
\usepackage{lmodern}
%bibliography modifications
\let\originalbibliography\bibliography
\ifmini
\renewcommand{\bibliography}[1]{\nocite{*}\cleardoublepage\phantomsection\addcontentsline{toc}{chapter}{Bibliography}\originalbibliography{#1}}
\else
\renewcommand{\bibliography}[1]{\cleardoublepage\phantomsection\addcontentsline{toc}{chapter}{Bibliography}\originalbibliography{#1}}
\fi
\makeatletter
\usepackage{setspace}
\usepackage{hyperref}
% Increase oddsidemargin from 0.5in to 1.6cm
\oddsidemargin=1.6cm
\evensidemargin 0in
% Remove marginparwidth from 40pt to 0pt
\marginparwidth=0pt
% Remove marginparsep from 10pt to 0pt
\marginparsep=0pt
\topmargin 0pt
\headsep .5in
% Increase textheight from 8.1in to 9in
\textheight=8.5in
% Decrease textwidth from 6in to 5.75in
\textwidth=5.75in
% Move the entire page up by 0.4cm
\voffset=-0.4cm
\renewcommand{\doublespace}{\spacing{1.5}}
\renewcommand{\onehalfspace}{\spacing{1.25}}
\renewcommand{\singlespace}{\spacing{1}}
\brokenpenalty=10000
\def\cl@chapter{\@elt{section}\@elt{footnote}}
\def\thefigure{\@arabic\c@figure}
\def\thetable{\@arabic\c@table}
\def\theequation{\arabic{equation}}
\long\def\@footnotetext#1{\insert\footins{\def\baselinestretch{1}\footnotesize
\interlinepenalty\interfootnotelinepenalty \splittopskip\footnotesep
\splitmaxdepth \dp\strutbox \floatingpenalty \@MM \hsize\columnwidth
\@parboxrestore \edef\@currentlabel{\csname
p@footnote\endcsname\@thefnmark}\@makefntext
{\rule{\z@}{\footnotesep}\ignorespaces #1\strut}}}
\def\degree#1{\gdef\@degree{#1}} \def\subject#1{\gdef\@subject{#1}}
\def\submitdate#1{\gdef\@submitdate{#1}}
\def\copyrightyear#1{\gdef\@copyrightyear{#1}}
\def\@title{}\def\@author{}\def\@subject{computer science}
\def\@principaladviser{}\def\@firstreader{}\def\@secondreader{}
\def\@submitdate{\ifcase\the\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\the\year} \ifnum\month=12 \@tempcnta=\year
\advance\@tempcnta by 1 \edef\@copyrightyear{\number\the\@tempcnta} \else
\def\@copyrightyear{\number\the\year} \fi
\def\titlep{
\thispagestyle{empty}
\null\vskip1in
\begin{center}
{\Large\uppercase\expandafter{\@title}}
\end{center}
\vfill
\begin{center}
\sc a \ifmini mini-thesis \else thesis \fi submitted to\\
The University of Kent\\
in the subject of \lowercase\expandafter{\@subject}\\
for the degree\\
of \lowercase\expandafter{\@degree}.
\end{center}
\vfill
\ifdraft
\begin{center}
{\LARGE Draft on \today}
\end{center}
\fi
\vfill
\begin{center}
\rm By\\ \@author\\ \@submitdate
\end{center}
\vskip.5in\newpage}
\def\copyrightpage{
\ifshowcopyright
\null\vfill
\begin{center}
\Large\copyright\ Copyright \@copyrightyear\\
by\\
\@author\\
\end{center}
\vfill\newpage
\fi}
\def\contentspages{
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Contents}
\tableofcontents
\newpage
\iflisttables {\addvspace{10pt} \let\saveaddvspace=\addvspace
\def\addvspace##1{}
\phantomsection
\addcontentsline{toc}{chapter}{List of Tables}
\listoftables
\let\addvspace=\saveaddvspace } \newpage
\fi
\iflistfig {\addvspace{10pt} \let\saveaddvspace=\addvspace
\def\addvspace##1{}
\phantomsection
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures
\let\addvspace=\saveaddvspace } \newpage
\fi
}
\newenvironment{preface}{\pagenumbering{roman}\pagestyle{plain}\titlep\relax\copyrightpage}{\contentspages\newpage\pagenumbering{arabic}\pagestyle{headings}}
\let\originalsection\section\relax
\renewcommand{\section}[1]{
\ifnum \pdfstrcmp{\@currenvir}{preface}=0
\chapter*{#1}\addcontentsline{toc}{chapter}{#1}
\else
\originalsection{#1}
\fi
}
\pagestyle{headings}
\doublespace
\makeatother