I have defined


and now i am able to write something like


but i am getting a weird behavior with the prework of the theorem! LaTeX sets the top \hrule on one page and the rest of the definition on another page! See here what i mean. Althoug it is german you can see that the top hrule of definition 1.2.7 is on page 6 while the rest can be found on top of page 7 (pages have a header line in my layout!). Any idea how to move this hrule to the same page as the definition without using \newpage to have still a dynamic document?

  • This looks like a duplicate of this question – Seamus Aug 4 '11 at 13:15
  • But i do not understand how to fix this with my template. I have way too many theorem environments to fix them easily. – Christian Ivicevic Aug 4 '11 at 13:29
  • Philippe's answer to the linked question involved redefining the theorem environment. Does this not work for you? If not could you explain why not? – Seamus Aug 4 '11 at 13:34
  • My environment is called definition and with renewenvironment the layout is screwed. Furthermore i have problems with the counter which in fact does not exist! Seems like i have to use \clearpage or \newpage... – Christian Ivicevic Aug 4 '11 at 13:55
  • As Phileppe's answer says, theorems are defined as lists and so there are break points in them. I'm not sure there's much more help we can offer without more of a complete example and more explanation about why the solution in that other question isn't satisfactory. – Seamus Aug 4 '11 at 14:01

I think the needspace pacakge might help here. Have a look at the code below

\theoremprework{\bigskip\needspace{\baselineskip}\hrule} % note this line
\theorempostwork{\hrule\needspace{\baselineskip}\bigskip} % note this line





You can also consider using mdframed:


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.