## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ subfig package destroys figure captions

Information and discussion about graphics, figures & tables in LaTeX documents.
tofergregg
Posts: 3
Joined: Mon Jan 17, 2011 5:20 am

### subfig package destroys figure captions

Hi there -- I am writing a paper using the acm_proc_article-sp.cls class file from the ACM. I'm also trying to use the subfig package as well. But, when I use the subfig package, my figure captions get screwed up. Instead of saying "Figure 1: This is my caption.", it says "1: This is my caption" without the bold and without "Figure".

The following is in acm_proc_article-sp.cls:
\long\def\@makecaption#1#2{    \vskip \baselineskip    \setbox\@tempboxa\hbox{\textbf{#1: #2}}    \ifdim \wd\@tempboxa >\hsize % IF longer than one line:        \textbf{#1: #2}\par               %   THEN set as ordinary paragraph.      \else                      %   ELSE  center.        \hbox to\hsize{\hfil\box\@tempboxa\hfil}\par    \fi}

How might I go about re-defining the caption to reflect the bolded "Figure"? Thanks!

sommerfee
Posts: 498
Joined: Mon Apr 09, 2007 4:20 pm
To use the subfig package without the caption package (so especially \@makecaption will not be overwritten) use the argument "caption=false" when loading the subfig package, e.g.
\usepackage[caption=false]{subfig}
See subfig package documentation for details.

tofergregg
Posts: 3
Joined: Mon Jan 17, 2011 5:20 am
Thank you! I ended up having to do it this way, though, as simply using the one line command gave me an error ("Error: caption undefined").

\usepackage[caption=false]{caption}\usepackage{subfig}

sommerfee
Posts: 498
Joined: Mon Apr 09, 2007 4:20 pm
tofergregg wrote:Thank you! I ended up having to do it this way, though, as simply using the one line command gave me an error ("Error: caption undefined").

Then you are using quite an old version of caption and subfig package. When Steven Cochran and I noticed that this feature would be useful, we implemented it first inside the caption package via option "caption=false". But this showed up some drawbacks, and therefore we change it in 2004 by moving the option "caption=false" to the subfig package.