summaryrefslogtreecommitdiff
path: root/macros/latex209/contrib/misc/isucaption.sty
blob: 10823eb3ed0bba75d74981e90af06188795d5e6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
%NAME: isucaption.sty
% written by gagac@isumvs.bitnet
%
%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}{#3}}}%
      \endgroup
     \else
        \begingroup
           \@makecaption{\csname fnum@#1\endcsname}
           {\ignorespaces #3}
        \endgroup
     \fi
    \par\vspace{1.7ex}
  \endgroup}