[Tex/LaTex] Two line caption positioning in subfigure

subfloats

I am using subfigure environment. One of the images has 2 line caption. Below is the sample code:

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfigure}

\begin{document}
\begin{figure}[h]
  \centering
  \subfigure[One line caption]{
    \includegraphics[width=0.3\linewidth]{example-image-a}
  }
  \subfigure[Little longer caption takes over 2 lines]{
    \includegraphics[width=0.3\linewidth]{example-image-b}
  }
  \subfigure[One line caption]{
    \includegraphics[width=0.3\linewidth]{example-image-c}
  }
  \caption{Various example images}
  \label{fig:example_images}
\end{figure}
\end{document}

Plese see below the screenshot of generated PDF:
Screenshot of generated PDF

The middle figure has two line caption. Notice that the second line starts just below from the caption numbering. I want the second line to start below from the first line, as shown in the modified picture below:
Screenshot of the desired PDF

Any workaround, please?

Best Answer

Use the hang option. But, please, don't use subfigure in new documents.

\documentclass{article}
\usepackage{graphicx}
\usepackage[hang]{subfigure}

\begin{document}
\begin{figure}[h]
  \centering
  \subfigure[One line caption]{%
    \includegraphics[width=0.3\linewidth]{example-image-a}%
  }
  \subfigure[Little longer caption takes over 2 lines]{%
    \includegraphics[width=0.3\linewidth]{example-image-b}%
  }
  \subfigure[One line caption]{%
    \includegraphics[width=0.3\linewidth]{example-image-c}%
  }
  \caption{Various example images}
  \label{fig:example_images}
\end{figure}
\end{document}

Note also the added % characters, to avoid spurious spaces.

enter image description here