在 Beamer 中为表格行添加动画,但不显示表格边框

在 Beamer 中为表格行添加动画,但不显示表格边框

我有一个包含三行的表格环境,我想在第一张幻灯片上仅显示第一行,然后显示下一行,最后显示第三行。我有一个几乎可行的解决方案,但它会在不可见的情况下显示第 2 行和第 3 行周围的边框,我不喜欢这样。有没有办法去掉这些空白边框?

这是我的代码:

\documentclass{beamer}

\mode<presentation>
{
  \usetheme{default}
  \useinnertheme{rounded}
  \usecolortheme{default}
}

\begin{document}

\begin{frame}{Test Frame}

{\footnotesize
\begin{tabular}{|p{4.0cm}|p{2.9cm}|p{2.950cm}|}
    \hline
    \textbf{Constraint Explanation} & \textbf{Assumptions} & \textbf{Notation} \\ \hline
    Each gate covered by only one module & Suppose gate $g$ is covered by modules $i$, $j$ and $k$ & $Var(g,i) + Var(g,j) + Var(g,k) \leq 1$ \\ \hline
    \onslide<2-> {Selecting a slice in the module implies selecting the common parts of the module & Module $i$ has $n$ slices & forall $1 \leq k \leq n: x_{i_0} - x_{i_k} \geq 0$} \\ \hline
    \onslide<3->{Each sliceable module must select either at least $M$ slices or no slices at all & Module $i$ has $n$ slices & \big( $\sum_{k=1}^n x_{i_k} \big) ~-~ M\cdot x_{i_{0}} \geq 0$} \\ \hline
\end{tabular}
}
\end{frame}

\end{document}

我得到的图像如下。

编译结果截图

我想要的与上面的完全相同,但没有第二行和第三行周围的边框。

答案1

在此处输入图片描述

\documentclass{beamer}

\mode<presentation>
{
  \usetheme{default}
  \useinnertheme{rounded}
  \usecolortheme{default}
}

\begin{document}
\makeatletter
\let\slideno\beamer@slideinframe
\makeatother


\begin{frame}[t]{Test Frame}
\onslide<2> {}
\onslide<3-> {}
{\footnotesize
\begin{tabular}{|p{4.0cm}|p{2.9cm}|p{2.950cm}|}
    \hline
    \textbf{Constraint Explanation} & \textbf{Assumptions} & \textbf{Notation} \\ \hline
    Each gate covered by only one module & Suppose gate $g$ is covered by modules $i$, $j$ and $k$ & $Var(g,i) + Var(g,j) + Var(g,k) \leq 1$ \\ \hline
\ifnum\slideno>1 
    Selecting a slice in the module implies selecting the common parts of the module & Module $i$ has $n$ slices & forall $1 \leq k \leq n: x_{i_0} - x_{i_k} \geq 0$\\ \hline
    \ifnum\slideno>2 
    Each sliceable module must select either at least $M$ slices or no slices at all & Module $i$ has $n$ slices & \big( $\sum_{k=1}^n x_{i_k} \big) ~-~ M\cdot x_{i_{0}} \geq 0$\\ \hline
\fi\fi
\end{tabular}
}
\end{frame}

\end{document}

相关内容