Consider the following code:
\documentclass{beamer}
\usepackage{tcolorbox}
\begin{document}
\begin{frame}
some text before
\pause
\begin{tcolorbox}
\begin{tabular}{cc}
cell1 & cell2\\\pause
cell3 & cell4
\end{tabular}
\end{tcolorbox}
\pause
some text after
\end{frame}
\end{document}
The expected result would be that "some text after" only appears on the fourth slide, but "some text after" is already visible on the second slide, then disappears on the third and then reappears in the fourth.
Any hint on what's going on?
Notes:
- the same result occurs if the
tabularx
tcolorbox key is used instead of tabular - my actual workaround for this is to use
\only
or\uncover
, but I'm more interested in the reason why this doesn't work.
edit: it seems that the tcolorbox environment interferes with the pause counter. If after the tcolorbox envirnoment you put
\setcounter{beamerpauses}{#}
where #
is equal to the number of \pause
issued before the tcolorbox environment everything works fine.
Uhm, actually that works only in a very specific scenario
Best Answer
You shouldn't use
\pause
insidetabular
in the first place... as thebeamer
manual states:Your main problem is independent from
tabular
, it's even independent fromtcolorbox
itself. It's bad interaction betweensetbeamercovered{invisible}
mode ofbeamer
and\endpgfpicture
(tcolorbox
usesTikZ/pgf
as far as I know). The following example shows, that when there are more\pause
-s inside thetikzpicture
the interpreter fails to hide the upcoming pauses (note: even in anothertikzpicture
afterwards).((As a workaround one could use
\setbeamercovered{transparent=0}
. But this still got issues withtabular
... where you shouldn't use\pause
... and some issues with the\tcolorbox
coloring...))So:
\pause
insidetabular
\pause
insidetikz
therefore insidetcolorbox