uosdocs.dtx 65.3 KB
Newer Older
1
2
3
4
5
6
7
% \iffalse
% This file builds on the class file `book.cls' to provide a thesis,
% minithesis, progress, project and report format, and on the class file `article.cls'
% to provide an article format, for use within the Dept. of Electronics
% and Computer Science at the University of Southampton.
%
% The thesis, minithesis, progress, project, report, gdp, gdpsummary and article environments are written to separate
8
% class files uosthesis.cls, uosminithesis.cls, uosprogress.cls, uosproject.cls, uosreport.cls, uosgdp.cls, uosgdpsummary.cls and uosarticle.cls.
9
% Copyright (C) 2001 by Steve R. Gunn
10
% Later Modifications (C) 2018 by Edward Longman
11
%    \begin{macrocode}
12
%<thesis|minithesis|progress|project|article|report|gdp|gdpsummary>\NeedsTeXFormat{LaTeX2e}[2007/02/26]
13
14
15
16
17
%    \end{macrocode}
%
%    Announce the document class and its version.
%
%    \begin{macrocode}
18
19
20
21
22
23
24
25
%<thesis>\ProvidesClass{uosthesis}
%<minithesis>\ProvidesClass{uosminithesis}
%<progress>\ProvidesClass{uosprogress}
%<project>\ProvidesClass{uosproject}
%<article>\ProvidesClass{uosarticle}
%<report>\ProvidesClass{uosreport}
%<gdp>\ProvidesClass{uosgdp}
%<gdpsummary>\ProvidesClass{uosgdpsummary}
26
%<*driver>
27
\ProvidesFile{uosdocs.drv}
28
29
%</driver>
%<*thesis|minithesis|progress|project|report|article|gdp|gdpsummary|driver>
Edward Longman's avatar
Edward Longman committed
30
              [2019/03/12 v2.2
31
32
33
34
35
36
37
38
39
40
41
42
%</thesis|minithesis|progress|project|report|article|gdp|gdpsummary|driver>
%<thesis|minithesis|progress|project|report|article|gdp|gdpsummary>   LaTeX document class]
%    \end{macrocode}
%
%    This bit of code contains the documentation driver file for
%    \TeX{}, i.e., the file that will produce the documentation you
%    are currently reading. It can be extracted from this file by the
%    {\sc docstrip} program.
%    \begin{macrocode}
%<*driver>
]
\documentclass[a4paper,10pt]{ltxdoc}
43
\GetFileInfo{uosdocs.drv} \CodelineIndex \EnableCrossrefs
44
45
46
%\RecordChanges
\setcounter{IndexColumns}{2}
\begin{document}
47
\DocInput{uosdocs.dtx}
48
49
50
51
52
53
54
55
\PrintIndex
%\PrintChanges
\end{document}
%</driver>
%    \end{macrocode}
% \fi
%
% \title{\LaTeXe{} Document Styles for the\\
56
%        University of Southampton\\
57
58
%       {File version \fileversion, dated \filedate}}
%
59
% \author{Edward Longman with prior work by Steve R. Gunn}
60
61
62
63
%
% \date{Printed \today}
%
% \maketitle
64
65
% \section{Quickstart}
%   This guide assumes you have installed MiKTeX or TeX live distributions.
66
%   It also requires having the program ``make'' for producing the templates again.
67
68
69
70
71
72
%
%   The folder labelled tex-mf should be installed in your local tex files
%   source or whatever your tex distro uses.
%
%   The Templates have been built for the Deparment of Electronics and Computer
%   Science in the Faculty of Engineering and Physical Science at the University
73
%   of Southampton.
74
%
75
%   The basic settings for University, Faculty and School are explained in Section~\ref{IntNames}
76
77
%
%   If a user only wishes to change the file for their thesis it is probably
78
%   easier to navigate to the class file labeled uosthesis and change the
79
%   department and faculty naming there. This will be located in the
80
%   subdirectory where you unzipped the files under tex/latex/uosdocs/
81
82
83
84
%
% \section{Description}
%
%    These \LaTeXe{} document classes are designed to produce thesis, mini-thesis, progress,
85
86
87
88
%    project, report, GDP report and GDP summary report documents which conformed to the
%    University of Southampton guidelines of April 2001. They were updated in Jan 2019 to
%    conform to changes in those guidelines. Specifically copyright and authorship
%    declaration changes. They are based on the document
89
90
91
92
93
94
95
96
97
98
99
%    class \texttt{book}, but modify some of its layout decisions. An article class is also
%    provided which is based on the document class \texttt{article}.
%
% \StopEventually{}
%
% \section{The {\sc docstrip} modules}
%
% The following modules are used in the implementation to direct
% {\sc docstrip} when generating the external files:
% \begin{center}
% \begin{tabular}{ll}
100
101
102
103
104
105
106
107
%   thesis            & produce the \texttt{uosthesis} document class\\
%   minithesis        & produce the \texttt{uosminithesis} document class\\
%   progress          & produce the \texttt{uosprogress} document class\\
%   project           & produce the \texttt{uosproject} document class\\
%   report            & produce the \texttt{uosreport} document class\\
%   article           & produce the \texttt{uosarticle} document class\\
%   gdp               & produce the \texttt{uosgdp} document class\\
%   gdpsummary        & produce the \texttt{uosgdpsummary} document class\\
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
%   testthesis        & produce an example thesis\\
%   testminithesis    & produce an example minithesis\\
%   testprogress      & produce an example progress\\
%   testproject       & produce an example project\\
%   testreport        & produce an example report\\
%   testarticle       & produce an example article\\
%   testgdp           & produce an example GDP report\\
%   testgdpsummary    & produce an example GDP summary report\\
%   introduction      & produce an example introduction chapter\\
%   conclusions       & produce an example conclusions chapter\\
%   appendix          & produce an example appendix chapter\\
%   figure            & produce an example figure file\\
%   definitions       & produce an example definitions file\\
%   references        & produce an example references file\\
%   bst               & produce a bibliography style file\\
%   driver            & produce a documentation driver file \\
% \end{tabular}
% \end{center}
%
% \section{Implementation}
%
129
130
% The checksum is to determine if there has been a truncation in the file during transmission over a network
%
131
%    The class has a custom option to define what colours should be used for links.
132
%    This option defines \texttt{sotoncolour} to use UoS palette colours.
133
134
%    Colour Code taken from \texttt{http://edshare.soton.ac.uk/10481}
%
135
136
137
138
139
140
141
142
%    All options are passed on to the \texttt{book} or \texttt{article} class.
%
%    \begin{macrocode}
%<*thesis|minithesis|progress|project|report|article|gdp|gdpsummary>
%    \end{macrocode}
%
% \begin{macro}{\baseclass}
%    \begin{macrocode}
143
144
145
146
%% ------------ Class/Formating Adjustment ----------------------
%% Adjust the book class to match the requirements
%% Set spacing, line and paragraph options
%% Set LaTeX builder options (work break penalties etc.)
147
148
149
150
151
152
153
154
155
156
%<*thesis|minithesis|progress|project|report|gdp|gdpsummary>
\def\baseclass{book}
%</thesis|minithesis|progress|project|report|gdp|gdpsummary>
%<*article>
\def\baseclass{article}
%</article>
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
157
158
159
\RequirePackage{xcolor}
\colorlet{linkBlue}{blue}
\colorlet{custGray}{gray}
160
161
\colorlet{chapRed}{red}
\DeclareOption{sotoncolour}{
162
163
\definecolor{sotonMarineBlue}{RGB}{1,67,89} % Soton marine blue (P 7469C)
  \definecolor{sotonGrey}{RGB}{153,153,166} % Soton grey (P 443C)
164
  \definecolor{sotonRed}{RGB}{171,18,16} % Soton Red (P 484C)
165
166
  \colorlet{linkBlue}{sotonMarineBlue}
  \colorlet{custGray}{sotonGrey}
167
  \colorlet{chapRed}{sotonRed}
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
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\baseclass}}
%    \end{macrocode}
%
% \begin{macro}{\@checkoptions}
%
%    Before we can process the options we must deal with a small
%    problem.  That is, we want to change the default options of
%    the \texttt{book} or \texttt{article} class to \texttt{a4paper} and \texttt{11pt} or \texttt{12pt} but the
%    macro |\ProcessOptions| used by the \texttt{book} or \texttt{article} class
%    processes the options in the order specified in the
%    file.  Because \texttt{a4paper} is the first of the paper
%    sizing options it will be overridden by any user defined
%    option.  But the same is not true of the font size option
%    \texttt{11pt} or \texttt{12pt}.  To remedy this we define a macro
%    |\@checkoptions{|\meta{default}|}{|\meta{option-list}|}|
%    which checks to see if any options in \meta{option-list} have
%    been specified and if not adds \meta{default} to the option list.
%
%    \begin{macrocode}
\def\@checkoptions#1#2{
  \edef\@curroptions{\@ptionlist{\@currname.\@currext}}
  \@tempswafalse
  \@tfor\@this:=#2\do{
    \@expandtwoargs\in@{,\@this,}{,\@curroptions,}
    \ifin@ \@tempswatrue \@break@tfor \fi}
  \let\@this\@empty
  \if@tempswa \else \PassOptionsToClass{#1}{\baseclass}\fi
}
%    \end{macrocode}
% \end{macro}
%
%    With this macro at our disposal we can continue to
%    process the options
%
%    \begin{macrocode}
%<*thesis|minithesis|progress|report|article|gdp|gdpsummary>
\@checkoptions{11pt}{{10pt}{11pt}{12pt}}
%</thesis|minithesis|progress|report|article|gdp|gdpsummary>
%<*project>
\@checkoptions{12pt}{{10pt}{11pt}{12pt}}
%</project>
\PassOptionsToClass{a4paper}{\baseclass}
\ProcessOptions\relax
%    \end{macrocode}
%
%    and load the \texttt{book} or \texttt{article} document class
%    with A4 as the default paper size.
%
%    \begin{macrocode}
\LoadClass{\baseclass}
%    \end{macrocode}
%
% \subsection{Banner}
%
% \begin{macro}{\bhrule}
% \begin{macro}{\btypeout}
%
%    Provide a function to produce a banner on the output making the location
%    of the current section simpler.
%
%    \begin{macrocode}
\newcommand\bhrule{\typeout{------------------------------------------------------------------------------}}
\newcommand\btypeout[1]{\bhrule\typeout{\space #1}\bhrule}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{Date}
%
% \begin{macro}{\today}
%
%    This macro uses the \TeX\ primitives |\month|, |\day| and |\year|
%    to provide the date of the \LaTeX-run in a suitable format.
%
%    \begin{macrocode}
%<*thesis>
\def\today{\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\year}
%</thesis>
%    \end{macrocode}
%
% \end{macro}
%
% \section{Document Layout}
%
256
257
258
259
260
261
262
263
264
265
% \subsection{Font}
%    \begin{macrocode}
%% \usepackage[T1]{fontspec}
%    Set font for copyright statement body text
\usepackage[defaultsans]{droidsans}
%    Set a particular style of font for the thesis. A font that has smallcaps
\usepackage{mathpazo}
%%\usepackage[T1]{fontenc} %This may not be necessary for english only text
%    \end{macrocode}

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
% \subsection{Spacing}
%
%    Load the \texttt{setspace} package so that spacing can easily be set. The text in all
%    three styles is set to one and a half spacing, paragraphs not indented, and a newline
%    between paragraphs.
%
%    \begin{macrocode}
\usepackage{setspace}
%<thesis|minithesis|progress|project|report|gdp|gdpsummary>\onehalfspacing
%<article>\singlespacing
\setlength{\parindent}{0pt}
\setlength{\parskip}{2.0ex plus0.5ex minus0.2ex}
%    \end{macrocode}
%
%  \subsection{Margins}
%
%    Load the \texttt{vmargin} package to setup the page dimensions.
%
%    \begin{macrocode}
\usepackage{vmargin}
%<*thesis|minithesis|progress|project|report|gdp|gdpsummary>
\setmarginsrb           { 1.5in}  % left margin
                        { 0.6in}  % top margin
                        { 1.0in}  % right margin
                        { 0.8in}  % bottom margin
                        {  20pt}  % head height
                        {0.25in}  % head sep
                        {   9pt}  % foot height
                        { 0.3in}  % foot sep
%</thesis|minithesis|progress|project|report|gdp|gdpsummary>
%<*article>
\setmarginsrb           { 0.8in}  % left margin
                        { 0.6in}  % top margin
                        { 0.8in}  % right margin
                        { 0.8in}  % bottom margin
                        {  20pt}  % head height
                        {0.25in}  % head sep
                        {   9pt}  % foot height
                        { 0.3in}  % foot sep
%</article>
%    \end{macrocode}
%
% \subsection{Breaks}
%
%    Control how pages and lines are broken.
%
%    \begin{macrocode}
\raggedbottom
\setlength{\topskip}{1\topskip \@plus 5\p@}
\doublehyphendemerits=10000       % No consecutive line hyphens.
\brokenpenalty=10000              % No broken words across columns/pages.
\widowpenalty=9999                % Almost no widows at bottom of page.
\clubpenalty=9999                 % Almost no orphans at top of page.
\interfootnotelinepenalty=9999    % Almost never break footnotes.
%    \end{macrocode}
%
%  \subsection{Fancy Page Headers}
%
%    Setup the the default fancy page headers with an underlined header containing
%    chapter, name and page number.
%
%    \begin{macrocode}
\usepackage{fancyhdr}
329
330
331
332
333
% Help from https://texblog.org/2007/11/07/headerfooter-in-latex-with-fancyhdr/#comment-4783
\fancyhead[LE]{\textrm\thepage}
\fancyhead[LO]{\fancyplain{}{\textsl{\rightmark}}}
\fancyhead[RE]{\fancyplain{}{\textsl{\leftmark}}}
\fancyhead[RO]{\textrm\thepage}
334
335
\chead{}\lfoot{}\rfoot{}\cfoot{}
\pagestyle{fancy}
336
337
338
339
340
\fancypagestyle{plain}{
  \fancyhf{}
  \fancyhead[OR]{\thepage}
  \renewcommand{\headrulewidth}{0pt}
}
341
342
343
344
345
346
347
348
349
%    \end{macrocode}
%
% \begin{macro}{\chaptermark}
% \begin{macro}{\sectionmark}
% \begin{macro}{\subsectionmark}
%
%    Redefine \texttt{chaptermark} and \texttt{sectionmark} to set up the correct header name and produce a
%    banner on the output making the location of messages simpler.
%
350
351
352
353
% The \textbackslash btypeout command is for console logging where chapters start
%
% \textbackslash chapapp expands to "Chapter" or "Appendix"
%
354
355
%    \begin{macrocode}
%<*thesis|minithesis|progress|project|report|gdp>
356
357
\renewcommand{\chaptermark}[1]{\btypeout{\thechapter.\space #1}\markboth{\chaptername\ \thechapter.\hspace{1em}#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection.\hspace{1em}#1}}
358
359
360
\renewcommand{\subsectionmark}[1]{}
%</thesis|minithesis|progress|project|report|gdp>
%<*article>
361
\renewcommand{\sectionmark}[1]{\btypeout{\thesection\hspace{1em}}\markboth{}{\thesection.\hspace{1em}#1}}
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
\renewcommand{\subsectionmark}[1]{}
\renewcommand{\subsubsectionmark}[1]{}
%</article>
%<gdpsummary>\markboth{GDP Summary Report}{GDP Summary Report}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\cleardoublepage}
%
%    Redefine \texttt{cleardoublepage} to remove headers from blank pages
%    in twosided documents.
%
%    \begin{macrocode}
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
%    \end{macrocode}
% \end{macro}
384
385
386
387
388
389
390
391
392
393
394
395
396
% \begin{macro}{\cleartoeven}
%
%    Define \texttt{cleartoeven} to remove headers from blank pages
%    and force to even page for appendix or index.
%
%    \begin{macrocode}
\def\cleartoeven{\clearpage\if@twoside \ifodd\c@page
\hbox{}
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
%    \end{macrocode}
% \end{macro}
397
398
399
400
401
402
403
%
% \subsection{Mathematics}
%
%    Load the \texttt{amsmath} packages, so we can do some serious math, and
%    setup the theorem environments.
%
%    \begin{macrocode}
404
405
%% -------------------- Figure/Table/Eq/Listing Stying --------------------
%% Set the styling for non text elements of the document
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
\usepackage{amsmath,amsfonts,amssymb,amscd,amsthm,xspace}
\theoremstyle{plain}
%<*thesis|minithesis|progress|project|report|gdp>
\newtheorem{example}{Example}[chapter]
\newtheorem{theorem}{Theorem}[chapter]
%</thesis|minithesis|progress|project|report|gdp>
%<*article|gdpsummary>
\newtheorem{example}{Example}[section]
\newtheorem{theorem}{Theorem}[section]
%</article|gdpsummary>
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{axiom}[theorem]{Axiom}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
%    \end{macrocode}
%
% \subsection{Captions}
%
% \begin{macro}{\fref}
% \begin{macro}{\tref}
% \begin{macro}{\eref}
% \begin{macro}{\cref}
% \begin{macro}{\sref}
% \begin{macro}{\aref}
%
435
%   Load the \texttt{caption} package to improve formatting of captions,
436
437
438
%   and provide short referencing commands.
%
%    \begin{macrocode}
439
\usepackage[justification=centerlast,font=small,labelfont=sc]{caption}
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
\setlength{\captionmargin}{20pt}
\newcommand{\fref}[1]{Figure~\ref{#1}}
\newcommand{\tref}[1]{Table~\ref{#1}}
\newcommand{\eref}[1]{Equation~\ref{#1}}
\newcommand{\cref}[1]{Chapter~\ref{#1}}
\newcommand{\sref}[1]{Section~\ref{#1}}
\newcommand{\aref}[1]{Appendix~\ref{#1}}
%    \end{macrocode}
%
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Float Placement}
%
% \begin{macro}{\topfraction}
% \begin{macro}{\textfraction}
%    Preventing figures from appearing on a page by themselves. \LaTeX's figure
%    placement algorithm is quite biased in favour of putting figures on a page
%    by themselves, instead of on the top of a page with some text below it.
%    Fortunately, the parameters of the algorithm can be changed. The main problem
%    is that \LaTeX\ per default only allows a part of the top of a text-page (70\%)
%    to contain figures, and requires at least 20\% of a page to be text when text and
%    figures share a page. These parameters should be set to more reasonable values,
%    for example 85\% and 10\%.
%    \begin{macrocode}
\renewcommand{\topfraction}{0.85}
\renewcommand{\bottomfraction}{.85}
\renewcommand{\textfraction}{0.1}
\renewcommand{\dbltopfraction}{.85}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\floatpagefraction}
%    This helps, but sometimes \LaTeX\ puts a figure on a page by itself, although it
%    would fit perfectly well on the top of a page. This happens when the figure will
%    not fit on the page where it was defined. \LaTeX\ then attempts to put it on a
%    figures-only page before it attempts to put it at the top of the next page. A page
%    may contain figures alone if the figure(s) use at least half the page. To prevent
%    half-empty pages this limit should probably be increased to around 75\%.
%    \begin{macrocode}
\renewcommand{\floatpagefraction}{0.75}
\renewcommand{\dblfloatpagefraction}{.75}
%    \end{macrocode}
%    Be careful not to make \texttt{floatpagefraction} larger than \texttt{topfraction},
%    then you risk to produce a figure that can neither go on the top of a text page,
%    nor on a page by itself. If that happens, the figure and all later figures will be
%    postponed until next time a \texttt{clearpage} is executed (typically at the end of
%    a chapter or the end of the document). This will also happen if a figure is too
%    large to fit on a page.
%    \begin{macrocode}
\setcounter{topnumber}{9}
\setcounter{bottomnumber}{9}
\setcounter{totalnumber}{20}
\setcounter{dbltopnumber}{9}
%    \end{macrocode}
% \end{macro}
%
%
% \subsection{Graphics}
%
%    Load the \texttt{graphicx} package, so we can include pictures easily. Load the \texttt{epstopdf},
%    so that eps files are automatically converted to pdf when pdf\LaTeX\ is used. This requires a
%   version of {\em epstopdf} to be installed on you system. You can find a windows version at\newline
%   \texttt{http://www.ctan.org/tex-archive/support/epstopdf/epstopdf.exe}.
%
%    \begin{macrocode}
\usepackage{graphicx}
\usepackage{epstopdf}
%    \end{macrocode}
%
% \subsection{Subfigures and subtables}
%
516
%    Load the \texttt{subcaption} package, so we can include subfigures easily.
517
518
%
%    \begin{macrocode}
519
\usepackage[]{subcaption}
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
547
548
549
\usepackage{booktabs}
\usepackage{rotating}
%    \end{macrocode}
%
% \subsection{Listings}
%
%    Load the \texttt{listings} package, so we can include listings easily.
%
%    \begin{macrocode}
\usepackage{listings}
% %\usepackage{lstpatch}
\lstset{captionpos=b,
        frame=tb,
        basicstyle=\scriptsize\ttfamily,
        showstringspaces=false,
        keepspaces=true}
\lstdefinestyle{matlab} {
        language=Matlab,
        keywordstyle=\color{blue},
        commentstyle=\color[rgb]{0.13,0.55,0.13}\em,
        stringstyle=\color[rgb]{0.7,0,0} }
%    \end{macrocode}
%
% \subsection{Hyperlinks}
%
%    Load the \texttt{hyperref} package to provide hyperlinks in pdf and dvi documents.
%
%    \begin{macrocode}
\usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,
   bookmarksopenlevel=0,bookmarksnumbered=true,hypertexnames=false,
550
   colorlinks,linkcolor={linkBlue},citecolor={linkBlue},urlcolor={linkBlue},
551
552
553
554
555
556
   pdfstartview={FitV},unicode,breaklinks=true]{hyperref}
\pdfstringdefDisableCommands{
   \let\\\space
}
%    \end{macrocode}
%
557
% \section{Internal Names}\label{IntNames}
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
%
% \begin{macro}{\supervisor}
% \begin{macro}{\examiner}
% \begin{macro}{\degree}
% \begin{macro}{\authors}
% \begin{macro}{\addresses}
% \begin{macro}{\university}
% \begin{macro}{\UNIVERSITY}
% \begin{macro}{\department}
% \begin{macro}{\DEPARTMENT}
% \begin{macro}{\group}
% \begin{macro}{\GROUP}
% \begin{macro}{\faculty}
% \begin{macro}{\FACULTY}
% \begin{macro}{\subject}
% \begin{macro}{\keywords}
%
%    The various elements of the documents are defined
%    as control sequences to make it easy to customize this
577
578
579
580
581
582
583
%    style for other parts of the University. When the
%    command is run the other terms are defined by the args.
%
%    The examiner and supervisor commands can be puralised
%    so that it can print "Supervisors:". This is with an
%    optional argument. [s] which will add and ``s'' to the
%    word "Supervisor"
584
585
%
%    \begin{macrocode}
586
%% --------------------- Organisational Structure ----------------------
587
588
\newcommand*{\supervisor}[2][]{\def\supname{#2}\def\supplural{#1}}
\newcommand*{\examiner}[2][]{\def\examname{#2}\def\examplural{#1}}
589
590
\newcommand*{\degree}[1]{\def\degreename{#1}}
\newcommand*{\authors}[1]{\def\authornames{#1}}
591
\newcommand*{\qualifications}[1]{\def\quals{#1}}
592
\newcommand*{\addresses}[1]{\def\addressnames{#1}}
593
\newcommand*{\doi}[1]{\def\doicode{#1}}
594
\newcommand*{\volume}[2]{\def\volno{#1}\def\volof{#2}}
595
\newcommand*{\orcidid}[1]{\def\orcid{#1}}
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
\newcommand*{\university}[1]{\def\univname{#1}}
\newcommand*{\UNIVERSITY}[1]{\def\UNIVNAME{#1}}
\newcommand*{\department}[1]{\def\deptname{#1}}
\newcommand*{\DEPARTMENT}[1]{\def\DEPTNAME{#1}}
\newcommand*{\group}[1]{\def\groupname{#1}}
\newcommand*{\GROUP}[1]{\def\GROUPNAME{#1}}
\newcommand*{\faculty}[1]{\def\facname{#1}}
\newcommand*{\FACULTY}[1]{\def\FACNAME{#1}}
\newcommand*{\subject}[1]{\def\subjectname{#1}}
\newcommand*{\keywords}[1]{\def\keywordnames{#1}}
%    \end{macrocode}
%
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \begin{macro}{\supname}
% \begin{macro}{\examname}
% \begin{macro}{\degreename}
% \begin{macro}{\authornames}
% \begin{macro}{\univname}
% \begin{macro}{\UNIVNAME}
% \begin{macro}{\deptname}
% \begin{macro}{\DEPTNAME}
% \begin{macro}{\groupname}
% \begin{macro}{\GROUPNAME}
% \begin{macro}{\facname}
% \begin{macro}{\FACNAME}
% \begin{macro}{\subjectname}
% \begin{macro}{\keywordnames}
%
%    The internal names of the elements are set
%    to defaults appropriate to the Department of Electronics and Computer Science.
%
643
%    By running these commands at the top of your tex file it will overwrite the defaults.
644
%    \begin{macrocode}
645
%% --------------------- Organisational Structure ----------------------
646
\doi{}
647
648
649
650
\supervisor  {}
\examiner    {}
\degree      {}
\authors     {}
651
652
\qualifications{}
\orcidid{}
653
654
\volume{}{}
\university  {\texorpdfstring{\href{http://www.southampton.ac.uk}
655
656
                {University of Southampton}}
                {University of Southampton}}
657
\UNIVERSITY  {\MakeUppercase{\univname}}
658
\department  {School of Electronics and Computer Science}
659
\DEPARTMENT  {\MakeUppercase{\deptname}}
660
\group       {Cyber Physical Systems Group}
661
\GROUP       {\MakeUppercase{\groupname}}
662
\faculty     {Faculty of Engineering and Physical Science}
663
\FACULTY     {\MakeUppercase{\facname}}
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
\addresses   {}
\subject     {}
\keywords    {}
%    \end{macrocode}
%
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \section{Special Pages}
%
% \subsection{Title Page}
%
% \begin{macro}{\maketitle}
%
%    Setup an appropriate title page and pdf strings if we are using
%    pdf\LaTeX.
%
693
%    The %\\global\\let\\@title\\@empty has been removed
694
695
696
%
%    Possibly the relax statement also needs to be removed
%
697
698
%   \begin{macrocode}
%<*thesis|minithesis|progress|project|report|gdp|gdpsummary>}
699
%    Start by Adding meta data to the produced document
700
701
702
703
704
705
706
\usepackage{titling}
\AtBeginDocument{
  \hypersetup{pdftitle={\thetitle}}
  \hypersetup{pdfsubject={\subjectname}}
  \hypersetup{pdfauthor={\authornames}}
  \hypersetup{pdfkeywords={\keywordnames}}
}
707
%    Define the title page layout
708
709
710
711
712
713
714
715
716
717
718
719
\renewcommand\maketitle{
  \btypeout{Title Page}
  \thispagestyle{empty}
  \begin{titlepage}
    \let\footnotesize\small
    \let\footnoterule\relax
    \let \footnote \thanks
    \setcounter{footnote}{0}
    \null\vfil
    \vskip 60\p@
    \begin{center}
      \setlength{\parskip}{0pt}
720
721
722
723
      {\scshape\LARGE\textbf{\univname}\par}
      %% TODO: Change all the descriptions to italic like the Thesis one
%<*thesis|minithesis|progress|project|gdp|gdpsummary>
      \bigskip
724
      {\large \facname \par}
725
726
%</thesis|minithesis|progress|project|gdp|gdpsummary>
%<*thesis|minithesis|progress|project>
727
      {\large \deptname \par}
728
%</thesis|minithesis|progress|project>
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
      \vfill
%<*minithesis>
      {\large A mini-thesis submitted for transfer from}
      {\large MPhil to PhD \par}
%</minithesis>
%<*progress>
      {\large A progress report submitted for continuation}
      {\large towards a PhD \par}
%</progress>
%<*project>
      {\large A project report submitted for the}
      {\large award of \par \degreename \par}
%</project>
%<*gdp>
      {\large A group design project report submitted for}
      {\large the award of \par \degreename \par}
%</gdp>
%<*gdpsummary>
      {\large A group design project summary report submitted}
      {\large for the award of \par \degreename \par}
%</gdpsummary>
%<*minithesis|progress|project|gdp|gdpsummary>
      \vfill
752
753
      {\normalsize Supervisor\supplural: \supname \par}
      {\normalsize Examiner\examplural: \examname \par}
754
755
756
757
758
759
      \vfill
      \hspace{6mm}\parbox[t][51mm][s]{89mm}{
        \center
        \vfill
        {\large \bf \@title \par}
        \vfill
760
        {\normalsize \textit{by} \textbf\authornames \par}
761
762
763
764
765
766
767
        \vfill
        {\normalsize \@date \par}
        \vfill
      }
      \parbox[t][95mm][s]{89mm}{}
%</minithesis|progress|project|gdp|gdpsummary>
%<*thesis|report>
768
769
770
771
      {\huge \bf \@title \par
}
      \ifthenelse{\equal{\doicode}{}}
      {}
772
773
774
775
      {\smallskip DOI: \href{http://orcid.org/\doicode}{\doicode}\par}
      \ifthenelse{\equal{\volno}{}}
      {}
      {\smallskip Volume \volno{} of \volof}
776
      \vfill
777
      {\LARGE \textit{by} \par}
778
      \smallskip
779
780
781
782
783
784
785
786
787
788
789
      {\LARGE \textbf\authornames
        \ifthenelse{\equal{\quals}{}}
        {}
        {\par\Large
        \quals}
      \par}
        \ifthenelse{\equal{\orcid}{}}
        {}
        {\smallskip
        ORCiD: \href{http://orcid.org/\orcid}{\orcid}}

790
791
      \vfill
%<*thesis>
792
793
      {\large \textit{A thesis for the degree of} \par}
      {\large \textit{Doctor of Philosophy} \par}
794
%</thesis>
795
%<*report>      {\large  \textit{Technical Report} \par}
796
      \bigskip
797
\bigskip
798
799
      {\large \facname \par}
      {\large \deptname \par}
800
%</report>
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
      \bigskip
      \bigskip
      \bigskip
      {\Large \@date \par}
      \bigskip
%</thesis|report>
    \end{center}
    \par
    \@thanks
    \vfil\null
  \end{titlepage}
  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@thanks\@empty
  \global\let\@author\@empty
  \global\let\@date\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
  \cleardoublepage
}
%</thesis|minithesis|progress|project|report|gdp|gdpsummary>
%<*article>
\if@titlepage
  \renewcommand\maketitle{
    \btypeout{Title Page}
    \markboth{\authornames}{\@title}
    \begin{titlepage}
    \thispagestyle{empty}
    \let\footnotesize\small
    \let\footnoterule\relax
    \let \footnote \thanks
    \null\vfil
    \vskip 60\p@
    \begin{center}
      {\LARGE \@title \par}
      \vskip 3em
      {\large \lineskip .75em
        \begin{tabular}[t]{c} \authornames \end{tabular}
      \par}
      \vskip 1em
      {\large \lineskip .5em
        \begin{tabular}[t]{c} \addressnames \end{tabular}
      \par}
      \vskip 1.5em
      {\large \@date \par}
      \if\keywordnames
      \else
        \quotation
        \vskip 1.5em
        {\noindent \normalsize
            \textbf{Keywords:}
            \textit{\keywordnames}
        \par}
        \endquotation
      \fi
    \end{center}
    \par
    \@thanks
    \vfil\null
    \end{titlepage}
    \setcounter{footnote}{0}
    \global\let\thanks\relax
    \global\let\maketitle\relax
    \global\let\@maketitle\relax
    \global\let\@thanks\@empty
    \global\let\@author\@empty
    \global\let\@date\@empty
    \global\let\title\relax
    \global\let\author\relax
    \global\let\date\relax
    \global\let\and\relax
  }
\else
  \renewcommand\maketitle{
    \btypeout{Title Page}
    \markboth{\authornames}{\@title}
    \thispagestyle{empty}
    \par
    \begingroup
      \renewcommand\thefootnote{\@fnsymbol\c@footnote}
      \def\@makefnmark{
        \rlap{\@textsuperscript{\normalfont\@thefnmark}}
      }
      \long\def\@makefntext##1{
        \parindent 1em\noindent \hb@xt@1.8em
        {\hss\@textsuperscript{\normalfont\@thefnmark}}##1
      }
      \if@twocolumn
        \ifnum \col@number=\@ne
          \@maketitle
        \else
          \twocolumn[\@maketitle]%
        \fi
      \else
        \newpage
        % Prevent figures from going at top of page.
        \global\@topnum\z@
        \@maketitle
      \fi
      \thispagestyle{plain}\@thanks
    \endgroup
    \setcounter{footnote}{0}%
    \global\let\thanks\relax
    \global\let\maketitle\relax
    \global\let\@maketitle\relax
    \global\let\@thanks\@empty
    \global\let\@author\@empty
    \global\let\@date\@empty
    \global\let\title\relax
    \global\let\author\relax
    \global\let\date\relax
    \global\let\and\relax
  }
  \def\@maketitle{
    \newpage
    \null
    \vskip 2em
    \begin{center}
      \let \footnote \thanks
      {\LARGE \@title \par}
      \vskip 1.5em
      {\large \lineskip .5em
        \begin{tabular}[t]{c} \authornames \end{tabular}
      \par}
      \vskip 0.7em
      {\large \lineskip .5em
        \begin{tabular}[t]{c} \addressnames \end{tabular}
      \par}
      \vskip 1em
      {\large \@date}
    \end{center}
    \par
    \vskip 1.5em
  }
\fi
%</article>
%    \end{macrocode}
%
% \end{macro}
%
% \subsection{Abstract Page}
%
% \begin{macro}{\abstract}
%
%    Setup an appropriate abstract page.
%
%    \begin{macrocode}
%<*thesis|minithesis|progress|project|report|gdp>
\newenvironment{abstract}
{
  \btypeout{Abstract Page}
  \thispagestyle{empty}
  \null\vfil
  \begin{center}
    \setlength{\parskip}{0pt}
959
    {\textsc\normalsize \univname \par}
960
    \bigskip
961
    {\underline{Abstract} \par}
962
    \bigskip
963
    {\textsc\normalsize \facname \par}
964
%<*thesis|minithesis|progress|project|report>
965
    {\textsc\normalsize \deptname \par}
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%</thesis|minithesis|progress|project|report>
    \bigskip
%<*thesis>
    {\normalsize \underline{Doctor of Philosophy}\par}
%</thesis>
%<*minithesis>
    {\normalsize \underline{A mini-thesis submitted for transfer from MPhil to PhD}\par}
%</minithesis>
%<*progress>
    {\normalsize \underline{A progress report submitted for continuation towards a PhD}\par}
%</progress>
%<*project>
    {\normalsize \underline{A project report submitted for the award of \degreename}\par}
%</project>
%<*gdp>
    {\normalsize \underline{A group design project report submitted for the award of \degreename}\par}
%</gdp>
    \bigskip
    {\normalsize\bf \@title \par}
    \medskip
    {\normalsize by \authornames \par}
    \bigskip
  \end{center}
}
{
  \vfil\vfil\vfil\null
  \cleardoublepage
}
%</thesis|minithesis|progress|project|report|gdp>
%<*article>
\if@titlepage
  \renewenvironment{abstract}{
      \titlepage
      \null\vfil
      \@beginparpenalty\@lowpenalty