Within my larger pdf document I have what is basically a slideshow that steps through a set of frames created using the animateinline environment. I would like to add a frame counter of the form "Frame 12 of 32".

I can imagine two possible approaches:

  • When the frames are created by the animate package, if there was a LaTeX counter available that corresponded to the frame number then it could be simply displayed as part of that frame.
  • Or, when the frames are being played back, have some javascript which updates a frame counter displayed somewhere on the page. I know from the animate documentation that I can get or set the frame number but don't know how to display and update this info.

1 Answer 1


The following example uses animate-internal counters and a macro to write information (frame count) into the aux file. This corresponds to the first of your suggested approaches. The counter is inserted using the \framecounter command.


%%%%%%%%%%%%%%%%%%%%%%%% \framecounter %%%%%%%%%%%%%%%%%%%%%%%%%
% Within `animateinline', inserts `curr. #frame / total #frame'.
  \@anim@keytoaux{a\the\@[email protected]}{\the@frame}%
    -\@anim@getkeyval{a\the\@[email protected]}/%
    \@anim@getkeyval{a\the\@[email protected]}-%
  }]{\strut\the@frame/\@anim@getkeyval{a\the\@[email protected]}}%



  end=\framecounter %insert at the end of every frame

  • Excellent. Just what I needed. Sorry I can't vote up your answer but this is my first foray into tex.stackexchange and I don't have enough points to do so. Mar 18, 2015 at 21:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .