% capcont.sty does 2 things:
%   1.  allow \caption{[lof arg]{caption}} to work correctly
%   2.  define \captcont for continuation of caps
% SubStyle file to permit the use of captions in continuations of floats.
% 

\def\caption{\@ifnextchar[{\@@oldcaption}{\@newcaption}}
\def\captcont{\@ifnextchar[{\@@oldcaptcont}{\@newcaptcont}}


\def\@newcaption#1{
\gdef\@captiontext{{#1}}
{\setbox0=\vbox{
\@ifnextchar[{\@optcapt}{\@nooptcapt}#1}}
\expandafter\expandafter\expandafter%
\@@oldcaption\expandafter\@optcaptiontext\@captiontext
}
\def\@newcaptcont#1{
\gdef\@captiontext{{#1}}
{\setbox0=\vbox{
\@ifnextchar[{\@optcapt}{\@nooptcapt}#1}}
\expandafter\expandafter\expandafter%
\@@oldcaptcont\expandafter\@optcaptiontext\@captiontext
}

\def\@optcapt[#1]#2{\gdef\@optcaptiontext{[#1]}\gdef\@captiontext{{#2}}}
\def\@nooptcapt{\gdef\@optcaptiontext{}}

\def\@@oldcaption{\refstepcounter\@captype \@dblarg{\@caption\@captype}}



\def\@@oldcaptcont{\@dblarg{\@captcont\@captype}}
\long\def\@captcont#1[#2]#3{
  \par
  \begingroup
    \@parboxrestore
    \normalsize
    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3 (cont)}\par
  \endgroup}
