1

I am preparing a small presentation in beamer where I use an enumeration with counter rememberance in between the frames. The problem is that, starting the the second frame, the numbering is starting to go off. I think this is due to the fact that the following command is executed for every slide of the frame:

\setcounter{enumi}{\thecurrentenumi}

My question then, is to know if anybody knows how to execute this command conditionaly, only on slide # 1 of the given frame? Here are two frames as an example:

\documentclass[aspectratio=169, 14pt, notes]{beamer}
\newcounter{currentenumi}

\begin{document}
  \begin{frame}[t]
    \frametitle{Simulation of my problem}
    \framesubtitle{frame 1}

    \footnotesize

    \begin{enumerate}
      \setlength{\itemsep}{0.7cm}

      \onslide<1->  \item Some text for frame 1 - slide 1
      \onslide<2->  \item Some text for frame 1 - slide 2
      \onslide<3->  \item Some text for frame 1 - slide 3
      \onslide<4->  \item Some text for frame 1 - slide 4

      \setcounter{currentenumi}{\theenumi}
    \end{enumerate}
  \end{frame}

  \begin{frame}[t]
    \frametitle{Simulation of my problem}
    \framesubtitle{frame 2}

    \footnotesize

    \begin{enumerate}
      \setlength{\itemsep}{0.7cm}

      \setcounter{enumi}{\thecurrentenumi}

      \onslide<1->  \item Some text for frame 2 - slide 1
      \onslide<2->  \item Some text for frame 2 - slide 2
      \onslide<3->  \item Some text for frame 2 - slide 3
      \onslide<4->  \item Some text for frame 2 - slide 4

      \setcounter{currentenumi}{\theenumi}
    \end{enumerate}
  \end{frame}
\end{document}

Here is what I get, with in red what I should have. enumeration with wrong numbering Thank you for the help,

2 Answers 2

1

Try putting your \setcounter command between the frames, like so:

\documentclass[aspectratio=169, 14pt, notes]{beamer}
\newcounter{currentenumi}

\begin{document}
  \begin{frame}[t]
    \frametitle{Simulation of my problem}
    \framesubtitle{frame 1}
    \footnotesize
    \begin{enumerate}
      \setlength{\itemsep}{0.7cm}%
      \onslide<1->  \item Some text for frame 1 - slide 1
      \onslide<2->  \item Some text for frame 1 - slide 2
      \onslide<3->  \item Some text for frame 1 - slide 3
      \onslide<4->  \item Some text for frame 1 - slide 4
    \end{enumerate}
  \end{frame}
      \setcounter{currentenumi}{\theenumi}
  \begin{frame}[t]
    \frametitle{Simulation of my problem}
    \framesubtitle{frame 2}
    \footnotesize
    \begin{enumerate}
      \setlength{\itemsep}{0.7cm}%
      \setcounter{enumi}{\thecurrentenumi}%
      \onslide<1->  \item Some text for frame 2 - slide 1
      \onslide<2->  \item Some text for frame 2 - slide 2
      \onslide<3->  \item Some text for frame 2 - slide 3
      \onslide<4->  \item Some text for frame 2 - slide 4
    \end{enumerate}
  \end{frame}
\setcounter{currentenumi}{\theenumi}
  \begin{frame}[t]
    \frametitle{Simulation of my problem}
    \framesubtitle{frame 3}
    \footnotesize
    \begin{enumerate}
      \setlength{\itemsep}{0.7cm}%
      \setcounter{enumi}{\thecurrentenumi}%
      \onslide<1->  \item Some text for frame 2 - slide 1
      \onslide<2->  \item Some text for frame 2 - slide 2
      \onslide<3->  \item Some text for frame 2 - slide 3
      \onslide<4->  \item Some text for frame 2 - slide 4
    \end{enumerate}
  \end{frame}
\end{document}
1

The problem is that you overwrite your counter on every overlay and it will thus be wrong on the next overlay. To prevent this, you could do \only<4>{\setcounter{currentenumi}{\theenumi}}.

You can avoid all the trouble with saving your counter if you use a single frame:

\documentclass[aspectratio=169, 14pt]{beamer}
\setbeameroption{show notes}
\newcounter{currentenumi}

\begin{document}
  \begin{frame}[t]
    \frametitle{Simulation of my problem}
    \framesubtitle<1-4>{frame 1}
    \framesubtitle<5-9>{frame 2}

    \footnotesize

    \begin{enumerate}
      \setlength{\itemsep}{0.7cm}

      \item<1-4|only@1-4> Some text for frame 1 - slide 1
      \item<2-4|only@1-4> Some text for frame 1 - slide 2
      \item<3-4|only@1-4> Some text for frame 1 - slide 3
      \item<4|only@1-4> Some text for frame 1 - slide 4

      \item<5-9|only@5-9> Some text for frame 2 - slide 1
      \item<6-9|only@5-9> Some text for frame 2 - slide 2
    \end{enumerate}
  \end{frame}
\end{document}

enter image description here

You must log in to answer this question.

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