% rccldoc.sty, March 1992, adapted by John Lloyd from the McGill
% mcreport.sty (May 1989, Lee Iverson), which was in turn
% adapted from report.sty.
%
% Only minor mods have been made for RCCL, and these are indicated
% by comment lines containing "RCCL"
%
\typeout{Document Style `RCCL documentation' <March 92>.}

\input{definitions.sty}

%% RCCL -- include options to control what we do here:
\input{options.tex}

%% RCCL -- define a few special fonts for titles and headings, so
%% that these can be redefined to support the ``sfheads'' option.
\def\hdr@nrm{\rm}
\def\hdr@nbf{\bf}
\def\hdr@nsl{\sl}
\def\hdr@lbf{\bf}
\def\hdr@hbf{\bf}
\def\hdr@Hbf{\bf}

%%
%% RCCL -- macro to implement the `sfheads' option for sans-serif headings
%%
\def\ds@sfheads{%
  \def\hdr@nrm{\sf}
  \def\hdr@nbf{\sfb}%
  \def\hdr@lbf{\sfb}%
  \def\hdr@hbf{\sfb}%
  \def\hdr@Hbf{\sfb}%
  \def\hdr@nsl{\sfs}%
}

%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

%% Figure inclusion substyle: figs, nofigs (default figs)
%%   nofigs: Don't include figures (affects *figinput commands)
%%   figs:   Include them.
\newif\if@figs \@figstrue
\def\ds@nofigs{\global\@figsfalse}
\def\ds@figs{\global\@figstrue}

%% Footnote format substyles: pagefoots, numfoots (default pagefoots)
%%   pagefoots: Page-based symbol-marked footnotes. 
%%   numfoots:  Numerically sequenced footnotes.
\def\f@@tstyle{\newfoots}
\def\ds@pagefoots{\gdef\f@@tstyle{\newfoots}}
\def\ds@numfoots{\gdef\f@@tstyle{\restorefoots}}

%% Figure, table numbering substyles: seqnums, incnums (default incnums)
%% Affects equations, figures, tables, theorems, etc...
%%   seqnums: Number sequentially (1, 2, ...)
%%   incnums: Number within chapters (1.1, 1.2, ..., 2.1, 2.2, ...)
\newif\if@incnum \@incnumfalse
\def\ds@seqnums{\global\@incnumfalse}
\def\ds@incnums{\global\@incnumtrue}

%% Draft substyle: draft, proof, final (default proof)
%%   draft: Uses draft mode with transparent \ref \label etc.
%%   proof: Inserts 'Proof version: \today' message in header.
%%   final: Blank header.
\def\dr@ftmsg{Draft version: \today}
\def\pr@@fmsg{Proof version: \today}

%%
%% RCCL -- read in the release number from releaseNum.tex, to be
%% used in the page foot message for "final" versions.
%%
{\newread\@rnumfile
\openin\@rnumfile = releaseNum.tex%
\catcode`\^^M=9\global\read\@rnumfile to \sysReleaseNumber
\closein\@rnumfile
}

\def\st@tmsg{}
\def\ds@final{\gdef\st@tmsg{\sysReleaseNumber, \today}}
\def\ds@draft{
  \ds@nofigs
  \gdef\st@tmsg{\dr@ftmsg}
  \def\baselinestretch{1.7}
  \input{draft.sty}
  \expmrgndr@ft{50pt}}
\def\ds@proof{
  \gdef\st@tmsg{\pr@@fmsg}}
\ds@proof

%% Chapter breaking substyles: chapters, sections (default sections)
%%   chapters: Page break before chapters.
%%   sections: No break.
\newif\if@chappage \@chappagefalse
\def\ds@chapters{\global\@chappagetrue \ds@incnums}
\def\ds@sections{\global\@chappagefalse\ds@seqnums}
\def\reset@chbreak{\let\if@chbreak=\if@chappage}
\def\chapterbreak{\let\if@chbreak=\iftrue}
\reset@chbreak

%% Pointsize substyle definitions: 10pt, 11pt, 12pt (default 10pt)
\def\@ptsize{0} 
\@namedef{ds@10pt}{\def\@ptsize{0}}
\@namedef{ds@11pt}{\def\@ptsize{1}}
\@namedef{ds@12pt}{\def\@ptsize{2}} 

%% Twosided substyle definition: twoside, oneside (default twoside)
%%   Enforces left/right side of page for headers.
\@twosidetrue \@mparswitchtrue
\def\ds@twoside{\global\@twosidetrue \global\@mparswitchtrue}
\def\ds@oneside{\global\@twosidefalse \global\@mparswitchfalse}

%% Submission substyle definition: doublespaces, moves figures to end
%% etc.
\newif\if@submit \@submitfalse
\def\ds@submit{
  \global\@submittrue
  \ds@sections \ds@oneside \ds@final
}

\def\repnumber#1{\gdef\@repnumber{#1}}
%% RCCL -- took out \nonumber because it masks the LaTeX \nonumber
%% \def\nonumber{\gdef\@repnumber{}}
\def\group#1{\gdef\@group{#1}}

\def\@repnumber{}
\def\@group{\mcrc@m}

%% RCCL -- McRCIM bibliography style stuff has been omitted ...

%% RCCL -- cut out some of the McCRCIM report header stuff ...
%%
\def\mcrc@m{
  McGill Research Centre for Intelligent Machines \\
  McGill University \\
  Montr\'eal, Qu\'ebec, Canada}
\def\ds@mcrcim{
 \def\repnumber##1{\gdef\@repnumber{TR-CIM-##1}}
 \def\@group{\mcrc@m}
}
\def\ds@cvarl{
 \def\repnumber##1{\gdef\@repnumber{TR-CIM-##1}}
 \def\@group{Computer Vision and Robotics Laboratory \\ \mcrc@m}
}
\def\postaddress{
  Postal Address: 3480 University Street, 
  Montr\'eal, Qu\'ebec, Canada\quad H3A 2A7 \\
  Telephone: (514) 398-6319
  \qquad Telex: 05 268510
  \qquad FAX: (514) 283-7897 \\
  RCCL/RCI Bug Reports: lloyd@curly.mcrcim.mcgill.edu \\
  General Network Address: mcrcim@larry.mcrcim.mcgill.edu
}

%% RCCL -- define macros for including the various font options,
%% which we will explicitly call later to ensure that the necessary files
%% are included in the right order.
%%
\def\@maybeloadsf{}
\def\ds@sf{%
   \def\@maybeloadsf{\input sf.sty}%
}
\def\@maybeloadtimes{}
\def\ds@times{%
   \if@hasPsFonts
      \def\@maybeloadtimes{\input times.sty}%
   \else
      \message{No PostScript fonts: "times" style spec ignored}%
   \fi
}
\def\@maybeloadhelvetica{}
\def\ds@helvetica{%
   \if@hasPsFonts
      \def\@maybeloadhelvetica{\input helvetica.sty}%
   \else
      \message{No PostScript fonts: "helvetica" style replaced with "sf"}%
      \def\@maybeloadhelvetica{\input sf.sty}%
   \fi
}
\def\@maybeloadsltt{}
\def\ds@sltt{%
   \if@hasSltt
      \def\@maybeloadsltt{\input sltt.sty}%
   \else
      \message{No cmsltt font: "sltt" style ignored}%
   \fi
}
\def\@maybeloadhyphentt{}
\def\ds@hyphentt{%
   \def\@maybeloadhyphentt{\input hyphentt.sty}%
}

%% Process options!
\@options

\begin{definitions}

\def\labelenumi{\arabic{enumi}.} 
\def\theenumi{\arabic{enumi}} 
\def\labelenumii{(\alph{enumii})}
\def\theenumii{\alph{enumii}}
\def\p@enumii{\theenumi}
\def\labelenumiii{\roman{enumiii}.}
\def\theenumiii{\roman{enumiii}}
\def\p@enumiii{\theenumi(\theenumii)}
\def\labelenumiv{\Alph{enumiv}.}
\def\theenumiv{\Alph{enumiv}} 
\def\p@enumiv{\p@enumiii\theenumiii}

\def\labelitemi{$\bullet$}
\def\labelitemii{\bf --}
\def\labelitemiii{$\ast$}
\def\labelitemiv{$\cdot$}

\def\verse{\let\\=\@centercr 
 \list{}{\itemsep\z@ \itemindent -1.5em\listparindent \itemindent 
 \rightmargin\leftmargin\advance\leftmargin 1.5em}\item[]}
\let\endverse\endlist
\def\quotation{\list{}{\listparindent 1.5em
 \itemindent\listparindent
 \rightmargin\leftmargin\parsep 0pt plus 1pt}\item[]}
\let\endquotation=\endlist
\def\quote{\list{}{\rightmargin\leftmargin}\item[]}
\let\endquote=\endlist

\def\descriptionlabel#1{\hspace\labelsep \bf #1}
\def\description{\list{}{\labelwidth\z@ \itemindent-\leftmargin
 \let\makelabel\descriptionlabel}}
\let\enddescription\endlist
\newdimen\descriptionmargin
\descriptionmargin=3em


\def\titlepage{\def\baselinestretch{1}\@normalsize
 \@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \else \newpage \fi \thispagestyle{empty}\c@page\z@}
\def\endtitlepage{\if@restonecol\twocolumn \else \newpage \fi}

\def\maketitle{\begin{titlepage}
\let\footnotesize\small \let\footnoterule\relax \setcounter{page}{0}
\null
\begin{center}
 \hdr@nrm
 \vskip 70pt
 \begin{minipage}{5.0truein}
  \vbox to 5.0truein{
   \parbox{5.0truein}{\begin{center}
%% RCCL -- next vbox was to 5.5truecm; we grew it to 6.5 cause it was to small
    \vbox to 6.5truecm{
     \vfill
     \parbox{10.5truecm}{\begin{center} 
      {\large\hdr@lbf \@title \par} 
     \end{center}}
     \vfill
     \parbox{10.5truecm}{\begin{center}
      {\lineskip .75ex
       \begin{tabular}[t]{c}
        \@author
       \end{tabular}\par}
%% RCCL -- took out report number support, for now --
%%    \vskip 1.5ex {\if@submit \else \@repnumber \qquad \fi \@date \par}
      \vskip 1.5ex {\@date \par}
     \end{center}}
     \vfill
    }
   \end{center}}
   \vfill
   \parbox{5.0truein}{\begin{center}
    \lineskip .75ex
    \@group\\[0.75ex]
    \@thanks
   \end{center}}
  }
 \end{minipage}
 \vfill
 {\small \lineskip .75ex \postaddress \par}
\end{center}
\null
\end{titlepage}
\setcounter{footnote}{0} \gdef\thanks##1{}
\let\maketitle\relax} 

\def\abstract{\begin{titlepage}
\let\footnotesize\small \let\footnoterule\relax \setcounter{page}{0}
\begin{center}
{\large\hdr@lbf \@title \par}
\vskip 2ex
\begin{center}
{\let\ref=\@gobble
 \lineskip .75ex \begin{tabular}[t]{c}\@author \end{tabular}\par}
\end{center}
\par
\vskip 3ex
{\hdr@nbf Abstract}
\end{center}}
\def\endabstract{\par\vfil\null\end{titlepage}
\gdef\@thanks##1{}\gdef\@author{}\gdef\@title{}\gdef\@number{}
}

\def\acknowledge{
  \vskip 5ex\begin{center}{\hdr@nbf Acknowledgements}\end{center}}
\def\endacknowledge{\par}

\arraycolsep 5pt \tabcolsep 6pt \arrayrulewidth .4pt \doublerulesep 2pt 
\tabbingsep \labelsep 
\skip\@mpfootins = \skip\footins
\fboxsep = 3pt \fboxrule = .4pt 

%% RCCL -- macro for inserting copyright.
\def\copyrightNotice{%
   \input ../Copyright.tex
}

%\newcounter{part}
%\newcounter {chapter}
%\newcounter {section}[chapter]
%\newcounter {subsection}[section]
%\newcounter {subsubsection}[subsection]
%\newcounter {paragraph}[subsubsection]
%\newcounter {subparagraph}[paragraph]

\def\thepart {\Roman{part}}
\def\thechapter {\arabic{chapter}}
\def\thesection {\thechapter.\arabic{section}}
\def\thesubsection {\thesection.\arabic{subsection}}
\def\thesubsubsection {\thesubsection .\arabic{subsubsection}}
\def\theparagraph {\thesubsubsection.\arabic{paragraph}}
\def\thesubparagraph {\theparagraph.\arabic{subparagraph}}
%\def\@chapapp{Chapter\space}
\def\@chapapp{}

\def\part{\cleardoublepage \thispagestyle{plain} \if@twocolumn \onecolumn
\@tempswatrue \else \@tempswafalse \fi \hbox{}\vfil \secdef\@part\@spart} 

\def\@part[#1]#2{\ifnum \c@secnumdepth >-2\relax \refstepcounter{part}
\addcontentsline{toc}{part}{\thepart \hspace{1em}#1}\else
\addcontentsline{toc}{part}{#1}\fi \markboth{}{}
 {\centering \ifnum \c@secnumdepth >-2\relax \huge\hdr@hbf Part \thepart \par
\vskip 20pt \fi \Huge\hdr@Hbf #1\par}\@endpart} 
\def\@endpart{\vfil\newpage \if@twoside \hbox{} \thispagestyle{empty} 
 \newpage 
 \fi \if@tempswa \twocolumn \fi} 
\def\@spart#1{{\centering \Huge\hdr@Hbf #1\par}\@endpart}


\def\@pnumwidth{1.55em}
\def\@tocrmarg {2.55em}
\def\@dotsep{4.5}
\setcounter{tocdepth}{2}

\def\tableofcontents{\chapterbreak
 \@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \fi\chapter*{Contents\@mkboth{CONTENTS}{CONTENTS}}
 \bgroup\let\label=\@gobble\@starttoc{toc}\egroup
 \if@restonecol\twocolumn\fi\chapterbreak}

\def\l@part#1#2{\addpenalty{-\@highpenalty}
 \addvspace{2.25em plus 1pt} \begingroup
 \@tempdima 3em \parindent \z@ \rightskip \@pnumwidth \parfillskip
-\@pnumwidth 
 {\large \bf \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}}\par
 \nobreak \endgroup}
\def\l@chapter#1#2{\pagebreak[3] 
 \vskip 1.0em plus 1pt \@tempdima 1.5em \begingroup
 \parindent \z@ \rightskip \@pnumwidth 
 \parfillskip -\@pnumwidth 
 \bf \leavevmode \advance\leftskip\@tempdima \hskip -\leftskip #1\nobreak\hfil
\nobreak\hbox to\@pnumwidth{\hss #2}\par
 \endgroup}
\def\l@section{\@dottedtocline{1}{1.5em}{2.3em}}
\def\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}
\def\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
\def\l@paragraph{\@dottedtocline{4}{10em}{5em}}
\def\l@subparagraph{\@dottedtocline{5}{12em}{6em}}

\def\listoffigures{\chapterbreak
   \@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
   \fi\chapter*{List\ of\ Figures
   \@mkboth{LIST\ OF\ FIGURES}{LIST\ OF\ FIGURES}}
   \bgroup\let\label=\@gobble\@starttoc{lof}\egroup
   \if@restonecol\twocolumn\fi\chapterbreak}
\def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}

\def\listoftables{\chapterbreak
   \@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
   \fi\chapter*{List\ of\ Tables
   \@mkboth{LIST\ OF\ TABLES}{LIST\ OF\ TABLES}}
   \bgroup\let\label=\@gobble\@starttoc{lot}\egroup
   \if@restonecol\twocolumn\fi\chapterbreak}
\let\l@table\l@figure

\def\@starttoc#1{\begingroup
  \def\baselinestretch{1}\@normalsize
  \makeatletter
  \@input{\jobname.#1}
  \if@filesw \expandafter\newwrite\csname tf@#1\endcsname
       \expandafter\openout \csname tf@#1\endcsname \jobname.#1\relax
  \fi \endgroup}

\def\thebibliography#1{\chapterbreak
 \addcontentsline{toc}{chapter}{Bibliography}
 \chapter*{Bibliography\@mkboth
 {BIBLIOGRAPHY}{BIBLIOGRAPHY}}\list
 {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
 \advance\leftmargin\labelsep
 \usecounter{enumi}}
 \def\newblock{\hskip .11em plus .33em minus .07em}
 \sloppy\clubpenalty4000\widowpenalty4000
 \sfcode`\.=1000\relax\chapterbreak}
\let\endthebibliography=\endlist

\newif\if@restonecol
\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
\columnseprule \z@
\columnsep 35pt\twocolumn[\@makeschapterhead{Index}]
 \@mkboth{INDEX}{INDEX}\thispagestyle{plain}\parindent\z@
 \parskip\z@ plus .3pt\relax\let\item\@idxitem}
