I am having a problem aligning figures in a subfloat. Here is the raw code:

\subfloat[]{{\includegraphics[width=.48\textwidth]{image1.pdf} }\label{}}%
\subfloat[]{{\includegraphics[width=.48\textwidth]{image2.pdf} }\label{}}%
\subfloat[]{{\includegraphics[width=.98\textwidth]{image3.pdf} }\label{}}%

I would expect the labels (a), (b) and (c) to be on the centreline of the page. The code gives no errors, but images 1 and 2 are not in the centerline of the page (i.e. their labels (a) and (b) are offset to the left).

I have read this might be something to do with using the width command but I am not sure how to fix it.



better than use \\ instead of the \newline, is to insert blank line:

\usepackage[demo]{graphicx} % in real document remove option"demo"

\subfloat[]{{\includegraphics[width=.48\textwidth]{image1.pdf} }\label{fig:mycaption-a}}

\subfloat[]{{\includegraphics[width=.48\textwidth]{image2.pdf} }\label{fig:mycaption-a}}

\subfloat[]{{\includegraphics[width=.98\textwidth]{image3.pdf} }\label{fig:mycaption-c}}
\caption{My caption}

enter image description here


I fixed the problem by using \\ instead of \newline in the code above. The figures now show up, one underneath the other, and correctly aligned along the vertical centreline of the page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.