tabular、pgfuseimage 和 multirows 的对齐问题

tabular、pgfuseimage 和 multirows 的对齐问题

我在表格中遇到了一些对齐问题: 我的图片问题

在草稿模式下:

我的问题只是盒子

重点是左下角的应该占据整个空间,但不要淹没底部(可以这么说)

提供这些图像的原始 MWE 如下:

\documentclass[9pt,draft]{beamer}
\usepackage{multirow}
\usepackage{tikz}

\pgfdeclareimage[interpolate=true,height=.15\textheight]{mousse-hexa}{img/foam2D-honeycomb.png}
\pgfdeclareimage[interpolate=true,height=.15\textheight]{mousse-grain}{img/foam2D-grain-boundaries.png}
\pgfdeclareimage[interpolate=true,height=.15\textheight]{mousse-desor}{img/foam2D-disordered.png}
\pgfdeclareimage[interpolate=true,height=.15\textheight]{murissement}{img/foam2D-coarsening.png}
\pgfdeclareimage[interpolate=true,height=.30\textheight]{graphe-mur}{img/lauriesfoam.png}

\begin{document}
\begin{frame}{title}
\begin{tabular}{c l}
   \pgfuseimage{murissement}                 & \pgfuseimage{mousse-hexa}  \\
   \multirow{2}{*}{\pgfuseimage{graphe-mur}} & \pgfuseimage{mousse-grain} \\
                                             & \pgfuseimage{mousse-desor} \\
\end{tabular}
\end{frame}
\end{document}

答案1

我认为 TiKZ 矩阵可以帮助您。从您的问题中我了解到您想要 lauriesfoam水平对齐与 的南侧foam2D-disordered。下一个代码显示了如何使用 TiKZ 矩阵来实现这一点。首先构建一个上行最右列的矩阵,然后包含lauriesfoam图形的节点与前一个节点对齐。在左列中,最后一个节点水平和垂直居中,右列显示上一个选项。借助calc库的帮助,您可以计算更复杂的对齐。

\documentclass[9pt,draft]{beamer}
\usepackage{tikz}
\usetikzlibrary{matrix}

\pgfdeclareimage[interpolate=true,height=.15\textheight]{mousse-hexa}{img/foam2D-honeycomb.png}
\pgfdeclareimage[interpolate=true,height=.15\textheight]{mousse-grain}{img/foam2D-grain-boundaries.png}
\pgfdeclareimage[interpolate=true,height=.15\textheight]{mousse-desor}{img/foam2D-disordered.png}
\pgfdeclareimage[interpolate=true,height=.15\textheight]{murissement}{img/foam2D-coarsening.png}
\pgfdeclareimage[interpolate=true,height=.30\textheight]{graphe-mur}{img/lauriesfoam.png}

\begin{document}
\begin{frame}{title}
\begin{columns}[t]
\column{.5\textwidth}
\begin{tikzpicture}[ampersand replacement=\&]
\matrix[column sep=2mm,row sep=3mm]{
   \node[draw] (A11) {\pgfuseimage{murissement}};                 \& \node[draw] (A12) {\pgfuseimage{mousse-hexa}};  \\
    \& \node[draw] (A22) {\pgfuseimage{mousse-grain}}; \\ \& \node[draw] (A32) {\pgfuseimage{mousse-desor}}; \\
};
\path (A22.south) -- coordinate [midway] (C) (A32.north);
\fill (C) circle (2pt);
\node[draw] (D) at (A11|-C) {\pgfuseimage{graphe-mur}};
\end{tikzpicture}
\column{.5\textwidth}
\begin{tikzpicture}[ampersand replacement=\&]
\matrix[column sep=2mm,row sep=3mm]{
   \node[draw] (A11) {\pgfuseimage{murissement}};                 \& \node[draw] (A12) {\pgfuseimage{mousse-hexa}};  \\
    \& \node[draw] (A22) {\pgfuseimage{mousse-grain}}; \\ \& \node[draw] (A32) {\pgfuseimage{mousse-desor}}; \\
};
\path (A22.south) -- coordinate [midway] (C) (A32.north);
\fill (C) circle (2pt);
\node[draw,anchor=south] (D) at (A11|-A32.south) {\pgfuseimage{graphe-mur}};
\end{tikzpicture}
\end{columns}
 \end{frame}
\end{document}

在此处输入图片描述

答案2

一个简单的解决方案是降低大图像,假装它没有高度和深度\smash

\begin{frame}{title}
\begin{tabular}{c l}
\pgfuseimage{murissement} & \pgfuseimage{mousse-hexa}  \\
\smash{\raisebox{\dimexpr-.15\textheight-2pt\relax}{\pgfuseimage{graphe-mur}}}
                          & \pgfuseimage{mousse-grain} \\
                          & \pgfuseimage{mousse-desor} \\
\end{tabular}
\end{frame}

在此处输入图片描述

相关内容