0

In latex beamer, how do I show an element briefly on advancing to the next slide, for example show current slide number or a more fancy progress indicator (example here)? Fade in/out with customizable time is helpful too.

2 Answers2

1

The idea of the following code is to automatically insert an additional (unnumbered) frame before every frame. The duration it will be visible can be adjusted with \transduration{0.5}.

\documentclass{beamer}

\BeforeBeginEnvironment{frame}{%
    \frame{%
        \transduration{0.5}
        \insertframenumber
        \addtocounter{framenumber}{-1}
    }
}

\begin{document}

\begin{frame}
test
\end{frame}

\begin{frame}
test
\end{frame}

\begin{frame}
test
\end{frame}

\begin{frame}
test
\end{frame}

\end{document}
0

While it is probably possible, it will be difficult to implement this within the pdf file. One would need to know how to program with JavaScript. There is a JavaScript event Page/Open that you could try to use. Another possibility would be to add buttons to each slide and program them such that cliquing the button could do both things: advance the slide and start the animation.

To have a progress indicator of the sort you want in a PDF file, I would find it much more natural to look for a PDF viewer that shows you the progress. For example, okular, the pdf viewer of KDE, by default shows the slide number for a few seconds when in presentation mode (I usually find that annoying and turn it off). As an alternative, impressive allows to run define scripts that are run when advancing to any given page, so it should also be able to do what you want.

One thing to keep in mind: If you try to do funny things in your PDF file itself, then it is quite likely that your PDF file does not work on all PDF viewers.

jarauh
  • 2,762
  • 15
  • 27