I have defined two new theorems, myexample and myexercise, using \newtcbtheorem in the tcolorbox package in Beamer. I have overlays (e.g. \pause, \uncover<2+>{ ... }, etc.) within the new theorems.
1) I would like to be able to 'click' past \pause, \uncover, etc., without incrementing the theorem counter.
2) On slide 1, it seems that the two new theorems have separate counters (as I want them to have) but when I 'click' past \pause to slide 2 in the Example theorem, both the Example and Exercise theorems' counters increment. (Solving my first problem may fix the second?)
I have tried to implement counters but clearly don't have counters figured out since they didn't do what I'd hoped (although they did compile without error). I have commented them out but you can see what I was trying to do.
\documentclass[mathserif]{beamer}
\usepackage[most]{tcolorbox}
\newtcbtheorem{myexample}{Example}{}{exam}
\newtcbtheorem{myexercise}{Exercise}{}{exer}
%\newcounter{examplecounter}
\begin{document}
\begin{frame}{}
\begin{myexample}{}{}
%\setcounter{examplecounter}{\thetcbcounter}
Example 1, part A \theexamplecounter \par
\uncover<2->{
%\setcounter{\tcbcounter}{\theexamplecounter}
Example 1, part B
}
\end{myexample}
\begin{myexample}{}{}
Example 2
\end{myexample}
\begin{myexercise}{}{}
Exercise 1
\end{myexercise}
\end{frame}
\end{document}
Any suggestions would be welcome. Thanks :)
beamer
puts each overlay in a TeX box first and decides which box is to be shown. However, thetcolorbox
theorem is actually in several boxes then, each incrementing the relevant counter.\resetcounteronoverlays
. See the manual for more insights.