
我正在使用此程式碼將一張大桌子放在一個圖形旁邊。
\begin{figure}%[t!]
\centering
\begin{minipage}[c]{0.95\textwidth}
\begin{tabular}{cc}
\resizebox{0.45\textwidth}{!}{
\begin{tabular}{c c c c c c}
% ... all the lines and stuff
\end{tabular} } & \includegraphics[width=0.45\textwidth]{./image.pdf}\\
(a) & (b) \\
\end{tabular}
\end{minipage}
\end{figure}
然而,程式碼導致表格和圖形未正確對齊,如下所示:
問題是什麼?
答案1
如果影像tabular
和影像的高度大致相同,則將它們對齊到基線。預設情況下,\includegraphics
在底部對齊,但tabular
在垂直中心對齊。使用\begin{tabular}[b]
就足夠了,因為它會將垂直中心對齊方式更改為與最後一行的基線對齊...
其他選項包括添加
\usepackage[export]{adjustbox}
到你的序言並使用
\includegraphics[valign=c,...]{<image>}
這會將影像與tabular
s(預設)垂直中心對齊。