
%% Current Version: July 2, 1993

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Style File for Technical Books                                       %%
%% Kluwer Academic Publishers                                           %%
%%                                                                      %%
%% Prepared by Amy Hendrickson, TeXnology Inc.                          %%
%%                                                                      %%
%% Inquiries to Suzanne M. Rumsey, net address: prod@world.std.com      %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\typeout{\space\space\space\space\space\space\space\space\space}
\typeout{Document Style `6x9 Technical Book' for Kluwer Academic Publishers}
\typeout{\space\space\space\space\space\space\space\space\space}
\typeout{Copyright (c) 1992 by Amy Hendrickson, TeXnology, Inc.\space}
\typeout{\space\space\space\space\space\space\space\space\space}
\typeout{\space\space\space\space\space\space\space\space\space}


%%%%%%%% 6x9 style
%% Kluwer Academic Publishers, variation on  LaTeX book.sty 

\def\@ptsize{0} \@namedef{ds@11pt}{\def\@ptsize{1}}
\@namedef{ds@12pt}{\def\@ptsize{2}} 
\@twosidetrue \@mparswitchtrue \def\ds@draft{\overfullrule 5pt} 

\newif\ifpsfonts

\@options

%%% Start bk10.sty ----->

% bk10.sty 19-Jan-88

\lineskip 1pt \normallineskip 1pt
\def\baselinestretch{1}

%% ==> new

%%  Computer Modern fonts if PostScript fonts are not used:

\font\authortitlepagefont= cmssq8 at 24pt        %% title in author title page
\font\authorfont=cmssbx10 scaled \magstep1       %% author in "     "      "
\font\affilfont=cmssqi8 scaled\magstep2          %% affiliation "   "      "

\font\booktitle=cmssq8 at 20pt                   %% title for book title page

\font\chapnumber=cmbx10 at 50pt                  %% chapter number
\font\chaptitle=cmbx10 scaled\magstep3           %% chapter title

\font\sectionfont=cmbx10 scaled \magstep2        %% section heads
\font\subsectionfont=cmbx10 scaled \magstep2
\font\subsubsectionfont=cmti10 scaled \magstep2

%% Small caps, used whether or not PostScript fonts are used:
\font\smallcaps=cmcsc10 scaled\magstep1          %% running heads

\def\@normalsize{\@setsize\normalsize{12pt}\xpt\@xpt
\abovedisplayskip 10pt plus2pt minus5pt\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus3pt\belowdisplayshortskip 6pt plus3pt
minus3pt\let\@listi\@listI
\ifpsfonts
\def\rm{\pstenrm}
\def\bf{\pstenbf}
\def\it{\psteni}
\def\tt{\pstentt}
\def\sf{\pstensf}
\rm\else\def\bit{\bf}\def\pstenbf{\bf}\fi
} 

\@normalsize

\def\small{\@setsize\small{11pt}\ixpt\@ixpt
\abovedisplayskip 8.5pt plus 3pt minus 4pt\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus2pt\belowdisplayshortskip 4pt plus2pt minus 2pt
\def\@listi{\leftmargin\leftmargini \topsep 4pt plus 2pt minus 2pt\parsep 2pt
plus 1pt minus 1pt
\itemsep \parsep}
\ifpsfonts
\def\bit{\ninebit}
\def\rm{\psninerm}
\def\bf{\psninebf}
\def\it{\psninei}
\def\sf{\psninesf}
\def\tt{\psninett}
\rm\else \def\bit{\bf}\fi}

\def\footnotesize{\@setsize\footnotesize{9.5pt}\viiipt\@viiipt
\abovedisplayskip 6pt plus 2pt minus 4pt\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus 1pt\belowdisplayshortskip 3pt plus 1pt minus
2pt
\def\@listi{\leftmargin\leftmargini \topsep 3pt plus 1pt minus 1pt\parsep 2pt
plus 1pt minus 1pt
\itemsep \parsep}
\ifpsfonts
\def\bit{\eightbit}
\def\rm{\pseightrm}
\def\bf{\pseightbf}
\def\it{\pseighti}\rm
\def\sf{\pseightsf}
\def\tt{\pseighttt}
\else \def\bit{\bf}\fi}
%%% <== end new

\def\scriptsize{\@setsize\scriptsize{8pt}\viipt\@viipt}
\def\tiny{\@setsize\tiny{6pt}\vpt\@vpt}
\def\large{\@setsize\large{14pt}\xiipt\@xiipt}
\def\Large{\@setsize\Large{18pt}\xivpt\@xivpt}
\def\LARGE{\@setsize\LARGE{22pt}\xviipt\@xviipt}
\def\huge{\@setsize\huge{25pt}\xxpt\@xxpt}
\def\Huge{\@setsize\Huge{30pt}\xxvpt\@xxvpt}
\normalsize 


\oddsidemargin .5in \evensidemargin 1.5in 
\marginparwidth .75in \marginparsep 7pt 
\topmargin .75in 
\footskip .35in 

\textheight = 41\baselineskip
\advance\textheight by \topskip

\columnsep 10pt \columnseprule 0pt 

%% ==> new
\textwidth 28.5pc

%% <== end new

\footnotesep 6.65pt 
\skip\footins 9pt plus 4pt minus 2pt 
\floatsep 12pt plus 2pt minus 2pt \textfloatsep 20pt plus 2pt minus 4pt
\intextsep 12pt plus 2pt minus 2pt \@maxsep 20pt \dblfloatsep 12pt plus 2pt
minus 2pt \dbltextfloatsep 20pt plus 2pt minus 4pt \@dblmaxsep 20pt 
\@fptop 0pt plus 1fil \@fpsep 8pt plus 2fil \@fpbot 0pt plus 1fil 
\@dblfptop 0pt plus 1fil \@dblfpsep 8pt plus 2fil \@dblfpbot 0pt plus 1fil
\marginparpush 5pt 

\parskip 0pt plus 1pt \parindent 15pt \partopsep 2pt plus 1pt minus 1pt 
\@lowpenalty 51 \@medpenalty 151 \@highpenalty 301 
\@beginparpenalty -\@lowpenalty \@endparpenalty -\@lowpenalty \@itempenalty
-\@lowpenalty 



\def\chapter{\clearpage 
\thispagestyle{plain} \global\@topnum\z@
\@afterindentfalse \secdef\@chapter\@schapter} 

%% new==>
\def\bigraggedleft{\leftskip0pt plus1fil\relax}

\newif\ifsettoroman

\def\@makechapterhead#1{\null\vskip-5pc
\vbox to 17pc{\hbox to\textwidth{\hfill\chapnumber\thechapter}
\hyphenpenalty=10000 % No hyphenation in chapter heads
\vskip8pt
\hrule height 1.5pt
\vskip12pt\vskip-\parskip
\def\\ {\vskip-\parskip}\parfillskip=0pt
\bigraggedleft
\LARGE\chaptitle\uppercase{\def\\ {\vskip-\parskip}#1}\vskip1sp
\vfill}
\ifnum\c@chapter=1
\ifappendix\else
\ifsettoroman\else\c@page=1 \relax\fi\fi
\ifsettoroman\else\global\settoromantrue
\pagenumbering{arabic}\fi\fi
\gdef\thepage{\@arabic\c@page}
}

\def\@makeschapterhead#1{\vbox to 7.5pc{
\hrule height 1.5pt
\hyphenpenalty=10000 % No hyphenation in chapter heads
\vskip12pt\vskip-\parskip
\def\\ {\vskip-\parskip}\parfillskip=0pt
\LARGE\bigraggedleft
\chaptitle\uppercase{#1}\vskip1sp\vfill}}

\newif\ifnewchap
\newif\ifappendix

\def\@chapter[#1]#2{\global\newchaptrue
 \refstepcounter{chapter}
{\def\\ { }
\ifnum \c@secnumdepth >\m@ne
 \typeout{\@chapapp\space\thechapter.}
\ifappendix
\def\\ { }
 \addcontentsline{toc}{appendix}{\protect
 \numberline{\thechapter}\string\uppercase{#1}}
\else
\def\\ { }
 \addcontentsline{toc}{chapter}{\protect
 \numberline{\thechapter}\string\uppercase{#1}}\fi
\else
 \addcontentsline{toc}{chapter}{\string\uppercase{#1}}
\fi}
 \chaptermark{\let\\ \  #1}
 \addcontentsline{lof}{listenv}{{\bf\@chapapp\ \thechapter}}
 \addcontentsline{lot}{listenv}{{\bf\@chapapp\ \thechapter}}
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}] 
\else
\def\two{#2}
\ifx\two\empty
\ifappendix
\@makechapterhead{Appendix}\fi
\else
 \@makechapterhead{#2}\fi
 \@afterheading \fi }

%% <== end new

\def\@schapter#1{\if@twocolumn \@topnewpage[\@makeschapterhead{#1}]
 \else \@makeschapterhead{#1} 
 \@afterheading\fi}

%% ==> new

\let\savelabel\label

%% to make same space after chapter heads whether followed by text or 
%% section head:
\def\@afterheading{\global\@nobreaktrue    
      \everypar{\global\newchapfalse%<---- new
\if@nobreak
                   \global\@nobreakfalse      
                   \clubpenalty \@M
                   \if@afterindent \else {\setbox0=\lastbox}\fi
                 \else \clubpenalty \@clubpenalty
                    \everypar{}\fi}}           

\def\@sect#1#2#3#4#5#6[#7]#8{\let\dolabelnow\relax%
\ifnum #2>\c@secnumdepth
     \def\@svsec{}\else 
     \refstepcounter{#1}\edef\@svsec{\csname the#1\endcsname\hskip 1em }\fi
\ifnewchap\global\newchapfalse\@tempskipa=1sp\relax\else
     \@tempskipa #5\relax\fi
      \ifdim \@tempskipa>\z@ 
        \begingroup#6\relax  
          \@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty \@M 
\hyphenpenalty=10000 % No hyphenation in section heads
\raggedright 
%% make section head uppercase
\ifnum#2=1{\def\label##1{\gdef\dolabelnow{\savelabel{##1}}}%
\global\setbox0=\hbox{\def\\ {\relax}#8}}%
\uppercase{\fi%
\def\label##1{}%
\def\\ {\hfill\break}%
#8\ifnum#2=1}\fi\par}%%
  \endgroup%
                         %% \csname #1mark\endcsname{#7} % We don't need this
\ifnum#2=1
\def\\ { }%
\addcontentsline
         {toc}{#1}{\ifnum #2>\c@secnumdepth \else
                      \protect\numberline{\csname the#1\endcsname}\fi
                    #7}\else
        \def\@svsechd{#6\hskip #3\@svsec #8%
                        %% \csname #1mark\endcsname {#7} % We don't need this
\addcontentsline{toc}{#1}{\ifnum #2>\c@secnumdepth \else
                             \protect\numberline{\csname the#1\endcsname}\fi
                       #7}}\fi
\fi\@xsect{#5}
\dolabelnow %% to make label not be uppercase.
}


\def\@ssect#1#2#3#4#5{\@tempskipa #3\relax
   \ifdim \@tempskipa>\z@
     \begingroup #4\@hangfrom{\hskip #1}{\interlinepenalty \@M 
#5\par}\endgroup\else \def\@svsechd{#4\hskip #1\relax #5}\fi
    \@xsect{#3}}

% \@startsection {NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE} 

\def\section{\@startsection {section}{1}{\z@}{20pt plus 4pt minus 2pt}{1sp}
{\Large\sectionfont}}

\def\subsection{\@startsection{subsection}{2}{\z@}{11pt plus 1pt minus 1pt}
{1sp}{\Large\bf\subsectionfont}}

\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{1pt}
{1sp}{\Large\it\subsubsectionfont}}

%% <== end new

\def\paragraph{\@startsection
 {paragraph}{4}{\z@}{3.25ex plus 1ex minus .2ex}{-1em}{\normalsize\bf}}
\def\subparagraph{\@startsection
 {subparagraph}{4}{\parindent}{3.25ex plus 1ex minus 
 .2ex}{-1em}{\normalsize\bf}}

{\let\\ \ %
\gdef\sectionmark#1{}
\gdef\chaptermark#1{\let\\ \ \markboth {{\smallcaps Chapter \thechapter}}
{#1}}% 
}


\setcounter{secnumdepth}{2}

\def\appendix{\par
\global\appendixtrue
 \setcounter{chapter}{0}
 \setcounter{section}{0}
 \def\@chapapp{Appendix}
 \def\thechapter{\Alph{chapter}}}



\leftmargini 20pt % was 25pt
\leftmarginii 22pt \leftmarginiii 18.7pt \leftmarginiv 17pt \leftmarginv 10pt
\leftmarginvi 10pt
\leftmargin\leftmargini
\labelsep 5pt

\labelwidth\leftmargini\advance\labelwidth-\labelsep

\def\@listI{\leftmargin\leftmargini \parsep 4pt plus 2pt minus 1pt\topsep 8pt
plus 2pt minus 4pt\itemsep 4pt plus 2pt minus 1pt}
\let\@listi\@listI
\@listi 
\def\@listii{\leftmargin\leftmarginii
 \labelwidth\leftmarginii\advance\labelwidth-\labelsep
 \topsep 4pt plus 2pt minus 1pt
 \parsep 2pt plus 1pt minus 1pt
 \itemsep \parsep}
\def\@listiii{\leftmargin\leftmarginiii
 \labelwidth\leftmarginiii\advance\labelwidth-\labelsep
 \topsep 2pt plus 1pt minus 1pt 
 \parsep \z@ \partopsep 1pt plus 0pt minus 1pt
 \itemsep \topsep}
\def\@listiv{\leftmargin\leftmarginiv
 \labelwidth\leftmarginiv\advance\labelwidth-\labelsep}
\def\@listv{\leftmargin\leftmarginv
 \labelwidth\leftmarginv\advance\labelwidth-\labelsep}
\def\@listvi{\leftmargin\leftmarginvi
 \labelwidth\leftmarginvi\advance\labelwidth-\labelsep}

%%% <---------- End bk10.sty  

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

\def\sqbullet{\raise.2ex\hbox{\vrule width 4pt height4pt}}
\def\labelitemi{\llap{\hbox to15pt{\sqbullet\hfill}}}
\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



\arraycolsep 5pt \tabcolsep 6pt \arrayrulewidth .4pt \doublerulesep 2pt 
\tabbingsep \labelsep 
\skip\@mpfootins = \skip\footins
\fboxsep = 3pt \fboxrule = .4pt 

\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}

\def\part{\clearpage \ifsettoroman\else\global\settoromantrue
\pagenumbering{arabic}\fi
\thispagestyle{empty} \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}{chapter}{Part \thepart \hspace{1em}\uppercase{#1}}\else
\addcontentsline{toc}{chapter}{#1}\fi \markboth{}{}
\vbox to 27pc{\vfill
\hyphenpenalty=10000 % No hyphenation in chapter heads
\rightline{\chaptitle PART \thepart}
\vskip8pt
\hrule height 1.5pt
\vskip12pt\vskip-\parskip
\def\\ {\vskip-\parskip}\parfillskip=0pt
\bigraggedleft
\LARGE\chaptitle\uppercase{\def\\ {\vskip-\parskip}#1}\vskip1sp
\vfill}
\@endpart} 

\def\@endpart{\vfil\newpage \if@twoside \hbox{} \thispagestyle{empty} 
 \newpage 
 \fi \if@tempswa \twocolumn \fi} 
\def\@spart#1{{\centering \Huge \bf #1\par}\@endpart}

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


\def\tableofcontents{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \fi\chapter*{Contents}{\noexpand\let\noexpand\\ \ \markboth{\thetitle
}{Contents}}
 \@starttoc{toc}\if@restonecol\twocolumn\fi}

\def\l@part#1#2{\addpenalty{-\@highpenalty}
 \addvspace{2.25em plus 1pt} \begingroup
 \@tempdima 3em \parindent \z@ \rightskip \@pnumwidth \parfillskip
-\@pnumwidth 
 {\large \bf \leavevmode Part \uppercase{#1}\hfill
\hbox to\@pnumwidth{\hss\tenrm #2}}\par
 \nobreak \endgroup}

\def\l@chapter#1#2{\pagebreak[3] 
\vskip1sp
\@tempdima 24pt
\begingroup
{\spaceskip .3333em \xspaceskip .5em\relax 
\parindent \z@ \rightskip \@pnumwidth plus 1.5in
    \parfillskip -\@pnumwidth 
\hyphenpenalty=10000
\large\bf
\leavevmode\advance\leftskip\@tempdima \hskip -\leftskip 
#1\nobreak\hfil\nobreak\hbox to\@pnumwidth{\hfill\tenrm #2}\par
 }\endgroup\vskip1sp}

\def\l@appendix#1#2{\pagebreak[3] 
\vskip1sp
\@tempdima 24pt
\begingroup
{\spaceskip .3333em \xspaceskip .5em\relax 
\parindent \z@ \rightskip \@pnumwidth plus 1.5in
    \parfillskip -\@pnumwidth 
\hyphenpenalty=10000
\large\bf
\leavevmode\advance\leftskip\@tempdima \hskip -\leftskip 
#1\nobreak\hfil\nobreak\hbox to\@pnumwidth{\hfill\tenrm #2}\par
 }\endgroup\vskip1sp}


\def\l@listenv#1#2{\pagebreak[3] 
\vskip4pt
\goodbreak
\@tempdima 24pt
{\parindent \z@ \bf\leavevmode#1}\nobreak\vskip4pt}


% \@dottedtocline{LEVEL}{INDENT}{NUMWIDTH}{TITLE}{PAGE}
\def\l@section{\@dottedtocline{1}{24pt}{2.3em}}

\def\listoffigures{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn\fi
\chapter*{List of Figures}
{\let\\ \ \markboth{\thetitle}{List of Figures}}
 \addcontentsline{toc}{chapter}{\protect
 \numberline{LIST OF FIGURES\string\hss}}
\@starttoc{lof}\if@restonecol \twocolumn\fi}

\def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}

\def\listoftables{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \fi\chapter*{List of Tables}{\let\\ \ \markboth
 {\thetitle}{List of Tables}}\@starttoc{lot}\if@restonecol
 \twocolumn\fi
 \addcontentsline{toc}{chapter}{\protect
 \numberline{LIST OF TABLES\string\hss}}
}
\let\l@table\l@figure



\def\thebibliography#1{\chapter*{REFERENCES}%
\markboth{\thetitle}{REFERENCES}%
 \addcontentsline{toc}{chapter}{\protect
 \numberline{REFERENCES\string\hss}}
\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}

\let\endthebibliography=\endlist

\def\references{\chapter*{REFERENCES}\markboth{\thetitle}{REFERENCES}
 \addcontentsline{toc}{chapter}{\protect
 \numberline{REFERENCES\string\hss}}
\bgroup%
\list{[\arabic{enumi}]}{\settowidth\labelwidth{[99]}\leftmargin\labelwidth
 \advance\leftmargin\labelsep
 \usecounter{enumi}}
 \def\newblock{\hskip .11em plus .33em minus .07em}
 \sloppy\clubpenalty4000\widowpenalty4000
 \sfcode`\.=1000\relax\frenchspacing}

