%%% ====================================================================
%%%  @LaTeX-style-file{
%%%     filename        = "hangcaption.sty",
%%%     version         = "1.03",
%%%     date            = "12 August 1992",
%%%     time            = "13:20:33 EDT",
%%%     author          = "David M. Jones",
%%%     address         = "MIT Laboratory for Computer Science
%%%                        Room NE43-316
%%%                        545 Technology Square
%%%                        Cambridge, MA 02139
%%%                        USA",
%%%     telephone       = "(617) 253-5936",
%%%     FAX             = "(617) 253-3480",
%%%     checksum        = "40467 85 381 3777",
%%%     email           = "dmjones@theory.lcs.mit.edu",
%%%     codetable       = "ISO/ASCII",
%%%     keywords        = "LaTeX, caption",
%%%     supported       = "no",
%%%     docstring       = "I did not write this file.  The original
%%%                        author is unknown.  However, I did fix a
%%%                        bug, namely, I removed a superflous "^^"
%%%                        that was causing one of the close braces to
%%%                        be interpreted as an equals sign, thus
%%%                        messing up the brace balancing.  I also
%%%                        tacked an "\endinput" on to the end of the
%%%                        file and added this header.
%%%
%%%                        v1.02 (12 August 1992): patches by Rainer
%%%                        Schoepf <schoepf@sc.ZIB-Berlin.DE> to (a)
%%%                        work around a bug in LaTeX and (b) measure
%%%                        the caption correctly by including room for
%%%                        the colon and the space.
%%%
%%%                        v1.03 (12 August 1992): minor changes to
%%%                        header.
%%%
%%%                        The checksum field above contains a CRC-16
%%%                        checksum as the first value, followed by the
%%%                        equivalent of the standard UNIX wc (word
%%%                        count) utility output of lines, words, and
%%%                        characters.  This is produced by Robert
%%%                        Solovay's checksum utility.",
%%%  }
%%% ====================================================================
%Figure 1.1: This is the debugged version of a modified caption macro
%            to produce captions with hanging indentation (like this).
%            If the caption is less than a full line, it will be
%            centered.  \isucaption is used in the same way as \caption
%            (the name may be changed).
%            The variable \captionwidth may be set to match the width
%            of a \tabular* environment.  If set inside a table or
%            figure environment, it will affect only that environment.

\def\isucaption{\refstepcounter\@captype
  \@dblarg{\@isucaption\@captype}}

\newlength\captionwidth \captionwidth=\hsize

\long\def\@isucaption#1[#2]#3{
  \baselineskip 14.5 pt
  \addcontentsline {\csname ext@#1\endcsname}{#1}%
  {\protect\numberline{\csname fnum@#1\endcsname}{\ignorespaces #2}}%
     \par
  \begingroup
    \@parboxrestore
    \setbox\@tempboxa\hbox{\csname fnum@#1\endcsname: #3}%
    \ifdim \wd\@tempboxa >\captionwidth
      \begingroup
       \setbox\@tempboxa\hbox{\csname fnum@#1\endcsname: }%
       \advance \captionwidth by -\wd\@tempboxa
        \@makecaption{\csname fnum@#1\endcsname}%
        {\ignorespaces{\protect\parbox[t]{\captionwidth}%
                                         {\leavevmode#3}}}%
      \endgroup
     \else
        \begingroup
           \@makecaption{\csname fnum@#1\endcsname}%
           {\ignorespaces #3}%
        \endgroup
     \fi
    \par\vspace{1.7ex}%
  \endgroup}

\endinput
