TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For some beamer related code in one of my packages I need to access the current overlay number. I mean the internal number used for things like \only<1>{..}.

\only<1>{ Some internal number must be one in here }
\only<2>{ But 2 in here }
\only<1-5>{\includegraphics[page=(current overlay number)]{...}}

I checked the beamer manual and could find any information about this. I checked the source code and found some related macros/counters but they didn't held always the correct values. \beamerpauses seems not the correct one either. Does anyone now the "offical" counter/macro for this number?

share|improve this question
up vote 13 down vote accepted

You may be looking for the internal counter


as defined in beamerbasedecode.sty: It is the value beamer consults when encountering something like \only<1,3-5>{...} to check whether to display or to hide the content.

A small demonstration on how to access this value:

\only<1>{ Some internal number must be \overlaynumber\ in here }
\only<2>{ But \overlaynumber\ in here }

\only<1-5>{Graphic \overlaynumber}
share|improve this answer
This seems indeed the right counter. How exactly did you find it? – Martin Scharrer May 9 '12 at 12:39
@MartinScharrer I already had fun with the decode routine when answering previous questions, so I knew where to look ;-) – diabonas May 9 '12 at 12:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.