-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwmthesis.cls
executable file
·643 lines (561 loc) · 18.9 KB
/
wmthesis.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
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
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
435
436
437
438
439
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
516
517
518
519
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
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
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
643
%%---------------------------------------------------
% The commented out commands are not needed for
% the 10/08/12 standards. Other commands have been
% modified to match these standards. -- Ruth
%%---------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{wmthesis}
%%---------------------------------------------------
%%-- Load the base class and modify current macros.
%%---------------------------------------------------
\newif\if@usecppsyntax \@usecppsyntaxfalse
\DeclareOption{cpp}{\@usecppsyntaxtrue}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
\ProcessOptions
%\PassOptionsToClass{12pt}{report}
\LoadClass{report}
%%---------------------------------------------------
%%--Set the section number depth.
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{4}
\setcounter{page}{2}
%%---------------------------------------------------
%%--Include some required packages.
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{setspace}
\RequirePackage{float}
\RequirePackage{citesort}
%%---------------------------------------------------
%%--Must change the margin above the Chapter heading to 2 inches
\RequirePackage{wmchapter}
%%---------------------------------------------------
%%--Create a vertical skip for the distance between the title and
%%--the first line of text on the prolog pages.
\newskip\thesisvskip
\thesisvskip 36pt
%%---------------------------------------------------
%%--Set the margins.
%\headheight6pt \headsep12pt
%\marginparwidth 1in
%\marginparsep 6pt
\oddsidemargin 0.5in%38pt %36pt
%\evensidemargin 38pt %36pt
\topmargin 0.25in
\rightmargin 0.25pt
\textwidth 5.9 in
\textheight 8.4 in
\footskip 24pt %%check this
%%---------------------------------------------------
%%--Set the pagestyle to headings.
\pagestyle{headings}
%%---------------------------------------------------
%%--Change the marginpar.
%\reversemarginpar
%\let\old@marginpar=\marginpar
%\def\marginpar#1{
% \old@marginpar{\def\baselinestretch{1}\em\small #1}}
%%---------------------------------------------------
%%--Parameters that can be set by the user.
\def\thesis@listtables{y}
\def\thesis@listfigures{y}
\newcommand{\notablelist}{\gdef\thesis@listtables{n}}
\newcommand{\nofigurelist}{\gdef\thesis@listfigures{n}}
%%--------------------------------------------
%%-- Prolog pages construction.
%%--------------------------------------------
%%--Macros used for the construction of the title page.
\newcommand{\thesisTitle}[1]{\gdef\thesis@title{#1}}
\newcommand{\thesisYear}[1]{\gdef\thesis@year{#1}}
\newcommand{\thesisMonth}[1]{\gdef\thesis@month{#1}}
\newcommand{\thesisAbstract}[1]{\gdef\thesis@abstract{#1}}
\newcommand{\thesisAcknowledge}[1]{\gdef\thesis@ack{#1}}
\newcommand{\thesisDedication}[1]{\gdef\thesis@Dedication{#1}}
\newcommand{\thesisVita}[1]{\gdef\thesis@vita{#1}}
\newcommand{\thesisBib}[1]{\gdef\thesis@bib{#1}}
\newcommand{\thesisAdvisor}[1]{\gdef\ThesisAdvisor{#1}}
%Location and Degrees added -- Ruth
\newcommand{\thesisLocation}[1]{\gdef\ThesisLocation{#1}}
\newcommand{\thesisDegreeOne}[1]{\gdef\ThesisDegreeOne{#1}}
\newcommand{\thesisDegreeTwo}[1]{\gdef\ThesisDegreeTwo{#1}}
\newcommand{\thesisDegreeThree}[1]{\gdef\ThesisDegreeThree{#1}}
% \thesisAuthor macro
% defines two TeX variables (only usable in this file)
% \thesis@author is assumed to be a "short" version of the author's name
% used on the title page
% \thesis@authorx is assumed to be the full name of the author
% used on the approval, the UMI abstract, and the vita pages
% For example
% \thesisAuthor{A. Goode Student}
% sets both \thesis@author and \ thesis@authorx to
% "A. Goode Student"
% \thesisAuthor[Aloysius Goode Student]{A. Goode Student}
% sets \thesis@author to "A. Goode Student" and
% \thesis@authorx to "Aloysius Goode Student"
%
\newcommand{\thesisAuthor}[2][\empty]{
\gdef\thesis@author{#2}
\ifx#1\empty \let\thesis@authorx\thesis@author
\else \gdef\thesis@authorx{#1}\fi}
\def\thesis@abstract{\empty}
\def\thesis@ack{\empty}
\def\thesis@vita{\empty}
\def\thesis@bib{\empty}
%%--Macro used to specify the committee.
\newcounter{thesis@members}
\setcounter{thesis@members}{1}
\newcommand{\thesisCommittee}[2][\mbox{\hspace*{1ex}}]{
\edef\thesis@ctr{\romannumeral\value{thesis@members}}
\expandafter\def\csname thesis@member\thesis@ctr\endcsname{#2}
\expandafter\def\csname thesis@position\thesis@ctr\endcsname{#1}
\addtocounter{thesis@members}{1}}
%%--The prolog pages.
\newcommand{\makeThesisProlog}{
\bigskip
\setcounter{page}{1}
\renewcommand{\thepage}{\roman{page}}
\pagestyle{plain}
\thispagestyle{empty}
%%--------------------------------------------
% Any of these pages can be individually commented
% out for non-final versions if desired -- Ruth
%%--------------------------------------------
%%-- title page
\maketitlepage
%%--------------------------------------------
%%-- copright page
\makecopyrightpage
%%--------------------------------------------
%%-- approval page
\makeapprovalpage
%%--------------------------------------------
%%-- compliance page
\makecompliancepage
%%--------------------------------------------
%%-- abstract
\makeabstractpage
%%--------------------------------------------
%-TOC pages
\newpage
\pagestyle{plain}\setcounter{page}{1}
{\large \tableofcontents }
%%--------------------------------------------
%%-- acknowledgements
\makeacknowledgepage
%%--------------------------------------------
%%-- dedication page
\makededicationpage
%%--------------------------------------------
%%-- List of tables and/or figures.
\maketablesfigurespage
%%--------------------------------------------
%%-- half-title page
\makehalftitlepage
%%--------------------------------------------
%%-- end of prolog, start of thesis
\newpage
\pagestyle{plain}
\renewcommand{\thepage}{\arabic{page}}
}
%%--------------------------------------------
%%-- Prolog related commands.
%%--------------------------------------------
%%--Page titles.
\def\acknowledgeName{ACKNOWLEDGMENTS}
\def\abstractName{ABSTRACT}
\def\complianceName{COMPLIANCE PAGE}
%%--------------------------------------------
%%--The title page.
\newcommand{\maketitlepage}{
\begin{titlepage}\begin{singlespace}
\begin{center}{\large
\thesis@title \\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\ %8 lines between title and author name -- Ruth
\thesis@authorx \\
\hspace{.1in} \\ %1 line between name and hometown -- Ruth
\ThesisLocation \\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\ % 4 lines between hometown and prior degrees -- Ruth
\ThesisDegreeOne \\
\ThesisDegreeTwo \\
% \ThesisDegreeThree % uncomment if you are more than 2
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\ % 4 lines between prior degrees and purpose statement -- Ruth
{A Dissertation presented to the Graduate Faculty\\
of the College of William \& Mary in Candidacy for the Degree of\\
<Insert Degree Name>}\\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\ % 7 lines between purpose statement and department -- Ruth
{Department of Computer Science}
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\ % 5 lines between department and college -- Ruth
{College of William \& Mary\\
\thesis@month\ \thesis@year}
}
\end{center}\end{singlespace}
\end{titlepage}
}
%%--------------------------------------------
%%--The copyright page
\newcommand{\makecopyrightpage}{
\newpage
\begin{titlepage}\begin{singlespace}
\begin{center}
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
\hspace{1in} \\
{\fontsize{12}{5}\selectfont \copyright~Copyright by Student Name 2018}
\end{center}
\end{singlespace} \end{titlepage}
}
%%--------------------------------------------
%%--The approval page.
\newcommand{\thesisapprovalwidth}{3in}
\newcommand{\makeapprovalpage}{
\newpage
\pagestyle{empty} % no page number on approval page -- Ruth
\begin{singlespace}
\begin{center}
{\Large APPROVAL PAGE}\\
{\large \hspace{.1in} } \\
{\large \hspace{.1in} } \\
{\large \hspace{.1in} } \\ % 3 lines between title and statement -- Ruth
{\large This Dissertation is submitted in partial fulfillment of \\
the requirements for the degree of}\\
\hspace{.1in} \\ % 1 lines between statements
{\large <Insert Degree Name>}\\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\ % 3 lines between statement and signature line -- Ruth
\underline{\hspace*{\thesisapprovalwidth}}\\
{\small \thesis@author}\\
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\ % 3 lines between signature line and approved -- Ruth
{\large Approved by the Committee, \thesis@month\ \thesis@year}\\
\hspace{.1in} \\
\hspace{.1in} \\ % 2 lines between approved and signature line -- Ruth
\underline{\hspace*{\thesisapprovalwidth}}\\
{\small Committee Chair\\
\thesis@memberi, \thesis@positioni\\
College of William \& Mary}
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\ % 3 lines between signatures -- Ruth
\underline{\hspace*{\thesisapprovalwidth}}\\
{\small\thesis@memberii, \thesis@positionii\\
College of William \& Mary}
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\ % 3 lines between signatures -- Ruth
\underline{\hspace*{\thesisapprovalwidth}}\\
{\small\thesis@memberiii, \thesis@positioniii\\
College of William \& Mary}
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\ % 3 lines between signatures -- Ruth
\underline{\hspace*{\thesisapprovalwidth}}\\
{\small\thesis@memberiv, \thesis@positioniv\\
College of William \& Mary}
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\ % 3 lines between signatures -- Ruth
\underline{\hspace*{\thesisapprovalwidth}}\\
{\small\thesis@memberv, \thesis@positioniv\\
The University of Texas at Dallas}
\hspace{.1in} \\
\hspace{.1in} \\
\hspace{.1in} \\ % 3 lines between signatures -- Ruth
\end{center}\end{singlespace}
}
%%--------------------------------------------
%%--The Compliance Page
\newcommand{\makecompliancepage}{
\newpage\pagestyle{empty} % no page number on abstract page -- Ruth
\begin{center}
\Large\complianceName
\vspace{2em}
\end{center}
\begin{singlespace}
\begin{large}
\setlength\parindent{32pt}Research approved by
\vspace{1em}
\begin{center}
\underline{Protection of Human Subjects Committee}
\end{center}
\vspace{4em}
%-----------------------------------------------------
%----Protocol-Numbers---------------------------------
Protocol number(s): PHSC-\#\#\#\#-\#\#-\#\#-\#\#\#\#\#-protocol\\
\vspace{-0.5em}
\setlength\parindent{140pt} PHSC-\#\#\#\#-\#\#-\#\#-\#\#\#\#\#-protocol\\
\vspace{1em}
%-----------------------------------------------------
%----Dates-of-Approval---------------------------------
\setlength\parindent{32pt}Date(s) of approval: mm/dd/yyyy\\
\vspace{-0.5em}
\setlength\parindent{141pt} mm/dd/yyyy\\
\end{large}
\end{singlespace}
}
%%--------------------------------------------
%%--The abstract page
\newcommand{\makeabstractpage}{
\newpage\pagestyle{empty} % no page number on abstract page -- Ruth
\begin{center}
\Large\abstractName
\end{center}
\begin{singlespace}
\input{\thesis@abstract}
\end{singlespace}
}
%%--------------------------------------------
%%--The acknowledgement page
\newcommand{\makeacknowledgepage}{
\newpage
\begin{center}
\addcontentsline{toc}{chapter}{\rm Acknowledgments}
\Large\acknowledgeName
\vspace{-0.4in}
\end{center}
\begin{singlespace}
\input{\thesis@ack}
\end{singlespace}
}
%%--------------------------------------------
%%--The dedication page
% This is to be "whole page" justified, so if your dedication is more than
% one line, the amount of vspace will need to be adjusted. -- Ruth
\newcommand{\makededicationpage}{
\newpage
\begin{center}
\addcontentsline{toc}{chapter}{\rm Dedication}
\vspace*{3in}
{\large \thesis@Dedication}
\end{center}
}
%%--------------------------------------------
%%--The tables and/or figures pages
\newcommand{\maketablesfigurespage}{
\newpage
\setlength{\cftafterlottitleskip}{2em}
\addcontentsline{toc}{chapter}{\rm List of Tables}
{\large \listoftables}
\newpage
\setlength{\cftafterloftitleskip}{2em}
\addcontentsline{toc}{chapter}{\rm List of Figures}
{\large \listoffigures }
}
%%--------------------------------------------
%%--The half-title page
% This page is not necessary. If you do not include it, be sure to
% still include the setcounter command to get the first page
% numbered as such.
\newcommand{\makehalftitlepage}{
\newpage
\setcounter{page}{1}
\pagestyle{empty}
\begin{center}
\vspace*{3in}
{\Large \thesis@title}
\end{center}
}
%%--------------------------------------------
%%-- Bibliography related commands.
%%--------------------------------------------
%%--Set the bib style
\def\thesisBibStyle{wmbib}
%%--Define a single command for making the bibliography.
\newcommand{\makeThesisBib}[1]{
\bibliographystyle{\thesisBibStyle}
\bibliography{#1}}
%%--Redefine the thebibliography environment
\let\wm@thebibliography\thebibliography
\let\wm@endthebibliography\endthebibliography
\def\thebibliography#1{\begin{spacing}{1}\wm@thebibliography{#1}
\addcontentsline{toc}{chapter}{Bibliography}}
\def\endthebibliography{\wm@endthebibliography\end{spacing}}
\newcommand{\makeThesisVita}[1]{
\newpage
\pagestyle{headings}\markright{}
\begin{center}
\addcontentsline{toc}{chapter}{Vita}
\Large VITA
\vskip\thesisvskip
\thesis@authorx
\vskip\thesisvskip
\end{center}
\input{#1}
}
% I did not write this or use this, so I do not know if it is compliant. -- Ruth
\newcommand{\makeUMIAbstract}[1]{
\newpage
\pagestyle{empty}
\thispagestyle{empty}
\begin{center}
\Large \thesis@title \\
\parbox{1in}{ ABSTRACT } \vskip\thesisvskip
\end{center}
\input{#1}
\vfill
\begin{center}
\large \thesis@authorx \\
Department of Computer Science \\
The College of William and Mary in Virginia \\
Advisor: \ThesisAdvisor \\
\thesis@title
\end{center}
}
%%--------------------------------------------
%%-- Definition and Quotation commands.
%%--------------------------------------------
\newtheorem{define}{Definition}[chapter]
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{lemma}{Lemma}[chapter]
\newtheorem{notate}{Notation}[chapter]
\newtheorem{axiom}{Axiom}[chapter]
\newenvironment{proof}[1][Proof]
{\noindent {\bf #1: }}{\hfill $\blacksquare$}
%%-----------------------------------------------
%%-- Float related environments and commands.
%%-----------------------------------------------
%%--Modify behavior of the figure and table environment.
\def\fps@figure{hbt}
\def\fnum@figure{{\bf \figurename~\thefigure}}
\def\fps@table{htb}
\def\fnum@table{{\bf \tablename~\thetable}}
\def\mathfigure{\thesisfiguretrue\figure}
\def\endmathfigure{\endfigure\thesisfigurefalse}
%%--Redefine the @makecaption command so \small can be used.
\long\def\@makecaption#1#2{%
\vskip\abovecaptionskip
\sbox\@tempboxa{{\small #1: #2}}%
\def\baselinestretch{1}\small%\@newbaseline
\ifdim \wd\@tempboxa >\hsize
#1: #2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
%%--This allows for the correct setting of \arraystrecth in the
%%--math environments when used within a figure.
%\let\old@figure=\figure
%\let\old@endfigure=\endfigure
%\renewenvironment{figure}[1][\empty]{
% \ifx\empty \begin{old@figure}
%\def\figure{\thesisFiguretrue\old@figure}
%\def\endfigure{\global\thesisFigurefalse\old@endfigure}
%%-----------------------------------------------
%%-- Modify the displayed math environments.
%%-----------------------------------------------
\newif\ifthesisfigure
\thesisfigurefalse
%%--Set the arraystretch for math display.
\everydisplay{
\abovedisplayskip \baselinestretch\abovedisplayskip %plus 0.0pt minus 10pt%
\belowdisplayskip \abovedisplayskip%
\abovedisplayshortskip \abovedisplayshortskip%
\belowdisplayshortskip \belowdisplayshortskip%
\ifthesisfigure\def\arraystretch{1}\else\def\arraystretch{0.5}\fi}
\def\@setsize#1#2#3#4{%\@nomath#1%-KPC
\let\@currsize#1\baselineskip
#2\baselineskip\baselinestretch\baselineskip
\parskip\baselinestretch\parskip
\setbox\strutbox\hbox{\vrule height.7\baselineskip
depth.3\baselineskip width\z@}%-KPC
\normalbaselineskip\baselineskip#3#4}
%%--------------------------------------------
%%-- Miscellaneous commands.
%%--------------------------------------------
%%--Commands to simplify font changing.
\newcommand{\sfup}{\sffamily\mdseries\upshape}
\newcommand{\sfsc}{\ttfamily\mdseries\scshape}
\newcommand{\sfit}{\sffamily\mdseries\itshape}
\newcommand{\rmup}{\rmfamily\mdseries\upshape}
\newcommand{\rmbf}{\rmfamily\bfseries\upshape}
\newcommand{\rmit}{\rmfamily\mdseries\itshape}
\newcommand{\ttup}{\ttfamily\mdseries\upshape}
\endinput
%%--The \tableofcontents.
%%%%% code removed REL
%%--The \listoffigures command.
\renewcommand\listoffigures{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\oldchapter*{\listfigurename
\@mkboth{\uppercase{\listfigurename}}{\uppercase{\listfigurename}}\vspace{-4em}}%
\@starttoc{lof}%
\if@restonecol\twocolumn\fi}
%%--The \listoftables command.
\renewcommand\listoftables{%
\if@twocolumn%
\@restonecoltrue\onecolumn%
\else%
\@restonecolfalse%
\fi%
\oldchapter*{\listtablename%
\@mkboth{\uppercase{\listtablename}}{\uppercase{\listtablename}}}%
\@starttoc{lot}%
\if@restonecol\twocolumn\fi}
\usepackage{wmchap}
\endinput