我希望的效果:
- 整个表格除了苹果二字,都出现在第一帧,直至结尾;
- 苹果二字在第二帧出现,直至结尾.
我不明白为什么你需要嵌套\visible,本身就是可见的呀。写得更tabularray-style一点,以下就可以满足你的需求:
\documentclass{beamer}
\usepackage{tabularray}
\begin{document}
\begin{frame}{frametitle}
Hello!\par
\begin{tblr}{hlines,vlines,colspec={*{2}{Q[c,3cm]}},cell{2}{2}={cmd=\visible<+->}}
1 & 2 \\
3 & apple
\end{tblr}
\visible<+->{something else}
\end{frame}
\end{document}
这是为什么?
Claim:以上并不是不是完整的回答,提供一些层次递进的探索结果:
\documentclass{beamer}
\usepackage{tabularray}
\begin{document}
\begin{frame}{frametitleA}
\visible<+->{%
visible stuff
\visible<+->{invisible stuff}
}
\end{frame}
\begin{frame}{frametitleB}
\visible<+->{%
\begin{tabular}{|c|c|}
\hline
1 & 2 \\
\hline
3 & \visible<+->{invisible stuff}\\
\hline
\end{tabular}
}
\end{frame}
\begin{frame}{frametitleC}
\visible<+->{%
\begin{tblr}{hlines,vlines}
1 & 2 \\
3 & \visible<+->{invisible stuff}
\end{tblr}
}
\end{frame}
\begin{frame}{frametitleD}
\visible<+->{%
\begin{tblr}{hlines,vlines,colspec={*{2}{Q[c,3cm]}}}
1 & 2 \\
3 & \visible<+->{invisible stuff}
\end{tblr}
}
\end{frame}
\end{document}1.不使用任何环境,只做overlay specification的嵌套:

2.在tabular环境中嵌套使用:

3.在tblr中但不指定colspec={*{2}{Q[c,3cm]},此时beamerpauses递增了五次...:

4.在tblr中且指定colspec={*{2}{Q[c,3cm]},正如OP所述,递增了三次:

Edited:
Thanks to samcarter_is_at_topanswers.xyz:
If you don't set a colspec yourself, tabularray needs to first count how many columns there are, before it can start its normal doings.要想解决上述由于tabularray造成beamerpauses计数错误的问题,调用counter子库即可(texdoc tabularray sec5.3),这将只产生两页slides:
\documentclass{beamer}
\usepackage{tabularray}
\UseTblrLibrary{counter}
\begin{document}
\begin{frame}
\frametitle{frametitle}
\visible<+->{%
\begin{tblr}{hlines,vlines,colspec={*{2}{Q[c,3cm]}}}
1 & 2 \\
3 & \visible<+->{invisible stuff}
\end{tblr}
}
\end{frame}
\end{document}


















问 beamer中的动画效果不及预期