Take the 2-minute tour ×
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.

1 Answer 1

\nopagebreak makes it infinitely bad to break at that point. So TeX will not break at that node However it is possible that it breaks at that point visually for example

 blah blah

 \nopagebreak
 \hrule height 0pt
 \pagebreak[2]


 blah blah

Then TeX will not break above the invisible rule, but may break after the invisible rule. So it may seem that adding \nopagebreak has not worked.

In complicated macros like section headings that are adding multiple penalties and spaces, each of which separately introduces a potential breakpoint it can be quite hard to prevent page breaking with a single \nopagebreak but the details depend on the exact details of the macro, and where it is inserting vertical space and penalties.

share|improve this answer
    
Can you give an example where the output is visually affected by a single \nopagebreak command? –  Ari Brodsky Sep 2 at 1:48

Your Answer

 
discard

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.