-
Notifications
You must be signed in to change notification settings - Fork 3
/
harvard-thesis.cls
276 lines (234 loc) · 8.62 KB
/
harvard-thesis.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
% -------------------------------------------------------------------
% @LaTeX-class-file{
% filename = "harvard-thesis.cls",
% version = "0.1.1",
% date = "5 April 2011",
% createdby = "Jordan Suchow, modified by Andrew Leifer and Guilherme Sperb Machado",
% email = "suchow at fas.harvard.edu, gsm at machados.org",
% codetable = "ISO/ASCII",
% keywords = "LaTeX, harvard-thesis, ifi-uzh-thesis",
% supported = "send email to [email protected] or [email protected]",
% docstring = "A thesis class for a IFI-UZH thesis."
% --------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{harvard-thesis}[2011/12/08 v0.3 Harvard University Thesis Class]
\LoadClass[11pt, a5paper]{book} %removed: oneside (default is twoside)
%these should be inpreamble of .tex file, not .cls
\RequirePackage{graphicx}
\RequirePackage{hyperref}
\usepackage[centertags]{amsmath}
% commented by GM:
%\RequirePackage{amssymb}
\RequirePackage[numbers, comma, sort&compress]{natbib}
\RequirePackage[small, md, sc]{titlesec}
\RequirePackage[tight,nice]{units}
\RequirePackage{verbatim}
\usepackage{color}
% added by GM:
\usepackage[table]{xcolor}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{1}
\usepackage{hyperref}
\definecolor{Crimson}{rgb}{0.6,0,0}
\RequirePackage{url}
\usepackage[titles]{tocloft}
\RequirePackage{rotating}
\usepackage{packages/natbibspacing}
\setlength{\bibspacing}{.4\baselineskip}
% added by GM:
\usepackage{placeins}
\usepackage{pgfkeys}
% added by GM:
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
% end of GM
\renewcommand{\cftchapfont}{\normalsize \scshape}
\renewcommand\bibname{References}
\renewcommand\listfigurename{List of Figures}
\renewcommand\listtablename{List of Tables}
%\raggedright
% Begin Andy's package additions
% GM: I commented this due to http://tex.stackexchange.com/questions/215786/tabular-environment-in-harvard-thesis-template
%\usepackage{pdfsync} % do pdf synchronization [andy]
\usepackage[closeFloats]{packages/fltpage}
\synctex=1 % turn synctex on automatically to sync between pdf viewer [andy]
% list an entire bibliography entry inline. Useful for acknowledging when my paper was previously published
\usepackage{bibentry}
\nobibliography*
% End Andy's package additions
\RequirePackage{lettrine} % big letter at start of chapter
\RequirePackage[a5paper,bottom=2cm, top=1.2cm, outer=2.2cm]{geometry}
\RequirePackage{fancyhdr}
\pagestyle{plain} % options: empty , plain , fancy
\RequirePackage[palatino]{quotchap}
\RequirePackage{titling}
\RequirePackage{setspace}
\RequirePackage[labelfont={sf,bf,small},textfont={sf,small},justification=RaggedRight,margin=0pt]{caption}
%\raggedright
\parindent 12pt
\RequirePackage{mathspec}
% Instead of using default latex for math fonts, we can be fancy and try to adapt Chaparral Pro.. --ANDY
\setmathsfont(Digits,Latin,Greek)[Numbers={OldStyle,Proportional}]{Arno Pro}
\setmathrm{Arno Pro} %I added this to handle \mathbf
%\setmathsfont(Digits,Latin,Greek)[Numbers={OldStyle,Proportional}]{Parsi Digits}
%\setmathrm{Parsi Digits}
%Use this if you want math fonts that are slightly better than default Latex
\setmathfont{Cambria Math}
\RequirePackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text, Numbers=OldStyle}
\setromanfont[Mapping=tex-text, Numbers=OldStyle]{Arno Pro}
% added by GM
\RequirePackage{enumitem}
\RequirePackage{pifont} % this is to use the \ding{} command for special characters.
%\setromanfont[Mapping=tex-text, Numbers=OldStyle,
%Ligatures={{Contextual,Rare}}]{Arno Pro}
% Contextuals=Swash, Ligatures={{Historic,Contextual,Rare}}
%Set fonts for Mac Specific (Comment out on Windows XP)
%\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Helvetica Neue}
%\setmonofont[Scale=MatchLowercase]{Consolas}
% some definitions
\def\degreeyear#1{\gdef\@degreeyear{#1}}
\def\degreemonth#1{\gdef\@degreemonth{#1}}
\def\degree#1{\gdef\@degree{#1}}
\def\advisor#1{\gdef\@advisor{#1}}
\def\coadvisor#1{\gdef\@coadvisor{#1}}
\def\department#1{\gdef\@department{#1}}
\def\university#1{\gdef\@university{#1}}
\def\authorcity#1{\gdef\@authorcity{#1}}
% defined by GM:
\def\approved#1{\gdef\@approved{#1}}
\def\degreeconferraldate#1{\gdef\@degreeconferraldate{#1}}
\def\degreeconferralplace#1{\gdef\@degreeconferralplace{#1}}
\def\faculty#1{\gdef\@faculty{#1}}
\def\chairdoctoralboard#1{\gdef\@chairdoctoralboard{#1}}
\newenvironment{mysideways}
{\begin{sideways}\begin{sideways}\begin{sideways}}
{\end{sideways}\end{sideways}\end{sideways}}
% GM: this is the original cover from the Harvard template.
% I made a \coveruzh, which is defined below
\renewcommand{\maketitle}{
\thispagestyle{empty}\vspace*{\fill}
\begin{center} \sc
\huge \begin{spacing}{0.75} \thetitle \end{spacing} \normalsize
\vspace{50pt} Doctoral Thesis\\ \vspace{18pt}
For the Degree of\\ \@degree\\ \vspace{18pt}
At the \@department\\ of the \\\@university\\ \vspace{18pt}
by \\\theauthor\\ from \\ \@authorcity\\ \vspace{18pt}
Accepted on the recommendation of \\\@advisor\\\@coadvisor\\ \vspace{18pt}
\@degreemonth\ \@degreeyear
\end{center} \vspace*{\fill}
}
\pgfkeys{
/coveruzh/.is family, /coveruzh,
% Here are the options that a user can pass
default/.style = {beforeTitle = 70pt, afterTitle = 70pt},
beforeTitle/.estore in = \coveruzhSpaceBeforeTitle,
afterTitle/.estore in = \coveruzhSpaceAfterTitle,
}
\newcommand{\coveruzh}[1][]{
\pgfkeys{/coveruzh, default, #1}%
\thispagestyle{empty}
\vspace*{\fill}
\begin{center}
Department of Informatics
\\ \vspace{\coveruzhSpaceBeforeTitle}
\huge \begin{spacing}{0.75} \thetitle \end{spacing} \normalsize
\vspace{\coveruzhSpaceAfterTitle}
Dissertation submitted to the\\
\textsc{\@faculty}
\\of the \textsc{\@university} \vspace{18pt}
\\to obtain the degree of\\
\textsc{Doktor / Doktorin der Wissenschaften, Dr. sc.}\\
(corresponds to \textsc{Doctor of Science, Ph.D.})\\ \vspace{30pt}
presented by\\
\textsc{\theauthor}\\
from \\
\textsc{\@authorcity}\\ \vspace{30pt}
approved in \textsc{\@approved}\\ \vspace{18pt}
accepted on the recommendation of\\
\textsc{\@advisor}\\
\textsc{\@coadvisor}\\
\end{center}
\vspace*{\fill}
\pagebreak
\thispagestyle{empty}
\vspace*{\fill}
The \@faculty of the \@university hereby authorizes the printing of this dissertation, without indicating an opinion of the views expressed in the work.\\ \vspace{20pt}
\\\textsc{\@degreeconferralplace, \@degreeconferraldate}\\ \vspace{20pt}
\\Chair of the Doctoral Board: \textsc{\@chairdoctoralboard}\\
\vspace*{\fill}
}
\renewcommand{\appendix}{
\par
\setcounter{chapter}{1}
\setcounter{section}{0}
\renewcommand{\thesection}{\Alph{chapter}.\arabic{section}}
\renewcommand{\thefigure}{\Alph{chapter}.\arabic{figure}}
}
\newcommand{\copyrightpage}{
\newpage \thispagestyle{empty} \vspace*{\fill}
\sc \noindent \copyright 2016\hspace{3pt}-- \theauthor \\
\noindent All rights reserved.
\vspace*{\fill} \newpage \rm
}
\newcommand{\abstractpage}{
\newpage
\setcounter{page}{3}
%\lhead{\@advisor} \rhead{\@author} \vspace*{\fill}
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}
\input{chapters/abstract}
\newpage %\lhead{} \rhead{}
\cfoot{\thepage}
}
\newcommand{\kurzfassungspage}{
\newpage
%\lhead{\@advisor} \rhead{\@author} \vspace*{\fill}
\chapter*{Kurzfassung}
\addcontentsline{toc}{chapter}{Kurzfassung}
\noindent
\input{chapters/kurzfassung}
\newpage %\lhead{} \rhead{}
%\cfoot{\thepage}
}
\newcommand{\dedicationpage}{
\pagestyle{fancy}
\newpage \thispagestyle{fancy} \vspace*{\fill}
\sc \noindent \input{chapters/dedication}
\vspace*{\fill} \newpage \rm
}
\newcommand{\authorlist}{
\pagestyle{fancy}
\newpage
\thispagestyle{fancy}
\chapter*{Author List}
\addcontentsline{toc}{chapter}{Author List}
\noindent \input{chapters/authorlist}
\newpage \rm
}
\newcommand{\acknowledgments}{
% \vspace*{\fill} %This has to be removed, otherwise you get an additional empty page
\chapter*{Acknowledgments}
\addcontentsline{toc}{chapter}{Acknowledgments}
\noindent
\input{chapters/acks}
}
\newcommand{\cv}{
% \vspace*{\fill} %This has to be removed, otherwise you get an additional empty page
\chapter*{Curriculum Vitae}
\addcontentsline{toc}{chapter}{Curriculum Vitae}
\noindent
\input{chapters/cv}
}
% An environment for paragraph-style section
\providecommand\newthought[1]{%
\addvspace{1.0\baselineskip plus 0.5ex minus 0.2ex}%
\noindent\textsc{#1}%
}
\widowpenalty=50000
\clubpenalty=50000
%\raggedbottom
%Andys Spacing
%Be more forgiving, and stretch word spacing out more so that wormds don't run out into the margins..
\sloppy
%End Andy Spacing