% \iffalse meta-comment
%
% Copyright (C) 2014 by Paul D. Gessler
% ---------------------------------------------------------------------------
% 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 `maintained'.
%
% The Current Maintainer of this work is Paul D. Gessler <pdgessler@gmail.com>.
%
% This work consists of the files mugsthesis.dtx and mugsthesis.ins
% and the derived file mugsthesis.cls.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{mugsthesis.dtx}
%</driver>
%<class>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%<class>\ProvidesClass{mugsthesis}
%<*class>
    [2014/08/07 v1.0 Marquette University Graduate School Thesis Class]
%</class>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{microtype}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
  \DocInput{mugsthesis.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{376}
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
%
% \changes{v1.0}{2014/08/07}{Initial public release}
%
% \DoNotIndex{\newcommand,\newenvironment}
% \DoNotIndex{\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ }
% \DoNotIndex{\@ne,\@ifstar,\@title}
% \DoNotIndex{\advance,\addcontentsline,\addtolength,\aftergroup}
% \DoNotIndex{\AtBeginEnvironment,\AtEndPreamble}
% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\boolfalse,\booltrue}
% \DoNotIndex{\catcode,\centering,\closein,\closeout}
% \DoNotIndex{\day,\def,\edef,\else,\empty,\end,\endgroup,\ifbool,\let}
% \DoNotIndex{\newbool,\newlength,\noexpand,\normalfont,\onelineskip}
% \DoNotIndex{\par,\parbox,\pretocmd,\protect,\providecommand}
% \DoNotIndex{\renewcommand,\renewenvironment,\RequirePackage}
% \DoNotIndex{\setcounter,\setlength,\small,\texorpdfstring,\unskip,\vfill,\vskip,\vspace}
%
% \providecommand*{\url}{\texttt}
% \newcommand{\pkg}[1]{\textsf{#1}}
% \newcommand{\cls}[1]{\textsf{#1}}
% \newcommand{\opt}[1]{\texttt{#1}}
% \newcommand{\optd}[1]{\opt{#1}~(default)}
% \GetFileInfo{mugsthesis.dtx}
% \title{The \cls{mugsthesis} class}
% \author{Paul D. Gessler \\ \url{<pdgessler@gmail.com>}}
% \date{\fileversion,~dated \filedate}
%
% \maketitle
% \begin{abstract}
% \cls{mugsthesis} is a document class to be used for typesetting Marquette University Graduate School (MUGS) theses. 
% It is based on the \cls{memoir} class, and meets the basic requirements contained 
% in the MUGS \emph{Thesis Directives}.\footnotemark The class provides a minimal
% set of changes to the \cls{memoir} class to meet the university's specifications.
% As such, it should be compatible with any other packages that are compatible with
% the widely used \cls{memoir} class.
% \end{abstract}
% \footnotetext{\cls{mugsthesis} \fileversion\ is compatible with MUGS \emph{Thesis Directives} dated 2014, available at \url{http://www.marquette.edu/grad/documents/ThesisDirectives2014.pdf}}
%
% \section{Introduction}
%
% The \cls{mugsthesis} document class is designed to allow straightforward preparation of MUGS theses
% using the \LaTeX\ document preparation system. It complies with the MUGS \emph{Thesis Directives}
% while maintaining compatibility with other packages used to extend the functionality of \LaTeX.
%
% Development of the document class is currently hosted on GitHub\footnote{\url{https://github.com/pdgessler/mugsthesis}}.
% You are welcome to follow development, submit any issues you discover, or suggest improvements/enhancements
% using the web interface there.
%
% The easiest way to start using the \cls{mugsthesis} document class is to take a look at the sample
% document provided, |mugsthesis_sample.tex|, along with its associated included files.
% You can take this as the basis for your own thesis.
%
% \section{Package Options}
% The class supports several options for configuring the appearance of the thesis.
% Apart from the options below, \cls{memoir} is loaded with options \opt{letterpaper} and \opt{oneside}
% as specified in the \emph{Thesis Directives}.
%
% \subsection{Font Size}
% The base font size of the document is adjusted through use of the options \opt{10pt}, \opt{11pt}, and \optd{12pt}.
% The font size options are mutually exclusive; if more than one is specified, the default will be used.
%
% \subsection{Other Options}
% The options \optd{final} and \opt{draft} configure the output document: \opt{final} produces a camera-ready copy of the thesis,
% while \opt{draft} marks overfull lines with black rules in the margins, and may have interaction with other packages.
% The most common interaction is that \pkg{graphicx} will place empty boxes instead of the actual graphics when the \opt{draft}
% option is set. These options are mutually exclusive.
%
% The options \optd{indentfirsttrue} and \opt{indentfirstfalse} configure the indentation of the first paragraph following a heading.
% The \emph{Thesis Directives} show indentation of the initial paragraphs and specify that ``new paragraphs should be indented 0.5\,in''.
% Centuries of typographers contend that the purpose of indentation is to mark the beginning of a new paragraph, and the heading itself
% serves that purpose for the first paragraph under a heading. So the \opt{indentfirstfalse} option is provided if you agree with this contention.
% These options are mutually exclusive.
%
% \subsection{Unsupported \cls{memoir} Options}
% The \cls{memoir} class has many other options. 
% Traditionally, an author can specify a base class option and the derived class will pass that option to the base class.
% However, many of these options would cause non-compliance with the MUGS \emph{Thesis Directives}.
% For this reason, all unsupported options are reported to the log file and otherwise ignored.
%
% \section{Usage}
%
% A number of commands (macros) and environments are defined by \cls{mugsthesis} for use
% in the preparation of theses. In-context examples of their use may be found in |mugsthesis_sample.tex|.
%
% \DescribeMacro{\title}
% The |\title|\marg{title} macro takes a single mandatory argument, which is the title of the thesis.
% Ensure that it is less than 120 characters long, and that it is entered with line breaks chosen
% to produce the requested inverted pyramid format. An example from the \emph{Thesis Directives}:
% \begin{verbatim}
%  \title{
%    A STUDY OF THE SOCIOLOGICAL IMPACT OF THE\\
%    1984 OLYMPICS ON THE POVERTY\\
%    LEVEL OF CITIZENS OF\\
%    LOS ANGELES
%  }\end{verbatim}
% The capitalization here is not strictly necessary; all letters are converted to upper case internally.
%
% \DescribeMacro{\author}
% The macro |\author|\marg{author} accepts a single mandatory argument, which should contain the author's name and credentials.
% Using the \emph{Thesis Directives} example once again: 
% \begin{verbatim} 
%  \author{John J. Smith, B.A.}\end{verbatim}
%
% \DescribeMacro{\degree}
% The |\degree|\marg{degree} macro takes a single mandatory argument, the degree pursued by the author. An example from
% the directives, as ever:
% \begin{verbatim}
%  \degree{Master of Science}\end{verbatim}
%
% \DescribeMacro{\degreemo}
% \DescribeMacro{\degreeyr}
% The macros |\degreemo|\marg{month} and |\degreeyr|\marg{year} each accept a single argument,
% which is the month and year, respectively, during which the degree is to be conferred. The value
% of \meta{month} must be one of May, August, or December:
% \begin{verbatim} 
%  \degreemo{December}
%  \degreeyr{2013}\end{verbatim}
%
% \DescribeMacro{\maketitle}
% The |\maketitle| command typesets the title page with all the previously-declared metadata, and should be used immediately at the beginning of the |document| environment.
%
% \DescribeEnv{abstract}
% \DescribeEnv{acknowledgments}
% \DescribeEnv{dedication}
% The environments |abstract| (mandatory), |acknowledgments| (optional), and |dedication| (optional)
% should be used for the respective content, if included. The |abstract| environment must immediately follow |\maketitle|,
% and the |acknowledgments| and |dedication| environments, if used, should follow |abstract|.
%
% \DescribeMacro{\tableofcontents}
% \DescribeMacro{\listoftables}
% \DescribeMacro{\listoffigures}
% The Graduate School requires a table of contents to appear in every thesis. Additionally, lists of tables and lists of figures may be used.
% The commands |\tableofcontents|, |\listoftables|, and |\listoffigures| should be used to generate these lists with the appropriate formatting.
% |\tableofcontents| should follow the abstract and any optional environments used in the front matter.
% |\listoftables| or |\listoffigures| should be used after |\tableofcontents|.
% If both are used, |\listoftables| should precede |\listoffigures|.
%
% \DescribeMacro{\frontmatter}
% \DescribeMacro{\mainmatter}
% \DescribeMacro{\appendix}
% The switch commands |\frontmatter|, |\mainmatter|, and |\appendix| set the page and chapter numbering styles for the appropriate parts of the thesis.
% They should immediately precede the abstract, first main body chapter, and first appendix (if any), respectively.
%
% \DescribeMacro{\bibname}
% The |\bibname| command contains the name text for the bibliography (default: BIBLIOGRAPHY). If the chosen
% citation/reference style specifies a different name (for example: REFERENCES), it can be changed with:
% \begin{verbatim}
%  \renewcommand{\bibname}{REFERENCES}\end{verbatim}
%
% Many other commands and environments are defined by the \cls{memoir} class for document elements 
% including (sub)figures, (sub)tables, associated captions, quotations, and more.
% Consult the \cls{memoir} documentation\footnote{\url{http://texdoc.net/pkg/memoir}} for complete details.
% If these or customizations from other packages are used, it is ultimately the author's responsibility to verify that
% compliance with the \emph{Thesis Directives} is maintained.
%
% \StopEventually{\PrintChanges \PrintIndex}
%
% \section{Implementation}
%
% \iffalse
%<*class>
% \fi
%
% First, load \pkg{etoolbox} for patching existing commands.
%    \begin{macrocode}
\RequirePackage{etoolbox}
%    \end{macrocode}
% Declare a new boolean to control indentation of initial paragraphs.
%    \begin{macrocode}
\newbool{indentfirst}
%    \end{macrocode}
% Declare class options, pass them to the base class if applicable,
% and discard any unsupported options, warning the user they have been ignored.
%    \begin{macrocode}
\DeclareOption{10pt}{\PassOptionsToClass{10pt}{memoir}}
\DeclareOption{11pt}{\PassOptionsToClass{11pt}{memoir}}
\DeclareOption{12pt}{\PassOptionsToClass{12pt}{memoir}}
\DeclareOption{final}{\PassOptionsToClass{final}{memoir}}
\DeclareOption{draft}{\PassOptionsToClass{draft}{memoir}}
\DeclareOption{indentfirsttrue}{\booltrue{indentfirst}}
\DeclareOption{indentfirstfalse}{\boolfalse{indentfirst}}
\DeclareOption*{% 
  \ClassWarning{mugsthesis}{Unknown option `\CurrentOption' ignored}%
}
%    \end{macrocode}
% Execute default options \opt{12pt}, \opt{final}, and \opt{indentfirsttrue},
% and process the author-specified options.
%    \begin{macrocode}
\ExecuteOptions{12pt,final,indentfirsttrue}
\ProcessOptions\relax
%    \end{macrocode}
% Use the \pkg{indentfirst} package if \opt{indentfirsttrue} is set.
%    \begin{macrocode}
\ifbool{indentfirst}{\RequirePackage{indentfirst}}{}
%    \end{macrocode}
% Load the base \cls{memoir} class with options \opt{letterpaper} and \opt{oneside}.
%    \begin{macrocode}
\LoadClass[letterpaper,oneside]{memoir}
%    \end{macrocode}
%
% Set the line spacing and justification according to the MUGS \emph{Thesis Directives}.
% Additionally set |\raggedbottom| to avoid underfull |\hbox|es with rigid skip lengths.
%    \begin{macrocode}
\DoubleSpacing
\raggedright
\raggedbottom
%    \end{macrocode}
% Set the page layout.
%    \begin{macrocode}
\setlrmarginsandblock{1.5in}{1.0in}{*} % left and right margins
\setulmarginsandblock{1.0in}{1.0in}{*} % top and bottom margins
\setheaderspaces{0.5in}{*}{*} % header 0.5in from edge
\marginparmargin{left} % use the wider (left) margin for notes
\setmarginnotes{0.125in}{1.25in}{\baselineskip} % type area for notes
\checkandfixthelayout[lines] % check the layout; TODO check algorithm selection
%    \end{macrocode}
% Set the paragraph indentation.
%    \begin{macrocode}
\setlength\parindent{0.5in}
%    \end{macrocode}
% Define and use the |mugs| pagestyle for page numbering throughout the thesis.
%    \begin{macrocode}
\makepagestyle{mugs}
\makeevenhead{mugs}{}{}{\thepage}
\makeoddhead{mugs}{}{}{\thepage}
%    \end{macrocode}
% Alias the |chapter| pagestyle to |mugs| so the chapter opening pages
% have numbering identical to the rest of the pages, and set the page style for the document.
%    \begin{macrocode}
\aliaspagestyle{chapter}{mugs}
\pagestyle{mugs}
%    \end{macrocode}
%
% \begin{macro}{\degree}
% \begin{macro}{\degreemo}
% \begin{macro}{\degreeyr}
% Define |\degree|\marg{degree} to set the degree name for the title page.
%    \begin{macrocode}
\newcommand{\degree}[1]{\def\mugsdegree{#1}}
%    \end{macrocode}
% Similarly, define |\degreemo|\marg{month} and |\degreeyr|\marg{year} to set the
% date of conferral for the title and abstract pages.
%    \begin{macrocode}
\newcommand{\degreemo}[1]{\def\mugsdegreemo{#1}}
\newcommand{\degreeyr}[1]{\def\mugsdegreeyr{#1}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\title}
% Redefine |\title| to use full upper case.
%    \begin{macrocode}
\renewcommand{\title}[1]{\def\@title{\uppercase{#1}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\maketitle}
% Redefine |\maketitle| to produce the appropriate title page, using all author metadata.
%    \begin{macrocode}
\renewcommand{\maketitle}{{%
  \cleardoublepage
  \pagenumbering{Alph}
  \SingleSpace
  \thispagestyle{empty}
  \centering
  \@title
  \vfill
  by
  \vskip \onelineskip
  \@author
  \vfill
  A Thesis submitted to the Faculty of the Graduate School,\\
  Marquette University,\\
  in Partial Fulfillment of the Requirements for\\
  the Degree of \mugsdegree{}
  \vfill
  Milwaukee, Wisconsin
  \vskip \onelineskip
  \mugsdegreemo~\mugsdegreeyr
  \clearpage
}}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{environment}{abstract}
% Redefine the |abstract| environment for typesetting according to the directives.
%    \begin{macrocode}
\renewenvironment{abstract}{%
  \thispagestyle{empty}
  \begin{SingleSpace}
  \begin{center}
    ABSTRACT\\
    \@title
    \vskip 2\onelineskip
    \@author
    \vskip \onelineskip
    Marquette University, \mugsdegreeyr
    \vskip 2\baselineskip 
  \end{center}
  \@afterindentfalse\@afterheading % makes indentfirst work with custom envs
}{
  \end{SingleSpace}\setcounter{page}{0}
}
%    \end{macrocode}
% \end{environment}
%
%
% \begin{environment}{acknowledgments}
% Define the optional |acknowledgments| environment.
%    \begin{macrocode}
\newenvironment{acknowledgments}{%
  \addcontentsline{toc}{chapter}{ACKNOWLEDGMENTS}
  \chapter*{Acknowledgments}
  \begin{SingleSpace}
  \begin{center}
    \unskip
    \@author
    \vskip 2\onelineskip
  \end{center}
  \@afterindentfalse\@afterheading
}{\end{SingleSpace}}
%    \end{macrocode}
% \end{environment}
%
%
% \begin{environment}{dedication}
% Define the optional |dedication| environment.
%    \begin{macrocode}
\newenvironment{dedication}{%
  \addcontentsline{toc}{chapter}{DEDICATION}
  \chapter*{Dedication}
  \begin{SingleSpace}\vskip\onelineskip
  \@afterindentfalse\@afterheading
}{\end{SingleSpace}}
%    \end{macrocode}
% \end{environment}
%
%
% Declare subfloats using \cls{memoir} facilities.\footnote{These are not needed by all users; consider an option to enable? Maximum depth required?}
% Ensure any subfloats are listed in the list of figures and list of tables.
%    \begin{macrocode}
\newsubfloat{figure}
\newsubfloat{table}
\setcounter{lofdepth}{2}
\setcounter{lotdepth}{2}
%    \end{macrocode}
% Define and use the MUGS chapter style throughout the thesis.
%    \begin{macrocode}
\makechapterstyle{mugs}{%
  \setlength{\midchapskip}{0pt}
  \setlength{\afterchapskip}{0pt}
  \renewcommand*{\chapterheadstart}{}
  \renewcommand*{\chaptitlefont}{\bfseries}
  \renewcommand*{\printchaptername}{\centering \MakeTextUppercase{\@chapapp}}
  \renewcommand*{\printchapternum}{\thechapter}
  \renewcommand*{\printchaptertitle}[1]{%
    \SingleSpacing \protect\parbox{\textwidth}{%
      \centering \chaptitlefont \MakeTextUppercase{##1}
    }
  }
}% end{mugs}
\chapterstyle{mugs}
%    \end{macrocode}
% Put the LoT and LoF on their own pages by patching their definitions.
%    \begin{macrocode}
\pretocmd{\listoftables}{\clearforchapter}{}{%
  \ClassWarning{mugsthesis}{Patching `\noexpand\listoftables' failed}
}
%    \end{macrocode}
%
%    \begin{macrocode}
\pretocmd{\listoffigures}{\clearforchapter}{}{%
  \ClassWarning{mugsthesis}{Patching `\noexpand\listoffigures' failed}
}
%    \end{macrocode}
%
% \begin{macro}{\contentsname}
% \begin{macro}{\listtablename}
% \begin{macro}{\listfigurename}
% \begin{macro}{\bibname}
% Style the ToC, LoT, LoF, and Bibliography headings.
%    \begin{macrocode}
\renewcommand*{\contentsname}{TABLE OF CONTENTS}
\renewcommand*{\listtablename}{LIST OF TABLES}
\renewcommand*{\listfigurename}{LIST OF FIGURES}
\renewcommand*{\bibname}{BIBLIOGRAPHY}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% Specify one line skip between bibliography entries.
%    \begin{macrocode}
\setlength{\bibitemsep}{\onelineskip}
%    \end{macrocode}
%
% \begin{macro}{\prebibhook}
% Redefine |\prebibhook| to set single spacing in the bibliography and proper spacing after the heading.
%    \begin{macrocode}
\renewcommand*{\prebibhook}{\SingleSpacing\vskip\onelineskip}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\biblistextra}
% Redefine |\biblistextra| to set item separation and indentation.
%    \begin{macrocode}
\renewcommand*{\biblistextra}{%
  \setlength{\itemsep}{\bibitemsep}
  \setlength{\leftmargin}{0.375in}% hanging indent
  \setlength{\itemindent}{\labelwidth}%
  \addtolength{\itemindent}{\labelsep}    
  \addtolength{\itemindent}{-\leftmargin}    
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\tableofcontents}
% Do not place an entry for the ToC within the ToC itself.
%    \begin{macrocode}
\renewcommand{\tableofcontents}{%
  \@ifstar{\mem@tableofcontents{01}}
          {\mem@tableofcontents{01}}%
}
%    \end{macrocode}
% \end{macro}
%
% Set the indentation for the ToC, LoT, and LoF (0.5\,in additional per level).
%    \begin{macrocode}
\setlength{      \cftchapterindent}{0.0in}
\setlength{      \cftsectionindent}{0.5in}
\setlength{   \cftsubsectionindent}{1.0in}
\setlength{\cftsubsubsectionindent}{1.5in}
\setlength{    \cftparagraphindent}{2.0in}
\setlength{ \cftsubparagraphindent}{2.5in}
\setlength{        \cfttableindent}{0.0in}
\setlength{     \cftsubtableindent}{0.5in}
\setlength{       \cftfigureindent}{0.0in}
\setlength{    \cftsubfigureindent}{0.5in}
%    \end{macrocode}
% Ragged right within and one line skip between ToC, LoT, and LoF entries.
%    \begin{macrocode}
\setrmarg{3.55em plus 1fil}
\setlength{\cftbeforechapterskip}{\onelineskip}
\setlength{\cftbeforesectionskip}{\onelineskip}
\setlength{\cftbeforesubsectionskip}{\onelineskip}
\setlength{\cftbeforesubsubsectionskip}{\onelineskip}
\setlength{\cftbeforeparagraphskip}{\onelineskip}
\setlength{\cftbeforesubparagraphskip}{\onelineskip}
\setlength{\cftbeforetableskip}{\onelineskip}
\setlength{\cftbeforesubtableskip}{\onelineskip}
\setlength{\cftbeforefigureskip}{\onelineskip}
\setlength{\cftbeforesubfigureskip}{\onelineskip}
%    \end{macrocode}
%
% \begin{macro}{\insertchapterspace}
% No extra space between chapters.
%    \begin{macrocode}
\renewcommand{\insertchapterspace}{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\aftertoctitle}
% \begin{macro}{\afterlottitle}
% \begin{macro}{\afterloftitle}
% Switch to single spacing in the ToC, LoT, and LoF.
%    \begin{macrocode}
\renewcommand{\aftertoctitle}{\vspace{-\onelineskip}\aftergroup\SingleSpacing}
\renewcommand{\afterlottitle}{\vspace{-\onelineskip}\aftergroup\SingleSpacing}
\renewcommand{\afterloftitle}{\vspace{-\onelineskip}\aftergroup\SingleSpacing}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \begin{macro}{\cftchapterfont}
% \begin{macro}{\cftchapterleader}
% \begin{macro}{\cftchapterpagefont}
% Style the ToC chapter headings.
%    \begin{macrocode}
\renewcommand{\cftchapterfont}{\normalfont}
\renewcommand{\cftchapterleader}{\cftsectionleader}
\renewcommand{\cftchapterpagefont}{\normalfont}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\f@rtoc}
% For \pkg{hyperref} bookmarking functionality (if present).
%    \begin{macrocode}
\AtEndPreamble{\providecommand{\texorpdfstring}[2]{#1}}
\settocpreprocessor{chapter}{%
\let\tempf@rtoc\f@rtoc%
\def\f@rtoc{%
  \texorpdfstring{\MakeTextUppercase{\tempf@rtoc}}{\tempf@rtoc}}%
}
%    \end{macrocode}
% \end{macro}
%
% Set spacing in quote and quotation environments.
%    \begin{macrocode}
\AtBeginEnvironment{quote}{\par\SingleSpacing}
\AtBeginEnvironment{quotation}{\par\SingleSpacing}
%    \end{macrocode}
% Set sectional unit numbering levels and ToC depth.
%    \begin{macrocode}
\maxsecnumdepth{subsection}
\settocdepth{subsection}
%    \end{macrocode}
% Style the lower-level headings.
%    \begin{macrocode}
\newlength{\preheadskip}\setlength{\preheadskip}{1sp plus 1sp minus 1sp}
\newlength{\postheadskip}\setlength{\postheadskip}{\onelineskip}
\setsecheadstyle{\bfseries\SingleSpacing}
\setbeforesecskip{\preheadskip}
\setaftersecskip{\postheadskip}
\setsubsecheadstyle{\bfseries\SingleSpacing}
\setbeforesubsecskip{\preheadskip}
\setaftersubsecskip{\postheadskip}
\setsubsubsecheadstyle{\bfseries\SingleSpacing}
\setbeforesubsubsecskip{\preheadskip}
\setaftersubsubsecskip{\postheadskip}
%    \end{macrocode}
% Set the list and table spacings.
%    \begin{macrocode}
\tightlists
\AtBeginEnvironment{tabular}{\SingleSpacing}
%    \end{macrocode}
% Set the caption styles and spacing.
%    \begin{macrocode}
\captionstyle[\centering]{\raggedright}
\subcaptionsize{\small}
\setlength{\abovecaptionskip}{\parsep}
\setlength{\belowcaptionskip}{-\parsep}
%    \end{macrocode}
% Avoid orphans, widows, and other detritus.
%    \begin{macrocode}
\clubpenalty=10000
\widowpenalty=9996
\brokenpenalty=4991
\predisplaypenalty=10000
\postdisplaypenalty=1549
\displaywidowpenalty=1602
%    \end{macrocode}
% Set the spacing between floats and surrounding elements.
%    \begin{macrocode}
\setlength{\floatsep}{3\onelineskip}
\setlength{\intextsep}{2\onelineskip}
\setlength{\textfloatsep}{2\onelineskip}
\setlength{\dblfloatsep}{2\onelineskip}
\setlength{\dbltextfloatsep}{2\onelineskip}
%    \end{macrocode}

%
% \iffalse
%</class>
% \fi
%
% \Finale
\endinput
