-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUoYCSproject.cls
executable file
·217 lines (193 loc) · 6.86 KB
/
UoYCSproject.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
% Jeremy Jacob UoYCSproject
% A class file to typeset BEng, Bsc, MEng, MMath and taught MSc
% project reports in the Department of Computer Science at the
% University of York.
% History
%
% Version 1
%
% 2004Apr27 Initial version
% 2004May10 Generation of list of tables and figures removed
% 2004Dec08 Minor fixes to error messages
% 2005Feb02 Package pdfcprot replaced by microtype
% 2005Apr12 dedication and acknowledgements now come after abstract
% 2005Jul27 added option `sc' to `mathpazo' package & `textcomp' package
% 2005Aug31 added packages for Helvetica and Courier fonts
%
% Version 2 created, not backward compatible with Version 1
%
% 2006Mar23 moved front matter generation from \AtBeginDocument to
% separately called \maketitle
% 2006Mar23 added options for choice of citation style
% 2006May12 improved communication with type area calculation
% 2006Jul03 added hypcap package
% 2006Dec10 added fixltx2e package
% 2007May31 fixed autoref names
% 2007Nov01 fixed Masters title names
% 2007Nov12 Added old-style text figures.
% 2008Oct03 used hyperref option `pdfusetitle'
% 2008Oct27 removed page numbers from `Part' pages
% 2009Jun26 changed to IEEE trans style; removed options.
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{UoYCSproject}[2008/10/27 V2.11 Jeremy Jacob]
% Koma-script report style
\PassOptionsToPackage{twoside}{typearea}
\LoadClass[11pt,a4paper,twoside,abstracton,pointlessnumbers,BCOR13mm,DIVcalc]{scrreprt}
\RequirePackage[T1]{fontenc} % prevents < in text mode turning into
\RequirePackage{textcomp} % !', etc
\RequirePackage[sc,osf]{mathpazo} % Palatino font
\RequirePackage{courier} % nicer typewriter-style fonts
\RequirePackage[scaled=.9]{helvet} % nice san serif fonts
\RequirePackage{microtype} % micro-typographical extensions for
% pdf(e)(la)tex
\RequirePackage[british]{babel} % British hyphenation patterns, etc.
\RequirePackage{fixltx2e}
\RequirePackage{ifthen}
\pagestyle{headings}
\renewcommand{\partpagestyle}{empty}
% Reference control
\RequirePackage[numbers,sort&compress,square,comma]{natbib}
\bibliographystyle{IEEEtranN}
\typearea[current]{calc} % force page layout recalculation after
% changing all the fonts
\newcommand*{\UoYCSP@mk@degree}[1]{%
\expandafter\def\csname#1\endcsname{\newcommand*{\UoYCSP@degree}{#1}}%
}
\UoYCSP@mk@degree{BEng}
\UoYCSP@mk@degree{BSc}
\UoYCSP@mk@degree{MEng}
\UoYCSP@mk@degree{MMath}
\newcommand*{\SWE}{\newcommand*{\UoYCSP@degree}{MSc~in~Software~Engineering}}
\newcommand*{\SCSE}{\newcommand*{\UoYCSP@degree}{MSc~in~Safety~Critical~Systems~Engineering}}
\newcommand*{\MIP}{\newcommand*{\UoYCSP@degree}{MSc~in~Information~Processing}}
\newcommand*{\MIT}{\newcommand*{\UoYCSP@degree}{MSc~in~Information~Technology}}
\newcommand*{\MNC}{\newcommand*{\UoYCSP@degree}{MSc~in~Natural~Computation}}
\newcommand*{\GTC}{\newcommand*{\UoYCSP@degree}{MSc~in~Gas~Turbine~Control}}
\newcommand*{\wordcount}[1]{\newcommand*{\UoYCSP@wordcount}{#1}}
\newcommand*{\includes}[1]{\renewcommand*{\UoYCSP@includes}{#1}}
\newcommand*{\UoYCSP@includes}{}
\newcommand*{\excludes}[1]{\renewcommand*{\UoYCSP@excludes}{#1}}
\newcommand*{\UoYCSP@excludes}{}
\newcommand*{\supervisor}[1]{\newcommand*{\UoYCSP@supervisor}{#1}}
\date{\fbox{\Huge DRAFT PROCESSED \today}}
\titlehead{The University of York\hfill Department of Computer Science}
\subject{%
\ifx\UoYCSP@degree\undefined%
\ClassError{UoYCSproject}%
{degree scheme not set}
{Declare the degree scheme in the preamble using
\protect\BEng, \protect\MEng, etc.}
\else%
\large Submitted in part fulfilment for the degree of
\UoYCSP@degree.%
\fi%
}
\publishers{%
\large
\ifx\UoYCSP@supervisor\undefined%
\ClassError{UoYCSproject}%
{supervisor not set}
{Declare the supervisor in the preamble using \protect\supervisor{Name}}
\else%
Supervisor: \UoYCSP@supervisor%
\fi%
\vspace{\fill}
\ifx\UoYCSP@wordcount\undefined%
\ClassError{UoYCSproject}%
{wordcount not set}
{Declare the word count in the preamble using \protect\wordcount{Numeral}.} %
\else
Number of words = \UoYCSP@wordcount, as counted by
\textsf{detex~|~wc~-w}.
\fi
This includes the body of the report%
\ifthenelse{ \equal{\UoYCSP@includes}{\@empty}
\and\equal{\UoYCSP@excludes}{\@empty}}
{\ only}
{\ifthenelse{\equal{\UoYCSP@includes}{\@empty}}%
{}%
{, and \UoYCSP@includes}%
\ifthenelse{\equal{\UoYCSP@excludes}{\@empty}}%
{}%
{, but not \UoYCSP@excludes}%
}%
.%
}
\let\old@abstract\abstract
\let\endold@abstract\endabstract
\renewcommand{\abstract}[1]{\newcommand{\UoYCSP@abstract}{#1}}
\renewcommand{\endabstract}{}
\let\old@dedication\dedication
\newcommand*{\UoYCSP@dedication}{}
\renewcommand*{\dedication}[1]{\renewcommand*{\UoYCSP@dedication}{#1}}
\newif\ifacknowledgements
\acknowledgementsfalse
\newcommand*{\UoYCSP@acknowledgements}{}
\newcommand{\acknowledgements}[1]{%
\renewcommand{\UoYCSP@acknowledgements}{#1}%
\acknowledgementstrue
}
\InputIfFileExists{\jobname.ldf}{}
\RequirePackage[pdfusetitle]{hyperref}% automatic hyperlinks, etc
\RequirePackage[all]{hypcap}% improve link placement in floats
\hypersetup{%
pdfstartview={Fit}%
}
\urlstyle{sf}
\renewcommand*{\Itemautorefname}{Item}
\renewcommand*{\chapterautorefname}{Chapter}
\renewcommand*{\sectionautorefname}{Section}
\renewcommand*{\subsectionautorefname}{Subsection}
\renewcommand*{\subsubsectionautorefname}{Subsubsection}
\renewcommand*{\paragraphautorefname}{Paragraph}
\renewcommand*{\Hfootnoteautorefname}{Footnote}
%\renewcommand*{\pageautorefname}{Page}
\let\old@maketitle=\maketitle
\renewcommand*{\maketitle}{%
\old@maketitle%
\ifx\UoYCSP@abstract\undefined%
\ClassError%
{UoYCSproject}%
{No abstract!}%
{Declare an abstract in the preamble using \protect\abstract{Text}.}
\else%
\begin{old@abstract}%
\UoYCSP@abstract%
\end{old@abstract}%
\fi%
% dedication & acknowledgements
\ifthenelse%
{\equal{\UoYCSP@dedication}{\@empty}
\and\equal{\UoYCSP@acknowledgements}{\@empty}}
{}{
\cleardoublepage%
\thispagestyle{empty}
\vspace*{\fill}%
%
\ifthenelse{\equal{\UoYCSP@dedication}{\@empty}}%
{}%
{ \begin{center}%
\large\UoYCSP@dedication%
\end{center}%
}%
%
\ifacknowledgements%
{ \vfill%
\normalsize%
\begin{center}%
\large\bfseries Acknowledgements%
\end{center}%
\UoYCSP@acknowledgements%
}%
\fi%
\vspace*{\fill}%
}%
\cleardoublepage%
\microtypesetup{protrusion=false}%
\tableofcontents%
\microtypesetup{protrusion=true}%
\listoffigures
}
\AtBeginDocument{%
\nonfrenchspacing%
}