I'm using LaTeX beamer and the forloop
-package to create a for loop, and I want to use the counter inside an \only-command
. Here is a MWE (or more like non-working example):
\documentclass[12pt]{beamer}
\usepackage{forloop}
\begin{document}
\begin{frame}
\begin{center}
\newcounter{slideno}
\forloop{slideno}{1}{\value{slideno} < 20}{
\only<\value{slideno}>{\arabic{slideno}}%
}
\end{center}
\end{frame}
\end{document}
The error message is:
! LaTeX Error: Command \c@slideno already defined.
Or name \end... illegal, see p.192 of the manual.
Now, the post over here[0] tells me that using counters like this in \only
should be possible, and in fact, if I comment out the for-loop (and add a \setcounter
), it works like a charm.
Does the for-loop some magic to the counter? Can I somehow circumvent this?
Thanks a lot,
Lukas
[0] usage of \only with counter, pdfcomment and beamer class