Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I fix the problem of \ref command when I have been used overlays in beamer?

This problem appears to me when I use overlays. Here is an example

\documentclass[notes=show,12pt]{beamer}
\usepackage{beamerthemeshadow}

\beamertemplateshadingbackground{red!15}{blue!15}
\usepackage{lmodern}
\usepackage[T1]{fontenc} % fonte codificado em em T1 (8 bits)
%\usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps,pgfshade}
\usepackage[latin1]{inputenc} % letras acentuadas
\usepackage{color}

\begin{document}

\frame { \frametitle{First Theorem}
Consider the equation 
\[\cos^2(x) + \sin^2(x)=1
\]

\begin{overprint}
\onslide<2>
Let bla bla...

\onslide<3>
\begin{theorem}{\label{T1}}
If
\begin{equation} \label{E1}
x = \pi
\end{equation}
then bla bla bla
\end{theorem}
\onslide<4>
\begin{exampleblock}{Observation}
The conclusion of Theorem \ref{T1} remains valid if the condition \eqref{E1} is replaced by $x = 2\pi$ 
\end{exampleblock}

\end{overprint}

}

\end{document}
share|improve this question
    
Welcome to TeX.sx! A tip: If you indent lines by 4 spaces or enclose words in backticks `, they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it). –  Martin Schröder Feb 2 '13 at 20:17
    
Please elaborate: What is the problem? –  Martin Schröder Feb 2 '13 at 20:19
1  
My problem is: when I using the command \label{XXX} in an equation on slide 2 (for example) and I'm going to use \eqref{XXX} on slide 5, then has been appeared (??) –  Moura Feb 2 '13 at 20:31
1  
Please edit your question and include that information. –  Martin Schröder Feb 2 '13 at 20:52
1  
Beside the fact that it is possible according to the answer below, I don't think it is useful. People normally won't remember what was equation xxx from several slides before. In many cases people even cannot remember what was on the before the current one. Therefore this could only be useful if the referenced equation is really easy to remember (E=mc^2 or so) and then it would maybe be easier to reprint it. –  Benedikt Bauer Feb 2 '13 at 23:29
add comment

1 Answer

up vote 3 down vote accepted

You can use \label<3> to get it on to the same layer as is output. Also I think frame wants to be an environment.

\documentclass[notes=show,12pt]{beamer}
\usepackage{beamerthemeshadow}

\beamertemplateshadingbackground{red!15}{blue!15}
\usepackage{lmodern}
\usepackage[T1]{fontenc} % fonte codificado em em T1 (8 bits)
%\usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps,pgfshade}
\usepackage[latin1]{inputenc} % letras acentuadas
\usepackage{color}

\begin{document}

\begin{frame}
 \frametitle{First Theorem}
Consider the equation 
\[\cos^2(x) + \sin^2(x)=1
\]

\begin{overprint}
\onslide<2>
Let bla bla...

\onslide<3>
\begin{theorem}{\label<3>{T1}}
If
\begin{equation} \label<3>{E1}
x = \pi
\end{equation}
then bla bla bla
\end{theorem}
\onslide<4>
\begin{exampleblock}{Observation}
The conclusion of Theorem \ref{T1} remains valid if the condition \eqref{E1} is replaced by $x = 2\pi$ 
\end{exampleblock}

\end{overprint}

\end{frame}

\end{document}
share|improve this answer
1  
While one can use \frame{...}, the syntax \begin{frame}...\end{frame} is cleaner and it's less easy to forget ending the frame. –  egreg Feb 2 '13 at 20:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.