\def\@idxitem{\par\hangindent 40pt}
\def\subitem{\par\hangindent 40pt \hspace*{20pt}}
\def\subsubitem{\par\hangindent 40pt \hspace*{30pt}}
\def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi}
\def\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax}

\def\footnoterule{\kern-3\p@ 
 \hrule width .4\columnwidth 
 \kern 2.6\p@} 
\@addtoreset{footnote}{chapter} 
\long\def\@makefntext#1{\parindent 1em\noindent 
 \hbox to 1.8em{\hss$^{\@thefnmark}$}#1}


\setcounter{topnumber}{2}
\def\topfraction{.7}
\setcounter{bottomnumber}{1}
\def\bottomfraction{.3}
\setcounter{totalnumber}{3}
\def\textfraction{.2}
\def\floatpagefraction{.5}
\setcounter{dbltopnumber}{2}
\def\dbltopfraction{.7}
\def\dblfloatpagefraction{.5}

\def\capnumsty{\small\bf}
\def\capsty{\small}
\def\capsize{5in}
\long\def\@makecaption#1#2{
 \vskip 10pt 
 \setbox\@tempboxa\hbox{{\capnumsty #1:} {\capsty #2}}
 \ifdim \wd\@tempboxa >\capsize 
 \centerline{\parbox{\capsize}{{\capnumsty #1:} {\capsty #2}}}
 \else \centerline{\box\@tempboxa}
 \fi}

%\if@incnum
%  \newcounter{figure}[chapter]
%  \def\thefigure{\thechapter.\@arabic\c@figure}
%\else
%  \newcounter{figure}
%  \def\thefigure{\@arabic\c@figure}
%\fi

\if@submit \def\fps@figure{} \else \def\fps@figure{hbtp} \fi
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{Figure\space\thefigure}
\def\figure{\@float{figure}}
\let\endfigure\end@float
\@namedef{figure*}{\@dblfloat{figure}}
\@namedef{endfigure*}{\end@dblfloat}

%\if@incnum
%  \newcounter{table}[chapter]
%  \def\thetable{\thechapter.\@arabic\c@table}
%\else
%  \newcounter{table}
%  \def\thetable{\@arabic\c@table}
%\fi
\if@submit \def\fps@table{p} \else \def\fps@table{tp} \fi
\def\ftype@table{2}
\def\ext@table{lot}
\def\fnum@table{Table\space\thetable}
\def\table{\@float{table}}
\let\endtable\end@float
\@namedef{table*}{\@dblfloat{table}}
\@namedef{endtable*}{\end@dblfloat}

\mark{{}{}} 

\if@twoside 
 \def\ps@headings{\let\@mkboth\markboth
  \def\@oddhead{\let\label=\@gobble\hbox{}\hdr@nsl \rightmark\hfil\rm\thepage}
  \def\@oddfoot{\hdr@nsl\st@tmsg\hfil}
  \def\@evenfoot{\hfil\hdr@nsl\st@tmsg}
  \def\@evenhead{\let\label=\@gobble\rm \thepage\hfil \hdr@nsl\leftmark}
  \def\chaptermark##1{\markboth
   {\uppercase{\ifnum\c@secnumdepth>\m@ne \@chapapp\thechapter.\space\fi ##1}}
   {}}
  \def\sectionmark##1{\markright
   {\uppercase{\ifnum \c@secnumdepth >\z@ \thesection. \ \fi ##1}}}}
\else 
 \def\ps@headings{\let\@mkboth\markboth
  \def\@oddhead{\let\label=\@gobble\hbox {}\hdr@nsl \rightmark \hfil\rm\thepage}
  \def\@oddfoot{\hdr@nsl\st@tmsg\hfil}
  \def\chaptermark##1{\markright
   {\uppercase{\ifnum\c@secnumdepth>\m@ne \@chapapp\thechapter.\space\fi ##1}}}}
\fi
\def\ps@empty{\let\@mkboth\@gobbletwo\def\@oddhead{}
  \def\@oddfoot{\hdr@nsl\st@tmsg\hfil}
  \def\@evenhead{}
  \def\@evenfoot{\hfil\hdr@nsl\st@tmsg}}

\def\ps@plain{\let\@mkboth\@gobbletwo
  \def\@oddhead{\hfil\rm\thepage}
  \def\@oddfoot{\hdr@nsl\st@tmsg\hfil}
  \def\@evenhead{\rm\thepage\hfil}
  \def\@evenfoot{\hfil\hdr@nsl\st@tmsg}}

\def\ps@myheadings{\let\@mkboth\@gobbletwo
 \def\@oddhead{\let\label=\@gobble\hbox{}\hdr@nsl\rightmark\hfil\rm\thepage}
 \def\@oddfoot{\hdr@nsl\st@tmsg\hfil}
 \def\@evenhead{\let\label=\@gobble\rm \thepage\hfil\hdr@nsl\leftmark\hbox{}}
 \def\@evenfoot{\hfil\hdr@nsl\st@tmsg}
 \def\sectionmark##1{}\def\subsectionmark##1{}}

\def\today{\ifcase\month\or
 January\or February\or March\or April\or May\or June\or
 July\or August\or September\or October\or November\or December\fi
 \space\number\day, \number\year}

\if@incnum
  \@addtoreset{equation}{chapter} 
  \def\theequation{\thechapter.\arabic{equation}}
\fi

% Redefine the macro used for floats (including figures and tables)
% so that single spacing is used.
% (Note \def\figure{\@float{figure}set single spacing} doesn't work
%  because figure has an optional argument)
\def\@xfloat#1[#2]{\ifhmode \@bsphack\@floatpenalty -\@Mii\else
   \@floatpenalty-\@Miii\fi\def\@captype{#1}\ifinner
      \@parmoderr\@floatpenalty\z@
    \else\@next\@currbox\@freelist{\@tempcnta\csname ftype@#1\endcsname
       \multiply\@tempcnta\@xxxii\advance\@tempcnta\sixt@@n
       \@tfor \@tempa :=#2\do
                        {\if\@tempa h\advance\@tempcnta \@ne\fi
                         \if\@tempa t\advance\@tempcnta \tw@\fi
                         \if\@tempa b\advance\@tempcnta 4\relax\fi
                         \if\@tempa p\advance\@tempcnta 8\relax\fi
         }\global\count\@currbox\@tempcnta}\@fltovf\fi
    \global\setbox\@currbox\vbox\bgroup 
    \def\baselinestretch{1} \@normalsize
    \boxmaxdepth\z@
    \hsize\columnwidth \@parboxrestore}


%%% 
%$% subfigure.sty
%$% Subfigure command for use with the LaTeX figure environment.
%%
%$% $Header: subfigure.doc,v 1.1 88/11/02 11:03:46 cochran Exp $
%%
%$% $Log:	subfigure.doc,v $
%$%  Revision 1.1  88/11/02  11:03:46  cochran
%$%  Initial revision
%$%  
%$%  05 Mar 86  cochran @ dworkin.usc.edu (USC-IRIS)
%$%  Created.
%%%  
%$% Usage:  \documentstyle[...,subfigure,...]{...}
%%
%$%         \subfigure[CAPTIONtext]{FIGUREbox}
%%
%%% Creates a subfigure box with an optional CAPTION under a FIGURE.  The 
%%% FIGURE is centered with \subfigtopskip of vertical space added above
%%% and \subfigcapskip vertical space added below it followed by the
%%% CAPTION.  The subfigure is followed by another \subfigtopskip of
%%% vertical space added at the bottom.
%%
%%% If a CAPTION is given (including a null CAPTION '[]') then the subfigure
%%% is labeled with a counter supplied by the macro '\thesubfigure' which
%%% returns '(a) ', '(b) ', etc.  If desired, this macro may be redefined.
%%% The counter used for labeling the subfigures is 'subfigure' and in
%%% incremented for each subfigure regardless of whether a CAPTION was
%%% printed.
%%
%%% One example of use is to surround the figure in a tabular environment:
%%%      \begin{figure}
%%%        \begin{center}
%%%          \begin{tabular}[t]{c}
%%%            \subfigure[First]{...}
%%%            \subfigure[Second]{...} \\
%%%            \subfigure[Third]{...}
%%%          \end{tabular}
%%%        \end{center}
%%%      \caption{Three Subfigures}
%%%      \end{figure}

%% Subfigure counter.
\newcounter{subfigure}[figure]

%% Generate CAPTION preface.
\def\thesubfigure{(\alph{subfigure})}

%% Size of the CAPTION font.
\def\subcapsize{\footnotesize} 

%% Length from the top of the subfigure box to the begining of the FIGURE
%% box.  Also from the bottom of the CAPTION to the bottom of the subfigure.
\def\subfigtopskip{10pt}

%% Length from the bottom of the FIGURE to the begining of the CAPTION.
\def\subfigcapskip{10pt}

%% Indentation of the caption from the sides of the subfigure box.
\def\subfigcapmargin{10pt} 

%
%% Define the subfigure command
%
\def\subfigures{
  \stepcounter{\@captype}
}
\def\endsubfigures{
  \addtocounter{\@captype}{-1}
}

\def\subfigure{
  \leavevmode
  \@ifnextchar [
    \@subfigure
    {\@subfigure[\@empty]}}

\long\def\@subfigure[#1]#2{
  \stepcounter{subfigure}
  \xdef\@currentlabel{\thefigure\thesubfigure}
  \setbox\@tempboxa \hbox{#2}
  \@tempdima=\wd\@tempboxa
  \vtop{
    \vbox{%   Put the figure in the top box
      \vskip\subfigtopskip
      \box\@tempboxa}
    %% Now skip down and add the caption paragraph.
    \vskip\subfigcapskip
    \begingroup
      \@parboxrestore
      \setbox\@tempboxa
      \ifx #1\@empty
        \hbox{\subcapsize\strut\hfil}
      \else
        \hbox{\subcapsize\strut\thesubfigure\space#1}
      \fi
      \@tempdimb=-\subfigcapmargin
      \multiply\@tempdimb\tw@
      \advance\@tempdimb\@tempdima
      \hbox to\@tempdima{
        \hfil
        \ifdim \wd\@tempboxa >\@tempdimb %   (Comment too wide for one line)
          \parbox{\@tempdimb}{\subcapsize\thesubfigure\space#1}
        \else
          \box\@tempboxa
        \fi
        \hfil}
    \endgroup
  \vskip\subfigtopskip}}


%	Figure inclusion.
%
%   These are designed so that if the figure (i.e. the texbinim output
% file) does not exist, then a box with the name of the file in it is
% output instead.  The commands look like \[c][b]figinput[WxH]{file}
%  'c' determines whether or not there is a caption.  This requires a
%      second mandatory argument, which precedes the figure file.
%  'b' determines whether or not there is a box.
% The optional [WxH] is the size of box to build if the figure is not
% present.

\newif\ifexists \newread\existsin
\def\checkexists#1{
 \openin\existsin=#1\relax\ifeof\existsin\existsfalse\closein\existsin
 \else\existstrue\closein\existsin\fi}

\newif\iff@gsize  \f@gsizefalse
\newif\iff@gboxed \f@gboxedfalse
\newdimen\f@gheight \f@gheight=1cm
\newdimen\f@gwidth  \f@gwidth=3cm

\def\figinput{
  \f@gboxedfalse\@ifnextchar [\f@ginputsize\f@ginputnosize}
\def\bfiginput{
  \f@gboxedtrue\@ifnextchar [\f@ginputsize\f@ginputnosize}
\def\cfiginput{
  \f@gboxedfalse\@ifnextchar [\cf@ginputsize\cf@ginputnosize}
\def\cbfiginput{
  \f@gboxedtrue\@ifnextchar [\cf@ginputsize\cf@ginputnosize}

\def\psfiginput{
  \f@gboxedfalse\@ifnextchar [\psf@ginputsize\psf@ginputnosize}
\def\bpsfiginput{
  \f@gboxedtrue\@ifnextchar [\psf@ginputsize\psf@ginputnosize}
\def\cpsfiginput{
  \f@gboxedfalse\@ifnextchar [\cpsf@ginputsize\cpsf@ginputnosize}
\def\cbpsfiginput{
  \f@gboxedtrue\@ifnextchar [\cpsf@ginputsize\cpsf@ginputnosize}

\def\f@ginputsize[#1,#2]#3{
  \begingroup\fboxsep=0pt\f@gsizetrue\f@gwidth=#1\f@gheight=#2
    \iff@gboxed\fbox{\f@ginput{#3}}\else\f@ginput{#3}\fi
  \endgroup}
\def\f@ginputnosize#1{
  \begingroup\fboxsep=0pt\f@gsizefalse
    \iff@gboxed\fbox{\f@ginput{#1}}\else\f@ginput{#1}\fi
  \endgroup}
\def\cf@ginputsize[#1,#2]#3#4{
  \begingroup\fboxsep=0pt\f@gsizetrue\f@gwidth=#1\f@gheight=#2
    \subfigure[#3]{\iff@gboxed\fbox{\f@ginput{#4}}\else\f@ginput{#4}\fi}
  \endgroup}
\def\cf@ginputnosize#1#2{
  \begingroup\fboxsep=0pt\f@gsizefalse
    \subfigure[#1]{\iff@gboxed\fbox{\f@ginput{#2}}\else\f@ginput{#2}\fi}
  \endgroup}

\def\psf@ginputsize[#1,#2]#3#4{
  \begingroup\fboxsep=0pt\f@gsizetrue\f@gwidth=#1\f@gheight=#2
    \iff@gboxed\fbox{\psf@ginput{#3}{#4}}\else\psf@ginput{#3}{#4}\fi
  \endgroup}
\def\psf@ginputnosize#1#2{
  \begingroup\fboxsep=0pt\f@gsizefalse
    \iff@gboxed\fbox{\psf@ginput{#1}{#2}}\else\psf@ginput{#1}{#2}\fi
  \endgroup}
\def\cpsf@ginputsize[#1,#2]#3#4#5{
  \begingroup\fboxsep=0pt\f@gsizetrue\f@gwidth=#1\f@gheight=#2
    \subfigure[#3]{\iff@gboxed\fbox{\psf@ginput{#4}{#5}}
		   \else\psf@ginput{#4}{#5}\fi}
  \endgroup}
\def\cpsf@ginputnosize#1#2#3{
  \begingroup\fboxsep=0pt\f@gsizefalse
    \subfigure[#1]{\iff@gboxed\fbox{\psf@ginput{#2}{#3}}
		   \else\psf@ginput{#2}{#3}\fi}
  \endgroup}

\def\f@ginput#1{
 \if@figs\checkexists{#1}\ifexists\input{#1}\else\n@fig{#1}\fi
 \else\n@fig{#1}
 \fi
}

\def\psf@ginput#1#2{
 \if@figs
   \checkexists{#1}
   \ifexists\def\a{}\def\b{#2}
     \ifx\a\b\psfig{figure=#1}\else\psfig{figure=#1,#2}\fi
   \else\n@fig{#1}
   \fi
 \else\n@fig{#1}
 \fi
}

\def\n@fig#1{
  \if@figs\message{<<#1\space not\space found>>}\fi
  \vbox to \f@gheight{
    \vfil
    \iff@gsize \hbox to \f@gwidth{\hss{\tt #1}\hss}
    \else      \hbox{\quad {\tt #1}\quad} \fi
    \vfil
  }
}



% SubStyle file to permit the use of captions in continuations of floats.
% 
% \captcont is like \caption, except that it doesn't update the counter, and
% it doesn't make an entry in the list of figures or list of tables.

\def\captcont{\@dblarg{\@captcont\@captype}}

\long\def\@captcont#1[#2]#3{
  \par
  \begingroup
    \@parboxrestore
    \normalsize
    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
  \endgroup}

% This file, equations.sty (August 1988), contains a collection of macros
% to aid in constructing displayed equations in LaTeX.  Written by
%   Charles Karney
%   Plasma Physics Laboratory   Phone:   +1 609 243 2607
%   Princeton University        MFEnet:  Karney@PPC.MFEnet
%   PO Box 451                  ARPAnet: Karney%PPC.MFEnet@NMFECC.ARPA
%   Princeton, NJ 08543-0451    Bitnet:  Karney%PPC.MFEnet@ANLVMS.Bitnet
% with some ideas and macros borrowed from John Hobby and Stephen Gildea.

% Use this as a style option, e.g.,
%     \documentstyle[equations]{article}
% These probably don't work in conjunction with the leqno option.

% This implements the following:

% (1) \yesnumber turns on an equation number in an eqnarray* environment
% (just as \nonumber turns it off in an eqnarray environment).  E.g.,
%     \begin{eqnarray*}
%        a &=& b \\
%          & & + c \\
%          & & + d \\
%          & & + e \\
%          & & + f \\
%          & & + g \yesnumber
%     \end{eqnarray*}

% (2) The eqalign environment is just like Plain TeX's \eqalign.  E.g.,
%     \begin{equation}
%           \begin{eqalign}
%              a &= b, \\
%              c &= d.
%           \end{eqalign}
%     \end{equation}
% Note that \begin{equation} \end{equation} or equivalent is needed.

% (3) The eqalignno environment is just like Plain TeX's \eqalignno.  E.g.,
%     \begin{eqalignno}
%        a &= b, \label{foo}\\
%        c &= d. \label{bar}
%     \end{eqalignno}
% Note the absence of \begin{equation} \end{equation}.  \nonumber can be used
% to suppress the equation number.  eqalignno* is the same except that the
% equation numbers are suppressed (unless a \yesnumber appears).

% (4) The eqaligntwo environment is a two-equation per line equivalent of
% eqalignno.  E.g.,
%     \begin{eqaligntwo}
%        a &= b, & x &= y, \label{foo} \\
%        c &= d, & z &= w. \label{bar}
%     \end{eqaligntwo}
% eqaligntwo* is defined similarly.

% (5) The cases environment is just like Plain TeX's \cases.  E.g.,
%     \begin{equation}
%        u(x) =
%           \begin{cases}
%             0, & for $x < 0$,
%             1, & for $x \ge 0$.
%           \end{cases}
%     \end{equation}
% Note the first column is treated as math, the second column as text.

% (6) I've borrowed John Hobby's modifications to the eqnarray environment
% (to fix up the spacing around the operator), and to the \big, \bigg, etc.
% operators (to make them scale with the point size).

% (7) I've borrowed Stephen Gildea's subequations environment, and fixed it
% so that it ignores spaces after the environment and so that you can refer
% both to the overall set of equations and to individual subequations.  E.g.,
%     \begin{subequations} \label{foo}
%       \begin{eqalignno}
%          a &= b, \label{foo-a} \\
%          c &= d, \label{foo-b}
%       \end{eqalignno}
%       text text text text ...
%       \begin{equation}
%          e = f. \label{foo-c}
%       \end{equation}
%     \end{subequations}
% Now \ref{foo}, \ref{foo-a}, \ref{foo-b}, \ref{foo-c}, produce 1, 1a, 1b,
% 1c.

% Fix up eqnarray* so that \yesnumber and \nonumber do the obvious things 
\newif\if@defeqnsw \@defeqnswtrue

% This is John Hobby's (hobby@research.att.com) version to fix up the spacing.
\def\eqnarray{\stepcounter{equation}\let\@currentlabel=\theequation
\if@defeqnsw\global\@eqnswtrue\else\global\@eqnswfalse\fi
%\global\@eqnswtrue
\tabskip\@centering\let\\=\@eqncr
$$\halign to \displaywidth\bgroup\hfil\global\@eqcnt\z@
  $\displaystyle\tabskip\z@{##}$&\global\@eqcnt\@ne 
  \hfil$\displaystyle{{}##{}}$\hfil
  &\global\@eqcnt\tw@ $\displaystyle{##}$\hfil 
  \tabskip\@centering&\llap{##}\tabskip\z@\cr}

\def\yesnumber{\global\@eqnswtrue}

\def\@@eqncr{\let\@tempa\relax\global\advance\@eqcnt by \@ne
    \ifcase\@eqcnt \def\@tempa{& & & &}\or \def\@tempa{& & &}\or
     \def\@tempa{& &}\or \def\@tempa{&}\else\fi 
     \@tempa \if@eqnsw\@eqnnum\stepcounter{equation}\fi
     \if@defeqnsw\global\@eqnswtrue\else\global\@eqnswfalse\fi
     \global\@eqcnt\z@\cr}

% Fix the eqnarray* environment:

\@namedef{eqnarray*}{\@defeqnswfalse\eqnarray}
\@namedef{endeqnarray*}{\endeqnarray}

% Several formulas like \eqalign (to go inside \begin{equation}
% \end{equation} or $$ $$.

\def\@eqnacr{{\ifnum0=`}\fi\@ifstar{\@yeqnacr}{\@yeqnacr}}

\def\@yeqnacr{\@ifnextchar [{\@xeqnacr}{\@xeqnacr[\z@]}}

\def\@xeqnacr[#1]{\ifnum0=`{\fi}\cr \noalign{\vskip\jot\vskip #1\relax}}

\def\eqalign{\null\,\vcenter\bgroup\openup1\jot \m@th \let\\=\@eqnacr
\ialign\bgroup\strut
\hfil$\displaystyle{##}$&$\displaystyle{{}##}$\hfil\crcr}
\def\endeqalign{\crcr\egroup\egroup\,}

% \cases

\def\cases{\left\{\,\vcenter\bgroup\normalbaselines\m@th \let\\=\@eqnacr
    \ialign\bgroup$##\hfil$&\quad##\hfil\crcr}
\def\endcases{\crcr\egroup\egroup\right.}

% Several formulas like \eqalignno (doesn't need the $$ $$)

\def\eqalignno{\stepcounter{equation}\let\@currentlabel=\theequation
\if@defeqnsw\global\@eqnswtrue\else\global\@eqnswfalse\fi
\let\\=\@eqncr
$$\displ@y \tabskip\@centering \halign to \displaywidth\bgroup
  \global\@eqcnt\@ne\hfil
  $\@lign\displaystyle{##}$\tabskip\z@skip&\global\@eqcnt\tw@
  $\@lign\displaystyle{{}##}$\hfil\tabskip\@centering&
  \llap{\@lign##}\tabskip\z@skip\crcr}

\def\endeqalignno{\@@eqncr\egroup
      \global\advance\c@equation\m@ne$$\global\@ignoretrue}


% Here's the eqalignno* environment:

\@namedef{eqalignno*}{\@defeqnswfalse\eqalignno}
\@namedef{endeqalignno*}{\endeqalignno}

% Two formulas like \eqalignno (doesn't need the $$ $$)

\def\eqaligntwo{\stepcounter{equation}\let\@currentlabel=\theequation
\if@defeqnsw\global\@eqnswtrue\else\global\@eqnswfalse\fi
\let\\=\@eqncr
$$\displ@y \tabskip\@centering \halign to \displaywidth\bgroup
  \global\@eqcnt\m@ne\hfil
  $\@lign\displaystyle{##}$\tabskip\z@skip&\global\@eqcnt\z@
  $\@lign\displaystyle{{}##}$\hfil\qquad&\global\@eqcnt\@ne
  \hfil$\@lign\displaystyle{##}$&\global\@eqcnt\tw@
  $\@lign\displaystyle{{}##}$\hfil\tabskip\@centering&
  \llap{\@lign##}\tabskip\z@skip\crcr}

\def\endeqaligntwo{\@@eqncr\egroup
      \global\advance\c@equation\m@ne$$\global\@ignoretrue}

\@namedef{eqaligntwo*}{\@defeqnswfalse\eqaligntwo}
\@namedef{endeqaligntwo*}{\endeqaligntwo}

% subequations
%
% Within the subequations environment, the only change is that
% equations are labeled differently.  The number stays the same,
% and lower case letters are appended.  For example, if after doing
% three equations, numbered 1, 2, and 3, you start a subequations
% environmment and do three more equations, they will be numbered
% 4a, 4b, and 4c.  After you end the subequations environment, the
% next equation will be numbered 5.
%
% Both text and equations can be put inside the subequations environment.
%
% If you make any improvements, I'd like to hear about them.
%
% Stephen Gildea
% MIT Earth Resources Lab
% Cambridge, Mass. 02139
% mit-erl!gildea
% gildea@erl.mit.edu
%
\newtoks\@stequation

\def\subequations{\refstepcounter{equation}
  \edef\@savedequation{\the\c@equation}
  \@stequation=\expandafter{\theequation}%   %only want \theequation
  \edef\@savedtheequation{\the\@stequation}% %expanded once
  \edef\oldtheequation{\theequation}
  \setcounter{equation}{0}
  \def\theequation{\oldtheequation\alph{equation}}}

\def\endsubequations{
  \setcounter{equation}{\@savedequation}
  \@stequation=\expandafter{\@savedtheequation}
  \edef\theequation{\the\@stequation}
  \global\@ignoretrue}

% More from John Hobby
% Fix Plain's \bigl, \Bigl, etc. macros so that they try to scale with
% LaTeX size changes.  This uses the fact that \@setsize sets \ht\strutbox
% to be 70% of the normal unstretched baselineskip.

\def\big#1{{\hbox{$\left#1\vcenter to1.428\ht\strutbox{}\right.\n@space$}}}
\def\Big#1{{\hbox{$\left#1\vcenter to2.142\ht\strutbox{}\right.\n@space$}}}
\def\bigg#1{{\hbox{$\left#1\vcenter to2.857\ht\strutbox{}\right.\n@space$}}}
\def\Bigg#1{{\hbox{$\left#1\vcenter to3.571\ht\strutbox{}\right.\n@space$}}}

% This style option should not change the appearance of a document,
% but merely change the page numbers (as defined by \count0) in the
% DVI file to be negative when roman pagenumbering is in use.

% To do this, the \@steppagecounter macro increments the absolute
% value of \count0
\def\@steppagecounter{% based on \advancepageno, TeXbook, p.362
  \ifnum\c@page<\z@ \global\advance\c@page\m@ne
  \else\global\advance\c@page\@ne \fi} % increase |c@page|

% The output routine is slightly modified so that \@steppagecounter is
% used.  We assume a) that the page counter is only modified in the
% output routine, and by \pagenumbering, and
% b) the output routine below is otherwise identical to that defined
% by LaTeX.  This should be checked before installation.
\def\@outputpage{\begingroup\catcode`\ =10 \if@specialpage 
     \global\@specialpagefalse\@nameuse{ps@\@specialstyle}\fi
     \if@twoside 
       \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
            \let\@themargin\oddsidemargin
          \else \let\@thehead\@evenhead
          \let\@thefoot\@evenfoot \let\@themargin\evensidemargin
     \fi\fi
     \shipout
     \vbox{\normalsize \baselineskip\z@ \lineskip\z@
           \vskip \topmargin \moveright\@themargin
           \vbox{\setbox\@tempboxa
                   \vbox to\headheight{\vfil \hbox to\textwidth{\@thehead}}
                 \dp\@tempboxa\z@
                 \box\@tempboxa
                 \vskip \headsep
                 \box\@outputbox
                 \baselineskip\footskip
                 \hbox to\textwidth{\@thefoot}}}\global\@colht\textheight
           \endgroup\@steppagecounter\let\firstmark\botmark} % <-- only
							     % this line changed
	   
% Modified version of the pagenumbering command that sets \count0 (aka
% \c@page) to -1 rather than 1 if roman numbering is specified.
\def\pagenumbering#1{{
  \def\@tmpa{#1} \def\@tmpb{roman} \def\@tmpc{Roman}
  \ifx\@tmpa\@tmpb % roman option; set -ve page number.
    \global\c@page \m@ne
  \else\ifx\@tmpa\@tmpc
    \global\c@page \m@ne
  \else
    \global\c@page \@ne
  \fi\fi
  \gdef\thepage{\csname @#1\endcsname \c@page}}}

% the modified versions of \@roman and \@Roman deal with negatives
\def\@romannumeral#1{\ifnum#1<0\romannumeral-#1\else\romannumeral#1\fi}
\def\@roman#1{\@romannumeral#1}
\def\@Roman#1{\expandafter\uppercase\expandafter{\@romannumeral#1}}

% A footnote-numbering style from Brian T. Schellenberger.  v1.0.
% This is redistributable by anybody to anybody for any price.
% I only ask that you credit me for it, and that if you make any
% changes and distribute them to anybody else at all, you (1) send
% them back to me, and (2) note who made them so that any different
% versions of this floating around may be distinguished.

% The footnote code itself.
% 1. This code resets foot notes on each page.  It needs two passes
%    to do this correctly, although it comes as close as possible on
%    the first pass.  You generally make two passes with LaTeX anyway,
%    to get cross-references right, so this shouldn't be a problem.
%    It uses the aux file like everything else.
% 2. It also uses the \fnsymbol to "number" the footnotes.  This is
%    controlled by the first line of \newfoots.
% 3. It gets rid of the usual footnote rule, and inserts more vertical
%    space for footnotes.  This is also easy to see/control in the
%    \newfoots command.
% 4. Most of this code simply makes the "new" footnotes stuff available;
%    you can include all of this except the last line in a style file
%    and only say \newfoots if you want them, or you include it all
%    and say \restorefoots for the files where you don't want it.
% 5. \restorefoots and/or \newfoots are only guarenteed to work right
%    in the preamble.
% 6. I don't think I depend on anything funny in LaTeX, but in case
%    this falls apart totally, I am running the 29-Apr-87 LaTeX.


%-----\my@footnote: stuff for handling my footnote stuff

% NOTE: This corrects it on the second pass, based on the page numbers
%       on the first pass.  Both this and other cross-reference stuff
%       will need to be run TWICE again if tables of contents, lists of
%       figures, &c. are paginated with the main material.

\def \my@footnote
  {
  \if@minipage\else    % In a minipage, we can't cross a page.
     \edef \tmp@name {ft@\thepage-\the\c@footnote}
     \expandafter\expandafter\expandafter\ifx
        \expandafter\csname\tmp@name\endcsname \relax
     \else
        % DEFINED:  replace footnote marker
        \edef\tmp@b{\expandafter\csname\tmp@name\endcsname}
        \begingroup
           \c@footnote = \tmp@b
           \xdef \@thefnmark {\thefootnote}
        \endgroup
     \fi % end \ifx ... \else DEFINED

     \if@filesw
        \edef \fttmp@
           {
           \write\@auxout
              {
              \string\newfoot@mark{\thepage}
                 {\the\c@footnote}{\noexpand\thepage}
              }
           }
        \fttmp@
     \fi % end \if@filesw
  \fi % end \if@minipage
  }

% \newfoot@mark:
% #1:  nominal page it occurs on, as by \thepage.
% #2:  nominal footnote number on that page.
% #3:  actual page it occurs on, as by \thepage.

\newcount\ft@page    \ft@page = 0
\newcount\ft@foot    \ft@foot = 0

\def \newfoot@mark #1#2#3
  {
  \ifdigit{#3}
     \ifnum #3 < \ft@page \ft@page=0
     \else\ifnum #3 > \ft@page \ft@page=#3 \ft@foot=0
     \fi\fi
  \else \ft@page=0
  \fi

  \addtolength\ft@foot{1}
  \def\tmp@a{#2}
  \edef\tmp@b{\the\ft@foot}
  \ifx \tmp@a\tmp@b \else
     \expandafter \xdef \csname ft@#1-#2\endcsname {\the\ft@foot}
  \fi
  }

\newif\ifisdigit
\def \ifdigit #1 {\digithelp #1 \digithelpend}
\def \digithelp#1#2\digithelpend
  {
  \isdigitfalse
  \if0#1\isdigittrue\fi \if1#1\isdigittrue\fi \if2#1\isdigittrue\fi
  \if3#1\isdigittrue\fi \if4#1\isdigittrue\fi \if5#1\isdigittrue\fi
  \if4#1\isdigittrue\fi \if5#1\isdigittrue\fi \if6#1\isdigittrue\fi
  \if7#1\isdigittrue\fi \if8#1\isdigittrue\fi \if9#1\isdigittrue\fi
  \ifisdigit
  }


\def \newfoots
  {
  \renewcommand \thefootnote   {\fnsymbol{footnote}}  %only if you want!
  \renewcommand \thempfootnote {\arabic{footnote}}
  %\renewcommand \footnoterule {}
  \skip\footins = 16pt plus 6pt minus 4pt
  \@addtoreset{footnote}{page}
  \let \cur@footnote = \my@footnote
  }

% NOTE: \restorefoots MUST be called before anything else is added to
%       \cl@page => do NOT move the \@@cl@page into the .static. file,
%       and do it at the very end of mytex.sty.  Also, if \stdfoots
%       are desired, they should be the first thing restored---and
%       \E{definately} in the preamble.

\def \restorefoots
  {
  \renewcommand \thefootnote   {\arabic{footnote}}
  \renewcommand \thempfootnote {\alph{mpfootnote}}
  %\let \footnoterule = \@@footnoterule
  \skip\footins = \bigskipamount
  \let \cl@page = \@@cl@page
  \let \cur@footnote = \relax
  }

\def \footnote
  {
  \@ifnextchar [
     {\@xfootnote}  %else, no optional argument:
     {
     \stepcounter{\@mpfn}
     \xdef\@thefnmark{\thempfn}
     \cur@footnote
     \@footnotemark\@footnotetext
     }
  }

% Redefine the macro used for footnotes to use single spacing
\long\def\@footnotetext #1 {
  \insert\footins{
    \def\baselinestretch{1} \footnotesize
    \interlinepenalty\interfootnotelinepenalty 
    \splittopskip\footnotesep
    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
    \hsize\columnwidth \@parboxrestore
   \edef\@currentlabel{\csname p@footnote\endcsname$^{\@thefnmark}$}
   \@makefntext{\rule{\z@}{\footnotesep}\ignorespaces #1\strut}
  }
}

\def \thanks #1 {
  \stepcounter{footnote}
  \xdef\@thefnmark{\thefootnote}
  \cur@footnote
  \@footnotemark
  \begingroup
    \def\protect{\noexpand\protect\noexpand} 
    \xdef\@thanks{\@thanks\strut\protect\\
     \protect\@thankstext[\@thefnmark]{#1}}
  \endgroup
}

\def \@thankstext [#1] #2 {
  \begingroup
    \footnotesize
    \edef\@currentlabel{\csname p@footnote\endcsname$^{#1}$}
    $^{#1}$#2\strut
  \endgroup
}


% Theorems and proofs.
\def\notheoremrules{
  \gdef\thm@toprule{}
  \gdef\thm@botrule{}
}

\def\theoremrules{
  \gdef\thm@toprule{
    \vbox{
    \centerline{\vrule width 0.75\textwidth height0.75pt depth0pt}
    \nointerlineskip
    \vskip 2pt
    \nointerlineskip
    \centerline{\vrule width 0.5\textwidth height0.75pt depth0pt}}
  } 
  \gdef\thm@botrule{
    \vbox{
    \centerline{\vrule width 0.5\textwidth height0.75pt depth0pt}
    \nointerlineskip
    \vskip 2pt
    \nointerlineskip
    \centerline{\vrule width 0.75\textwidth height0.75pt depth0pt}}
  } 
}

\notheoremrules

\def\@begintheorem#1#2{
  \ifhmode \unskip\par \fi
  \addvspace{\topsep}
  \begingroup
  \thm@toprule
  \nopagebreak\vspace{\topsep}
  \noindent \it {\sc #1\ #2:} \quad
}

\def\@opargbegintheorem#1#2#3{
  \ifhmode \unskip\par \fi
  \addvspace{\topsep}
  \begingroup
  \thm@toprule
  \nopagebreak\vspace{\topsep}
  \noindent \it {\sc#1\ #2:\ (#3)} \quad
}

\def\@endtheorem{
  \samepage
  \def\@tempa{theorem}
  \ifx\@tempa\@currenvir 
  \else
    \def\@tempa{lemma}
    \ifx\@tempa\@currenvir
    \else
      \noproof
    \fi
  \fi
  \endgroup
  \ifhmode \unskip\par \fi
  \vspace{\itemsep}
}

\def\noproof{
  \ifhmode \unskip\@@par \fi
  \thm@botrule
}

\def\proof{\begingroup}
\def\endproof{
  \samepage
  \hfill\qed \@@par
  \thm@botrule
  \endgroup
  \ifhmode \unskip\par \fi
  \vspace{\itemsep}
}

\def\qed{\vrule width0.75em height0.75em depth0.5\dp\strutbox\relax}

\def\eqnproof{\proof\subequations}
\def\endeqnproof{\endsubequations\endproof}

\if@incnum
  \newtheorem{theorem}{Theorem}[chapter]
  \newtheorem{lemma}[theorem]{Lemma}
  \newtheorem{definition}{Definition}
  \newtheorem{prediction}{Prediction}
\else
  \newtheorem{theorem}{Theorem}
  \newtheorem{lemma}[theorem]{Lemma}
  \newtheorem{definition}{Definition}
  \newtheorem{prediction}{Prediction}
\fi

%  Protected versions of these.
\def\Label{\protect\label}
\def\Ref{\protect\ref}
\def\Pageref{\protect\pageref}
\def\Cite{\protect\cite}

\end{definitions}


%% RCCL -- special sizing macros to support \sfs and \sfb
%% (sans-serif bold and sans-serif slanted)
\newfam\sfbfam	% sans-serif bold
\newfam\sfsfam  % sans-serif slanted

\def\@mssb{cmssbx10}
\def\@msss{cmssi10}
\def\sfb{\protect\psfb}
\def\sfs{\protect\psfs}

\def\sf@subfont{%
   \def\psfb{\@subfont\sfb\bf}%
   \def\psfs{\@subfont\sfi\rm}%
}

\def\sf@getfont#1#2{%
   \def\psfb{\@getfont\psfb\sfbfam#1{\@mssb\@ptscale{#2}}}%
   \def\psfs{\@getfont\psfs\sfsfam#1{\@msss\@ptscale{#2}}}%
}

\def\vpt@ext{\sf@subfont}
\def\vipt@ext{\sf@subfont}
\def\viipt@ext{\sf@subfont}
\def\viiipt@ext{\sf@getfont\@viiipt{8}}
\def\ixpt@ext{\sf@getfont\@ixpt{9}}
\def\xpt@ext{\sf@getfont\@xpt{10}}
\def\xipt@ext{\sf@getfont\@xipt{11}}
\def\xiipt@ext{\sf@getfont\@xiipt{12}}
\def\xivpt@ext{\sf@getfont\@xivpt{14}}
\def\xviipt@ext{\sf@getfont\@xviipt{17}}
\def\xxpt@ext{\sf@getfont\@xxpt{20}}
\def\xxvpt@ext{\sf@getfont\@xxvpt{25}}

\input rdoc1\@ptsize.sty\relax

%% RCCL -- double spaced submission style has been removed, since
%% I can't find the appropriate .sty file.
%%\if@submit
%%  \input{dspc.sty}
%%  \setstretch{1.7}
%%\fi

\ps@headings \pagenumbering{arabic} \onecolumn \f@@tstyle
\if@twoside\else\raggedbottom\fi 
%%
%% RCCL -- new definitions specifically for the documentation
%%
\newbox\@desclistbox
\def\desclistlabel#1{\setbox\@desclistbox=\hbox{#1}%
\ifdim\wd\@desclistbox > \labelwidth
	\vbox{\hbox to 0pt{#1 \hss}\hbox{\strut}}\hfil
\else
	#1 \hfil
\fi}
\newenvironment{desclist}{\begin{list}{}{\setlength{\leftmargin}{1.5truein}
 \setlength{\labelsep}{\parindent}
 \setlength{\labelwidth}{\leftmargin}
 \addtolength{\labelwidth}{-\parindent}
 \addtolength{\labelwidth}{-\parindent}
 \let\makelabel\desclistlabel}}{\end{list}}
%\rect <hor dimen>  by <vert dimen>}  A centered rectangular box.
\def\r@ect{\centerline{\vbox{\hrule
                          \hbox{\vrule height \the\dimen2
                                \hskip \dimen0
                                \vrule height \the\dimen2}
                          \hrule
                         }}}
\def\rect #1by{\dimen0 #1\afterassignment\r@ect \dimen2}
\def\done{\end{document}}
\newif\ifs@ubdocument \s@ubdocumenttrue
\outer\def\subdocumentmacros#1{\ifs@ubdocument #1 \fi\s@ubdocumenttrue}
\outer\def\inputsubdocument #1{\begingroup
                              \s@ubdocumentfalse
                              \let\done=\relax 
                              \input #1
                              \endgroup}

\def\fullpagefigure#1{{\def\addcontentsline##1##2##3{\relax}%
	\setbox0=\vbox{\@caption\@captype[]{#1}}%
	\dimen0=\vsize\advance\dimen0 by -\ht0\vskip\dimen0%
	}\caption{\quad#1}}

\def\boxedfig#1#2{%
   \centerline
      {\hbox{\vbox
         {\hrule height.05truemm \hbox
            {\vrule width.05truemm #1\vrule width.05truemm}%
          \hrule height.05truemm}}}%
   \caption{\quad#2}}

% \boxedsizedfig{3in}{4in}{\psfig...}{This is figure 4}
\def\boxedsizedfig#1#2#3#4{%
   \centerline
      {\hbox{\vbox
         {\hrule height.05truemm \hbox
            {\vrule width.05truemm%
               \hbox to #1{\hss\vbox to #2{\vss #3\vss}\hss}%
               \vrule width.05truemm}%
          \hrule height.05truemm}}}%
   \caption{\quad#4}}

\def\boxedfullpagefig#1#2{%
   \setbox0=\vbox{\@caption\@captype[]{#2}}%
   \dimen0=\textheight\advance\dimen0 by -\ht0%
   \centerline
      {\hbox{\vrule width.05truemm%
         \vbox to \dimen0%
            {\hrule height.05truemm\vfil 
               \hbox to \textwidth{\hfil#1\hfil} \vfil 
             \hrule height.05truemm}%
	 \vrule width.05truemm}}
   \caption{\quad#2}}
%
% A macro for putting boxes around tables
% 
\newskip\tableboxskip
\tableboxskip = .125truein
\def\tablebox#1{\vbox{\hrule\hbox{\vrule\kern\tableboxskip
 	\vbox{\kern\tableboxskip#1\kern\tableboxskip}
	\kern\tableboxskip\vrule}\hrule}}
%
% A macro for producing items with hanging identation
%
\newdimen\refItemIndent
\newbox\argbox
\refItemIndent=1.5truein
\def\refitem#1{%
	\par%\noindent
	\smallskip
	\setbox\argbox=\hbox{{#1}\quad}%
	\hangindent=\refItemIndent \hangafter=1
	\noindent
	\ifdim\wd\argbox > \refItemIndent
% uncomment the \hfil\break to drop down a line on overwide #1
		\box\argbox \hfil\break
	\else
		\hbox to \refItemIndent{\box\argbox\hfill}%
	\fi
        \ignorespaces
}
%
% define \_ to expand to a \tt underscore.
\def\_{\char`\_}
% 
% Old defintion of \_, not needed anymore.
%\def\_{
%   \expandafter\ifx\the\font\tt
%      \char`\_%
%   \else
%      \leavevmode\kern.06em\vbox{\hrule width.3em}%
%   \fi
%}

%% 
%% RCCL -- load the necessary font specification files:
%%
\@maybeloadsf
\@maybeloadtimes
\@maybeloadhelvetica
\@maybeloadsltt
\@maybeloadhyphentt
%%
%% RCCL -- load in psfig.tex
%%
\@psfigInput
\catcode`\@=11\relax	% psfig resets @
\if@hasPsInclude
\else
   \message{psfig disabled: figures will be left blank}%
   \psdraft
\fi
%%
%% Macro for setting filename fonts
%%
\let\filefont=\tt
