-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsotonphd.cls
executable file
·343 lines (303 loc) · 9.3 KB
/
sotonphd.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
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Identify, Process Options, and Load Class
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{sotonphd}[2018/04/05 v1.0]
\gdef\baseclass{book}
%%%%%%%%%%%%%%%%%%%%%
% Available options:
%
% sotonformat: use 11pt font and 1.5-spacing for main text, margins as in the guidelines
% print: disable link colouring
% final: disable the "to do" command
\newif\if@sotonformat\@sotonformatfalse
\newif\if@print\@printfalse
\newif\if@final\@finalfalse
\DeclareOption{sotonformat}{\@sotonformattrue}
\DeclareOption{print}{\@printtrue}
\DeclareOption{final}{\@finaltrue}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\baseclass}}
\ExecuteOptions{a4paper, twoside, openright}
\ProcessOptions\relax
\if@sotonformat
\PassOptionsToClass{11pt}{\baseclass}
\PassOptionsToPackage{inner=1.5in, outer=1in, top=1in, bottom=1in}{geometry}
\PassOptionsToPackage{onehalfspacing}{setspace}
\fi
\LoadClass{\baseclass}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Essential Packages
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage[l2tabu, orthodox]{nag} % Issues warnings if deprecated packages are used
\RequirePackage{float} % in order to force figure placement with option [H]
\RequirePackage{geometry}
\RequirePackage{mathtools,amsfonts,amssymb}
\RequirePackage{parskip} % Leave some space between paragraphs instead of indenting a new paragraph
\RequirePackage[usenames,dvipsnames,svgnames,x11names]{xcolor}
\PassOptionsToPackage{hyphens}{url} % hyperref loads the url package
\RequirePackage{hyperref}
\RequirePackage[english]{babel}
\RequirePackage[utf8x]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage{lmodern}
\RequirePackage{microtype}
\RequirePackage[numbers,sort&compress]{natbib}
\RequirePackage{bookmark}
\RequirePackage{xspace} % Used in the definition of the \etc custom command
\RequirePackage{setspace} % Loads \singlespacing, \onehalfspacing, \doublespacing
\RequirePackage{graphicx}
\RequirePackage[labelfont=bf]{caption} % make "Figure x.x" be printed in bold face
\RequirePackage{fancyhdr} % Style page headers and footers
\RequirePackage{sectsty} % Style titles for chapters, sections etc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Styling
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Headers and Footers
\setlength{\headheight}{14pt}
\fancyhead{} % Clear all header fields
\fancyhead[RE]{\itshape\nouppercase\leftmark}
\fancyhead[LO]{\itshape\nouppercase\rightmark}
\fancyhead[RO,LE]{\thepage}
\fancyfoot{}
% Chapters, Sections, etc.
\partfont{\normalfont\scshape\underline}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% New Commands
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Add a chapter title to the table of contents and to the bookmarks
\newcommand*\TOCchapter[1]{
\phantomsection{}
\addcontentsline{toc}{chapter}{#1}
}
% Add a table of contents
\newcommand*\addTOC{
\begingroup
\singlespacing
\renewcommand{\contentsname}{Table of Contents}
\TOCchapter{\contentsname}
\tableofcontents
\cleardoublepage{}
\endgroup
}
% Add a list of figures and a list of tables
\newcommand*\addFiguresTables{
\begingroup
\singlespacing
\TOCchapter{List of Figures and Tables}
\listoffigures
\listoftables
\cleardoublepage{}
\endgroup
}
% For meta data
\newcommand*\university[1]{\gdef\@university{#1}}
\newcommand*\faculty[1]{\gdef\@faculty{#1}}
\newcommand*\department[1]{\gdef\@department{#1}}
% To do commands
\newcommand*\todo[1]{
\if@final
{}
\else
{\color{red}(#1)}
\fi
}
\newcommand*\todomaybe[1]{
\if@final
{}
\else
{\color{blue}(#1)}
\fi
}
% Abbreviations: e.g., i.e., etc.
\newcommand*\eg{e.g.\@\xspace}
\newcommand*\ie{i.e.\@\xspace}
\newcommand*\etc{\@ifnextchar{.}{etc}{etc.\@\xspace}}
% Maths operators
\DeclareMathOperator{\sech}{sech}
\DeclareMathOperator{\csch}{csch}
\DeclareMathOperator{\arcsec}{arcsec}
\DeclareMathOperator{\arccot}{arcCot}
\DeclareMathOperator{\arccsc}{arcCsc}
\DeclareMathOperator{\arccosh}{arcCosh}
\DeclareMathOperator{\arcsinh}{arcsinh}
\DeclareMathOperator{\arctanh}{arctanh}
\DeclareMathOperator{\arcsech}{arcsech}
\DeclareMathOperator{\arccsch}{arcCsch}
\DeclareMathOperator{\arccoth}{arcCoth}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\id}{id}
\DeclareMathOperator{\diag}{diag}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Configuration
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Meta data
\author{Name Surname}
\title{Title}
\date{Month Year}
\university{University of Southampton}
\faculty{Faculty of Physical Sciences and Engineering}
\department{Physics and Astronomy}
% Bookmarks
\bookmarksetup{
open,
numbered,
addtohook={% CHANGE THE LEVELS DEPENDING ON WHETHER CHAPTER OR SECTION IS THE LOWEST LEVEL
\ifnum\bookmarkget{level}=-1 %
\bookmarksetup{bold}%
\fi%
\ifnum\bookmarkget{level}>0 %
\bookmarksetup{italic}%
\fi
},
}
% Hyperlinks
\hypersetup{
colorlinks=true,
allcolors=DeepSkyBlue4,
bookmarksopen=true,
bookmarksopenlevel=0
}
\if@print
\hypersetup{hidelinks}
\fi
% Allow long equations to be continued to the next page
\allowdisplaybreaks{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Document Structure
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% [x] Title and subtitle
% [x] Abstract
% [x] List of contents
% [x] List of tables, illustrations etc.
% [-] List of accompanying material, if any
% [x] Author's declaration
% [x] Acknowledgements
% [-] Definitions, abbreviations used
% [x] Introduction
% [x] Main text, divided into chapters, sections etc.
% [x] Conclusion
% [x] Appendices
% [-] Glossary
% [x] List of references/Bibliography
% [-] Index
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Title Page
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand\maketitle{
\TOCchapter{Title Page}
\hypersetup{pdftitle={\@title}}
\hypersetup{pdfauthor={\@author}}
\thispagestyle{empty}
\begin{titlepage}
\begin{center}
\setlength{\parskip}{0pt}
{\Large\textbf{\@university}\par}
{\large Faculty of Physical Sciences and Engineering\par \par}
{\large Physics and Astronomy\par \par}
\vfill
{\huge \bfseries \@title \par}
\vfill
{\LARGE by \par}
\smallskip
{\LARGE \@author \par}
\vfill
{\large A thesis submitted for the degree of \par}
{\large Doctor of Philosophy \par}
\bigskip
\bigskip
\bigskip
{\Large \@date \par}
\bigskip
\end{center}
\end{titlepage}
\cleardoublepage
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Abstract
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newenvironment{abstract}
{
\TOCchapter{Abstract}
\singlespacing
% \thispagestyle{empty}
\begin{center}
\setlength{\parskip}{0pt}
{\large \bfseries \MakeUppercase{\@university} \par \par}
\bigskip
\bigskip
{\LARGE \bfseries \underline{ABSTRACT} \par \par}
\bigskip
\bigskip
{\normalsize \MakeUppercase{\@faculty} \par \par}
\medskip
{\normalsize \MakeUppercase{\@department} \par \par}
\bigskip
{\normalsize \underline{Thesis for the degree of Doctor of Philosophy} \par}
\bigskip
{\normalsize \bfseries \MakeUppercase{\@title} \par \par}
\medskip
{\normalsize by \@author \par \par}
\end{center}
}{\cleardoublepage}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Declaration of Authorship
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand\authorshipdeclaration[1]{
\cleardoublepage
\TOCchapter{Declaration of Authorship}
\begin{center}
{\Large\textbf{Declaration of Authorship}}
\end{center}
\begingroup
\singlespacing
I, {\@author}, declare that this thesis entitled \emph{\@title} and the work presented in it are my own and have been generated by me as the result of my own original research.
I confirm that:
\begin{enumerate}
\item This work was done wholly or mainly while in candidature for a research degree at this University;
\item Where any part of this thesis has previously been submitted for a degree or any other qualification at this University or any other institution, this has been clearly stated;
\item Where I have consulted the published work of others, this is always clearly attributed;
\item Where I have quoted from the work of others, the source is always given. With the exception of such quotations, this thesis is entirely my own work;
\item I have acknowledged all main sources of help;
\item Where the thesis is based on work done by myself jointly with others, I have made clear exactly what was done by others and what I have contributed myself;
\item Either none of this work has been published before submission, or parts of this work have been published as:
#1
\end{enumerate}
\bigskip
\bigskip
\bigskip
Signed:
\bigskip
Date:
\endgroup
\cleardoublepage
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Acknowledgements
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand\acknowledgements[1]{
\TOCchapter{Acknowledgements}
\chapter*{Acknowledgements}
{\singlespacing\normalsize #1}
\cleardoublepage
}
% (The End)