-
Notifications
You must be signed in to change notification settings - Fork 4
/
thesis.sty
328 lines (278 loc) · 8.65 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
%
% LaTeX style for University of Wolverhampton PhD theses.
%
% Based on a similar piece of work by Donald Craig at Memorial
% University, Newfoundland. You can find Donald's original work on his
% web site, here: http://www.cs.mun.ca/~donald/metathesis/
%
% (c) Sarah Mount, 2009.
%
\usepackage[xcdraw,table]{xcolor}
\definecolor{lightgray}{gray}{0.9}
\usepackage{graphicx}
\usepackage{latexsym}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[CO]{\leftmark}
\fancyhead[CE]{\rightmark}
\fancyfoot[CE,CO]{\thepage}
%%% Fixing running headers on empty pages
%%% Patch from: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=reallyblank
\let\origdoublepage\cleardoublepage
\newcommand{\clearemptydoublepage}{%
\clearpage
{\pagestyle{empty}\origdoublepage}%
}
\let\cleardoublepage\clearemptydoublepage
\floatsep = .29in
\textfloatsep = \floatsep
\intextsep = \floatsep
\bibliographystyle{unsrt}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
% Almost everything is double spaced.
\newcommand{\spacing}{1.8}
\renewcommand{\baselinestretch}{\spacing}
\newcommand{\singlespace}[1]{
\renewcommand{\baselinestretch}{0.8}
#1
\renewcommand{\baselinestretch}{\spacing}
}
%
% Footnotes are to be single spaced.
%
\newcommand{\wlvfootnote}[1]{%
\renewcommand{\baselinestretch}{1.0}%
\footnote{#1}%
\renewcommand{\baselinestretch}{\spacing}%
}
%
% Style for Chapter headings.
%
\renewcommand{\@makechapterhead}[1]{%
\renewcommand{\baselinestretch}{1.0}%
\vspace*{5\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\Large \scshape \@chapapp\space \thechapter % Chapter number
\par\nobreak
\vskip 20\p@
\fi
\hrule % horizontal line
\vspace{20pt}% % add vertical space
\interlinepenalty\@M
\Large \scshape #1\par % chapter title
\vspace{10pt}% % add vertical space
\hrule % horizontal rule
\nobreak
\vskip 40\p@
\renewcommand{\baselinestretch}{\spacing}%
}}
%
% Style for a \chapter*{} heading.
%
\renewcommand{\@makeschapterhead}[1]{%
\vspace*{5\p@}%
{\parindent \z@ \raggedright
\normalfont
\hrule % horizontal line
\vspace{10pt}% % add vertical space
\interlinepenalty\@M
\Large\scshape #1\par % chapter title
\vspace{10pt}% % add vertical space
\hrule % horizontal line
\nobreak
\vskip 40\p@
}}
% Lengthy quotes must also be single spaced.
% We provide a parameter for the citation label too.
\newcommand{\wlvquote}[2]{%
\renewcommand{\baselinestretch}{1.0}%
\normalsize
\begin{quote}{``\textsl{#1}''~\cite{#2}}\end{quote}
\renewcommand{\baselinestretch}{\spacing}%
\normalsize
}
% Same, with no citation.
\newcommand{\wlvbarequote}[1]{%
\renewcommand{\baselinestretch}{1.0}%
\normalsize
\begin{quote}{``\textsl{#1}''~}\end{quote}
\renewcommand{\baselinestretch}{\spacing}%
\normalsize
}
\newcommand{\setuphyperref}[2]{%
\makeatletter
\let\savedbibitem\bibitem
\makeatother
\usepackage{hyperref}
\hypersetup{
bookmarks=true, % show bookmarks bar?
unicode=false, % non-Latin characters in Acrobat’s bookmarks
pdftoolbar=true, % show Acrobat’s toolbar?
pdfmenubar=true, % show Acrobat’s menu?
pdffitwindow=false, % window fit to page when opened
pdfstartview={Fit}, % fits the width of the page to the window
pdftitle={#1}, % title
pdfauthor={#2}, % author
pdfsubject={University of Wolverhampton PhD Thesis}, % subject of the document
pdfcreator={#2}, % creator of the document
pdfproducer={#2}, % producer of the document
pdfkeywords={thesis} {template} {latex}, % list of keywords
pdfnewwindow=true, % links in new window
colorlinks=true, % false: boxed links; true: colored links
linkcolor=DarkScarletRed, % color of internal links
citecolor=DarkChameleon, % color of links to bibliography
filecolor=DarkPlum, % color of file links
urlcolor=DarkSkyBlue % color of external links
}
}
% Command for creating the thesis title page.
% For usage example, see thesis.tex.
\newcommand{\thesistitle}[3]{%
\pagenumbering{roman}\setcounter{page}{1}
\pagestyle{plain}
\thispagestyle{empty}
\begin{center}
\renewcommand{\baselinestretch}{1.0}%
\hrule
\vspace{0.5cm}
{\scshape\Large #1}
\vspace{0.5cm}
\hrule
\renewcommand{\baselinestretch}{\spacing}%
\vspace{1.0cm}
%\copyright{}
{\large\scshape #2}
\vspace{\fill}
\centering{
A thesis submitted in partial fulfilment of the requirements of the
University of Wolverhampton for the degree of Doctor of Philosophy
}
\vspace{\fill}
#3 \\
\end{center}
\vspace{\fill}
This work or any part thereof has not previously been presented in any
form to the University or to any other body whether for the purposes
of assessment, publication or for any other purpose (unless
otherwise indicated). Save for any express acknowledgements,
references and/or bibliographies cited in the work, I confirm that the
intellectual content of the work is the result of my own efforts and
of no other person.
The right of #2 to be identified as author of this work is
asserted in accordance with ss.77 and 78 of the Copyright, Designs and
Patents Act 1988. At this date copyright is owned by the author.
\vspace{\fill}
Signature: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Date: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
}
%
% The \wlvfig command is used to insert a new EPS figure
% into our document. Usage is:
%
% \wlvfig[scale]{filename}{caption}
%
% Note:
% - scale is optional (defaults to 1.0)
% - Assumes that the graphics file is in the 'figures' directory.
% - 'filename' should not include the filename extension.
% - 'filename' also serves as the label for the figure.
% e.g. \ref{fig:filename} or \pageref{fig:filename}
%
\newcommand{\wlvfig}[3][1.0]{%
\begin{figure}[!Hhtbp]
\centering
\vspace{2mm}
\scalebox{#1}{\includegraphics{figures/#2}}
\caption{#3}
\label{fig:#2}
\end{figure}
}
%
% The \wlvtab command is used to insert a new table into our document.
% Usage is:
%
% \wlvtab{table_format}{label}{caption}{table_contents}x
%
% Note that we could have created a \newenvironment, but opted for
% a \newcommand so as to be consistent with the \wlvepsfig command.
%
\newcommand{\wlvtab}[4]{%
\begin{table}[!htbp]
\renewcommand{\baselinestretch}{1.0}%
\centering
\vspace{2mm}
\rowcolors{1}{}{lightgray}
\begin{tabular}{#1}
#4
\end{tabular}
\caption{\label{tab:#2}#3}
\end{table}
\renewcommand{\baselinestretch}{\spacing}%
}
%
% The \wlveqn command is used to add an equation to the thesis.
% Usage is
%
% \wlveqn{label}{equation_body}
%
\newcommand{\wlveqn}[2]{%
\begin{equation}
\centering
\label{eqn:#1}
#2
\end{equation}
}
%
% Typeset a thesis statement.
% Usage:
%
% \wlvthesis{fff}{The thesis of this work is Foo is better than Bar.}
%
% blah blah thesis statement on Page \pageref{fff} blah blah
%
\newcommand{\wlvthesis}[2]{%
\vspace{1cm}
\hrule{}
\vspace{1em}
\label{#1}
\renewcommand{\baselinestretch}{1.0}\normalsize
\noindent \bfseries { #2 }
\vspace{1em}
\hrule{}
\vspace{1cm}
% Now reset everything...
\mdseries
\renewcommand{\baselinestretch}{\spacing}\normalsize
}
%
% For theorems and corollaries.
%
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem{definition}{Definition}[chapter]
\theoremstyle{definition}
\newtheorem{case}{Case}
\theoremstyle{definition}
\newtheorem{theorem}{Theorem}[chapter]
\theoremstyle{definition}
\newtheorem{lemma}{Lemma}[chapter]
\theoremstyle{definition}
\newtheorem{thesis}{Thesis}[chapter]
\newcommand{\eqdef}{\stackrel{\mbox{\upshape\tiny def}}{=}}
%
% Compress the space taken up by lists.
% Use this command after a list is openned.
% Usage:
% \begin{itemize}\compresslist{}
% \item ...
% \end{itemize}
\newcommand{\compresslist}{%
\setlength{\itemsep}{1pt}%
\setlength{\parskip}{0pt}%
\setlength{\parsep}{0pt}%
}