# tcolorbox with beamer

The MWE

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage{tcolorbox}
\begin{document}
\begin{frame}
\begin{tcolorbox}
A\pause B
\end{tcolorbox}
\begin{tcolorbox}
A\pause B
\end{tcolorbox}
\end{frame}
\end{document}


produces three slides: A-AB, AB-A, and AB-AB, which is not what I would expect (A-, AB-A, and AB-AB).

Here somebody advises not to use \pause at all inside a tcolorbox, but the manual does mention a beamer skin, so I guess it must have support for beamer. Is there a better way to do the above?

• Well, the manual says "This skin resembles boxes known from the beamer class and therefore is called ’beamer’." The presence of the skin doesn't imply support for beamer. Jul 2, 2017 at 19:53

Using \only instead works, though it is a bit more work.

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage{tcolorbox}
\begin{document}
\begin{frame}
\begin{tcolorbox}
A\only<2->{B}
\end{tcolorbox}
\begin{tcolorbox}
\only<3->{A}\only<4>{B}
\end{tcolorbox}
\end{frame}
\end{document}

• Do you also know a way to prevent the tcolorbox to become smaller if the text is still hidden? Jul 2, 2017 at 20:06
• @Carucel To fix the size, try with \visible instead of \only Jul 2, 2017 at 20:07