-
Notifications
You must be signed in to change notification settings - Fork 2
/
uc-dissertation.cls
398 lines (344 loc) · 10.1 KB
/
uc-dissertation.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
%% uc-dissertation
%% LaTeX class for writing Ph.D. theses
%% for the University of Cincinnati.
%% Author: Jireh Loreaux <[email protected]>
%%
%% This material is subject to the LaTeX Project Public License
%% version 1.3c or, if you prefer, any later version of this license.
%% See http://latex-project.org/lppl/lppl-1-3c.html
%% for the details of that license.
%%
%% Please let me know if you use uc-dissertation.
%% I'll will do my best to implement suggestions assuming they are
%% appropriate for a LaTeX class.
%% ========================================================================
%% Identification
%% ========================================================================
\newcommand\fileversion{1.0}
\newcommand\filedate{2014/09/26}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{uc-dissertation}[\filedate\space University of Cincinnati dissertation class by Jireh Loreaux (v\fileversion)]
%% ========================================================================
%% Option parsing
%% ========================================================================
\DeclareOption{chap}{%
\AtEndOfClass{%
\RequirePackage[Lenny]{fncychap}
\ChNameVar{\usekomafont{title}\Large}
\ChTitleVar{\usekomafont{title}\Huge}
}%
}
\DeclareOption{comply}{%
\PassOptionsToClass{oneside,11pt,toc=listofnumbered}{scrbook}%
\AtEndOfClass{%
\let\oldmainmatter\mainmatter%
\renewcommand\mainmatter{%
\oldmainmatter%
\doublespacing%
}%
\let\oldbackmatter\backmatter%
\renewcommand\backmatter{%
\oldbackmatter%
\singlespacing%
}%
\renewcommand*\mainmattertwo{%
\if@twoside\cleardoubleoddpage\else\clearpage\fi
\@mainmattertrue%
\doublespacing%
}
}%
}
\DeclareOption{comply-nospace}{%
\PassOptionsToClass{oneside,11pt,toc=listofnumbered}{scrbook}
}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrbook}}
\ProcessOptions\relax
%% ========================================================================
%% Package loading
%% ========================================================================
%% Base class
\LoadClass{scrbook}
%% Control structures
\RequirePackage{xifthen}
%% Line spacing
\RequirePackage{setspace}
%% Date manipulations
\RequirePackage{datetime}
%% Complex macro arguments
\RequirePackage{xparse}
%% Graphics management
\RequirePackage{graphicx}
%% General useful tools
\RequirePackage{etoolbox}
%% ========================================================================
%% Main code
%% ========================================================================
%% Counters for loops
\newcounter{LoopCountOne}
\newcounter{LoopCountTwo}
%% Declare font for use on title page.
\newkomafont{declaration}{\Large}
%%% Miscellany
%% Create a date format using only the month and year (requires 'datetime')
\newdateformat{monthonly}{\monthname[\THEMONTH]{} \THEYEAR}
\renewcommand{\date}[2]{%
\newdate{fixed}{01}{#1}{#2}
}
%% Makes a mainmatter command that doesn't reset the page numbering
\newcommand*\mainmattertwo{%
\if@twoside\cleardoubleoddpage\else\clearpage\fi
\@mainmattertrue%
}
%% Typesets a chapter quote
\DeclareRobustCommand{\chapterquote}[2]{%
{%
\singlespacing%
\begin{minipage}{0.7\textwidth}%
\noindent\emph{``#1''}%
\begin{flushright}%
--- #2%
\end{flushright}%
\end{minipage}%
\vspace{1cm}%
}%
}
%% Don't break enumerations (etc.) across pages in
%% an ugly manner
\clubpenalty = 10000
\widowpenalty = 10000
%%% Title page macros and user input commands
%% Degree to be conferred
\newcommand*{\@degreetoconfer}{Doctor of Philosophy}
\newcommand*{\degreetoconfer}[1]{%
\renewcommand{\@degreetoconfer}{#1}
}
%% Department in which degree is earned
\newcommand{\@department}{Mathematical Sciences}
\newcommand{\department}[1]{%
\renewcommand{\@department}{#1}
}
%% College in which degree is earned
\newcommand*{\@college}{McMicken College of Arts and Sciences}
\newcommand*{\college}[1]{%
\renewcommand{\@college}{#1}
}
%% University where degree is earned
\newcommand*{\@university}{University of Cincinnati}
\newcommand*{\university}[1]{%
\renewcommand{\@university}{#1}
}
%% reset the internal \@author command to be empty
\renewcommand{\@author}{}
%% Previous degrees
%% The difficulty in defining this command is that we don't know
%% how many degrees the author has obtained. To get around this,
%% we use the xparse package to split the arguments at semicolons,
%% and then splice these together in the appropriate way. This is
%% almost certainly not elegant code, but it does what we want.
\newcommand{\@previousdegrees}{}
\newcommand{\printmeornotone}[1]{%
\ifthenelse{\value{LoopCountOne} = \value{LoopCountTwo}}{%
\g@addto@macro\@previousdegrees{& #1, }%
}{%
\relax%
}%
\stepcounter{LoopCountTwo}%
}
\newcommand{\printmeornottwo}[1]{%
\ifthenelse{\value{LoopCountOne} = \value{LoopCountTwo}}{%
\g@addto@macro\@previousdegrees{#1, \\}%
}{%
\relax%
}%
\stepcounter{LoopCountTwo}%
}
\newcommand{\printmeornotthree}[1]{%
\ifthenelse{\value{LoopCountOne} = \value{LoopCountTwo}}{%
\g@addto@macro\@previousdegrees{& \quad #1 \\}%
}{%
\relax%
}%
\stepcounter{LoopCountTwo}%
}
\NewDocumentCommand\previousdegrees{O{1} >{\SplitList{;}}m >{\SplitList{;}}m >{\SplitList{;}}m}{%
\renewcommand{\@previousdegrees}{}%
\setcounter{LoopCountOne}{0}%
\whiledo{\value{LoopCountOne} < #1}{%
\setcounter{LoopCountTwo}{0}%
\ProcessList{#2}{%
\printmeornotone
}%
\setcounter{LoopCountTwo}{0}%
\ProcessList{#3}{%
\printmeornottwo
}%
\setcounter{LoopCountTwo}{0}%
\ProcessList{#4}{%
\printmeornotthree
}%
\stepcounter{LoopCountOne}%
}%
}
%% Committee chair
\newcommand*{\@chair}{}
\newcommand*{\chair}[1]{%
\renewcommand{\@chair}{#1}
}
%% Committee members (not including chair)
%% We apply the same techniques as for \previousdegrees
\newcommand{\@committee}{}
\newcommand{\printmeornotfour}[1]{%
\ifthenelse{\value{LoopCountOne} = \value{LoopCountTwo}}{%
\g@addto@macro\@committee{\\}%
}{%
\relax%
}%
\stepcounter{LoopCountTwo}%
}
\NewDocumentCommand\committee{O{1} >{\SplitList{;}}m}{%
\renewcommand{\@committee}{}%
\setcounter{LoopCountOne}{0}%
\whiledo{\value{LoopCountOne} < #1}{%
\setcounter{LoopCountTwo}{0}%
\ProcessList{#2}{%
\printmeornotfour
}%
\stepcounter{LoopCountOne}%
}%
}
\newcommand{\@logo}{\includegraphics[width=2.9in]{UC_logo-[black]}}
\newcommand{\logo}[2][width=0.5\textwidth]{%
\renewcommand{\@logo}{\includegraphics[#1]{#2}}
}
%%% New title page design
\renewcommand{\maketitle}[1][]{%
\begin{titlepage}
\monthonly
\begin{center}
\hrulefill\par \vskip 2em
{\usekomafont{title}{\huge \@title\par}}%
\vskip 1em
{\ifx\@subtitle\@empty\else\usekomafont{subtitle}{\@subtitle\par}\fi}%
\vskip 2em \hrulefill\par
\vskip 0.6in
\@logo
\vskip 0.6in
{\usekomafont{declaration}%
A dissertation submitted in partial fulfillment \\
of the requirements for the degree of \\
\@degreetoconfer{} \\
}
\vskip 2em
{\usekomafont{declaration}%
Department of \@department{} \\
\@college{} \\
\@university{}, \ifstrequal{#1}{fixed}{\displaydate{fixed}}{\today} \\
}
\end{center}\par
\vskip \z@ \@plus4fill
\begin{minipage}[t][][b]{0.5\textwidth}
\begin{flushleft}
\begin{tabular}{ll}%
\ifdefempty{\@author}{}{%
\textbf{Author:} & \@author \\
}
\ifdefempty{\@previousdegrees}{}{%
\textbf{Degrees:} \@previousdegrees
}
\end{tabular}
\end{flushleft}
\end{minipage}
\hfill
\begin{minipage}[t][][b]{0.5\textwidth}
\begin{flushleft}
\begin{tabular}{ll}
\ifdefempty{\@chair}{}{%
\textbf{Chair:} & \@chair \\
}
\ifdefempty{\@committee}{}{%
\textbf{Committee:} \@committee
}
\end{tabular}
\end{flushleft}
\end{minipage}
\usdate
\end{titlepage}
}
%%% Abstract
\newcommand{\@abstract}{}
\newcommand{\abstract}[1]{%
\renewcommand{\@abstract}{#1}
}
\newcommand{\abstractpage}{%
\cleardoublepage
\chapter{Abstract}
\label{cha:abstract}
\pagestyle{plain}
\@abstract
}
%%% Copyright page
\newcommand{\copyrightpage}[1][all]{%
\cleardoublepage
\thispagestyle{empty}
\ifthenelse{\isempty{#1}}{\hfill\par}{%
\hfill\par%
\vskip 0.33\textheight%
\begin{center}
{%
\usekomafont{declaration}{%
\addcontentsline{toc}{chapter}{Copyright}%
\copyright{} \the\year{} by \@author.%
\ifthenelse{\equal{all}{#1}}{ All rights reserved.}{} \par
\vskip 1em \par
\ifthenelse{\isin{cc}{#1}}{%
{Released under a Creative Commons \par}%
}{}
\ifthenelse{\isin{by}{#1}}{%
{Attribution--}%
}{}%
\ifthenelse{\isin{nc}{#1}}{%
{NonCommercial--}%
}{}%
\ifthenelse{\isin{nd}{#1}}{%
{NoDerivatives \par
4.0 International License.
}%
}{}%
\ifthenelse{\isin{sa}{#1}}{%
{ShareAlike \par
4.0 International License.
}%
}{}%
\vskip 2em \par
\ifthenelse{\isin{cc}{#1}}{%
\includegraphics[width=0.75cm]{cc}
}{}
\ifthenelse{\isin{by}{#1}}{%
\includegraphics[width=0.75cm]{by}
}{}
\ifthenelse{\isin{nc}{#1}}{%
\includegraphics[width=0.75cm]{nc}
}{}
\ifthenelse{\isin{nd}{#1}}{%
\includegraphics[width=0.75cm]{nd}
}{}%
\ifthenelse{\isin{sa}{#1}}{%
\includegraphics[width=0.75cm]{sa}
}{}
}%
}%
\end{center}
}%
}
%%% Acknowledgments
\newcommand{\@acknowledgments}{}
\newcommand{\acknowledgments}[1]{%
\renewcommand{\@acknowledgments}{#1}
}
\newcommand{\acknowledgmentspage}{%
\cleardoublepage
\chapter{Acknowledgments}
\label{cha:acknowledgments}
\pagestyle{plain}
\@acknowledgments
}