EDIT: See improved code in bottom of this post

I've succeeded in getting a beamer pdf presented on dual screen (projector and laptop) with \setbeameroption{show notes on second screen=right} and Dual-Screen PDF viewer. Now I'm preparing my presentation (will be around 30 unique slides and 30 minutes) including allocating time to each slide and writing notes. I've added the following code in my preamble for managing and adding timer details to the notes shown on the laptop:

% Add timer counters
\newcounter{TotalS} % Total time seconds
\newcounter{TotalM} % Total time minutes
\newcounter{Slide}  % Slide time seconds

% Use ifthen for counter adding

% Command for timer and note
\note{T: \ifthenelse{\value{TotalM}<10}{0}{}
    S: 00:\arabic{Slide}}}

Now, by using \timer{x} on each slide, I'll get x seconds for that slide and add x seconds to the total timer, as well as getting the timers displayed in the notes.


  • Automatic total time keeping
  • Automatic time note
  • When a slide is split using \only, \onslide, \visible or similar, the counter is added each time. This is a pro, since the slide timer in Dual-Screen PDF Viewer resets as well (because beamer produces explicit pages in the pdf), but requires the time allocation to be split accordingly


  • Only works with <60 seconds per slide
  • Doesn't work well with >60 minute presentation

Wanted improvements:

  • Only use 1 total timer (seconds), and divide it into hours, minutes and seconds in the note command
  • Since I'm (relatively) new to LaTeX, the code may be fragile and contain issues I'm not aware of. It would be great to have more experienced people review and improve the code


  • Can anyone suggest how to improve the code according to the above?

EDIT: Improved code, suggestions still very welcome:

% Add timer counters

% Use ifthen for counter adding and leading zero

% Command for timer and note

What has been improved:

  • \timer{125} now correctly splits into 2 minutes and 5 seconds \timer{125} now correctly splits into 2 minutes and 5 seconds

  • newline added to avoid jumping time allocation when notes are otherwise empty

  • I don't see a question, so do I assume correctly the wanted points should be taken as such?
    – naphaneal
    Apr 5, 2016 at 10:40
  • Yes, you're right. Apr 5, 2016 at 10:52
  • Maybe tex.stackexchange.com/questions/191010/time-calculations might help in converting seconds to minutes. Apr 5, 2016 at 11:02
  • @samcarter Yes, there were definitely some good points in that thread. After doing some research based on the info there, I decided to use a \loop, \ifnum, \repeat instead, since that seems a bit easier to control. Apr 5, 2016 at 15:05


Browse other questions tagged or ask your own question.