# reference to equation from other lecture in class beamer

I'm using the class beamer to prepare lectures. I want to make a reference to a formula given in last week's lecture, but I get only question marks.

Example input:

\documentclass[handout]{beamer}

\includeonlylecture{week 2}

\begin{document}

\lecture{lecture 1}{week 1}
\begin{frame}
$$\label{eq:test} 1=1$$
\end{frame}

\lecture{lecture 2}{week 2}
\begin{frame}
$$\label{eq:test2} 2=2$$
equation(\ref{eq:test}) and (\ref{eq:test2})
\end{frame}

\end{document}


equation number 1 is correctly counted when calculating the number for the second equation, but I did not manage to get acces to \ref{eq:test}.

Any hints?

thanks

Martin

• I don't see anything obvious. Your best workaround for the moment might be to combine \lecture with \include and use \includeonly instead of \includeonlylecture. – Ulrich Schwarz Nov 9 '14 at 11:57

Assuming you compiled the slides from week one with the jobname "test", you could do

\RequirePackage{xr-hyper}
\documentclass[handout]{beamer}

\externaldocument{test}
\includeonlylecture{week 2}

\begin{document}

\lecture{lecture 1}{week 1}
\begin{frame}
$$\label{eq:test} 1=1$$
\end{frame}

\lecture{lecture 2}{week 2}
\begin{frame}
$$\label{eq:test2} 2=2$$
equation (\ref{eq:test}) and (\ref{eq:test2})
\end{frame}

\end{document}