[Tex/LaTex] Is it more standard to use subfig or subcaption package with beamer

beamercaptionssubfloats

Suppose I'm making a beamer presentation and I want to have a figure with some subfigures (each of which shows an image).

Is it more standard/popular to use the subfig package or the caption and subcaption packages for this purpose?

What are the exact include statements I should use to include the appropriate packages? I want to make sure I get the optional parameters correct.

Best Answer

Update

From version caption.sty 2015/09/17 v3.3-111 Customizing captions (AR) subcaption and caption are compatible with beamer, so you can use either subcaption or subfig. For older versions of caption, read below.

Initial answer (old versions of caption)

If you really need subfigures in a presentation, with beamer you should use subfig. subcaption and beamer are not compatible.

This

\documentclass{beamer}
\usepackage{subcaption}

\begin{document}

\begin{frame}
test
\end{frame}

\end{document}

gives the error

! Package caption Error: The `subcaption' package does not work correctly
(caption)                in compatibility mode.

which forces you to load caption with compatibility=false:

\documentclass{beamer}
\usepackage[compatibility=false]{caption}
\usepackage{subcaption}

\begin{document}

\begin{frame}
test
\end{frame}

\end{document} 

and the caption package author says about this option:

But please note that using this option is neither recommended nor supported since unwanted side-effects or even errors could occur afterwards. (For that reason you will get a warning about this.)

Load subfig with the caption=false option:

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

\begin{document}

\begin{frame}
test
\end{frame}

\end{document} 

Since internally subfig requires the caption package; using the caption=false option prevents caption from taking (ot attempting to take) control over captions in beamer.

Related Question