For space reasons I want to break up the contents of an itemize
list into separate slides, which I have been doing without much problem using \only
. However, the following minimal document complains that the label eq:formula
is not defined:
\documentclass{beamer}
\begin{document}
\begin{frame}{Title}
\begin{itemize}
\only<1>{
\item Item 1.
} % Comment
\only<2>{ % these lines
\item Item 2, with equation
\begin{equation}
\label{eq:formula}
xyz
\end{equation}
\item Item 3, with reference \eqref{eq:formula}.
}
\end{itemize}
\end{frame}
\end{document}
As you can see, it is clearly defined. The problem goes away if you comment out the marked lines (thus, printing everything on one slide). I see using \tracingmacros
that there is a serious redefinition of \label
in beamer, and as such it appears that this is a bug with detecting what slide the label is printed on.
Is that right, and what is the solution?