48

I was using the subfigure package to align multiple small images in a document. However, WikiBooks states that "the subfigure and subfig packages are deprecated and shouldn't be used any more" (WikiBooks Floats, Figures and Captions).

What is the alternative/proper option to achieve the same result?

10
  • 4
    Afaik, only subfigure is deprecated and subfig is the way to go instead.
    – Ruben
    Nov 13, 2013 at 11:52
  • 8
    subfig isn't deprecated!. You can also use subcaption which provides subfigure.
    – user11232
    Nov 13, 2013 at 11:53
  • 17
    I've written tens of times that subfig is only deprecated by one (albeit respectable) guide. The package subcaption has better features, perhaps, but subfig remains invaluable with classes such as RevTeX4 that are not compatible with caption (which is required by subcaption).
    – egreg
    Nov 13, 2013 at 11:57
  • 1
    @egreg Can you post up an answer explaining this and what the updsides of each are? As I recall, you explained this to me less then a week ago.
    – Canageek
    Nov 14, 2013 at 5:34
  • 1
    @egreg, also I couldn't make subcaption work with Beamer, although subfig works.
    – alfC
    Mar 17, 2014 at 1:54

2 Answers 2

39
+50

There are at least four classes that aren't compatible with caption (hence with subcaption), whereas subfig is a substitute when called as

\usepackage[caption=false]{subfig}
  1. The ws-proc9x6 class (and related ones by the same publisher), see how to get the ws-procs9x6 document class to work with subcaption package?

  2. tufte-book and the other similar classes, see Problem with tufte-book and subfigure

  3. IEEEtran, see 2-col floats and citation order problem

  4. REVTeX, see subfigures with revtex?

It's true that subfig doesn't cooperate well with hyperref, but when the alternative is no subfloats at all …


Related subfloat discussion is also given in subcaption vs. subfig: Best package for referencing a subfigure

5
  • 1
    subfig is simpler, I find. If you don't need what caption offers or the complexities and sophistication of subcaption, subfig often works well.
    – cfr
    Jul 16, 2016 at 2:17
  • 2
    @cfr What do you mean by "simpler"? "Simpler to use"? The syntax of \subcaptionbox (by subcaption) is similar to \subfloat (by subfig). "Simpler implementation"? No, the major part of the caption package is inside caption3.sty and this is loaded by subfig, too, even when using caption=false. The rest of subfig is handling the counters and duplicated code while the (sub)caption package tries to use as much code as possible for both, captions and sub-captions. So if you want a real lightweight solution without all the caption stuff, you need to use subfigure.
    – user2574
    Jul 17, 2016 at 10:46
  • 2
    @AxelSommerfeldt Simpler to understand and to use. subcaption's documentation requires more effort to navigate. Not necessarily more difficult, but certainly trickier and more time-consuming. subfig is relatively straightforward to figure out and utilise. This is not a criticism of subcaption. It is pretty much to be expected given that subcaption is more powerful/flexible than subfig. But if you don't need that power and flexibility, subfig is often easier.
    – cfr
    Jul 17, 2016 at 18:14
  • @cfr Thanks for the feedback. I'm not really happy with the documentation either, and am currently rewriting the caption bundle doc., but unfortunately progress is rather slow...
    – user2574
    Jul 19, 2016 at 15:14
  • @AxelSommerfeldt Documentation is hard. Really hard.
    – cfr
    Jul 19, 2016 at 15:28
10

I was able to avoid subfig completely. Used The Subfig Package documentation: "Do You Need This Package?"

\begin{figure}%
\centering
\parbox{1.2in}{...figure code...}%
\qquad
\begin{minipage}{1.2in}%
...figure code...
\end{minipage}%
\caption{Here are two figures side-by-side.}%
\label{fig:1figs}%
\end{figure}

Thanks for the info! I'm sure it will be even more useful as I dig into the package more.

3
  • 1
    I realize that I'm not very knowledgable in (La)TeX, but I am really confused now. You avoided subfig by using subfig??
    – jacobq
    Apr 5, 2014 at 15:41
  • Add the word "documentation". =) Used the subfig docs.
    – PLG
    Apr 6, 2014 at 16:41
  • 8
    However, this does not add captions, which might be desired.
    – Scz
    Nov 6, 2014 at 8:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.