子浮点中的标题向右移动

子浮点中的标题向右移动

使用 subfloat 时,我看到了奇怪的行为。我有 6 个数字,我想将它们显示为 2 x 3(2 行,3 列)。标题(a、b、c 等)向右移动,这意味着图 b) 被标记为 a),而 c) 出现在没有图像的页边距上。

\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}

有人有线索吗 ?

答案1

检查图像,如果有足够的空间,还要查找警告。也许发布一个可编译的示例。这个可编译的示例显示了预期的正确行为:

\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}

子浮点示例

相关内容