-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathucdthesis.cls
361 lines (361 loc) · 10.3 KB
/
ucdthesis.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
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ucdthesis}[2010/05/25 University of California Davis Thesis Class]
\newif\if@ucd@copyright
\@ucd@copyrightfalse
\newif\if@ucd@thesis
\@ucd@thesisfalse
\providecommand\phantomsection{}
% ****************************************
% * OPTIONS *
% ****************************************
\DeclareOption{10pt}{\PassOptionsToClass{10pt}{book}}
\DeclareOption{11pt}{\PassOptionsToClass{11pt}{book}}
\DeclareOption{12pt}{\PassOptionsToClass{12pt}{book}}
\DeclareOption{oneside}{\PassOptionsToClass{oneside}{book}}
\DeclareOption{twoside}{\PassOptionsToClass{twoside}{book}}
\DeclareOption{final}{\PassOptionsToClass{final}{book}}
\DeclareOption{draft}{\PassOptionsToClass{draft}{book}}
\DeclareOption{copyright}{\@ucd@copyrighttrue}
\DeclareOption{thesis}{\@ucd@thesistrue}
\DeclareOption{dissertation}{\@ucd@thesisfalse}
\ProcessOptions\relax
\LoadClass[12pt,letterpaper,oneside,final]{book}
% ****************************************
% * PACKAGES *
% ****************************************
\RequirePackage{setspace}
% ****************************************
% * LANGUAGE DECLARATIONS *
% ****************************************
\def\contentsname{Contents}
\def\listfigurename{List of Figures}
\def\listtablename{List of Tables}
\def\bibname{Bibliography}
\def\indexname{Index}
\def\figurename{Figure}
\def\tablename{Table}
\def\chaptername{Chapter}
\def\appendixname{Appendix}
\def\partname{Part}
\def\abstractname{Abstract}
\def\vitaename{Curriculum Vit\ae}
% ****************************************
% * CAMPUS SPECIFIC *
% ****************************************
\newcommand\graddept{Office of Graduate Studies}
\newcommand\campussystem{University of California}
% ****************************************
% * PAGE STYLE *
% ****************************************
\setlength\hoffset{0in}
\setlength\voffset{0in}
\setlength\oddsidemargin{0.0in}
\setlength\evensidemargin{0.0in}
\setlength\topmargin{-0.5in}
\setlength\headheight{0.25in}
\setlength\headsep{0.25in}
\setlength\textwidth{6.5in}
\setlength\textheight{9.0in}
\setlength\marginparsep{0.0in}
\setlength\marginparwidth{1.0in}
\setlength\footskip{0.5in}
%\let\scriptsize\normalsize
\doublespacing
% ****************************************
% * NUMBERING *
% ****************************************
%\newcommand\ps@frontmatter{%
% \def\@oddfoot{\hfil\textrm{-\thepage -}\hfil}
% \let\@evenfoot\@oddfoot
% \let\@oddhead\@empty
% \let\@evenhead\@empty
%}
%\let\ps@mainmatter\ps@plain
%\let\ps@backmatter\ps@plain
% ****************************************
% * USER DECLARATIONS *
% ****************************************
% Author
\def\author#1{\gdef\@author{#1}}
% The year the degree will be officially conferred
\def\degreeyear#1{\gdef\@degreeyear{#1}}
% The month the degree will be officially conferred
\def\degreemonth#1{\gdef\@degreemonth{#1}}
% The semester (Fall or Spring) the degree will be officially conferred
\def\degreesemester#1{\gdef\@degreesemester{#1}}
% The full (unabbreviated) name of the degree
\def\degreename#1{\gdef\@degreename{\MakeUppercase{#1}}}
% Previous degrees (type, university, campus, year)
\newcommand\@previousdegrees{}
\newcommand*{\previousdegree}[4]{%
\protected@edef\@previousdegrees{%
\@previousdegrees%
\noexpand\par{#1 (#2, #3) #4}%
}%
}
\def\prevdegrees#1{\gdef\@prevdegrees{#1}}
%
\newcommand*{\signline}{%
\underline{$\mbox{\hspace{0.6\textwidth}}$}
}
% The name of your committees chair
\def\chair#1{\gdef\@chair{#1}}
% The names of your other committe members, one per line
\newcommand\@othermembers{}
\newcommand*{\othermember}[1]{%
\protected@edef\@othermembers{%
\@othermembers%
\noexpand\par{\signline}%
\noexpand\par{#1}%
}%
}
% The name of your degrees field (e.g. Psychology, Computer Science)
\def\field#1{\gdef\@field{#1}}
% The name of your UC Campus (e.g. Berkeley, Los Angeles)
\def\campus#1{\gdef\@campus{\MakeUppercase{#1}}}
% ****************************************
% * TWOSIDE *
% ****************************************
\renewcommand\cleardoublepage{
\clearpage
\if@twoside
\ifodd
\c@page
\else
\hbox{}
\vspace*{\fill}
\begin{center}
%This page intentionally contains only this sentence.
\end{center}
\vspace{\fill}
\thispagestyle{empty}
\newpage
\fi
\fi
}
% ****************************************
% * TITLE PAGE *
% ****************************************
\renewcommand\maketitle{%
\ifx\hyper@@anchor\undefined%
\else%
\hypersetup{
pdftitle={\@title},
pdfauthor={\@author},
pdfsubject={\@field},
}
\fi%
\cleardoublepage
\begin{center}
\par{\@title}
\par{By}
\begin{singlespace}
\par{\MakeUppercase{\@author}}
\par{}\@previousdegrees
\end{singlespace}
\if@ucd@thesis
\par{THESIS}
\else
\par{DISSERTATION}
\fi
\par{Submitted in partial satisfaction of the requirements for the degree of}
\par{\@degreename}
\par{in}
\par{\@field}
\par{in the}
\par{\MakeUppercase{\graddept}}
\par{of the}
\par{\MakeUppercase{\campussystem}}
\par{\@campus}
\par{Approved:}
\par{\signline}
\par{{\@chair}, Chair}
\par{}\@othermembers
\par{Committee in Charge}
\par{\@degreeyear}
\end{center}
\if@ucd@copyright
\clearpage
\thispagestyle{empty}
\vspace*{\fill}
\begin{center}
\par{Copyright by}
\par{\MakeUppercase{\@author}}
\par{\@degreeyear}
\end{center}
\vspace*{\fill}
\fi
\cleardoublepage
}
% ****************************************
% * DEDICATION PAGE *
% ****************************************
\newenvironment{dedication}{%
\cleardoublepage
\begin{center}
\vspace*{\fill}
}{%
\vspace*{\fill}
\end{center}
}
% ****************************************
% * CONTENTS PAGE *
% ****************************************
\renewcommand\tableofcontents{%
\chapter*{\contentsname}%
\@starttoc{toc}%
}
% ****************************************
% * FIGURES PAGE *
% ****************************************
\renewcommand\listoffigures{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter{\listfigurename}%
\@mkboth{\MakeUppercase\listfigurename}%
{\MakeUppercase\listfigurename}%
\@starttoc{lof}%
\if@restonecol\twocolumn\fi
}
% ****************************************
% * TABLES PAGE *
% ****************************************
\renewcommand\listoftables{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter{\listtablename}%
\@mkboth{%
\MakeUppercase\listtablename}%
{\MakeUppercase\listtablename}%
\@starttoc{lot}%
\if@restonecol\twocolumn\fi
}
% ****************************************
% * ABSTRACT PAGE *
% ****************************************
\newcommand\abstract{
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{\abstractname}
\begin{singlespace}
\begin{flushright}
\@author\par\@degreemonth~\@degreeyear\par\@field
\end{flushright}
\end{singlespace}
\begin{center}
\@title\par
\underline{\bf\abstractname}
\end{center}
}
% ****************************************
% * BACK MATTER *
% ****************************************
\renewenvironment{frontmatter}{%
\setcounter{page}{1}
\renewcommand{\thepage}{-\roman{page}-}
\@mainmatterfalse
}{
\cleardoublepage
\cleardoublepage
\renewcommand{\thepage}{arabic{page}}
\setcounter{page}{1}
}
\def\mainmatter{%
\cleardoublepage
\pagestyle{plain}
\@mainmattertrue
}
\def\backmatter{%
\cleardoublepage
\pagestyle{plain}
\@mainmatterfalse
}
% ****************************************
% * CHAPTER *
% ****************************************
\renewcommand\chapter{
\if@openright\cleardoublepage\else\clearpage\fi
\global\@topnum\z@
\@afterindentfalse
\secdef\@chapter\@schapter
}
\def\@makechapterhead#1{%
\vspace*{0 \p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\huge\bfseries \@chapapp\space \thechapter
\par\nobreak
\vskip 20\p@
\fi
\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
\def\@makeschapterhead#1{%
\vspace*{0 \p@}%
{\parindent \z@ \raggedright
\normalfont
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
% ****************************************
% * THE BIBLIOGRAPHY *
% ****************************************
\@ifpackageloaded{chapterbib}{}{% chapterbib not loaded
\AtBeginDocument{
\renewenvironment{thebibliography}[1]{%
\chapter{\bibname}
\begin{thebibitemlist}{#1}}{\end{thebibitemlist}}
}
}
\newenvironment{thebibitemlist}[1]{
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty 'thebibliography' environment}}%
\endlist}
% ****************************************
% * THE INDEX *
% ****************************************
\renewenvironment{theindex}
{
\if@twocolumn
\@restonecolfalse
\else
\@restonecoltrue
\fi
\twocolumn[
\phantomsection
\vspace*{43pt}
\@makeschapterhead{\indexname}
\addcontentsline{toc}{chapter}{\indexname}
]%
\@mkboth{\MakeUppercase\indexname}{\MakeUppercase\indexname}%
\parindent\z@
\parskip\z@ \@plus .3\p@\relax
\columnseprule \z@
\columnsep 35\p@
\let\item\@idxitem
}{\if@restonecol\onecolumn\else\clearpage\fi}
\ps@plain
\endinput