forked from ccwang002/wustl-latex-dissertation-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wustlthesis.cls
280 lines (229 loc) · 8.78 KB
/
wustlthesis.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
% WUSTL thesis/dissertation template
% Copyright 2021–2023 Liang-Bo Wang
%
% This work may be distributed and/or modified under the conditions of the LaTeX Project Public
% License, either version 1.3 of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `unmaintained'.
%
% This work consists of the files wustlthesis.cls.
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ProvidesClass{wustlthesis}[2023/01/30 WUSTL thesis/dissertation template]
% ---- Define Page Layout -----------------------------------------------------
\LoadClass[letterpaper,12pt,openany,oneside,onecolumn]{memoir}
% Page margin
\setlrmarginsandblock{1in}{1in}{*}
\setulmarginsandblock{1in}{88pt}{*} % 1in + 16pt = 88pt
% Header and footer location
% Note though the style specifies that nothing can be inside the page margins, the style guide
% doc file actually places the page numbers in the margin. The settings below mimics the doc.
\setheadfoot{18pt}{16pt}
\setheaderspaces{*}{6pt}{*}
% Margin note location
% Note that the style guide prohibits margin notes.
\setmarginnotes{1em}{4em}{\onelineskip}
% Math environment
\RequirePackage{amsmath}
% Unicode fonts
\RequirePackage{fontspec}
\RequirePackage{unicode-math}
% Localization specific settings
\RequirePackage[english]{babel}
% Quotation style
\RequirePackage[autostyle,english=american]{csquotes}
% ---- Main page style --------------------------------------------------------
\makepagestyle{main}
\makeevenfoot{main}{}{\thepage}{}
\makeoddfoot{main}{}{\thepage}{}
% Default page style
\pagestyle{plain}
% Quotation style
\AtBeginEnvironment{quote}{\SingleSpacing}
% Chapter style
\makechapterstyle{thesis}{%
\chapterstyle{tandh}
\renewcommand*{\chapnamefont}{\normalfont\LARGE\bfseries}
\renewcommand*{\chapnumfont}{\normalfont\LARGE\bfseries}
\renewcommand*{\chaptitlefont}{\normalfont\LARGE\bfseries}
\renewcommand*{\printchaptername}{%
\OnehalfSpacing\centering\chapnamefont\chaptername\ }
\renewcommand*{\printchapternum}{\thechapter:\ }
\renewcommand*{\printchapternonum}{\OnehalfSpacing\centering}
}
% Default chapter style
\chapterstyle{thesis}
% Appendix style
\addto{\captionsenglish}{\renewcommand{\appendixname}{Appendix}}
\makechapterstyle{thesisappendix}{%
\chapterstyle{thesis}
\renewcommand*{\printchaptername}{%
\OnehalfSpacing\centering\chapnamefont\appendixname\ }
}
\addtodef{\appendix}{}{\chapterstyle{thesisappendix}}
% Section numbering down to subsection
\setsecnumdepth{subsection}
\maxsecnumdepth{subsection}
% ---- Supplemental figures and tables -----------------------------------------
\newcommand{\suppfigurename}{Supplemental Figure}
\newfloat[chapter]{suppfigure}{lof}{\suppfigurename}
\renewcommand\thesuppfigure{%
S\ifnum\c@chapter>\z@ \thechapter.\fi \@arabic\c@suppfigure%
}
\newcommand{\supptablename}{Supplemental Table}
\newfloat[chapter]{supptable}{lot}{\supptablename}
\renewcommand\thesupptable{%
S\ifnum\c@chapter>\z@ \thechapter.\fi \@arabic\c@supptable%
}
% ---- Bibliography/References style ------------------------------------------
\setlength{\bibitemsep}{\onelineskip}
% ---- Table of contents (ToC) -----------------------------------------------
\setrmarg{3em}
\setpnumwidth{1.5em}
\maxtocdepth{subsection} % put 3 levels into the ToC
\addto{\captionsenglish}{\renewcommand{\contentsname}{Table of Contents}}
\renewcommand{\cftdotsep}{0.5}
\renewcommand*{\cftchapterfont}{\normalfont}
\renewcommand*{\cftchapterpagefont}{\normalfont}
\renewcommand*{\cftchapterleader}{\cftchapterfont\cftdotfill{\cftchapterdotsep}}
\renewcommand*{\cftchapterdotsep}{\cftdotsep}
\renewcommand*{\cftchaptername}{\chaptername}
\renewcommand*{\cftchapterpresnum}{\ }
\renewcommand*{\cftchapteraftersnum}{:}
\renewcommand*{\cftappendixname}{\appendixname}
\setlength{\cftbeforechapterskip}{6pt plus 1pt minus 1pt}
\setlength{\cftbeforesectionskip}{6pt plus 1pt minus 1pt}
\setlength{\cftbeforesubsectionskip}{6pt plus 1pt minus 1pt}
% ---- List of figures (LoF), and list of tables (LoT) -----------------------
\addtodef{\listoffigures}{\clearpage}{}
\renewcommand*{\cftfigurename}{\figurename}
\renewcommand*{\cftfigurepresnum}{\ }
\renewcommand*{\cftfigureaftersnum}{:}
\setlength{\cftbeforefigureskip}{6pt plus 1pt minus 1pt}
\cftsetindents{figure}{0em}{2.5em}
% include supplemental figures in LoF
\newlistentry{suppfigure}{lof}{0}
\renewcommand*{\cftsuppfigurename}{\figurename}
\renewcommand*{\cftsuppfigurepresnum}{\ }
\renewcommand*{\cftsuppfigureaftersnum}{:}
\setlength{\cftbeforesuppfigureskip}{\cftbeforefigureskip}
\cftsetindents{suppfigure}{0em}{2.5em}
\addtodef{\listoftables}{\clearpage}{}
\renewcommand*{\cfttablename}{\tablename}
\renewcommand*{\cfttablepresnum}{\ }
\renewcommand*{\cfttableaftersnum}{:}
\setlength{\cftbeforetableskip}{6pt plus 1pt minus 1pt}
\cftsetindents{table}{0em}{2.5em}
% include supplemental tables in LoT
\newlistentry{supptable}{lot}{0}
\renewcommand*{\cftsupptablename}{\tablename}
\renewcommand*{\cftsupptablepresnum}{\ }
\renewcommand*{\cftsupptableaftersnum}{:}
\setlength{\cftbeforesupptableskip}{\cftbeforetableskip}
\cftsetindents{supptable}{0em}{2.5em}
% No chapter space inserted in LoF and LoT
\renewcommand{\insertchapterspace}{}
% ---- Title page -----------------------------------------------------
\newcommand{\settitle}[1]{\def\thesistitle{#1}}
\newcommand{\setauthor}[1]{\def\thesisauthor{#1}}
\newcommand{\setthesistype}[1]{\def\thesistype{#1}}
\newcommand{\setthesisdegree}[1]{\def\thesisdegree{#1}}
\newcommand{\setthesisdegreeabbrv}[1]{\def\thesisdegreeabbrv{#1}}
% Degree officially earn date must be in December, May, or August
\newcommand{\setdegreedatemy}[2]{%
\def\degreeearnmonth{#1}
\def\degreeearnyear{#2}}
\newcommand{\setthesisadvisorwithtitle}[1]{\def\thesisadvisorwithtitle{#1}}
\newcommand{\setthesiscommittee}[1]{\def\thesiscommittee{#1}}
\newcommand{\setthesisschool}[1]{\def\thesisschool{#1}}
\newcommand{\setthesisdepartment}[1]{\def\thesisdepartment{#1}}
\newcommand{\setthesispresentee}[1]{\def\thesispresentee{#1}}
\newcommand{\setthesisabstractfulldegree}[1]{\def\thesisabstractfulldegree{#1}}
\newcommand{\thetitlepage}{%
% Define a different page numbering for title page
% to avoid this warning (pdf backend): ignoring duplicate destination with the name 'page.i'
\pagenumbering{Alph}
\begin{titlingpage}
\thispagestyle{empty}
\SingleSpacing
\setSingleSpace{1.2}
\centering
WASHINGTON UNIVERSITY IN ST.~LOUIS \\[\onelineskip]
\thesisschool \\
\thesisdepartment \\[3\onelineskip]
\thesistype\ Examination Committee: \\
\thesiscommittee
\vfill
\thesistitle \\
by\\
\thesisauthor \\[4\onelineskip]
A \MakeLowercase{\thesistype} presented to \\
\thesispresentee \\
in partial fulfillment of the \\
requirements for the degree \\
of \thesisdegree
\vfill
\vfill
\degreeearnmonth\ \degreeearnyear\\
St.~Louis, Missouri
\end{titlingpage}
\clearpage%
}
% ---- Thesis copyright page -------------------------------------------------
\newcommand{\thesiscopyright}[1]{{%
\clearpage
\thispagestyle{empty}
\mbox{}
\vfill
\centering #1
\vfill
\clearpage%
}}
% ---- Acknowledgements page -------------------------------------------------
\newcommand{\thesisacknowledgments}{%
\chapter*{Acknowledgments}
\vspace*{-1.5in}\phantomsection\vspace*{1.5in}
\addcontentsline{toc}{chapter}{Acknowledgements}%
}
% ---- Dedication page -------------------------------------------------------
\newcommand{\thesisdedication}[1]{{%
\clearpage
\label{thesisdedication}
\mbox{}
\vfill
\centering #1
\vfill
\clearpage%
}}
% ---- Abstract page ---------------------------------------------------------
\BeforeBeginEnvironment{abstract}{%
\vspace*{-1.5in}\phantomsection\vspace*{1.5in}
\addcontentsline{toc}{chapter}{Abstract}%
}
% Update the abstract title.
% Note the \addto{\captionLANG}{...} is needed to override babel.
% Ref: https://tex.stackexchange.com/a/24778
\addto{\captionsenglish}{%
\renewcommand{\abstractname}{%
ABSTRACT OF THE \MakeUppercase{\thesistype}\\
\thesistitle \\
by \\
\thesisauthor \\
\thesisabstractfulldegree \\
Washington University in St.~Louis, \degreeearnyear \\
\thesisadvisorwithtitle%
}}
\renewcommand{\absnamepos}{center}
\renewcommand{\abstractnamefont}{%
\vspace{-\beforechapskip}
\vspace{-\baselineskip}
\normalfont\normalsize%
}
\renewcommand{\abstracttextfont}{\normalfont\normalsize}
\AtBeginDocument{
\setlength{\absleftindent}{0em}
\setlength{\absparindent}{0em}
\setlength{\absrightindent}{0em}
}