Recommended package for making same-height subfigures?

I've read that the subfigure package has been deprecated in favor of the subcaption package. However, the subcaption package has the unfortunate requirement that you specify the width of each subfigure in advance. But, for the common case of creating a row of same-height subfigures, you don't know their widths in advance, you just know that you want all them to be 5cm tall (for example).

So, what would be a recommended (and not deprecated) package for making strips of subfigures so that they're automatically scaled to a given height?

Note: The easiest syntax, the better (ie: I prefer to avoid manually defined minipages nor custom boxes, and use a package with easy syntax instead, just like subcaption, subfigure, etc...)

• Try to use subfig package: \subfloat[<sub caption> \label{...}]{\includegraphics[height=...]{<picture name>}}. – Zarko Oct 21 '15 at 19:12
• You can use the subfloatrow environment, from the floatrow package. – Bernard Oct 21 '15 at 20:20

There is no requirement to specify the width of the box when you supply the content inside a \subcaptionbox:

\documentclass{article}

\usepackage{subcaption,graphicx}

\begin{document}

\begin{figure}
\centering
\end{figure}

\end{document}


The width of the resulting box is made to fit the contents naturally. You can specify the width if you need to, since \subcaptionbox has the following extended usage/format:

\subcaptionbox[<list entry>]{<heading>}[<width>][<inner-pos>]{<contents>}


Note the optional macro for specifying the <width> of the box.

• Choose this one because the subcaption package is the one that fits best in my current scenario. – user2811963 Oct 21 '15 at 21:15

The \subfloat command from the subfig package can also be used:

\documentclass{article}
\usepackage{subfig}
\usepackage{graphicx}

\begin{document}

\begin{figure}
\centering

• +1 for showing how to do it with subfig. Thanks a lot! – user2811963 Oct 21 '15 at 21:16