%% FILE:   isucaptn.sty in SYS2.TEX.PUB.ISULATEX.STYLES
%% AUTHOR: Erica M. S. Harris
%% DATE:   Jan 1990
%% DESCR:  See comments with macros.
%% MODS:
%%
% \@makecaption{NUMBER}{TEXT} : Macro to make a figure or table caption.
%      NUMBER : Figure or table number--e.g., 'Figure 3.2'
%      TEXT   : The caption text.
%  Macro should be called inside a \parbox of right width, with \normalsize.
% changed 25 Jun 86 to fix according to Howard Trickey:
% instead of \unhbox\@tempboxa\par we do #1: #2\par
% We continue to use old way in order to handle table footnotes on captions.

\long\def\@makecaption#1#2{\vskip 10pt
 \newbox\@tempboxb
 \setbox\@tempboxb\hbox{#2}
 \setbox\@tempboxa\hbox{#1~~~} % #1 is Figure n.n: or Table n.n:
% IF width of caption text > (\captionwidth - width of caption heading)
% THEN set caption text in a parbox
% ELSE set as is
% Complete caption is centered in both cases.
 \advance\captionwidth by -\wd\@tempboxa
 \ifdim \captionwidth < \wd\@tempboxb
    \hbox to \hsize{\hfil\box\@tempboxa%
           \parbox[t]{\captionwidth}{\unhbox\@tempboxb}\hfil}
 \else
    \hbox to \hsize{\hfil\box\@tempboxa\box\@tempboxb\hfil}
 \fi}

\def\fnum@figure{Figure \thefigure\if@continued\global\@continuedfalse%
\else:\fi}

\def\fnum@table{Table \thetable\if@continued\global\@continuedfalse%
\else:\fi}

% Same as \caption, but calls \@isucaption instead.
\def\isucaption{\refstepcounter\@captype
  \@dblarg{\@isucaption\@captype}}

% Width to be used for setting the caption. Can be set by the user.
\newdimen\captionwidth \captionwidth=\textwidth

\long\def\@isucaption#1[#2]#3{\par
%  \baselineskip 14.5 pt
  \addcontentsline {\csname ext@#1\endcsname}{#1}
  {\protect\numberline{\csname fnum@#1\endcsname}{\ignorespaces #2}}
  \begingroup
    \@parboxrestore
    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}
    \par\vspace{1.7ex}
  \endgroup}

% \isucontinuecaption allows easy captioning of continued tables and figures.
% No text supplied by user. Text is '(Continued)'. No ':' after table/figure
% number and current table/figure number is used without being stepped.
\newif\if@continued \@continuedfalse
\def\isucontinuecaption{\@isucontinuecaption\@captype}
\def\@isucontinuecaption#1{\par %\baselineskip 14.5pt
      \begingroup
         \global\@continuedtrue
         \@parboxrestore
         \@makecaption{\csname fnum@#1\endcsname}{(Continued)}%
         \par \vspace{1.7ex}%
      \endgroup}


