0

In would like to use the exercise package in a beamer presentation (this allows me to keep the conventions I use in the corresponding paper document).

This works well except that exercise numbers are changing with overlays. How can I avoid Exercise counter to be affected by beamer overlays ?

Here is a simple example:

\documentclass{beamer}
\usepackage{exercise}

\setbeamercovered{transparent}

\begin{document}

 \begin{frame}
  \frametitle{Title}

  \begin{Exercise}
   This is the content of my exercise.
  \end{Exercise}
  \pause
  \begin{block}{A block which appears later}
   This is the content of my block.
  \end{block}
 \end{frame}

\end{document}

MWE

  • This one is a bit cleaner than the one you found, so probably less side effects. – Marijn Feb 12 at 15:45
0

I've find a hack which do the job, thanks to this post, but I'm not sure this would not cause some unexpected effects. Advice welcome!

Adding the following lines to the preamble seems to do the job:

\newcounter{preFrameExerciseCounter}

\AtBeginEnvironment{frame}{\setcounter{preFrameExerciseCounter}{\value{Exercise}}}

\let\originalframe=\frame
\def\frame{\originalframe\setcounter{Exercise}{\value{preFrameExerciseCounter}}}

MWE

|improve this answer|||||

Not the answer you're looking for? Browse other questions tagged or ask your own question.