图形的放置位置由当前文本的排列方式所决定。为使图形居中放置,可将其 放入一个居中(center)环境中。
\begin{center}
\includegraphics[width=2in]{graphic.eps}
\end{center}
如果将 \includegraphics 命令放入一个环境中(minipage 或
figure),用 \centering 可将其后的内容居中排列。例如:
\begin{figure}
\centering
\includegraphics[width=2in]{graphic.eps}
\end{figure}
就等同于
\begin{figure}
\begin{center}
\includegraphics[width=2in]{graphic.eps}
\end{center}
\end{figure}
这里推荐使用 \centering,因为 \begin{center} 会使图形上下
方的垂直间距增加一倍( figure 环境带有的间距加上 center 环境
带有的间距)。若希望有特殊的垂直间距,可使用第 18.1节介绍的命令。
\psfig 和 \epsfbox 命令
的缺陷让它们很难使图形居中排列。作为一种解决办法,使用了 TEX 命令 \centerline 和 \leavevmode。而 \includegraphics 命令
已克服了这些缺陷,允许直接与 \centering 命令一起使用或用在 center
环境中,因此也就不需再使用 \centerline 和 \leavevmode了。
|