[OS X TeX] Captions

Bruno Voisin bvoisin at mac.com
Fri Aug 17 16:16:20 CEST 2007


Le 17 août 07 à 15:35, George LGhio a écrit :

> I'm writing a 100 year school history. Is it possible to have a  
> caption without the "Figure 1:" in it.
>
> What I want is a caption that says "Francis McNamara" as opposed to  
> "Figure 1: Francis McNamara"
>
> There will be no LOF in the book.

A possibility is to locate the definition of \@makecaption in the  
document class you're using, then paste it in the preamble of your  
document between \makeatletter and \makeatother and edit the part  
defining the content of the caption.

For example the article class contains:

\long\def\@makecaption#1#2{%
   \vskip\abovecaptionskip
   \sbox\@tempboxa{#1: #2}%
   \ifdim \wd\@tempboxa >\hsize
     #1: #2\par
   \else
     \global \@minipagefalse
     \hb at xt@\hsize{\hfil\box\@tempboxa\hfil}%
   \fi
   \vskip\belowcaptionskip}

Accordingly, for it you "just" have to put in the preamble:

\makeatletter
\long\def\@makecaption#1#2{%
   \vskip\abovecaptionskip
   \sbox\@tempboxa{#2}%
   \ifdim \wd\@tempboxa >\hsize
     #2\par
   \else
     \global \@minipagefalse
     \hb at xt@\hsize{\hfil\box\@tempboxa\hfil}%
   \fi
   \vskip\belowcaptionskip}
\makeatother

Namely, just erase everything starting with #1 and ending up before  
#2 in the definition.

Some explanation: #1 corresponds to the figure name and number (like  
"Figure 1"), #2 is the text of the caption itself, and ": " defines  
what goes between the two (like ". " or ": " or " -- " depending on  
the class). Hence by erasing "#1: " above you suppress everything  
before the text of the caption.

There might be more elegant solutions involving dedicated packages.  
The LaTeX Companion 2nd edn is the ultimate source for that kind of  
information, but I still haven't got it (ordered, not yet received).

Bruno Voisin
------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the macostex-archives mailing list