# beamer - overlays and counter

I have a macro with counters in it and overlays (class beamer). Every time I use overlays it increases the counters although it should not.

Macro:

\def\test{\thesection\stepcounter{section}}


Main code:

\begin{frame}
\test\\
\onslide<1->{One}
\onslide<2->{Two}
\end{frame}


Here the counter is not supposed to increase on every overlay command, just when calling the test macro.

How can I fix this?

Help would be appreciated!

• Why do you want to change the section counter even inside the same section? To change the section (and its counter), use \section{} outside a frame. – Sigur Oct 10 at 13:23
• It is just an example. Using a custom counter results in the same problem. – funnyguy Oct 10 at 14:04