# Beamer : after the last page — initiate a loop

I'd like that the presentation goes to a specific page after the last page, as it would be the natural next page.

I know : \hypersetup{pdfstartpage=1}

But it works only to go back to the first page.

My point is to loop on a set of selected slides to make a looping animation at the end of the presentation. I know how to make the set of selected slides, how to change the \transduration, the last point is how to initiate the loop.

\documentclass{beamer}

\pdfcatalog{
/AA <<
/WC <<
/S/JavaScript/JS (app.fs.loop=false;)
>>
>>
}
\pdfpageattr{
/AA <<
/O <<
/S/JavaScript/JS (app.fs.loop=true;)
>>
>>
}

\begin{document}
\begin{frame}[label=bob]
\begin{enumerate}[<+->]

\item a
\item b
\item c

\end{enumerate}
\end{frame}

% save current value of \pdfpageattr
\edef\pdfpageattrOrig{\the\pdfpageattr}
% append page duration to the page attributes (do it manually)
\begingroup
\edef\x{\endgroup
\pdfpageattr{\the\pdfpageattr /Dur 0.2}%
}%
\x

\againframe<2->{bob}

\end{document}


This loops back to the 4th page (zero based pageNum equal 3) which is the start of the \againframe section:

\documentclass{beamer}

\begin{document}
\begin{frame}[label=bob]

\begin{enumerate}[<+->]

\item a
\item b
\item c

\end{enumerate}
\end{frame}

% append page duration to the page attributes (do it manually)
\begingroup
\edef\x{\endgroup
\pdfpageattr{
\the\pdfpageattr /Dur 0.2
/AA <<
/O <<
/S/JavaScript /JS(
if(this.pageNum==this.numPages-1)
var retVal=app.setTimeOut( "this.pageNum=3;", 200 );
)
>>
>>
}%
}%
\x

\end{document}


For this, beamer provides \againframe. This requires you to label a frame, and then recall it using

\againframe<slide>{<label>}


Here's an example:

\documentclass{beamer}
\let\Tiny\tiny% http://tex.stackexchange.com/q/58087/5764

\begin{document}

\begin{frame}[label=abc]
\begin{enumerate}[<+->]
\item a
\item b
\item c
\end{enumerate}
\end{frame}

\againframe<2>{abc}% Repeat slide 2 of frame labelled "abc"

\end{document}


The <slide> addition is optional.

• But after the new last page (the fifth now) the presentation ends, I still want it goes back to page 2 again and again ... My point is to loop on a set of selected slides to make a looping animation at the end of the presentation. I made my question more specific. – Tarass Jul 8 '15 at 8:28