整个表格除了苹果二字,都出现在第一帧,直至结尾;
苹果二字在第二帧出现,直至结尾.
整个表格除了苹果二字,都出现在第一帧,直至结尾;
苹果二字在第三帧出现,直至结尾.
也即:
第一次遇到\visible<+->
,应为\visible<1->
.
第二次遇到\visible<+->
,应为\visible<2->
,可是好像此时为\visible<3->
这是为什么?
\documentclass[aspectratio=169]{ctexbeamer}
\usepackage{tabularray,ctex}
\begin{document}
\begin{frame}{整理数据(表格)}
\visible<+->{
\begin{tblr}{
hlines,
vlines,
colspec={*{2}{Q[c,3cm]}},
}
3&\visible<+->{苹果}\\
4 &5\\
\end{tblr}}
\end{frame}
\end{document}
我希望的效果:
- 整个表格除了苹果二字,都出现在第一帧,直至结尾;
- 苹果二字在第二帧出现,直至结尾.
我不明白为什么你需要嵌套\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}
这是为什么?
\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所述,递增了三次:
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}