[comp.text.tex] Problems with a style file

vanwyk@longfellow.ecn.purdue.edu (Kenric D VanWyk) (04/04/91)

I aquired a style file called hangcaption.sty.  I saved this style
file to hangcaption.sty.  I then tried to sample this style file
with the enclosed latex file.  The file would not latex and
produced the .log file which is at the end of this message.  I am
not fluent enough yet in tex to figure out what is wrong.  Any help
would be appreciated.  Please e-mail responses to
vanwyk@ecn.purdue.edu


Thanks,
Kenric




% Save file as: HANGCAPTION.STY        Source: FILESERV@SHSU.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}




\documentstyle [hangcaption]{article}
\begin{document}
Here is room for a table and its caption.
\begin{table}[htb]
\vskip 4 in
\isucaption{The hangcaption header claims to take a regular caption
such as this one and indent it so that all text is in a column,
making the caption easier to read}
\end{table}
\end{document}





This is TeX, C Version 2.95 (preloaded format=lplain 89.10.25)  3 APR 1991 17:20
**&lplain m
(m.tex
LaTeX Version 2.09 <4 Aug 1988>
(/usr/unsup/lib/tex/inputs/article.sty
Document Style `article' <16 Mar 88>.
(/usr/unsup/lib/tex/inputs/art10.sty)
\c@part=\count78
\c@section=\count79
\c@subsection=\count80
\c@subsubsection=\count81
\c@paragraph=\count82
\c@subparagraph=\count83
\c@figure=\count84
\c@table=\count85
)
(/home/author/vanwyk/tex/inputs/hangcaption.sty
\captionwidth=\skip41
)
Runaway definition?
#1[#2]#3-> \baselineskip 14.5 pt \addcontentsline {\csname ext@#1\endcsname \ET
C.
! File ended while scanning definition of \@isucaption.
<inserted text> 
                }
<to be read again> 
                   \relax 
\@documentstyle ...let \@elt \input \@optionfiles 
                                                  \let \@elt \relax \makeato...
l.1 \documentstyle [hangcaption]{article}
                                         
? X
 
Here is how much of TeX's memory you used:
 138 strings out of 4614
 1408 string characters out of 64060
 25963 words of memory out of 262141
 2086 multiletter control sequences out of 9500
 18996 words of font info for 72 fonts, out of 72000 for 255
 14 hyphenation exceptions out of 607
 12i,0n,15p,158b,15s stack positions out of 300i,40n,60p,2000b,4000s
No pages of output.
--