I tried to define some environment but came across bad page breaks sometimes. The minimal working example is as follows:

\usepackage{hyperref} % page break is correct when removing this line

\newenvironment{question}{\par\refstepcounter{question}\thequestion. }{}
% page break is correct when changing \refstepcounter to \stepcounter




If ... Then ... ( ).\par
(A) 11; (B) 22; (C) 33; (D) 44.



The page break is correct when removing hyperref package, or changing \refstepcounter to \stepcounter. What is the problem with this example?

  • 1
    Thanks for posting a very clear MWE. I can reproduce the problem behavior. Fortunately, it disappears if one loads the geometry package as well. – Mico Oct 3 '13 at 11:49
  • @Mico geometry doesn't fix the issue it just changes the size a bit so makes the tipping point happen at a different place so makes the issue go from this example. – David Carlisle Oct 3 '13 at 12:12
  • Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – jub0bs May 4 '14 at 12:34

Avoid putting specials in vmode

\newenvironment{question}{\par\mbox{}\refstepcounter{question}\thequestion. }{}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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