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 want to obtain the current page number, for use in Lua conditionals, e.g.:

    if 10 <= \pagenumber < 20 then
        context("The pages are between 10 and 20")

How can I display and work with the current page number in ConTeXt?

share|improve this question
If you are using ConTeXt MkIV, you should use the latest version of the ConTeXt Standalone distribution. – Aditya May 6 '12 at 4:33
up vote 6 down vote accepted

You can access the current page number with tex.count.pageno.

    if 10 <= tex.count.pageno and tex.count.pageno < 20 then
        context("The pages are between 10 and 20")

Another thing: You have to combine the two tests with an and. A simple concatenation like in your example does not work.

share|improve this answer

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.