![将一组大小和形状各异的子图并排放置,自上而下,按子标题垂直对齐](https://linux22.com/image/370794/%E5%B0%86%E4%B8%80%E7%BB%84%E5%A4%A7%E5%B0%8F%E5%92%8C%E5%BD%A2%E7%8A%B6%E5%90%84%E5%BC%82%E7%9A%84%E5%AD%90%E5%9B%BE%E5%B9%B6%E6%8E%92%E6%94%BE%E7%BD%AE%EF%BC%8C%E8%87%AA%E4%B8%8A%E8%80%8C%E4%B8%8B%EF%BC%8C%E6%8C%89%E5%AD%90%E6%A0%87%E9%A2%98%E5%9E%82%E7%9B%B4%E5%AF%B9%E9%BD%90.png)
我想放置四幅不同的图像,两幅在上,两幅在下,像一个矩阵一样,按子标题对齐。我使用了 \subfigure 环境,但图像很混乱。
\begin{figure}%
\centering
\subfigure[][]{
\label{fig:A}
\includegraphics[height=5.4cm]{ImageA}
}
\hspace{1cm}
\subfigure[][]{
\label{fig:B}
\includegraphics[height=5cm]{ImageB}
}\\
\subfigure[][]{
\label{fig:C}
\includegraphics[height=3.65cm]{ImageC}
}
\hspace{95pt}
\subfigure[][]{
\label{fig:D}
\includegraphics[height=3.65cm]{ImageD}
}
\hspace{20pt}
\caption[Set of four subfigures.]{Set of four subfigures:
\subref{fig:A} first subfigure;
\subref{fig:B} second subfigure;
\subref{fig:C} third subfigure; and,
\subref{fig:D} last subfigure.}%
\label{fig:Figure}%
\end{figure}
答案1
- 您的代码使用了过时的包
subfigure
。相反,最好使用subfloats[]{...}
它的取代subfig
(参见下面的代码片段) - 用以下方法替换子图形之间的所有固定距离
\hfill
通过这些改变你将获得:
\begin{figure}[htb]
\centering
\subfloat[]{ % <---
\label{fig:A}
\includegraphics[height=5.4cm]{ImageA}
}
\hfil
\subfloat[]{ % <---
\label{fig:B}
\includegraphics[height=5cm]{ImageB}
}
\subfloat[]{ % <---
\label{fig:C}
\includegraphics[height=3.65cm]{ImageC}
}
\hfil
\subfloat[]{ % <---
\label{fig:D}
\includegraphics[height=3.65cm]{ImageD}
}
\caption[Set of four subfigures.]{Set of four subfigures:
\subref{fig:A} first subfigure;
\subref{fig:B} second subfigure;
\subref{fig:C} third subfigure; and,
\subref{fig:D} last subfigure.}%
\label{fig:Figure}%
\end{figure}