![四幅并排的图画,每对都有一个共同的标题](https://linux22.com/image/290314/%E5%9B%9B%E5%B9%85%E5%B9%B6%E6%8E%92%E7%9A%84%E5%9B%BE%E7%94%BB%EF%BC%8C%E6%AF%8F%E5%AF%B9%E9%83%BD%E6%9C%89%E4%B8%80%E4%B8%AA%E5%85%B1%E5%90%8C%E7%9A%84%E6%A0%87%E9%A2%98.png)
我正在使用以下 LaTeX 代码将四个图形放在两行中,两个图形并排放置,以便它们都在一行上并有一个共同的标题。不幸的是,当我使用标题时,LaTeX 文件无法正确执行。我该如何执行上述过程?还有其他代码不起作用。我使用的是 MiKTeX 2.8 和 TeXnicCenter 稳定版 2.3。
这是我的代码:
\begin{figure}[htp]
\begin{tabular}{cc}
% Requires \usepackage{graphicx}
\includegraphics[width=13cm]{fig1.eps}&
\hspace{-5cm} \includegraphics[width=13cm]{fig2}\caption{}\
\includegraphics[width=13cm]{fig3.eps}& \hspace{-5cm} \includegraphics[width=13cm]{fig4.eps}\caption{}\
\end{tabular} \end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SECOND CODE IS
\begin{figure}
\centering
\begin{tabular}{cc}
\includegraphics{fig1} &
\includegraphics{fig2}
\end{tabular}
\caption{.....}
\end{figure}
\begin{figure}
\centering
\begin{tabular}{cc}
\includegraphics{fig3} &
\includegraphics{fig4}
\end{tabular}
\caption{.....}
\end{figure}
答案1
一种选择:
\documentclass{article}
\usepackage[demo]{graphicx}
\begin{document}
\begin{figure}
\centering
\includegraphics[width=.4\linewidth]{fig2}\quad
\includegraphics[width=.4\linewidth]{fig3}\par
\caption{the caption for the first group}\par\bigskip
\label{fig:testa}
\includegraphics[width=.4\linewidth]{fig4}\quad
\includegraphics[width=.4\linewidth]{fig4}
\caption{the caption for the second group}
\label{fig:testb}
\end{figure}
\end{document}
您对宽度(13cm
)的设置对于标准文档来说可能太宽;最好使用一小部分来控制宽度\linewidth
,就像我在示例代码中所做的那样。
选项demo
只是graphicx
用黑色矩形替换实际图形;不是在实际文档中使用该选项。