# Caption in subfloat shifted to the right

I'm seeing strange behavior when using subfloat. I have 6 figures that I want to display as 2 by 3 (2 lines, 3 columns). The caption (a, b, c etc.) is shifted to the right which means figure b) is labeled a) and c) appears on page margin where no image is located.

\usepackage{graphicx,subfig}

\begin{document}
\begin{figure}[ht!]
\centering
\subfloat[Shield One]{\includegraphics[width=4cm]{figure/items/shield_1}}
\subfloat[Shield Two]{\includegraphics[width=4cm]{figure/items/shield_2}}
\subfloat[Shield Three]{\includegraphics[width=4cm]{figure/items/shield_3}}
\newline
\subfloat[Sword One]{\includegraphics[width=4cm]{figure/items/sword_1}}
\subfloat[Sword Two]{\includegraphics[width=4cm]{figure/items/sword_2}}
\subfloat[Sword Three]{\includegraphics[width=4cm]{figure/items/sword_3}}
\caption[Items and their definition]{Items and their definition}
\label{fig:items}
\end{figure}
\end{document}


Does anyone have a clue ?

-
Newer use \newline inside a centered environment, i.e. \centering or center environment. Use \\ instead. (Since you did not give us a complete example document I cannot test if this will fix your problem.) –  Axel Sommerfeldt Aug 1 '11 at 15:39
I had the exact same problem. In my case it was a clash with the caption package. –  user13185 Apr 2 '12 at 1:32
@KMAC The subfig documentation mentions compatibility with caption; even requiring it (see section 4.1 Caption package of 4 Compatibility with other packages, p 36). How did your usage clash with caption? –  Werner Apr 2 '12 at 2:11
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. –  Martin Schröder Apr 2 '12 at 6:41

Check images and if there's sufficient space, also look for warnings. Perhaps post a compilable example. This compilable example shows the expected correct behavior:

\documentclass{article}
\usepackage{graphicx,subfig}
\begin{document}
\begin{figure}[ht!]
\centering
\subfloat[Shield One]{\includegraphics[width=4cm]{figure/items/shield_1}}
\subfloat[Shield Two]{\includegraphics[width=4cm]{figure/items/shield_2}}
\subfloat[Shield Three]{\includegraphics[width=4cm]{figure/items/shield_3}}
\newline
\subfloat[Sword One]{\includegraphics[width=4cm]{figure/items/sword_1}}
\subfloat[Sword Two]{\includegraphics[width=4cm]{figure/items/sword_2}}
\subfloat[Sword Three]{\includegraphics[width=4cm]{figure/items/sword_3}}
\caption[Items and their definition]{Items and their definition}
\label{fig:items}
\end{figure}
\end{document}


-