我正在尝试在 Latex 中构建一个图像表。我的两幅图像是纵向的,两幅是横向的。我的最终目标是让它们看起来像这样:
| | B | |
| A |---| D |
| | C | |
我的代码是:
\begin{tabular}{|c|c|c|}
\multirow{2}{*}{\includegraphics[width=0.25\textwidth]{./2_ACES/images/widiStructures/h_back.eps}} & \includegraphics[width=0.25\textwidth]{./2_ACES/images/widiStructures/h_side.eps} & \multirow{2}{*}{\includegraphics[width=0.25\textwidth]{./2_ACES/images/widiStructures/h_front.eps}} \\
& \includegraphics[width=0.25\textwidth]{./2_ACES/images/widiStructures/h_side2.eps} & \\ \hline
\end{tabular}
然而,我的表格的最终结果是
| | B | |
| |---| |
| A | C | D |
A D
其中 A 和 D 图像位于表格底部以下!
答案1
只使用 minipage 怎么样:
\documentclass{article}
\newcommand*{\WideFig}{\fbox{\parbox{1.5in}{WIDE \\ FIGURE}}}%
\newcommand*{\TallFig}{\fbox{\parbox{1.0in}{.\\ VERY\\ VERY\\ VERY\\ VERY \\ TALL \\ FIGURE\\ }}}%
\begin{document}
\begin{figure}
\begin{minipage}{0.30\textwidth}
\centering
\WideFig
\end{minipage}\hfill
\begin{minipage}{0.35\textwidth}
\centering
\TallFig
\TallFig
\end{minipage}\hfill
\begin{minipage}{0.30\textwidth}
\centering
\WideFig
\end{minipage}\hfill
\end{figure}
\end{document}
答案2
我发现,即使是稍微复杂的表格布局,ConTeXt 语法也更好用。下面这个例子就是一个很好的例子:
\useMPlibrary[dum] % For dummy figures
% Specify the dimensions of figures
\defineexternalfigure[potrait] [height=6cm, width=3cm]
\defineexternalfigure[landscape][height=3cm, width=3cm]
\starttext
\bTABLE[offset=none]
\bTR
\bTD[nr=2] \externalfigure[dum][potrait] \eTD
\bTD \externalfigure[dum][landscape] \eTD
\bTD[nr=2] \externalfigure[dum][potrait] \eTD
\eTR
\bTR
\bTD \externalfigure[dum][landscape] \eTD
\eTR
\eTABLE
\stoptext
这使: