I'm trying to put two images with the subcaption package side by side in an enumerate environement. This works fine, however the indent is not correct. Here is my code:
\documentclass[10pt,a5paper]{book}
\usepackage[demo]{graphicx}
\usepackage{epstopdf}
\usepackage{subcaption}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label=\alph*)]
\item first item
\item second item
\item
\begin{figure}[htb!]
\centering
\begin{subfigure}[b]{0.40\linewidth}
\includegraphics[width=\linewidth]{figures/fig1.eps}
\caption{}
\label{fig1}
\end{subfigure}
\hspace{0.05\textwidth}
\begin{subfigure}[b]{0.40\linewidth}
\includegraphics[width=\linewidth]{figures/fig2.eps}
\caption{}
\label{fig2}
\end{subfigure}
\caption{(a) fig1 (b) fig2}
\label{fig1and2}
\end{figure}
\end{enumerate}
\end{document}
Similar problems were discussed here:
Subfigure with caption within an itemize list not indenting correctly
(I do not want to use the subfig package as it stands in conflict with subcaption package)
Figure with caption within an itemize list not indenting correctly (only one image is subject to the procedure)
Thank you for your help!
