我需要在一页中放置六幅图。一页有三行两列。每幅图都有一个子标题。对于这个 3 * 2 的图,它也有标题。
提前谢谢。我试过了。但确实有效。所以我还没有添加标题。
\begin{figure}[H]
\centering
\subfloat[]{
\begin{minipage}{\linewidth}
\includegraphics[width=0.5\linewidth, height = 0.2\textheight, keepaspectratio=true]{1.eps}
\includegraphics[width=0.5\linewidth, height = 0.2\textheight, keepaspectratio=true]{2.eps}
\end{minipage}}
\subfloat[]{
\begin{minipage}{\linewidth}
\includegraphics[width=0.5\linewidth, height = 0.2\textheight, keepaspectratio=true]{3.eps}
\includegraphics[width=0.5\linewidth, height = 0.2\textheight, keepaspectratio=true]{4.eps}
\end{minipage}}
\subfloat[]{
\begin{minipage}{\linewidth}
\includegraphics[width=0.5\linewidth, height = 0.2\textheight, keepaspectratio=true]{5.eps}
\includegraphics[width=0.5\linewidth, height = 0.2\textheight, keepaspectratio=true]{6.eps}
\label{fig mmmf d}
\end{minipage}}
\end{figure}
答案1
subfigure
以下是使用包提供的环境的解决方案subcaption
。观察使用\hspace*{\fill}
实现水平分离和使用\medskip
实现图形之间的一点垂直分离。
可以给定环境以及单独的环境,figure
并且可以使用通常的机制来交叉引用这些环境。subfigure
\caption
\label
\ref
\documentclass{article}
\usepackage[demo]{graphicx} % "demo" option just for this example
\usepackage{subcaption}
\begin{document}
\begin{figure}[t!] % "[t!]" placement specifier just for this example
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=\linewidth]{pic1.pdf}
\caption{First subfigure} \label{fig:a}
\end{subfigure}\hspace*{\fill}
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=\linewidth]{pic2.pdf}
\caption{Second subfigure} \label{fig:b}
\end{subfigure}
\medskip
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=\linewidth]{pic3.pdf}
\caption{Third subfigure} \label{fig:c}
\end{subfigure}\hspace*{\fill}
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=\linewidth]{pic4.pdf}
\caption{Fourth subfigure} \label{fig:d}
\end{subfigure}
\medskip
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=\linewidth]{pic5.pdf}
\caption{Fifth subfigure} \label{fig:e}
\end{subfigure}\hspace*{\fill}
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=\linewidth]{pic6.pdf}
\caption{Sixth subfigure} \label{fig:f}
\end{subfigure}
\caption{My complicated figure} \label{fig:1}
\end{figure}
A cross-reference to Figure~\ref{fig:1}, and a cross-reference to Subfigure~\ref{fig:e}.
\end{document}