\def\endreferences{\endlist\egroup\newpage}
 

\newif\if@restonecol

\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}



%  \c@topnumber            : Number of floats allowed at the top of a column.
%  \topfraction            : Fraction of column that can be devoted to floats.
%  \c@dbltopnumber, \dbltopfraction : Same as above, but for double-column
%                          floats.
%  \c@bottomnumber, \bottomfraction : Same as above for bottom of page.
%  \c@totalnumber          : Number of floats allowed in a single column, 
%                          including in-text floats.
%  \textfraction         : Minimum fraction of column that must contain text.
%  \floatpagefraction    : Minimum fraction of page that must be taken
%                          up by float page.

%% June 10, 1993, reset these to more generous values to make it easier
%% to position floats.

\setcounter{topnumber}{3}
\setcounter{bottomnumber}{3}

\def\topfraction{.99}
\def\bottomfraction{.9}
\def\textfraction{.01}
\def\floatpagefraction{.5}

\setcounter{totalnumber}{9}

\setcounter{dbltopnumber}{2}
\def\dbltopfraction{.7}
\def\dblfloatpagefraction{.5}

%% ==> new
\newdimen\belowtableskip
\newdimen\abovetableskip
\abovetableskip=6pt
\def\xtable{table}

\long\def\@makenarrowcaption#1#2{%
\vskip12pt
\hbox to\textwidth{\hss\vtop{\hsize=1.5in\parskip=6pt\footnotesize%
{\bf#1}\hskip1em#2}}}

\def\narrowcaption#1{{\let\@makecaption\@makenarrowcaption
\caption{#1}}}

\def\dblcaption#1#2{
\hbox to\textwidth{%
\vtop{\textwidth=13.5pc\hsize13.5pc\caption{#1}}\hfill\vtop{\textwidth=13.5pc%
\hsize13.5pc\caption{#2}}}
}

\def\lettereddblcaption#1#2#3#4{
\hbox to\textwidth{%
\vtop{\textwidth13.5pc \hsize13.5pc\letteredcaption{#1}{#2}}\hfill%
\vtop{\textwidth13.5pc \hsize13.5pc\letteredcaption{#3}{#4}}}
}

%%%%%%%%%
%%%% Continued captions

\def\Nfnum@figure{Figure \thefigure\ {\it(continued)}\hfill\break}

\def\Nfnum@table{Table \thetable\ {\it(continued)}\hfill\break}

\def\Ccaption{\@dblarg{\C@caption\@captype}}

\long\def\C@caption#1[#2]#3{\par\addcontentsline{\csname
  ext@#1\endcsname}{#1}{\protect\numberline{\csname 
  the#1\endcsname}{\ignorespaces(Continued) #2}}\begingroup
    \@parboxrestore
    \normalsize
    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}\par
  \endgroup}

\def\contcaption#1{{\let\fnum@figure\Nfnum@figure
\let\fnum@table\Nfnum@table
\Ccaption{#1}}}

\def\narrowcontcaption#1{{\let\@makecaption\@makenarrowcaption
\let\fnum@figure\Nfnum@figure
\let\fnum@table\Nfnum@table
\Ccaption{#1}}}

%%%%%%%%% Lettered Captions

\def\theletter{\relax}
\newif\ifxfirsttime
\xfirsttimetrue

\def\caption{\ifx\@captype\xtable
\ifx\theletter\xrelax
\global\xfirsttimetrue\refstepcounter\@captype\else
\ifxfirsttime\global\xfirsttimefalse\refstepcounter\@captype\fi\fi
\else
\ifx\theletter\xrelax
\global\xfirsttimetrue\refstepcounter\@captype\else
\ifxfirsttime\global\xfirsttimefalse\refstepcounter\@captype\fi\fi\fi
\edef\@currentlabel{\expandafter\csname p@\@captype\endcsname%
\expandafter\csname the\@captype\endcsname\theletter}
\xdef\currcaptype{\@captype}
\@dblarg{\@caption\@captype}}

\def\letteredcaption#1{\gdef\theletter{#1}\caption}

\long\def\@makecaption#1#2{\xdef\currcaptype{\@captype}%
\ifx\@captype\xtable\vskip\belowtableskip\relax\fi
\vskip12pt
\setbox0=\hbox{\footnotesize Figure x.x\hskip1em#2}\ifdim\wd0>.6\textwidth
\hbox to\textwidth{\hss\vtop{\hsize=.85\textwidth 
\parskip=6pt\footnotesize{\bf#1}\hskip1em#2}\hss}
\else\hbox to\textwidth{\hss\hbox{\footnotesize{\bf#1}\hskip1em#2}\hss}\fi
%
\xdef\@currentlabel{\expandafter\csname p@\@captype\endcsname%
\expandafter\csname the\@captype\endcsname\theletter}
%
\gdef\theletter{\relax}
\ifx\@captype\xtable\vskip\abovetableskip\relax\fi
}


%%%%%%%%%

\def\widefigure{\clearpage\textwidth=\textheight \textheight=28.5pc
\pagestyle{empty}\begin{figure}[h]}
\def\endwidefigure{\end{figure}\clearpage}

\def\widetable{\clearpage\textwidth=\textheight \textheight=28.5pc
\pagestyle{empty}\begin{table}[h]}
\def\endwidetable{\end{table}\clearpage}

%% <== end new
\newcounter{figure}[chapter]
\def\thefigure{\thechapter.\@arabic\c@figure}
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{Figure\ \ifappendix\thechapter\fi\thefigure\theletter}
\def\figure{\@float{figure}}
\let\endfigure\end@float
\@namedef{figure*}{\@dblfloat{figure}}
\@namedef{endfigure*}{\end@dblfloat}
\newcounter{table}[chapter]
\def\thetable{\thechapter.\@arabic\c@table}
\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\fnum@table{Table\ \ifappendix\thechapter\fi\thetable\theletter}
\def\table{\@float{table}}
\let\endtable\end@float
\@namedef{table*}{\@dblfloat{table}}
\@namedef{endtable*}{\end@dblfloat}


\mark{{}{}} 

%% ==> new
\def\ps@headings{\def\@oddfoot{}\def\@evenfoot{}
\def\@evenhead{\large\rm\thepage\hfil{\smallcaps\leftmark}}
\def\@oddhead{\hbox{}\large\it\rightmark\rm\hfil\thepage}
{\let\\ \ %
\gdef\chaptermark##1{\let\\ \ \markboth 
{{\smallcaps\@chapapp\ \thechapter}}
{##1}}}}% 
%% <== end new


\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}
\@addtoreset{equation}{chapter} 



\ps@headings 
\onecolumn 

%% ==> new
%% Modifications %%%%%%%

\headheight 12pt \headsep 4pc

\pagenumbering{roman}  %% reset to arabic in chapter command

\parindent=0pt
\parskip=\baselineskip
\raggedbottom

\rightmargin=0pt 
\leftmargin=0pt

\oddsidemargin=5pc
\evensidemargin=5pc

\def\@dottedtocline#1#2#3#4#5{\ifnum #1>\c@tocdepth \else
\vskip-\parskip
 \vskip 2pt
  {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
    \parindent #2\relax\@afterindenttrue
   \interlinepenalty\@M
   \leavevmode 
   \@tempdima #3\relax \advance\leftskip \@tempdima \hbox{}\hskip -\leftskip
    #4\nobreak
     %\leaders\hbox{$\m@th \mkern \@dotsep mu.\mkern \@dotsep mu$}
\hfill \nobreak \hbox to\@pnumwidth{\hfil#5}\par}\fi}


%%%%%% New commands

%% Front Matter

\def\preface{\chapter*{Preface}{
\markboth{\thetitle}{Preface}}
 \addcontentsline{toc}{chapter}{\protect
 \numberline{PREFACE\string\hss}}
}

%%% title and author

\def\title#1{
{\def\\ {{} }\xdef\thetitle{#1}}
{\def\\ {\vskip-\parskip}\xdef\titlepagetitle{\uppercase{#1}}}
}

\title{Please supply a title!}
%% For shortened version of title:
%%\xdef\thetitle{Shortened Title for Running Heads}

\newcount\authorcount
\def\author#1\affil#2\location#3{\def\\ {\vskip3pt\noindent\hfill}
\global\advance\authorcount by1
\expandafter\gdef\csname theauthor\the\authorcount\endcsname{#1}
\expandafter\gdef\csname theaffil\the\authorcount\endcsname{#2}
\expandafter\gdef\csname theloc\the\authorcount\endcsname{#3}
}

%% default values, in case author has not entered above commands.
\title{Please use {\tt\string\title\string{Your Title\string}} Command!}
\def\thetitle{Please supply a Title!}
\author{Please use {\tt\string\author\string{Your name\string}} Command!}
\affil{Please use {\tt\string\affil\string{Your Affiliation\string}} Command!}
\location{Please use {\tt\string\location\string{Your Location\string}} 
Command!}
\advance\authorcount by-1


\def\titlepage{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \else \newpage \fi \thispagestyle{empty}\c@page\z@
\null\vskip-6pc
\hrule height 1.5pt\vskip24pt\vskip-\parskip
{\hyphenpenalty=10000 % No hyphenation in chapter heads
\parfillskip=0pt
\bigraggedleft
\Huge\booktitle{\def\\ {\vskip\parskip}\titlepagetitle}\newpage}}

\newcount\loopcount
\def\authortitlepage{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \else \newpage \fi \thispagestyle{empty}\c@page\z@
\null\vskip-6pc
\vbox to\textheight{\parskip=0pt
\hrule height 1.5pt\vskip24pt
\hyphenpenalty=10000 % No hyphenation in chapter heads
\parfillskip=0pt
\bigraggedleft
{\Huge\authortitlepagefont{\def\\ {\vskip\parskip}\titlepagetitle}

}
\normalsize
\vskip24pt
\hrule height 1.5pt
\vskip24pt
\advance \authorcount by1 
\loopcount=1
\loop\expandafter\ifnum\loopcount<\authorcount
\ifnum\loopcount=1 \vskip18pt\else
\vrule height 12pt width12pt depth0pt\vskip12pt\fi
{\authorfont\csname theauthor\the\loopcount\endcsname}\vskip3pt
{\affilfont\csname theaffil\the\loopcount\endcsname}\vskip6pt
{\affilfont\csname theloc\the\loopcount\endcsname}
\vskip12pt \global\advance\loopcount by1 \repeat
\vfill
\theimprint
}
\newpage}


\def\theimprint{\vtop{\parskip=0pt\parindent=0pt
{\large\baselineskip=14pt
\hbox to\textwidth{\hss KLUWER ACADEMIC PUBLISHERS\hss}
\hbox to\textwidth{\large\hss Boston/London/Dordrecht\hss}
}}}


%%%%%%%%%%% Code examples in text

%% algorithm
{\obeylines
\gdef\looker{\ifx\next\lineending\vskip-4pt%
\noindent\qquad\else%
\ifx\next\end\vskip-4pt\let^^M\ \else%
\vskip0pt\noindent\qquad\fi\fi}

\gdef\lineending{\parfillskip=0pt plus1fil\relax\futurelet\next\looker}

\gdef\algorithm{\medskip
\def\note##1{\parfillskip=0pt\hfill##1}\def\ {\qquad}%
\baselineskip=12pt\parskip=2pt\obeylines\let^^M=\lineending}
}% end of obeylines

\def\endalgorithm{\vskip1pt}

%% code example

\newif\ifcodeon
\newif\ifneedspace
{\obeylines\obeyspaces

\gdef\codelooker{\ifx\next\lineending\vskip-4pt%
\noindent\else%
\ifx\next\end\vskip-4pt\let^^M\ \else%
\vskip0pt\noindent\fi\fi}

\gdef\codelineending{\relax\futurelet\next\codelooker}

\gdef\codesamp{\medskip\global\codeontrue\baselineskip=12pt%
\parskip=2pt\tt\obeylines\obeyspaces\let^^M=\codelineending}
\gdef\endcodesamp{\global\codeonfalse\vskip2pt}

\gdef\spcodesamp{\baselineskip=12pt%
\parskip=2pt\tt\obeylines\obeyspaces\let^^M=\codelineending}

\gdef\codebox#1{\let\go\relax%
\ifcodeon\else\global\needspacetrue\let\go\spcodesamp\fi\go%
\global\dimen1=#1\relax\global\setbox0=\vbox\bgroup}

\gdef\endcodebox{\ifneedspace\global\needspacefalse\vskip\baselineskip\fi%
\egroup%
\vtop to \ht0{\vskip-3pt\hrule\hbox to\dimen1{\vrule height\ht0%
\hfill\vrule height\ht0 depth \dp0}\hrule\vss}%
\nobreak\vskip-\ht0\rlap{\hskip6pt\vbox{\unvbox0}}}}

%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Indexing 

%%%%%%% Index Formatting

\def\testforadd{\addtoindex}

\def\ltr#1{\nobreak\vskip5pt
\hrule
\nobreak
\vskip3pt
{\bf#1}
\nobreak
\vskip5pt}


{\catcode`>=\active
\gdef\printindex{\catcode`>=\active%
\let>\doindex
\@input{\jobname.srt} \catcode`\*=12
\if@restonecol\onecolumn\else\vfill\clearpage\fi
\leftskip=0pt\vskip1sp}
}


\newif\if@restonecol
\def\doindex #1{\clearpage\ifodd\c@page\else\null\thispagestyle{empty}%
\clearpage\fi
\bgroup
\parindent=-\indexwrap \leftskip=\indexwrap
\def\,{\ifmmode\mskip\thinmuskip\else\noexpand\comma\fi}
\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
 \addcontentsline{toc}{chapter}{\protect
 \numberline{INDEX\string\hss}}
\columnsep 35pt\twocolumn[\chapter*{Index}]
 \markright{Index}\thispagestyle{empty}
\hfuzz=.5in
\def\checker{#1}
\parskip=0pt plus.8pt
\raggedright
\ifx\checker\testforadd\let\next=\relax\else\let\next=\beginindex\fi\next #1}


%%%%%%  Index Entries

\newwrite\innx

\immediate\openout\innx=\jobname.inx

\newif\ifsilent
\newif\ifnotsilent

\newcount\spcount
\def\oneast{\global\spcount=1}
\def\twoast{\global\spcount=2}

\def\astsplit#1*#2#3{\xdef\pagenumzeros{\ifnum\count0<100
\ifnum\count0<10 00\else 0\fi\fi}\if#2\relax%
\writeit{#1}%
\else\if#3\relax\writeita{#1}\else
\writeitb{#1}\fi\fi%
\ifnotsilent#1\global\notsilentfalse\fi}

\def\pickup#1{\astsplit#1*\relax\relax}
\def\inx#1{\global\notsilenttrue\pickup{#1}}
\def\inxx#1{\astsplit#1*\relax\relax}

\def\romannums{\csname @roman\endcsname\c@page}

\def\writeit#1{\xdef\pagenumzeros{\ifnum\count0<100
\ifnum\count0<10 00\else 0\fi\fi}%
\ifx\thepage\romannums%
\write\innx{\noexpand#1 |{%
\pagenumzeros\the\count0\string\global\string\romanontrue}}\else
\write\innx{\noexpand#1 |{\pagenumzeros\the\count0}}\fi}

\def\writeita#1{\xdef\pagenumzeros{\ifnum\count0<100
\ifnum\count0<10 00\else 0\fi\fi}%
\ifx\thepage\romannums%
\write\innx{\noexpand#1 |{\pagenumzeros\the\count0
\oneast\string\global\string\romanontrue}}\else
\write\innx{\noexpand#1 |{\pagenumzeros\the\count0
\oneast}}\fi}

\def\writeitb#1{\xdef\pagenumzeros{\ifnum\count0<100
\ifnum\count0<10 00\else 0\fi\fi}%
\ifx\thepage\romannums%
\write\innx{\noexpand#1 |{\pagenumzeros\the\count0
\twoast\string\global\string\romanontrue}}\else
\write\innx{\noexpand#1 |{\pagenumzeros\the\count0
\twoast}}\fi}

\write\innx{\noexpand>}
\write\innx{\noexpand~}

%% end sending to index

%% start formatting index

%%% Index Macros
%%% Copyright 1992, Amy Hendrickson
%%% TeXnology, Inc.
%%% All rights reserved.


\def\indexit#1{{\it\expandafter\capthis #1}}
\def\indexbf#1{{\bf\expandafter\capthis #1}}
\def\indexsl#1{{\sl\expandafter\capthis #1}}
\def\indextt#1{{\tt\expandafter\capthis #1}}

\def\lcindexit#1{{\it #1}}
\def\lcindexbf#1{{\bf #1}}
\def\lcindexsl#1{{\sl #1}}
\def\lcindextt#1{{\tt #1}}


\def\module{}\def\rightmodule{}
\def\splittocstuff#1{\global\indxnum=#1}

\def\onward{}

\def\addtoindex{\par}
\def\endadd #1{\def\lfe{#1}\if\lfe\noexpand~
\let\more=\relax\let\lfe=\onecolumn\else
\ifx\lfe\munge\let\more=\relax\else\par\let\more=\beginindex\fi\fi
\expandafter\more\lfe}

\newcount\indxnum
\newcount\oldindxnum

\def\comma{,\ }
\def\go{}
\def\compare{}
\def\eatthree#1,#2,{}
\def\eattwo#1,{}
\def\oldthreecol{}
\def\oldtwocol{}
\def\oldonecol{}

\newbox\savenumbox

\def\eatcommas{\ifx\twocol\empty%
\let\eat=\relax
\else
   \ifx\threecol\empty\let\eat=\eattwo\else
      \let\eat=\eatthree
    \fi
\fi\eat}

\def\splitoff#1,#2,#3,{\gdef\onecol{#1}\gdef\twocol{#2}%
\gdef\threecol{#3}\eatcommas}
\def\endin{}
\def\testind{\endin}
\def\testadd{\addtoindex}
\def\oldcompare{}
\newif\ifendindex
\newif\ifsavenum
\newcount\saveindxnum
\newif\ifnnum
\newdimen\indexwrap
\newdimen\indexindent


\def\endindx{\vskip1sp\egroup
\@normalsize\markboth{}{}}

\newif\ifromanon

\def\beginindex #1 |#2 #3{%
\parindent=-\indexwrap \leftskip=\indexwrap%
\def\module{}\let\oldrightmodule=\rightmodule%
\def\rightmodule{}%
\setbox0=\hbox{\expandafter\splittocstuff{#2}}%
\global\oldindxnum=\saveindxnum\relax%
\def\changenums{\ifnum\spcount<1%
\ifsavenum\global\savenumfalse\hbox{\unhbox\savenumbox}\fi%
, {\module\ifromanon\expandafter\romannumeral\fi%
\number\indxnum\rightmodule}\else%
\ifnum\spcount=1% 
\ifsavenum\global\savenumfalse\hbox{\unhbox\savenumbox}\fi%
, \underbar{\module\ifromanon\expandafter\romannumeral\fi%
\number\indxnum\rightmodule}%
\relax\global\spcount=0%
\else\ifnum\spcount=2%
\ifsavenum\global\savenumfalse\hbox{\unhbox\savenumbox}\relax%
\global\spcount=0\fi%
\global\spcount=0, {\bf\module\ifromanon\expandafter\romannumeral\fi%
\number\indxnum\rightmodule}%
\fi\fi\fi}%
\def\comparenums{\ifnum\oldindxnum=0\changenums\else%%%%
\ifnum\indxnum=\oldindxnum%
\ifx\oldrightmodule\rightmodule\relax%
\else%
, {\module\ifromanon\expandafter\romannumeral\fi%
\number\indxnum\rightmodule}\fi%
\else%
\advance\oldindxnum by 1\relax%
\ifnum\indxnum=\oldindxnum%
\ifnum\spcount=1%
\gdef\numinbox{\underbar{\ifromanon\expandafter\romannumeral\fi%
\number\indxnum\rightmodule}}%
\global\nnumtrue%
\else%
\ifnum\spcount=2\gdef\numinbox{\bf\ifromanon\expandafter\romannumeral\fi%
\number\indxnum\rightmodule}%
\global\nnumtrue%
\else%
\gdef\numinbox{\ifromanon\expandafter\romannumeral\fi%
\number\indxnum\rightmodule}\fi\fi%
\setbox\savenumbox=\hbox{--\hskip1sp\numinbox}%
\global\spcount=0%
\global\savenumtrue%
    \else%
\ifsavenum\global\savenumfalse\hbox{\unhbox\savenumbox}\changenums%
\else%
\changenums\fi\fi\fi\fi}%
\def\compare{#1}% now compare words
\ifx\compare\oldcompare\comparenums% 
\else\splitoff#1,{},{},%
\ifx\onecol\oldonecol%
\ifx\twocol\empty%
\ifsavenum\global\savenumfalse\hbox{\unhbox\savenumbox}\fi%
\par\global\oldindxnum=0 
\expandafter\capthis\onecol\comparenums%
\xdef\lastonecol{\onecol}\else%% 
\ifx\twocol\oldtwocol%
\ifx\threecol\empty\else%
\ifx\threecol\oldthreecol\else%
\ifsavenum\global\savenumfalse\hbox{\unhbox\savenumbox}\fi%
\ifx\onecol\lastonecol\else\par\expandafter\capthis%
\onecol\xdef\lastonecol{\onecol}\fi%
\ifx\twocol\lasttwocol\else\par\hskip\indexindent\twocol%
\xdef\lasttwocol{\twocol}\fi%
\par\global\oldindxnum=0\relax%
\hskip2\indexindent\threecol\comparenums%% ***
\fi\fi\else%
\ifsavenum\global\savenumfalse\hbox{\unhbox\savenumbox}\fi%
\global\oldindxnum=0\relax
\ifx\threecol\empty% 
  \ifx\onecol\lastonecol\else\par%
\expandafter\capthis\onecol\xdef\lastonecol{\onecol}\fi%
  \par\hskip\indexindent\twocol\comparenums%% ***
  \xdef\lasttwocol{\twocol}%
\else%% this is just for error control, 
%% when author has new third level
%% but neglects second level entry.
\ifx\onecol\lastonecol\else\par%
\expandafter\capthis\onecol\xdef\lastonecol{\onecol}\fi%
\ifx\twocol\lasttwocol\else\par\hskip\indexindent\twocol%
\xdef\lasttwocol{\twocol}\fi%
\par\hskip2\indexindent\threecol\comparenums% ***
\fi%
\fi\fi\else\ifx\twocol\empty%
\ifsavenum\global\savenumfalse\hbox{\unhbox\savenumbox}\fi% 
\par\global\oldindxnum=0\relax%
\expandafter\capthis\onecol\comparenums%
\xdef\lastonecol{\onecol}%
\else\ifx\threecol\empty%
\ifsavenum\global\savenumfalse\hbox{\unhbox\savenumbox}\fi%
\global\oldindxnum=0\relax%
\ifx\onecol\lastonecol\else\par%
\expandafter\capthis\onecol\xdef\lastonecol{\onecol}\fi%
\par\hskip\indexindent\twocol\comparenums%% ***
\else%
\ifsavenum\global\savenumfalse\hbox{\unhbox\savenumbox}\fi%
\global\oldindxnum=0\relax%
\ifx\onecol\lastonecol\else\par%
\expandafter\capthis\onecol\xdef\lastonecol{\onecol}\fi%
\ifx\twocol\lasttwocol\else\par\hskip\indexindent\twocol%
\xdef\lasttwocol{\twocol}\fi%
\par\hskip2\indexindent\threecol\comparenums% ***
\fi\fi\fi\fi%
\gdef\oldcompare{#1}%
\global\saveindxnum=\indxnum%
\ifnnum\global\saveindxnum=0\global\nnumfalse\fi%
\global\let\oldonecol=\onecol\relax%
\global\let\oldtwocol=\twocol% 
\global\let\oldthreecol=\threecol% 
\def\turnoff{#3}\ifx\turnoff\testadd% 
\ifsavenum\global\savenumfalse\hbox{\unhbox\savenumbox}\fi%
\let\go=\relax\else\ifx\turnoff\testind\let\go=\relax%
\ifsavenum\global\savenumfalse\hbox{\unhbox\savenumbox}\fi\else%
\if\turnoff\noexpand~\let\go=\endindx%
\ifsavenum\global\savenumfalse\unskip\hbox{\unhbox\savenumbox}\fi%
\else\let\go=\beginindex\fi\fi\fi\global\romanonfalse\go#3}


%% The following commands are used to match original documentation,
%% so the author could write \begin{theindex} \end{theindex}
%% The author could just write \printindex and get the same results.

\let\theindex\printindex
\let\endtheindex\relax

%% CHANGE INDEX FORMAT HERE ====>

%% If you DO NOT want the first letter of each first level index
%% entry to be capitalized, delete the % in front of the following line, 
%% and put % in front of the next line:

%\let\capthis\relax
\def\capthis#1{\uppercase{#1}}%

\indexindent=8pt %% indentation for index subentries
\indexwrap=24pt  %% indentation when term is too wide for column,
                 %% continues on following lines indented this much.


%%%%%%%%%%%%
%% Added June 11, 1993

%% Prevent most widow and club lines:

\clubpenalty=10000
\widowpenalty=10000

%%%%%%%%%%%%
%%% Math, added July 2, 1993

\def\@eqnnum{{\rm (\theequation)}} 
\def\xrelax{\relax}
\newif\iffirsttime
\global\firsttimetrue
\newif\ifequation

\def\themathletter{\relax}
\def\mathletter#1{\gdef\themathletter{#1}}
\def\spletter#1{\gdef\thespletter{#1}}
\spletter{}

\def\theequation{\thespletter\ifappendix \thechapter.\fi\arabic{equation}\themathletter}

\def\]{\relax\ifmmode\ifinner\@badmath\else$$\fi%%$$ BRACE MATCH HACK
        \else \@badmath \fi\spletter{}\mathletter{}\ignorespaces}

\def\@@eqncr{\let\@tempa\relax 
    \ifcase\@eqcnt \def\@tempa{& & &}\or \def\@tempa{& &} 
      \else \def\@tempa{&}\fi 
     \@tempa 
\ifx\themathletter\xrelax\stepcounter{equation}
\else\iffirsttime\global\firsttimefalse\stepcounter{equation}\fi\fi
\if@eqnsw\@eqnnum
\fi\global\@eqnswtrue\global\@eqcnt\z@\cr}

\def\eqnarray{\let\@currentlabel=\theequation
\global\@eqnswtrue
\global\@eqcnt\z@\tabskip\@centering\let\\=\@eqncr
$$\everycr={\noalign{\gdef\themathletter{\relax}}}
\halign to \displaywidth\bgroup\@eqnsel\hskip\@centering
  $\displaystyle\tabskip\z@{##}$&\global\@eqcnt\@ne 
  \hskip 2\arraycolsep \hfil${##}$\hfil
  &%
\global\@eqcnt\tw@ \hskip 2\arraycolsep $\displaystyle\tabskip\z@{##}$\hfil 
   \tabskip\@centering&\llap{##}\tabskip\z@\cr}

\def\endeqnarray{\@@eqncr\egroup
\global\firsttimetrue\spletter{}$$
\global\@ignoretrue}


\def\equation{$$ % $$ BRACE MATCHING HACK
}

\def\endequation{%
\ifx\themathletter\xrelax\global\firsttimetrue%
\refstepcounter{equation}\else%
\iffirsttime\global\firsttimefalse\refstepcounter{equation}\fi\fi%
\eqno \@eqnnum % $$ BRACE MATCHING HACK
$$\gdef\themathletter{\relax}\global\equationfalse
\global\@ignoretrue}

%%% End Math





