-
Notifications
You must be signed in to change notification settings - Fork 1
/
ucsbthesis.cls
485 lines (448 loc) · 13 KB
/
ucsbthesis.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
% Christopher H. Gorman
% Initial Version: 1 December 2017
%
% This class is designed to fulfill all of the requirements
% for the University of California, Santa Barbara
% dissertation requirements for 2018--2019 academic year.
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ucsbthesis}[2023/04/07 UCSB Thesis Class]
% Class Options
% Font size:
% 12pt is required for for submssion
\DeclareOption{10pt}{
\PassOptionsToClass{\CurrentOption}{book}
}
\DeclareOption{11pt}{
\PassOptionsToClass{\CurrentOption}{book}
}
\DeclareOption{12pt}{
\PassOptionsToClass{\CurrentOption}{book}
}
% Paper size:
% letterpaper is required for submission
\DeclareOption{letterpaper}{
\PassOptionsToPackage{\CurrentOption}{geometry}
}
\DeclareOption{a4paper}{
\PassOptionsToPackage{\CurrentOption}{geometry}
}
% Formatting:
% proper is required for submission;
% this option ensures the proper formatting
% pretty makes for a more pleasing when writing;
% this option is closer to standard LaTeX.
\DeclareOption{proper}{
\PassOptionsToClass{oneside}{book}
\PassOptionsToPackage{top=1in,bottom=1in,left=1.25in,right=1in,
footskip=0.25in}{geometry}
\PassOptionsToPackage{doublespacing,nodisplayskipstretch}{setspace}
\newif\ifproper
\propertrue
}
\DeclareOption{pretty}{
\PassOptionsToPackage{margin=1in,footskip=0.25in}{geometry}
\PassOptionsToPackage{singlespacing}{setspace}
\newif\ifproper
\properfalse
}
% Formatting math:
% prettymath ensures single spacing for math equations;
% this leads to a more pleasing result.
\newif\ifprettymath
\prettymathfalse
\DeclareOption{prettymath}{
\prettymathtrue
}
% Option for Co-Advisors:
% use when there are two advisors
\newif\ifadvisors
\advisorsfalse
\DeclareOption{advisors}{
\advisorstrue
}
% Option for the number of Committee Members:
% The standard number of committee members is assumed to be two;
% for more members use the options below.
% Note that this does not include the advisor or co-advisors.
%
% members3: committee with 3 at-large members
% members4: committee with 4 at-large members
% members5: committee with 5 at-large members
\newif\ifmembersthree
\membersthreefalse
\DeclareOption{members3}{
% Use if there are three committee members, not including advisor(s)
\membersthreetrue
}
\newif\ifmembersfour
\membersfourfalse
\DeclareOption{members4}{
% Use if there are four committee members, not including advisor(s)
\membersthreetrue
\membersfourtrue
}
\newif\ifmembersfive
\membersfivefalse
\DeclareOption{members5}{
% Use if there are four committee members, not including advisor(s)
\membersthreetrue
\membersfourtrue
\membersfivetrue
}
% Option Fallback (Failure)
\DeclareOption*{
\ClassWarning{ucsbthesis}{Unknown option '\CurrentOption'}
}
% Execute Default Options
\ExecuteOptions{12pt}
\ExecuteOptions{letterpaper}
% Process given options
\ProcessOptions\relax
% Load Base Class
\LoadClass{book}
% Required Packages
%
% We only load those packages which are required
% for this class to work and no others.
% In particular, no mathematics classes are added,
% as that should be taken care of by the author and
% loaded in a specific preamble.
\RequirePackage{etoolbox}
\RequirePackage{fancyhdr}
\RequirePackage{geometry}
\RequirePackage{setspace}
% If there are Co-Advisors
\newtoggle{advisors}
\ifadvisors
\toggletrue{advisors}
\else
\togglefalse{advisors}
\fi
% If there are three committee members, not including advisor(s)
\newtoggle{members3}
\ifmembersthree
\toggletrue{members3}
\else
\togglefalse{members3}
\fi
% If there are four committee members, not including advisor(s)
\newtoggle{members4}
\ifmembersfour
\toggletrue{members4}
\else
\togglefalse{members4}
\fi
% Note: when using ``members4'' option, both boolean toggles
% for member3 and members4 are true.
% If there are five committee members, not including advisor(s)
\newtoggle{members5}
\ifmembersfive
\toggletrue{members5}
\else
\togglefalse{members5}
\fi
% Note: when using ``members5'' option, boolean toggles
% for member3, members4, and member5 are true.
% Specify Header and Footer information for Front, Main, and Back
\fancypagestyle{fancyfront}{
% Header and footer information for front matter
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\cfoot{\thepage}
}
\fancypagestyle{fancymain}{
% Header and footer information for main matter
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\cfoot{\thepage}
}
\fancypagestyle{fancyback}{
% Header and footer information for back matter
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\cfoot{\thepage}
}
% Specific commands used within the class file
% Degree Objective:
% Degree Name (Doctor of Philosophy, Master of Arts, or
% Master of Science)
% Degree Thesis Name (Dissertation or Thesis)
% Degree Major
\newcommand{\degreeobjective}[3]{\gdef\@degreename{#1}
\gdef\@degreethesisname{#2}
\gdef\@major{#3}}
% Advisor Commands:
% advisor
%
% advisorA
% advisorB
\iftoggle{advisors}{
\newcommand{\advisorA}[2]{\gdef\@advisorAname{#1}
\gdef\@advisorAtitle{#2}}
\newcommand{\advisorB}[2]{\gdef\@advisorBname{#1}
\gdef\@advisorBtitle{#2}}
}{
\newcommand{\advisor}[2]{\gdef\@advisorname{#1}
\gdef\@advisortitle{#2}}
}
% Committee Commands:
% committeeA
% committeeB
%
% If additional committee members are specified,
% then the following options are used:
%
% committeeC
% committeeD
% committeeE
\newcommand{\committeeA}[2]{\gdef\@committeeAname{#1}
\gdef\@committeeAtitle{#2}}
\newcommand{\committeeB}[2]{\gdef\@committeeBname{#1}
\gdef\@committeeBtitle{#2}}
\iftoggle{members3}{
\newcommand{\committeeC}[2]{\gdef\@committeeCname{#1}
\gdef\@committeeCtitle{#2}}
\iftoggle{members4}{
\newcommand{\committeeD}[2]{\gdef\@committeeDname{#1}
\gdef\@committeeDtitle{#2}}
\iftoggle{members5}{
\newcommand{\committeeE}[2]{\gdef\@committeeEname{#1}
\gdef\@committeeEtitle{#2}}
}{
}
}{
}
}{
}
% Graduation Date:
% Grad Month
% December for Fall
% March for Winter
% June for Spring
% September for Summer
% Grad Year
\newcommand{\graduationdate}[2]{
\gdef\@gradmonth{#1}
\gdef\@gradyear{#2}}
% Committee Sign Date:
% this may be different than Graduation Date
\newcommand{\committeesignsdate}[2]{
\gdef\@signmonth{#1}
\gdef\@signyear{#2}}
% Dedication: specifies the dedication
\newcommand{\dedication}[1]{
\gdef\@dedication{#1}}
% Acknowledgements: specifies the acknowledgements
\newcommand{\acknowledgements}[1]{
\gdef\@acknowledgements{#1}}
% CV: specifies the CV
\newcommand{\cv}[1]{
\gdef\@cv{#1}}
% Abstract: specifies the abstract
\newcommand{\abstract}[1]{
\gdef\@abstract{#1}}
% Specify the Title page length
\newlength{\titlepagespacing}
\setlength{\titlepagespacing}{0.35in}
% Make the title page
\renewcommand{\maketitle}{
\thispagestyle{empty}
\null
\vfill
{
\doublespacing
\begin{center}
University of California \\ Santa Barbara \\
\vspace{\titlepagespacing}
\textbf{\Large \@title} \\
\vspace{\titlepagespacing}
A \MakeLowercase{\@degreethesisname} submitted in partial satisfaction\\
of the requirements for the degree \\
\@degreename \\ in \\ \@major \\ by \\ \@author
\end{center}
\vspace{\titlepagespacing}
Committee in charge: \\
\iftoggle{advisors}{
\indent \indent {\@advisorAtitle}~{\@advisorAname}, Co-Chair \\
\indent \indent {\@advisorBtitle}~{\@advisorBname}, Co-Chair \\
}{
\indent \indent {\@advisortitle}~{\@advisorname}, Chair \\
}
\indent \indent {\@committeeAtitle}~\@committeeAname \\
\indent \indent {\@committeeBtitle}~\@committeeBname \\
\iftoggle{members3}{
\indent \indent {\@committeeCtitle}~\@committeeCname \\
\iftoggle{members4}{
\indent \indent {\@committeeDtitle}~\@committeeDname \\
\iftoggle{members5}{
\indent \indent {\@committeeEtitle}~\@committeeEname \\
}{
}
}{
}
}{
}
\begin{center} {\@gradmonth}~{\@gradyear} \end{center}
}
\vfill
\clearpage
}
% Specify the Signature page length
\newlength{\sigpagespacing}
\newlength{\sigpagespacingdate}
\iftoggle{members5}{
\setlength{\sigpagespacing}{0.40in}
\setlength{\sigpagespacingdate}{0.25in}
}{
\iftoggle{members4}{
\setlength{\sigpagespacing}{0.50in}
\setlength{\sigpagespacingdate}{0.70in}
}{
\setlength{\sigpagespacing}{0.65in}
\setlength{\sigpagespacingdate}{1.00in}
}
}
% Make the signature page
\newcommand{\makesignature}{
\thispagestyle{empty}
\null
\vfill
\vspace*{\fill}
{
\doublespacing
\begin{center}
The \MakeLowercase{\@degreethesisname} of {\@author} is approved. \\
\vspace{\sigpagespacing}
\rule{3.5in}{0.4pt} \\
{\@committeeAtitle} \@committeeAname \\
\vspace{\sigpagespacing}
\rule{3.5in}{0.4pt} \\
{\@committeeBtitle} \@committeeBname \\
\iftoggle{members3}{
\vspace{\sigpagespacing}
\rule{3.5in}{0.4pt} \\
{\@committeeCtitle} \@committeeCname \\
\iftoggle{members4}{
\vspace{\sigpagespacing}
\rule{3.5in}{0.4pt} \\
{\@committeeDtitle} \@committeeDname \\
\iftoggle{members5}{
\vspace{\sigpagespacing}
\rule{3.5in}{0.4pt} \\
{\@committeeEtitle} \@committeeEname \\
}{
}
}{
}
}{
}
\iftoggle{advisors}{
\vspace{\sigpagespacing}
\rule{3.5in}{0.4pt} \\
{\@advisorAtitle} {\@advisorAname}, Co-Chair \\
\vspace{\sigpagespacing}
\rule{3.5in}{0.4pt} \\
{\@advisorBtitle} {\@advisorBname}, Co-Chair \\
}{
\vspace{\sigpagespacing}
\rule{3.5in}{0.4pt} \\
{\@advisortitle} {\@advisorname}, Chair \\
}
\vspace{\sigpagespacingdate}
{\@signmonth}~{\@signyear}
\end{center}
}
\vfill
\null
\newpage
}
% Make the copyright page
\newcommand{\makecopyright}{
\null
\vspace{0.75in}
{\doublespacing
\begin{center}
{\@title} \\
\vspace{0.75in}
Copyright {\textcopyright} {\@gradyear} \\
by \\
\@author
\end{center}
}
\vfill
\null
\newpage
}
% Make the dedication page
\newcommand{\makededication}{
\null
{\@dedication}
\null
\clearpage
}
% Make the acknowledgements page
\newcommand{\makeacknowledgements}{
\null
\begin{center}
\textbf{\large Acknowledgements}
\end{center}
{\@acknowledgements}
\vfill
\clearpage
}
% Make the CV page
\newcommand{\makecv}{
\null
{\@cv}
\vfill
\clearpage
}
% Make the Abstract
\newcommand{\makeabstract}{
\null
{\doublespacing
\begin{center}
\textbf{Abstract} \\
\vspace{1cm}
{\@title} \\ by \\ {\@author} \\
\end{center}
}
{\@abstract}
\vfill
\clearpage
}
% Fix frontmatter, mainmatter, and backmatter
\renewcommand{\frontmatter}{
\clearpage
\pagenumbering{roman}
\pagestyle{fancyfront}
}
\renewcommand{\mainmatter}{
\clearpage
\pagenumbering{arabic}
\pagestyle{fancymain}
}
\renewcommand{\backmatter}{
\clearpage
\pagestyle{fancyback}
}
% This looks good for right now but I have not checked to see
% if it breaks \[ \] or \( \) or anything like that.
\ifprettymath
\BeforeBeginEnvironment{equation}{\begin{singlespace}}
\AfterEndEnvironment{equation}{\end{singlespace}\noindent\ignorespaces}
\BeforeBeginEnvironment{equation*}{\begin{singlespace}}
\AfterEndEnvironment{equation*}{\end{singlespace}\noindent\ignorespaces}
\BeforeBeginEnvironment{align}{\begin{singlespace}}
\AfterEndEnvironment{align}{\end{singlespace}\noindent\ignorespaces}
\BeforeBeginEnvironment{align*}{\begin{singlespace}}
\AfterEndEnvironment{align*}{\end{singlespace}\noindent\ignorespaces}
\BeforeBeginEnvironment{gather}{\begin{singlespace}}
\AfterEndEnvironment{gather}{\end{singlespace}\noindent\ignorespaces}
\BeforeBeginEnvironment{gather*}{\begin{singlespace}}
\AfterEndEnvironment{gather*}{\end{singlespace}\noindent\ignorespaces}
\fi
\endinput