1

I recently tried \newtcbtheorem to define new environments, however, these are not overlay-aware. Any idea why this is happening ?

Here is a MWE :

\documentclass{beamer}

\usepackage[theorems]{tcolorbox}

\newtcbtheorem[number within=section]{theo_beamer}{Theorem}{colframe=blue}{thm}
\newtcbtheorem[number within=section,use counter from=theo_beamer]{prop_beamer}{Proposition}{colframe=red}{prop}

\resetcounteronoverlays{tcb@cnt@theo_beamer}

\begin{document}
\begin{frame}

\begin{theo_beamer}{Title}{label1}
main result
\end{theo_beamer}

\onslide<2->{
\begin{prop_beamer}{Title}{label2}
Let's call Theorem \ref{label1}
\end{prop_beamer}
}
\end{frame}
\end{document}
1
  • With \ref{label1} replaced by \ref{thm:label1}, compiling your example, I get a two-page pdf. First page shows theo_beamer environment only, and second page shows two environments. Hence I cannot reproduce your problem. Commented Jul 7, 2020 at 23:42

1 Answer 1

0

You can make your custom theorem overlay aware like this:

\documentclass{beamer}

\usepackage[theorems]{tcolorbox}

\newtcbtheorem[number within=section]{theo_beamer}{Theorem}{colframe=blue}{thm}
\newtcbtheorem[number within=section,use counter from=theo_beamer]{prop_beamer}{Proposition}{colframe=red}{prop}

\resetcounteronoverlays{tcb@cnt@theo_beamer}

\renewenvironment<>{prop_beamer}[2]{
  \begin{actionenv}#3
    \begin{originalprop_beamer}{#1}{#2}
}{
    \end{originalprop_beamer}
  \end{actionenv}
}

\begin{document}
\begin{frame}

\begin{theo_beamer}{Title}{label1}
main result
\end{theo_beamer}

\begin{prop_beamer}<2->{Title}{label2}
Let's call Theorem \ref{thm:label1}
\end{prop_beamer}

\end{frame}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .