TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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

I have a counter that I want to use for the beamer \onslide command.


\onslide<\coun ->{ ....}

doesn't work. What is the correct way to do this?

share|improve this question
up vote 5 down vote accepted

Use \value{coun} instead:




Always here
\onslide<\value{coun} ->{on slide 3}

In general, with LaTeX counters then \value{<counter name>} expands to the value of the counter. The counter name itself is not a macro so there's some magic under the bonnet that links the counter name (in this case coun) with a macro that displays its value.

(Note: In the original, I had \thecoun in place of \value{coun}. As Matthew pointed out in the comments, \value{coun} is the correct one to have here.)

share|improve this answer
Does \value{coun} work as well? \thecoun can be redefined to give non-numeric renderings of the counter value. But \value{coun} should always give the arabic value. – Matthew Leingang Dec 6 '10 at 13:41
@Matthew: you are absolutely right. I'll change my answer. – Loop Space Dec 6 '10 at 13:48
Will Robertson reminded me of that a few days ago. Though it's unlikely the OP would change \thecoun and get errors, it is "the LaTeX way." – Matthew Leingang Dec 6 '10 at 15:40
(Missed one; edited again) – Loop Space Dec 6 '10 at 21:38

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.