forked from kolesarm/harvard-gsas-thesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gsasthesis.cls
189 lines (161 loc) · 5.13 KB
/
gsasthesis.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
% This is file `gsasthesis.cls',
%
% LaTeX2e class for publishing a PhD thesis according to Harvard GSAS
% requirements:
%
% http://www.gsas.harvard.edu/images/stories/pdfs/form%20of%20dissertation.pdf
%
% Modifies appearance of standard report class.
%
% Author: Michal Kolesár
% E-mail: kolesarmi at googlemail dot com
% Disclaimer: not endorsed by Harvard, use at your own risk.
% 1. Identification
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{gsasthesis}
% 2. Load extra packages
% Load the report class and send it all class options
\LoadClassWithOptions{report}
% Dissertation should be double-spaced throughout nodisplayskipstretch makes
% sure equations are single-spaced. Otherwise array-like objects (say pmatrix)
% look rather ugly.
\RequirePackage[nodisplayskipstretch,doublespacing]{setspace}
% This makes tables single-spaced by default. Since they are supposed to be
% double-spaced unless they are too long, need to set double-spacing for tables
% manually using \renewcommand{\arraystretch}{2} inside the table environment
% Add references, to Table of Contents, but not TOC itself, or list of tables
% and figures
\RequirePackage[nottoc,notlot,notlof]{tocbibind}
% 3. Required and Optional fields
\newcommand\degreename[1]{\renewcommand\@degreename{#1}}
\newcommand\@degreename{\ClassError{gsasthesis}{No \noexpand\degreename given}{}}
\newcommand\degreefield[1]{\renewcommand\@degreefield{#1}}
\newcommand\@degreefield{\ClassError{gsasthesis}{No \noexpand\degreefield given}{}}
\newcommand\degreemonth[1]{\renewcommand\@degreemonth{#1}}
\newcommand\@degreemonth{\ClassError{gsasthesis}{No \noexpand\degreemonth given}{}}
\newcommand\degreeyear[1]{\renewcommand\@degreeyear{#1}}
\newcommand\@degreeyear{\ClassError{gsasthesis}{No \noexpand\degreeyear given}{}}
\newcommand\department[1]{\renewcommand\@department{#1}}
\newcommand\@department{\ClassError{gsasthesis}{No \noexpand\department given}{}}
\newcommand\principaladvisor[1]{\renewcommand\@principaladvisor{#1}}
\newcommand\@principaladvisor{\ClassError{gsasthesis}{No \noexpand\principaladvisor given}{}}
% Optional
\newcommand\secondadvisor[1]{\newcommand\@secondadvisor{#1}}
% 4. (Re)define commands and environments
\newcommand{\thesistitlepage}{%
\begin{titlepage}
\thispagestyle{empty}
\null\vfil
%\addcontentsline{toc}{section}{Title Page} % seems silly to add it
\begin{center}
{\LARGE\bfseries {\@title}}\\[3em]
A dissertation presented\\
by\\[2em]
{\Large\@author}\\[2em]
to\\[2em]
{\large\@department}\\[2em]
in partial fulfillment of the requirements\\
for the degree of\\
\@degreename\\
in the subject of\\
\@degreefield\\[2em]
Harvard University\\
Cambridge, Massachusetts\\
\@degreemonth\ \@degreeyear
\end{center}
\vfil\null
\end{titlepage}
\addtocounter{page}{1} % titlepage is not numbered by default
}
\newcommand{\copyrightpage}
{
\thispagestyle{empty}
\null\vfil
\begin{center}
\copyright\ \@degreeyear\ \@author\\
All rights reserved.
\end{center}
\vfil\null
\clearpage
}
\renewenvironment{abstract}%
{
\clearpage
% Standard spacing for the header
\begin{spacing}{1.2}
\begin{minipage}[t]{0.46\textwidth}
\begin{flushleft}
\ifx\@secondadvisor\undefined
\emph{Dissertation Advisor:}\\
{\bfseries\@principaladvisor}
\else
\emph{Dissertation Advisors:}\\
{\bfseries\@principaladvisor\\\@secondadvisor}
\fi
\end{flushleft}
\end{minipage}
\begin{minipage}[t]{0.46\textwidth}
\begin{flushright}
\emph{Author:} \\
{\bfseries\@author}
\end{flushright}
\end{minipage}
\vspace{2em}
\begin{center}
{\large\bfseries\@title}
\end{center}
\vspace{2em}
\end{spacing}
\addcontentsline{toc}{section}{Abstract}
\section*{\centering \abstractname}
}%
{\clearpage}
% GSAS: "Table of contents, lists of figures and tables can be single-spaced".
% Let's redefine them to be single-spaced.
% Save the latex commands
\let\LaTeXTOC\tableofcontents
\let\LaTeXLOT\listoftables
\let\LaTeXLOF\listoffigures
% Redefine them
\renewcommand{\tableofcontents}%
{
\begin{spacing}{1.2} % 1.2 looks nicer than 1
\LaTeXTOC
\end{spacing}
}
\renewcommand{\listoftables}%
{
\begin{spacing}{1.2}
\LaTeXLOT
\end{spacing}
}
\renewcommand{\listoffigures}%
{
\begin{spacing}{1.2}
\LaTeXLOF
\end{spacing}
}
\newenvironment{acknowledgments}
{
\clearpage
\addcontentsline{toc}{section}{Acknowledgments}
\section*{\centering Acknowledgments}
}
{\clearpage}
\newenvironment{dedication}
{
\clearpage
\par\vspace*{.2\textheight}
\begin{quotation}
}
{\end{quotation}\clearpage}
% 4. Odds and ends
% Quotations should be single-spaced
\expandafter\def\expandafter\quote\expandafter{\quote\singlespacing}
\expandafter\def\expandafter\quotation\expandafter{\quotation\singlespacing}
% Footnotes should single-spaced (setspace default), but there should be
% double-spacing between footnotes.
\setlength{\footnotesep}{0.8\baselineskip}
% Indicate that LaTeX can stop reading this file. LaTeX will ignore anything
% after this line. Not required, but good practice.
\endinput