0

I want to compile a code of a colleague with texstudio. I shrinked the code as much as possible but it still contains the error:

\documentclass{beamer}

\usepackage[english]{babel}

\begin{document}
    \begin{frame}{Summary}  
        \newcounter{finalframe}
        Here are lots of items
        \visible<2->{\LARGE THANK YOU}
    \end{frame}
\end{document}

I get the error message:

Command \c@finalframe already defined. \end{frame}

If the \visible command is not there, the code compiles.

I couldn't find a reason why there is this conflict.

Cheers Ralph

Bobyandbob
  • 4,899
Ralph
  • 1

1 Answers1

2

I am not sure what you want to use your new counter for, but you should not define a new counter inside of a frame. The reason is that overlays (like your \visible<2->{...}) will basically create multiple copies of the same frame, thus the new counter is defined more then once, which is not possible.

If you need this new counter for something undisclosed in your question, define it outside of the frame or even better in the preamble, otherwise remove it.

\documentclass{beamer}

\usepackage[english]{babel}
\newcounter{finalframe}

\begin{document}

    \begin{frame}{Summary}  
        Here are lots of items
        \visible<2->{\LARGE THANK YOU}
    \end{frame}

\end{document}