-
Notifications
You must be signed in to change notification settings - Fork 113
/
suthesis.sty
575 lines (486 loc) · 19.2 KB
/
suthesis.sty
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
% Stanford University PhD thesis style -- modifications to the report style
% This is unofficial so you should always double check against the
% Registrar's office rules
%
% People are free to borrow as long as they change the name and date
% in the \typeout lines, the name of the file, and acknowledge the
% work that has been done by previous people. Ideally they should
% comment their changes.
% Original version by Joseph Pallas back in 1989
% Modified by Emma Pease 5/7/92
% added singlespace environment from doublespace.sty
% added switches for variant title pages
% modified the figure environment according to changes in latex.tex
% corrected the signature page due to University rule changes
% added an optional third reader to signature page
% Corrected a spacing problem with style changes 5/14/92 - Emma
% Modified by Emma Pease 1/10/95
% Modified for latex2e 5/17/95
% changed \@xfloat and \@footnotetext to reflect latex2e changes
% Modified for latex2e 6/22/95 (Emma Pease)
% changed singlespace environment so it would work (taken from doublespace.sty)
% Modified 9/8/95 (Emma Pease)
% removed doublespace.sty commands and explicitely inputted
% doublespace
% Modified 12/17/96 (Emma Pease)
% added optional \coprincipaladvisor (\coprincipaladviser)
% Modified 5/29/98
% replaced the required doublespace.sty by setspace.sty
% Modified 8/21/98
% added a \businessthesis for the school of business
% Modified 8/22/98
% added a \lawthesis
% Modified 8/23/98
% spelling error in \businessthesis def corrected
% Modified 5/14/1999 by Emma Pease
% 'By' dropped from title page
% Modified 7/26/1999 by Emma Pease
% copyright page fixed
% Modified 9/28/99 by Emma Pease
% more copyright page fixings
% Modified 10/28/99 by Emma Pease
% and more copyright page fixings plus a minor mod on bibliography
% need to start thinking of overhauling to standard package format
% Modified 11/26/99
% fixed copyrightyear so that all Fall quarter theses are next
% year's copyright
% Modified 5/31/01 by Emma Pease
% fixed certification statement. Setup for twoside option.
% Modified 6/4/01 by Emma Pease
% emphasized that it is unofficial
% Modified 8/3/01 by Emma Pease
% setup so that on twoside if the intro material (page numbered with
% roman numerals) ends on an odd page an extra blank page is included so
% the main body (page numbered with arabic numbers) starts on an odd
% absolute page (explanation modified 5/28/02)
% Modified 5/28/02 by Emma Pease
% made first and second reader optional (not that the first reader
% should ever be missing but someone managed to avoid a second reader)
% If they aren't defined, they won't appear
% Modified 7/13/2003 by Emma Pease
% dropped signature line for ``Approved for the University Committee
% on Graduate Studies'' on signature page. Also made sure the next
% section starts on an odd page if two sided.
% Modified 11/19/03 by Emma Pease
% fixed the bibliography so the addcontentsline works correctly with
% hyperref. Thanks to Peter Sturdza for pointing out this
% Modified 2/14/04 by Emma Pease
% Changed documentation on how to change line spacing
% Modified 6/29/04 by Emma Pease
% Correction to humanitiesthesis definition
% Modified 11/9/2004 by Emma Pease
% Reformatted Signature Page to fit requirements
% Reformatted Title page to fit requirements
% Modified 8/26/2005 by Emma Pease
% Modified \language to \languagemajor so as not to interfere with
% babel.
% Modifed 10/31/2005 by Emma Pease
% added an optional fourth reader to signature page (Biology)
% added a length \signaturespace
% Modified 8/23/2006 by Emma Pease
% added () around names on signature page
% Modified 5/7/2007 by Emma Pease
% redefined \@endpart so that blank page after part has page number
% as per thesis office requirements
% Modified 9/17/2008 by Emma Pease
% changed copyright year calculations so September theses are summer
% November 2009 by Emma Pease
% changing to use online or hardcopy options for the new online
% submission possibility.
% Modified May 2010 by Emma Pease
% added command \onlinesignature which creates a signatue page
% for the online version. This should be the last command before the
% \end{document}
% Modified May 2014 by Emma Pease
% fixed error in the signature page (Stanford University Committee not just University Committee)
%%%%%
%%%%% PRELIMS
%%%%%
\ProvidesPackage{suthesis-2e}[2014/05/26]
%%\typeout{Document Style Option `suthesis' for latex2e <$Date: 9/17/2008 $>.}
\typeout{Note that this tries to fulfill the Stanford Thesis
requirements but it is unofficial}
% First thing we do is make sure that report has been loaded. A
% common error is to try to use suthesis as a documentstyle.
\@ifundefined{chapter}{\@latexerr{The `suthesis' option should be used
with the `report' document style}{You should probably read the
suthesis documentation.}}{}
%%%%%
%%%%% SETUP DOUBLESPACING
%%%%%
% include doublespace.sty for some of the stuff below
\RequirePackage{setspace}
% default to hardcopy submission
\newif\ifonline
\onlinefalse
\DeclareOption{online}{\onlinetrue}
\DeclareOption{hardcopy}{\onlinefalse}
\ProcessOptions
% Use 1.3 times the normal baseline-to-baseline skip
\setstretch{1.3}
%%%%%
%%%%% DOCUMENTATION
%%%%%
\long\def\comment#1{}
\comment{
Example of use:
\documentclass{report}
\usepackage{suthesis-2e}
\dept{Computer Science}
\begin{document}
\title{How to Write Theses\\
With Two Line Titles}
\author{John Henry Candidate}
\principaladviser{John Parker}
\firstreader{John Green}
\secondreader{John BigBooty}
\thirdreader{Jane Supernumerary} %if needed
\fourthreader{Severus Snape} %if needed
\beforepreface
\prefacesection{Preface}
This thesis tells you all you need to know about...
\prefacesection{Acknowledgments}
I would like to thank...
\afterpreface
\chapter{Introduction}
...
\chapter{Conclusions}
...
\appendix
\chapter{A Long Proof}
...
\bibliographystyle{plain}
\bibliography{mybib}
\end{document}
Documentation:
This style file modifies the standard report style to follow the
Graduate Degree Support Section of the Registrar's Office's
"Directions for Preparing Doctoral Dissertations". It sets the
margins and interline spacing and disallows page breaks at
hyphens.
The \beforepreface command creates the title page, a copyright page
(optionally), and a signature page. Then the user should put
preface section(s), using the \prefacesection{section title}
command. The \afterpreface command then produces the tables of
contents, tables and figures, and sets things up to start
the main body (on arabic page 1).
The following commands can control what goes in the front matter
material:
\title{thesis title}
\author{author's name}
\dept{author's department}
- Computer Science if omitted
The following switches allow for special title pages (not all are current)
\committeethesis - for a thesis in a committee (no dept.)
use \dept{committee name}
\programthesis - for a thesis in a program (no dept.)
use \dept{program name}
\educationthesis - for the School of Education. \dept doesn't matter
\businessthesis - for the GraduateSchool of Business. \dept doesn't matter
\lawthesis - for the School of law. \dept doesn't matter
\humanitiesthesis - for a thesis also submitted to the Graduate
Program in Humanities
\specialthesis - for a Graduate Special thesis
\industrialthesis - for a thesis in Industrial Engineering
\dualthesis - for a thesis in a dual language department.
Also define \languagemajor{language}.
e.g., \dept{French and Italian}
\languagemajor{Italian}
\principaladviser{the principal advisor's name}
(or \principaladvisor, if you prefer advisor spelled with o)
\coprincipaladviser{optional second principal advisor's name}
(or \coprincipaladvisor, use only if you have two principal
advisors only for the second one)
\firstreader{the first reader's name}
\secondreader{the second reader's name}
\thirdreader{optional third reader's name}
\fourthreader{optional fourth reader's name}
\setlength{\signaturespace}{.5in}
- default is .5in, can be adjusted to fit all
signatures in one page
\submitdate{month year in which submitted to GPO}
- date LaTeX'd if omitted
\copyrightyear{year degree conferred (next year if submitted
in Fall quarter)}
- year LaTeX'd (or next year, in December) if omitted
\copyrighttrue or \copyrightfalse
- produce or don't produce a copyright page (true by default)
\thesiscopyrighttrue or \thesiscopyrightfalse
- produces the style of copyright page listed by the
Thesis Office or the style that everyone else uses
(Thesis office by default).
\figurespagetrue or \figurespagefalse
- produce or don't produce a List of Figures page
(true by default)
\tablespagetrue or \tablespagefalse
- produce or don't produce a List of Tables page
(true by default)
This style uses interline spacing that is 1.3 times normal, except
in the figure and table environments where normal spacing is used.
That can be changed by doing:
\setstretch{1.6}
(or whatever you want instead of 1.6)
This command should be put before the \begin{document} command but
after loading the packages
You can also set any particular section in singlespacing mode by using
the singlespace environment. For example
\begin{quote}
\begin{singlespace}
...
\end{singlespace}
\end{quote}
makes the quote singlespaced. See the documentation for setspace.sty
for more information.
The example at the beginning shows the 12pt substyle being used. This
seems to give acceptable looking results, but it may be omitted to get
smaller print.
}
%%%%%
%%%%% SETUP MARGINS AND PENALTIES NEEDED FOR STANFORD THESIS
%%%%%
% We need 1" margins except on the binding edge, where it is 1 1/2"
% Theses may be either single or double sided
\if@twoside
\setlength\oddsidemargin {36.1\p@}
\setlength\evensidemargin {0\p@}
\setlength\marginparwidth {40\p@}
\else
\setlength\oddsidemargin {36.1\p@}
\setlength\evensidemargin {36.1\p@}
\setlength\marginparwidth {40\p@}
\fi
\marginparsep 10pt
%\oddsidemargin 0.5in \evensidemargin 0in
%\marginparwidth 40pt
\topmargin 0pt \headsep .5in
\textheight 8.1in \textwidth 6in
% Disallow page breaks at hyphens (this will give some underfull vbox's,
% so an alternative is to use \brokenpenalty=100 and manually search
% for and fix such page breaks)
\brokenpenalty=10000
%%%%%
%%%%% SETUP COMMANDS PECULIAR TO THESES
%%%%%
% \author, \title are defined in report; here are the rest of the
% front matter defining macros
\def\dept#1{\gdef\@dept{#1}}
\def\advis@r{Adviser} % default spelling
\def\principaladviser#1{\gdef\@principaladviser{#1}}
\def\principaladvisor#1{\gdef\@principaladviser{#1}\gdef\advis@r{Advisor}}
\def\coprincipaladvisor#1{\gdef\@coprincipaladviser{#1}\gdef\advis@r{Co-Advisor}}
\def\coprincipaladviser#1{\gdef\@coprincipaladviser{#1}\gdef\advis@r{Co-Adviser}}
\def\firstreader#1{\gdef\@firstreader{#1}}
\def\secondreader#1{\gdef\@secondreader{#1}}
\def\thirdreader#1{\gdef\@thirdreader{#1}}
\def\fourthreader#1{\gdef\@fourthreader{#1}}
\def\submitdate#1{\gdef\@submitdate{#1}}
\def\copyrightyear#1{\gdef\@copyrightyear{#1}} % \author, \title in report
% needed only for dual language departments to choose the language
\def\languagemajor#1{\gdef\@languagemajor{#1}} \def\@language{babel}
\def\jointprogram#1{\gdef\@jointprogram{#1}}
\def\@title{}\def\@author{}\def\@dept{computer science}
\def\@principaladviser{}\def\@firstreader{*}\def\@secondreader{*}
\def\@coprincipaladviser{*}
\def\@thirdreader{*}
\def\@fourthreader{*}
\def\@submitdate{\ifcase\the\month\or
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi
\space \number\the\year}
% Stanford says that Fall quarter theses should have the next year as the
% copyright year
\ifnum\month>9
\@tempcnta=\year \advance\@tempcnta by 1
\edef\@copyrightyear{\number\the\@tempcnta}
\else
\def\@copyrightyear{\number\the\year}
\fi
\newif\ifcopyright \newif\iffigurespage \newif\iftablespage
\newif\ifthesiscopyright
\copyrighttrue
\thesiscopyrighttrue
\figurespagetrue \tablespagetrue
\def\@standardsub{submitted to the department of \uppercase\expandafter{\@dept}\\
and the committee on graduate studies}
\def\@standardend{}
\def\committeethesis{\let\@whichsub=\@committeesub}
\def\programthesis{\let\@whichsub=\@programsub}
\def\educationthesis{\let\@whichsub=\@educationsub}
\def\businessthesis{\let\@whichsub=\@businesssub}
\def\lawthesis{\let\@whichsub=\@lawsub}
\def\humanitiesthesis{\let\@whichsub=\@humanitiessub%
\let\@whichend=\@humanitiesend}
\def\specialthesis{\let\@whichsub=\@specialsub%
\let\@whichend=\@specialend}
\def\industrialthesis{\let\@whichsub=\@industrialsub%
\let\@whichend=\@industrialend}
\def\dualthesis{\let\@whichsub=\@dualsub%
\let\@whichend=\@dualend}
\def\@committeesub{SUBMITTED TO THE COMMITTEE ON \uppercase\expandafter{\@dept}\\
AND THE COMMITTEE ON GRADUATE STUDIES}
\def\@programsub{SUBMITTED TO THE PROGRAM IN \uppercase\expandafter{\@dept}\\
AND THE COMMITTEE ON GRADUATE STUDIES}
\def\@educationsub{SUBMITTED TO THE GRADUATE SCHOOL OF EDUCATION\\
AND THE COMMITTEE ON GRADUATE STUDIES}
\def\@businesssub{SUBMITTED TO THE GRADUATE SCHOOL OF BUSINESS\\ AND THE
COMMITTEE ON GRADUATE STUDIES}
\def\@lawsub{SUBMITTED TO THE GRADUATE SCHOOL OF LAW\\
AND THE COMMITTEE ON GRADUATE STUDIES}
\def\@humanitiessub{SUBMITTED TO THE DEPARTMENT OF\\ \uppercase\expandafter{\@dept}
AND THE\\ COMMITTEE ON\\ GRADUATE STUDIES}
\def\@humanitiesend{\\IN\\ \uppercase\expandafter{\@jointprogram} AND HUMANITIES}
\def\@specialsub{SUBMITTED TO THE COMMITTEE ON GRADUATE STUDIES}
\def\@specialend{\\IN\\ \uppercase\expandafter{\@dept}}
\def\@dualsub{SUBMITTED TO THE DEPARTMENT OF \uppercase\expandafter{\@dept}\\
AND THE COMMITTEE ON GRADUATE STUDIES}
\def\@dualend{\\IN\\ \uppercase\expandafter{\@languagemajor}}
\let\@whichend=\@standardend
\let\@whichsub=\@standardsub
\def\titlep{%
\thispagestyle{empty}%
\null\vskip1in%
\begin{center}
\large\uppercase\expandafter{\@title}
\end{center}
\vfill
\begin{center}
\large
% \sc a dissertation\\
% \lowercase\expandafter{\@whichsub}\\
% of stanford university\\
% in partial fulfillment of the requirements\\
% for the degree of\\
% doctor of philosophy \uppercase\expandafter{\@whichend}
A DISSERTATION\\
\uppercase\expandafter{\@whichsub}\\
OF STANFORD UNIVERSITY\\
IN PARTIAL FULFILLMENT OF THE REQUIREMENTS\\
FOR THE DEGREE OF\\
DOCTOR OF PHILOSOPHY \uppercase\expandafter{\@whichend}
\end{center}
\vfill
\begin{center}
\rm \@author\\
\@submitdate\\
\end{center}\vskip.5in\newpage}
\def\thesiscopyrightpage{%
\null\vfill
\begin{center}
\large
\copyright\ Copyright\ by \@author\ \@copyrightyear\\
All Rights Reserved
\end{center}
\vfill\newpage}
\def\tradcopyrightpage{%
\null\vfill
\begin{center}
\large
Copyright\ \copyright\ \@copyrightyear\ by \@author\\
All Rights Reserved
\end{center}
\vfill\newpage}
\newlength{\signaturespace}
\setlength{\signaturespace}{.5in}
\long\def\signature#1{%
\begin{flushright}
\begin{minipage}{5in}
\parindent=0pt
I certify that I have read this dissertation and that, in my opinion,
it is fully adequate in scope and quality as a dissertation for the degree
of Doctor of Philosophy.
\par
\vspace{\signaturespace}
%\hbox to 4in{\hfil\shortstack{\vrule width 3in height 0.4pt\\ #1}}
\hbox to 5in{\hfil\begin{tabular}{@{}l@{}}\vrule width 3in height
0.4pt depth 0pt\\ #1\end{tabular}}
\end{minipage}
\end{flushright}}
\long\def\ucgssignature{%
\begin{flushright}
%\begin{minipage}{5in}
%\parindent=0pt
%\hfill Approved for the Stanford University Committee on Graduate Studies
%\par
%\vspace{\signaturespace}
%\hbox to 5in{\hfil\begin{tabular}{@{}l@{}}\vrule width 3in height
% 0.4pt depth 0pt\end{tabular}}
%\end{minipage}
\end{flushright}}
\def\signaturepage{%
\ifonline
\setcounter{page}{0}
\def\thepage{}
\thispagestyle{myheadings}
\markboth{\rm \@author}{\rm \@author}\fi
\signature{(\@principaladviser)\quad Principal \advis@r}
\vfill
% if second principal advisor
\if*\@coprincipaladviser \else
\signature{(\@coprincipaladviser)\quad Principal \advis@r}
\vfill\fi
\if*\@firstreader \else
\signature{(\@firstreader)}
\vfill\fi
\if*\@secondreader \else
\signature{(\@secondreader)}
\vfill\fi
% if thirdreader then do \signature\@thirdreader \vfill
\if*\@thirdreader \else
\signature{(\@thirdreader)}
\vfill\fi
% if fourthreader then do \signature\@fourthreader \vfill
\if*\@fourthreader \else
\signature{(\@fourthreader)}
\vfill\fi
\ucgssignature
}
\def\onlinesignature{
\cleardoublepage
\@twosidetrue
\signaturepage
}
\def\beforepreface{
\pagenumbering{roman}
\pagestyle{plain}
\titlep
% online version has no copyright or signature pages but page counter
% must be incremented
% signature page should come at end
\ifonline\setcounter{page}{4}\else
\ifcopyright\ifthesiscopyright\thesiscopyrightpage\else\tradcopyrightpage\fi\fi
\signaturepage\fi
\cleardoublepage}
\def\prefacesection#1{%
\chapter*{#1}
\addcontentsline{toc}{chapter}{#1}}
\def\afterpreface{\newpage
\tableofcontents
\iftablespage
\listoftables
\fi
\iffigurespage
\listoffigures
\fi
\cleardoublepage
\pagenumbering{arabic}
\pagestyle{headings}}
% Redefine \thebibliography to go to a new page and put an entry in the
% table of contents
\let\@ldthebibliography\thebibliography
\renewcommand{\thebibliography}[1]{\newpage
\@ldthebibliography{#1}%
\addcontentsline{toc}{chapter}{\bibname}}
% redefine \@endpart so the blank page after part has a page number
\def\@endpart{\vfil\newpage
\if@twoside
\if@openright
\null
\thispagestyle{plain}%
\newpage
\fi
\fi
\if@tempswa
\twocolumn
\fi}
% Start out normal
\pagestyle{headings}