[Tex/LaTex] Figure caption alignment problem

captionsgraphics

I have a problem with the captions of my figures in a paper I am writing using the IOP template. I am using the usual package \usepackage{graphicx}.

And the LaTeX commands are

\begin{figure}[!h]
\centering
\includegraphics[width= 7.5cm,height=6cm]{figures/fig1.pdf}
\includegraphics[width= 7.5cm,height=6cm]{figures/fig2.pdf}
\caption[width = \textwidth]{Bla bla bla}
\label{fig:1}
\end{figure}

which are pretty standard. The result I get is

enter image description here

As you can see the caption is not aligned with the figures, and it actually not even aligned with the text. What can I do?

Best Answer

Try the following:

\usepackage{graphicx, caption}
\usepackage{lipsum} % for dummy text only

\begin{figure}[!h]
  \centering
  \captionsetup{width=\linewidth}
  \includegraphics[width= 7.5cm,height=6cm]{figures/fig1.pdf}
  \includegraphics[width= 7.5cm,height=6cm]{figures/fig2.pdf}
  \caption[Second figure]{\lipsum*[2]} 
  \label{fig:1}  
\end{figure}