31

I've been just reading through this Latex wikibook and I spotted they advocate use of \subfloat in figures. I've always used \subfigure.
What is the difference?

Stefan Kottwitz
  • 231,401
Łukasz Lew
  • 8,543
  • 12
  • 43
  • 42

2 Answers2

21

\subfigure belongs to the obsolete package with the name subfigure. It's still supported in the newer subfig package because of backward compatibility. I recommend to use \subfloat.

subfig should be preferref to subfigure, that's why the command \subfigure is not needed. Though it's available if you load the configuration altsf.cfg. It defines simply

\@ifundefined{c@subfigure}{\newsubfloat{figure}}{}
\def\subfigure{\subfloat}
\@ifundefined{c@subtable}{\newsubfloat{table}}{}
\def\subtable{\subfloat}

and further options for captions.

Stefan Kottwitz
  • 231,401
5

Note that you might prefer subfig to subfloat if wanting to use tocloft (*) to configure your TOC, LOF and LOT look and feel.

In which case, for example,

\@ifpackageloaded{subfig}
  {\usepackage[subfigure,...]{tocloft}}
  {\usepackage[...]{tocloft}}
\renewcommand{\cftchappresnum}{...}
...
\@ifpackageloaded{subfig}{\renewcommand{\cftsubfigpresnum}{...}}{}
...
\renewcommand{\cftchappagefont}{...}
...
\@ifpackageloaded{subfig}{\renewcommand{\cftsubfigpagefont}{...}}{}

(*) I'm sure tocloft's Current Maintainer could provide the canonicals should anyone want to ask.