# Use of subcaption in enumerate environment

This is a simple question. Say you were to place two (or more) related figures in an enumerate environment. Outside of an enumerate environment, which itself is a floating environment, you would probably work in a figure environment, using the caption and subcaption packages, and centering each figure with respect to the global text body. Now, in an enumerate environment, you include the figures directly, avoiding the additional use of a figure environment, and center the figures/subfigures together with their captions/subcaptions with respect to the local text body in the enumerate environment. In the case of a single figure, you could do this in a rather straightforward way (e.g., by using \includegraphics{...} and \captionof{figure}{...} nested within a centered environment). In the case of multiple figures (subfigures to be precise) I have found this fairly tricky I must say. How would I go about doing this? Many thanks.

-
Welcome to TeX.sx! A tip: You can use backticks  to mark your inline code as I did in my edit. –  Torbjørn T. Nov 19 '11 at 13:52

I recommend using the subcaption package and the caption package. Within the enumerate environment, you could use minipages for arranging subfigures, or even a table with any alignment you like. An easy example with a simple table and \subcaptionbox:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\begin{enumerate}
\item First item
\item Some figures:
\captionsetup{type=figure}
\begin{tabular}[t]{cc}
\subcaptionbox{The first}{\includegraphics{fig1}}
& \subcaptionbox{The second}{\includegraphics{fig2}} \\[1cm]
\subcaptionbox{The third}{\includegraphics[width=2cm,height=1cm]{fig3}}
& \subcaptionbox{The last}{\includegraphics[width=2cm,height=2cm]{fig4}} \\
\end{tabular}
\item Third item
\end{enumerate}
\end{document}


-

This works for me:

\begin{figure}
\begin{enumerate}
\item abc
\begin{center}
\begin{minipage}[b]{.5\linewidth}
\centering\large A
\subcaption{A subfigure}\label{fig:1a}
\end{minipage}%
\begin{minipage}[b]{.5\linewidth}
\centering\large B
\subcaption{Another subfigure}\label{fig:1b}
\end{minipage}
\end{center}
\item def
\end{enumerate}
\caption{What's this?}
\end{figure}


Instead of \large A and \large B put your \includegraphics` commands.

-