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

I would like to use the page counter as a the first part of the label for definitions. I tried


but that wouldn't work if the definition is at the top of a new page, presumably because of this. Is there any way around it?

share|improve this question
up vote 4 down vote accepted

You can use the perpage package:


% We encourage TeX to break before a definition so the numbering will be correct

\usepackage[paperheight=60pt]{geometry} % just for the example

First on first page

Second on first page


First on second page

This will assign numbers 1.1, 1.2 and 2.1

enter image description here

share|improve this answer
This doesn't work if one removes \newpage and adds (in the preamble) \textheight=50pt. – lockstep Dec 25 '12 at 23:49
@lockstep The new version should work better – egreg Dec 26 '12 at 0:05
this works perfectly, thank you so much! – vuce Dec 26 '12 at 0:07
@vuce Yet it might fail in some circumstances; keep an eye on the numbering and if you find that some definition at the top of a page doesn't get numbered correctly, issue a \pagebreak before it. Please have a look at the site FAQ, particularly with respect to what voting means. – egreg Dec 26 '12 at 0:10

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.