I want to get rid of pages ending with a heading title only. I want at least 2 text rows following the heading title to make a better look.

What is the exact value to be passed to \Needspace*{} to avoid this heading orphan?

  • 7
    By default, pages should not end with a heading in LaTeX. Show a minimal example as evidence to the contrary.
    – lockstep
    Jan 24, 2011 at 7:15
  • 1
    @xport: I think it was a bad idea to change your user name beyond recognition. On this site, people just got to know you under the name xport. Jan 31, 2011 at 17:47
  • @xport: If one of the answers solved your problem, please consider accepting an answer so that your question moves off the "Unanswered" list. Mar 2, 2011 at 16:46
  • @Hendrik: DONE. Mar 7, 2011 at 17:26
  • @xport: Ah, your back. While you're here, can you please also rename yourself to "xport", please? Thanks! Mar 7, 2011 at 17:37

2 Answers 2


The normal way to control orphans is to adjust the \clubpenalty variable. Try to set it to a high value. See http://www.tex.ac.uk/cgi-bin/texfaq2html?label=widows for more information.

If you want to use \Needspace*{} I would assume that 4\baselineskip is reasonable for the heading title plus two text rows. I'm simply counting the bigger heading title line twice, therefore the factor 4. You could experiment with factors between 3 and 4. The exact amount is of course dependent on the kind of heading that follows.

  • 3
    I don't think that \clubpenalty is relevant here: It controls how much first lines of paragraphs at the bottom of a page a discouraged. The present post is about single line headings. Jan 24, 2011 at 11:19
  • Ok, another thing learnt. Jan 25, 2011 at 10:44

I don't know if this is what you're looking for but you could always use \begin{samepage} and \end{samepage} to keep together the stuff that you don't want to be separated.

There should be a penalty counter though that omits this dreadful use of the samepage environment. Read this question for more info on the how to discourage latex in breaking pages after your headings.

Add the following to your preamble and you should be fine:


    {\clubpenalty \@M}{\clubpenalties 3 \@M \@M 0}{}{}
    {\clubpenalty \@clubpenalty}{\clubpenalties 2 \@clubpenalty 0}{}{}
  • 1
    Welcome to tex.sx! Note that you don't have to (and shouldn't) sign with your name since it automatically appears in the lower right corner of your post. Jan 31, 2011 at 17:45
  • haha ok. I'll try to keep that in mind.
    – romeovs
    Feb 1, 2011 at 22:56

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.