1 | %% |
---|
2 | %% This is file `Thesis.cls', based on 'ECSthesis.cls', by Steve R. Gunn |
---|
3 | %% generated with the docstrip utility. |
---|
4 | %% |
---|
5 | %% Created by Steve R. Gunn, modified by Sunil Patel: www.sunilpatel.co.uk |
---|
6 | \NeedsTeXFormat{LaTeX2e}[1996/12/01] |
---|
7 | \ProvidesClass{Thesis} |
---|
8 | [2007/22/02 v1.0 |
---|
9 | LaTeX document class] |
---|
10 | \def\baseclass{book} |
---|
11 | \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\baseclass}} |
---|
12 | \def\@checkoptions#1#2{ |
---|
13 | \edef\@curroptions{\@ptionlist{\@currname.\@currext}} |
---|
14 | \@tempswafalse |
---|
15 | \@tfor\@this:=#2\do{ |
---|
16 | \@expandtwoargs\in@{,\@this,}{,\@curroptions,} |
---|
17 | \ifin@ \@tempswatrue \@break@tfor \fi} |
---|
18 | \let\@this\@empty |
---|
19 | \if@tempswa \else \PassOptionsToClass{#1}{\baseclass}\fi |
---|
20 | } |
---|
21 | \@checkoptions{11pt}{{10pt}{11pt}{12pt}} |
---|
22 | \PassOptionsToClass{legalpaper}{\baseclass} |
---|
23 | \ProcessOptions\relax |
---|
24 | \LoadClass{\baseclass} |
---|
25 | \newcommand\bhrule{\typeout{------------------------------------------------------------------------------}} |
---|
26 | |
---|
27 | \newcommand\Declaration[1]{ |
---|
28 | \btypeout{Declaration of Authorship} |
---|
29 | \addtotoc{Declaration of Authorship} |
---|
30 | \thispagestyle{plain} |
---|
31 | \null\vfil |
---|
32 | %\vskip 60\p@ |
---|
33 | \begin{center}{\huge\bf Declaration of Authorship\par}\end{center} |
---|
34 | %\vskip 60\p@ |
---|
35 | {\normalsize #1} |
---|
36 | \vfil\vfil\null |
---|
37 | %\cleardoublepage |
---|
38 | } |
---|
39 | \newcommand\btypeout[1]{\bhrule\typeout{\space #1}\bhrule} |
---|
40 | \def\today{\ifcase\month\or |
---|
41 | January\or February\or March\or April\or May\or June\or |
---|
42 | July\or August\or September\or October\or November\or December\fi |
---|
43 | \space \number\year} |
---|
44 | \usepackage{setspace} |
---|
45 | %\onehalfspacing |
---|
46 | % TODO: please turn this back on |
---|
47 | \doublespacing |
---|
48 | \setlength{\parindent}{0pt} |
---|
49 | \setlength{\parskip}{2.0ex plus0.5ex minus0.2ex} |
---|
50 | \iffalse |
---|
51 | \usepackage{vmargin} |
---|
52 | \setmarginsrb { 1.5in} % left margin |
---|
53 | { 0.6in} % top margin |
---|
54 | { 1.0in} % right margin |
---|
55 | { 0.8in} % bottom margin |
---|
56 | { 20pt} % head height |
---|
57 | {0.25in} % head sep |
---|
58 | { 9pt} % foot height |
---|
59 | { 0.3in} % foot sep |
---|
60 | \fi |
---|
61 | \raggedbottom |
---|
62 | \setlength{\topskip}{1\topskip \@plus 5\p@} |
---|
63 | \doublehyphendemerits=10000 % No consecutive line hyphens. |
---|
64 | \brokenpenalty=10000 % No broken words across columns/pages. |
---|
65 | \widowpenalty=9999 % Almost no widows at bottom of page. |
---|
66 | \clubpenalty=9999 % Almost no orphans at top of page. |
---|
67 | \interfootnotelinepenalty=9999 % Almost never break footnotes. |
---|
68 | \usepackage{geometry} |
---|
69 | \geometry{ |
---|
70 | letterpaper, |
---|
71 | left=1.0in,top=0.5in,right=1.0in,bottom=0.5in,footskip=1cm, |
---|
72 | headheight=20pt,headsep=0.25in,%footheight=9pt, |
---|
73 | includeheadfoot |
---|
74 | } |
---|
75 | \usepackage{fancyhdr} |
---|
76 | \lhead[\rm\thepage]{\fancyplain{}{\sl{\rightmark}}} |
---|
77 | \rhead[\fancyplain{}{\sl{\leftmark}}]{\rm\thepage} |
---|
78 | \chead{}\lfoot{}\rfoot{}\cfoot{} |
---|
79 | \pagestyle{fancy} |
---|
80 | \renewcommand{\chaptermark}[1]{\btypeout{\thechapter\space #1}\markboth{\@chapapp\ \thechapter\ #1}{\@chapapp\ \thechapter\ #1}} |
---|
81 | \renewcommand{\sectionmark}[1]{} |
---|
82 | \renewcommand{\subsectionmark}[1]{} |
---|
83 | \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else |
---|
84 | \hbox{} |
---|
85 | \thispagestyle{empty} |
---|
86 | \newpage |
---|
87 | \if@twocolumn\hbox{}\newpage\fi\fi\fi} |
---|
88 | \usepackage{amsmath,amsfonts,amssymb,amscd,amsthm,xspace} |
---|
89 | \theoremstyle{plain} |
---|
90 | \newtheorem{example}{Example}[chapter] |
---|
91 | \newtheorem{theorem}{Theorem}[chapter] |
---|
92 | \newtheorem{corollary}[theorem]{Corollary} |
---|
93 | \newtheorem{lemma}[theorem]{Lemma} |
---|
94 | \newtheorem{proposition}[theorem]{Proposition} |
---|
95 | \newtheorem{axiom}[theorem]{Axiom} |
---|
96 | \theoremstyle{definition} |
---|
97 | \newtheorem{definition}[theorem]{Definition} |
---|
98 | \theoremstyle{remark} |
---|
99 | \newtheorem{remark}[theorem]{Remark} |
---|
100 | \usepackage[centerlast,small,sc]{caption} |
---|
101 | \setlength{\captionmargin}{20pt} |
---|
102 | \newcommand{\fref}[1]{Figure~\ref{#1}} |
---|
103 | \newcommand{\tref}[1]{Table~\ref{#1}} |
---|
104 | \newcommand{\eref}[1]{Equation~\ref{#1}} |
---|
105 | \newcommand{\cref}[1]{Chapter~\ref{#1}} |
---|
106 | \newcommand{\sref}[1]{Section~\ref{#1}} |
---|
107 | \newcommand{\aref}[1]{Appendix~\ref{#1}} |
---|
108 | \renewcommand{\topfraction}{0.85} |
---|
109 | \renewcommand{\bottomfraction}{.85} |
---|
110 | \renewcommand{\textfraction}{0.1} |
---|
111 | \renewcommand{\dbltopfraction}{.85} |
---|
112 | \renewcommand{\floatpagefraction}{0.75} |
---|
113 | \renewcommand{\dblfloatpagefraction}{.75} |
---|
114 | \setcounter{topnumber}{9} |
---|
115 | \setcounter{bottomnumber}{9} |
---|
116 | \setcounter{totalnumber}{20} |
---|
117 | \setcounter{dbltopnumber}{9} |
---|
118 | \usepackage{graphicx} |
---|
119 | \usepackage{epstopdf} |
---|
120 | \usepackage[scriptsize]{subfigure} |
---|
121 | \usepackage{booktabs} |
---|
122 | \usepackage{rotating} |
---|
123 | \usepackage{listings} |
---|
124 | \usepackage{lstpatch} |
---|
125 | \lstset{captionpos=b, |
---|
126 | frame=tb, |
---|
127 | basicstyle=\scriptsize\ttfamily, |
---|
128 | showstringspaces=false, |
---|
129 | keepspaces=true} |
---|
130 | \lstset{escapeinside={<@}{@>}} |
---|
131 | \lstdefinestyle{matlab} { |
---|
132 | language=Matlab, |
---|
133 | keywordstyle=\color{blue}, |
---|
134 | commentstyle=\color[rgb]{0.13,0.55,0.13}\em, |
---|
135 | stringstyle=\color[rgb]{0.7,0,0} } |
---|
136 | \usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true, |
---|
137 | bookmarksopenlevel=0,bookmarksnumbered=true,hypertexnames=false, |
---|
138 | colorlinks,linkcolor={blue},citecolor={blue},urlcolor={red}, |
---|
139 | pdfstartview={FitV},unicode,breaklinks=true]{hyperref} |
---|
140 | \pdfstringdefDisableCommands{ |
---|
141 | \let\\\space |
---|
142 | } |
---|
143 | \lstdefinestyle{C++nokeyword} { |
---|
144 | language=C++, |
---|
145 | basicstyle=\linespread{1}\ttfamily, |
---|
146 | %numbers=left, |
---|
147 | stepnumber=1, |
---|
148 | firstnumber=1, |
---|
149 | %keywordstyle=\color{blue}\ttfamily, |
---|
150 | stringstyle=\color{red}\ttfamily, |
---|
151 | commentstyle=\color{ForestGreen}\ttfamily, |
---|
152 | } |
---|
153 | \lstdefinestyle{C++} { |
---|
154 | language=C++, |
---|
155 | basicstyle=\linespread{1}\ttfamily, |
---|
156 | %numbers=left, |
---|
157 | stepnumber=1, |
---|
158 | firstnumber=1, |
---|
159 | keywordstyle=\color{blue}\ttfamily, |
---|
160 | stringstyle=\color{red}\ttfamily, |
---|
161 | commentstyle=\color{ForestGreen}\ttfamily, |
---|
162 | } |
---|
163 | \lstdefinestyle{Python} { |
---|
164 | language=Python, |
---|
165 | basicstyle=\linespread{1}\ttfamily, |
---|
166 | %numbers=left, |
---|
167 | stepnumber=1, |
---|
168 | firstnumber=1, |
---|
169 | keywordstyle=\color{blue}\ttfamily, |
---|
170 | stringstyle=\color{red}\ttfamily, |
---|
171 | commentstyle=\color{ForestGreen}\ttfamily, |
---|
172 | } |
---|
173 | |
---|
174 | \newcommand*{\supervisor}[1]{\def\supname{#1}} |
---|
175 | \newcommand*{\emails}[1]{\def\supname{#1}} |
---|
176 | \newcommand*{\examiner}[1]{\def\examname{#1}} |
---|
177 | \newcommand*{\degree}[1]{\def\degreename{#1}} |
---|
178 | \newcommand*{\authors}[1]{\def\authornames{#1}} |
---|
179 | \newcommand*{\addresses}[1]{\def\addressnames{#1}} |
---|
180 | \newcommand*{\university}[1]{\def\univname{#1}} |
---|
181 | \newcommand*{\UNIVERSITY}[1]{\def\UNIVNAME{#1}} |
---|
182 | \newcommand*{\department}[1]{\def\deptname{#1}} |
---|
183 | \newcommand*{\DEPARTMENT}[1]{\def\DEPTNAME{#1}} |
---|
184 | \newcommand*{\group}[1]{\def\groupname{#1}} |
---|
185 | \newcommand*{\GROUP}[1]{\def\GROUPNAME{#1}} |
---|
186 | \newcommand*{\faculty}[1]{\def\facname{#1}} |
---|
187 | \newcommand*{\FACULTY}[1]{\def\FACNAME{#1}} |
---|
188 | \newcommand*{\subject}[1]{\def\subjectname{#1}} |
---|
189 | \newcommand*{\keywords}[1]{\def\keywordnames{#1}} |
---|
190 | \supervisor {} |
---|
191 | \emails {tmltran@uwaterloo.ca} |
---|
192 | \examiner {} |
---|
193 | \degree {} |
---|
194 | \authors {} |
---|
195 | \university {\texorpdfstring{\href{University Web Site URL Here (include http://)} |
---|
196 | {University Name}} |
---|
197 | {University Name}} |
---|
198 | \UNIVERSITY {\texorpdfstring{\href{https://www.uwaterloo.ca} |
---|
199 | {UNIVERSITY OF WATERLOO}} |
---|
200 | {UNIVERSITY OF WATERLOO}} |
---|
201 | \department {\texorpdfstring{\href{Department or School Web Site URL Here (include http://)} |
---|
202 | {Software Engineering Department}} |
---|
203 | {Software Engineering Department}} |
---|
204 | \DEPARTMENT {\texorpdfstring{\href{Department or School Web Site URL Here (include http://)} |
---|
205 | {SOFTWARE ENGINEERING DEPARTMENT}} |
---|
206 | {SOFTWARE ENGINEERING DEPARTMENT}} |
---|
207 | \group {\texorpdfstring{\href{Research Group Web Site URL Here (include http://)} |
---|
208 | {Research Group Name}} |
---|
209 | {Research Group Name}} |
---|
210 | \GROUP {\texorpdfstring{\href{Research Group Web Site URL Here (include http://)} |
---|
211 | {RESEARCH GROUP NAME (IN BLOCK CAPITALS)}} |
---|
212 | {RESEARCH GROUP NAME (IN BLOCK CAPITALS)}} |
---|
213 | \faculty {\texorpdfstring{\href{Faculty Web Site URL Here (include http://)} |
---|
214 | {Faculty of Mathematics and Faculty of Engineering}} |
---|
215 | {Faculty of Mathematics and Faculty of Engineering}} |
---|
216 | \FACULTY {\texorpdfstring{\href{Faculty Web Site URL Here (include http://)} |
---|
217 | {FACULTY NAME (IN BLOCK CAPITALS)}} |
---|
218 | {FACULTY NAME (IN BLOCK CAPITALS)}} |
---|
219 | \addresses {} |
---|
220 | \subject {} |
---|
221 | \keywords {} |
---|
222 | \renewcommand\maketitle{ |
---|
223 | \btypeout{Title page} |
---|
224 | \hypersetup{pdftitle={\@title}} |
---|
225 | \hypersetup{pdfsubject=\subjectname} |
---|
226 | \hypersetup{pdfauthor=\authornames} |
---|
227 | \hypersetup{pdfkeywords=\keywordnames} |
---|
228 | \thispagestyle{empty} |
---|
229 | \begin{titlepage} |
---|
230 | \let\footnotesize\small |
---|
231 | \let\footnoterule\relax |
---|
232 | \let \footnote \thanks |
---|
233 | \setcounter{footnote}{0} |
---|
234 | \null\vfil |
---|
235 | \vskip 60\p@ |
---|
236 | \begin{center} |
---|
237 | \setlength{\parskip}{0pt} |
---|
238 | {\large\textbf{\UNIVNAME}\par} |
---|
239 | \vfill |
---|
240 | {\huge \bf \@title \par} |
---|
241 | \vfill |
---|
242 | {\LARGE by \par} |
---|
243 | \smallskip |
---|
244 | {\LARGE \authornames \par} |
---|
245 | \vfill |
---|
246 | \bigskip |
---|
247 | \bigskip |
---|
248 | {\large in the \par} |
---|
249 | {\large \facname \par} |
---|
250 | {\large \deptname \par} |
---|
251 | \bigskip |
---|
252 | \bigskip |
---|
253 | \bigskip |
---|
254 | {\Large \@date \par} |
---|
255 | \bigskip |
---|
256 | \end{center} |
---|
257 | \par |
---|
258 | \@thanks |
---|
259 | \vfil\null |
---|
260 | \end{titlepage} |
---|
261 | \setcounter{footnote}{0}% |
---|
262 | \global\let\thanks\relax |
---|
263 | \global\let\maketitle\relax |
---|
264 | \global\let\@thanks\@empty |
---|
265 | \global\let\@author\@empty |
---|
266 | \global\let\@date\@empty |
---|
267 | \global\let\@title\@empty |
---|
268 | \global\let\title\relax |
---|
269 | \global\let\author\relax |
---|
270 | \global\let\date\relax |
---|
271 | \global\let\and\relax |
---|
272 | \cleardoublepage |
---|
273 | } |
---|
274 | \newenvironment{preface} |
---|
275 | { |
---|
276 | \btypeout{Preface} |
---|
277 | \thispagestyle{empty} |
---|
278 | \null\vfil |
---|
279 | \begin{center} |
---|
280 | \setlength{\parskip}{0pt} |
---|
281 | %{\normalsize \UNIVNAME \par} |
---|
282 | %\bigskip |
---|
283 | {\huge{\textit{Preface}} \par} |
---|
284 | %\bigskip |
---|
285 | %{\normalsize \facname \par} |
---|
286 | %{\normalsize \deptname \par} |
---|
287 | %\bigskip |
---|
288 | %{\normalsize\bf \@title \par} |
---|
289 | %\medskip |
---|
290 | %{\normalsize by \authornames \par} |
---|
291 | %\bigskip |
---|
292 | \end{center} |
---|
293 | } |
---|
294 | { |
---|
295 | \vfil\vfil\vfil\null |
---|
296 | \cleardoublepage |
---|
297 | } |
---|
298 | \addtocounter{secnumdepth}{1} |
---|
299 | \setcounter{tocdepth}{6} |
---|
300 | \newcounter{dummy} |
---|
301 | \newcommand\addtotoc[1]{ |
---|
302 | \refstepcounter{dummy} |
---|
303 | \addcontentsline{toc}{chapter}{#1}} |
---|
304 | \renewcommand\tableofcontents{ |
---|
305 | \btypeout{Table of Contents} |
---|
306 | \begin{spacing}{1}{ |
---|
307 | \setlength{\parskip}{1pt} |
---|
308 | \if@twocolumn |
---|
309 | \@restonecoltrue\onecolumn |
---|
310 | \else |
---|
311 | \@restonecolfalse |
---|
312 | \fi |
---|
313 | \chapter*{\contentsname |
---|
314 | \@mkboth{ |
---|
315 | \MakeUppercase\contentsname}{\MakeUppercase\contentsname}} |
---|
316 | \@starttoc{toc} |
---|
317 | \if@restonecol\twocolumn\fi |
---|
318 | \cleardoublepage |
---|
319 | }\end{spacing} |
---|
320 | } |
---|
321 | \renewcommand\listoffigures{ |
---|
322 | \btypeout{List of Figures} |
---|
323 | \addtotoc{List of Figures} |
---|
324 | \begin{spacing}{1}{ |
---|
325 | \setlength{\parskip}{1pt} |
---|
326 | \if@twocolumn |
---|
327 | \@restonecoltrue\onecolumn |
---|
328 | \else |
---|
329 | \@restonecolfalse |
---|
330 | \fi |
---|
331 | \chapter*{\listfigurename |
---|
332 | \@mkboth{\MakeUppercase\listfigurename} |
---|
333 | {\MakeUppercase\listfigurename}} |
---|
334 | \@starttoc{lof} |
---|
335 | \if@restonecol\twocolumn\fi |
---|
336 | \cleardoublepage |
---|
337 | }\end{spacing} |
---|
338 | } |
---|
339 | \renewcommand\listoftables{ |
---|
340 | \btypeout{List of Tables} |
---|
341 | \addtotoc{List of Tables} |
---|
342 | \begin{spacing}{1}{ |
---|
343 | \setlength{\parskip}{1pt} |
---|
344 | \if@twocolumn |
---|
345 | \@restonecoltrue\onecolumn |
---|
346 | \else |
---|
347 | \@restonecolfalse |
---|
348 | \fi |
---|
349 | \chapter*{\listtablename |
---|
350 | \@mkboth{ |
---|
351 | \MakeUppercase\listtablename}{\MakeUppercase\listtablename}} |
---|
352 | \@starttoc{lot} |
---|
353 | \if@restonecol\twocolumn\fi |
---|
354 | \cleardoublepage |
---|
355 | }\end{spacing} |
---|
356 | } |
---|
357 | \newcommand\listsymbolname{Abbreviations} |
---|
358 | \usepackage{longtable} |
---|
359 | \newcommand\listofsymbols[2]{ |
---|
360 | \btypeout{\listsymbolname} |
---|
361 | \addtotoc{\listsymbolname} |
---|
362 | \chapter*{\listsymbolname |
---|
363 | \@mkboth{ |
---|
364 | \MakeUppercase\listsymbolname}{\MakeUppercase\listsymbolname}} |
---|
365 | \begin{longtable}[c]{#1}#2\end{longtable}\par |
---|
366 | \cleardoublepage |
---|
367 | } |
---|
368 | \newcommand\listconstants{Physical Constants} |
---|
369 | \usepackage{longtable} |
---|
370 | \newcommand\listofconstants[2]{ |
---|
371 | \btypeout{\listconstants} |
---|
372 | \addtotoc{\listconstants} |
---|
373 | \chapter*{\listconstants |
---|
374 | \@mkboth{ |
---|
375 | \MakeUppercase\listconstants}{\MakeUppercase\listconstants}} |
---|
376 | \begin{longtable}[c]{#1}#2\end{longtable}\par |
---|
377 | \cleardoublepage |
---|
378 | } |
---|
379 | \newcommand\listnomenclature{Symbols} |
---|
380 | \usepackage{longtable} |
---|
381 | \newcommand\listofnomenclature[2]{ |
---|
382 | \btypeout{\listnomenclature} |
---|
383 | \addtotoc{\listnomenclature} |
---|
384 | \chapter*{\listnomenclature |
---|
385 | \@mkboth{ |
---|
386 | \MakeUppercase\listnomenclature}{\MakeUppercase\listnomenclature}} |
---|
387 | \begin{longtable}[c]{#1}#2\end{longtable}\par |
---|
388 | \cleardoublepage |
---|
389 | } |
---|
390 | \newcommand\acknowledgements[1]{ |
---|
391 | \btypeout{Acknowledgements} |
---|
392 | \addtotoc{Acknowledgements} |
---|
393 | \thispagestyle{plain} |
---|
394 | \begin{center}{\huge{\textit{Acknowledgements}} \par}\end{center} |
---|
395 | {\normalsize #1} |
---|
396 | \vfil\vfil\null |
---|
397 | |
---|
398 | } |
---|
399 | \newcommand\dedicatory[1]{ |
---|
400 | \btypeout{Dedicatory} |
---|
401 | \thispagestyle{plain} |
---|
402 | \null\vfil |
---|
403 | \vskip 60\p@ |
---|
404 | \begin{center}{\Large \sl #1}\end{center} |
---|
405 | \vfil\null |
---|
406 | \cleardoublepage |
---|
407 | } |
---|
408 | \renewcommand\backmatter{ |
---|
409 | \if@openright |
---|
410 | \cleardoublepage |
---|
411 | \else |
---|
412 | \clearpage |
---|
413 | \fi |
---|
414 | \addtotoc{\bibname} |
---|
415 | \btypeout{\bibname} |
---|
416 | \@mainmatterfalse} |
---|
417 | \endinput |
---|
418 | %% |
---|
419 | %% End of file `Thesis.cls'. |
---|