home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / text / tex / 12921 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  1.6 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!rutgers!cmcl2!adm!smoke!brl.mil!fsbrn
  2. From: fsbrn@brl.mil (Fred S. Brundick)
  3. Newsgroups: comp.text.tex
  4. Subject: Re: help with caption ?
  5. Message-ID: <19342@smoke.brl.mil>
  6. Date: 6 Nov 92 20:11:22 GMT
  7. References: <1992Nov5.210204.1@utxvms.cc.utexas.edu>
  8. Sender: news@smoke.brl.mil
  9. Reply-To: fsbrn@brl.mil
  10. Organization: Army Research Laboratory
  11. Lines: 27
  12.  
  13. In article <1992Nov5.210204.1@utxvms.cc.utexas.edu>, mtaw621@utxvms.cc.utexas.edu writes:
  14. |> I do not know how to do the following, within a \caption.
  15. |>  (i) How to have more than one line of text, appropriately aligned
  16. |>      to the right the word "Figure 1".
  17.  
  18. Here is what I use.  If a caption does not fit on one line, it calculates
  19. the width of "Figure n.---" and uses it as the hanging indent.
  20.  
  21. \long\def\@makecaption#1#2{
  22. \vskip 10pt
  23. \setbox\@tempboxa\hbox{#1.---{\em #2}}
  24. \ifdim \wd\@tempboxa > \hsize%        IF longer than one line
  25.   \setbox\@tempboxa\hbox{#1.---}%    THEN set as ordinary paragraph
  26.  \@tempdima=\hsize%                 with hanging indent
  27.   \advance\@tempdima by -\wd\@tempboxa
  28.   #1.---\parbox[t]{\@tempdima}%
  29. {\if@raggedright\rightskip\@flushglue\fi\em #2}\par
  30. \else%                    ELSE center.
  31.   \hbox to\hsize{\hfil\box\@tempboxa\hfil}
  32. \fi}
  33.  
  34. If you change the style in line 3 make sure to do the same thing in line 5.
  35.  
  36.                                         dsw, fferd
  37.                                         Fred S. Brundick
  38.                                         USARL, APG, MD.
  39.                                         <fsbrn@brl.mil>
  40.