我在 2x3 的表格中放了 6 个图,包括标题,它们正好填满了一页。我想在每行的左上角用 a)、b)、c) 标记它们。我尝试过子图,但没有成功。在某种程度上,该caption
包也与该包冲突subcaption
。这是我目前所拥有的。我很感激任何提示!
\usepackage{hyperref}
\usepackage[labelfont=bf]{caption}
%\usepackage{subcaption}
\usepackage{subfig}
\begin{figure}
\centering
\begin{tabular}{cc}
\subfloat{\includegraphics[width=0.5\linewidth]{1}} &
\subfloat{\includegraphics[width=0.5\linewidth]{2}} \\
\subfloat{\includegraphics[width=0.5\linewidth]{3}} &
\subfloat{\includegraphics[width=0.5\linewidth]{4}} \\
\subfloat{\includegraphics[width=0.5\linewidth]{5}} &
\subfloat{\includegraphics[width=0.5\linewidth]{6}}
\end{tabular}
\caption{x}
\label{x}
\end{figure}
答案1
PS:您指的是 2x3 还是 3x2?您说您需要创建 2x3,但您给出的代码是 3x2。无论如何,我都会给出两种方法。
对于 3x2:
您可以使用
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subfig,multicol}
\begin{document}
\begin{figure}[htbp]
\begin{multicols}{2}
\noindent
\subfloat[configuration 1]{\includegraphics[width=.5\linewidth]{8}}\par
\subfloat[configuration 2]{\includegraphics[width=.5\linewidth]{9}}\par
\subfloat[configuration 3]{\includegraphics[width=.5\linewidth]{7}}\newpage
\subfloat[configuration 4]{\includegraphics[width=.5\linewidth]{8}}\par
\subfloat[configuration 5]{\includegraphics[width=.5\linewidth]{9}}\par
\subfloat[configuration 6]{\includegraphics[width=.5\linewidth]{8}}
\end{multicols}
\caption{Here goes the caption.}
\label{fig6}
\end{figure}
\end{document}
这将给出:
对于 2x3:
您可以删除caption
包,subfig
单独删除就足够了。有两种方法可以删除:
使用表格:
\begin{figure}[htbp] \centering \begin{tabular}{ccc} \subfloat[configuration 1]{\includegraphics[height=1.8in]{8}} & \subfloat[configuration 2]{\includegraphics[height=1.8in]{9}} & \subfloat[configuration 3]{\includegraphics[height=1.8in]{7}} \\ \subfloat[configuration 4]{\includegraphics[height=1.8in]{8}} & \subfloat[configuration 5]{\includegraphics[height=1.8in]{9}} & \subfloat[configuration 6]{\includegraphics[height=1.8in]{8}} \end{tabular} \caption{Here goes the caption.} \label{fig6} \end{figure}
不使用表格:
\begin{figure}[htbp] \centering \subfloat[configuration 1]{\includegraphics[height=1.8in]{8}} \subfloat[configuration 2]{\includegraphics[height=1.8in]{9}} \subfloat[configuration 3]{\includegraphics[height=1.8in]{7}} \hspace{\textwidth} \subfloat[configuration 4]{\includegraphics[height=1.8in]{8}} \subfloat[configuration 5]{\includegraphics[height=1.8in]{9}} \subfloat[configuration 6]{\includegraphics[height=1.8in]{8}} \caption{Here goes the cpation.} \end{figure}
两者都会得到类似这样的结果: