32

The FAQ refers to "pagebreak hints". I can't find any mention of these by searching (for "[page-breaking] hints" and various other things). What are pagebreak hints and how does one use them?

  • 3
    hints (to the output routine or to the paragraph builder) are given by \penalty commands. in the context of the faq answer, that would be where you are trying to keep stuff on the same page (by imposing high penalties), but the stuff itself is hinting that "here would be a good place to break" by setting a low penalty. i would welcome suggestions (to the usual faq development address) for rewording of this text -- in default of anybody else's suggestions i'll try to clarify my writing myself. – wasteofspace Nov 19 '12 at 14:13
  • I didn't mean to employ that your text was unclear -- it's more that I wanted to use said hints myself. – Mohan Nov 19 '12 at 14:14
  • It refers to the \pagebreak and \nopagebreak commands, that take an optional argument (a number from 0 to 4). – egreg Nov 19 '12 at 14:32
  • wasteofspace's answer led me to this, which is what I was interested in: tex.stackexchange.com/questions/51263/… – Mohan Nov 19 '12 at 14:39
  • See also: \goodbreak vs. \pagebreak – Martin Thoma Apr 26 '17 at 12:18
44

The answers to What are penalties and which ones are defined? can be a guide, but perhaps it's better to show the LaTeX way for suggesting page breaks.

The commands for this are \pagebreak and \nopagebreak. They can be used both in a paragraph or between paragraphs (that is, with a blank line before and after them). When in the body of a paragraph they refer to a possible page break after the line where the commands finally appear in the typeset output.

Each one takes an optional argument, a number from 0 to 4, and the unadorned commands are equivalent to specify 4.

  • \pagebreak[0] means "this is a good place for breaking a page, but don't take it too seriously"

  • \pagebreak[1] means "this is a rather nice place for breaking a page"

  • \pagebreak[2] means "this is a nice place for breaking a page"

  • \pagebreak[3] means "this is a very nice place for breaking a page"

  • \pagebreak[4] (or simply \pagebreak) means "break a page here"

  • \nopagebreak[0] means "this is a bad place for breaking a page, but don't take it too seriously"

  • \nopagebreak[1] means "this is a rather bad place for breaking a page"

  • \nopagebreak[2] means "this is a bad place for breaking a page"

  • \nopagebreak[3] means "this is a very bad place for breaking a page"

  • \nopagebreak[4] (or simply \nopagebreak) means "don't break a page here"

Specifying either \pagebreak[0] or \nopagebreak[0] is completely equivalent: the "don't take it too seriously" means just this. The sense is "this is a place where breaking is feasible", which between paragraphs or after a line is usually the case (unless it would create a widow or club line). So they can be used as a reminder that we might have something to do with page breaks there during the final revision.

Such commands should be used only during the final revision of the document, when the text is in its final form and we need to correct possible bad page breaks; in this situation we do know where to place them, if we have to use them in the body of a paragraph, because paragraph are broken into lines at an earlier stage of processing.

When a new edition of the document is prepared, then all \pagebreak and \nopagebreak commands added in the final revision should be removed, because the pagination will probably be different and a forced page break can spoil the new edition.

| improve this answer | |
  • 1
    If \pagebreak[0] and \nopagebreak[0} are indeed completely equivalent, your verbal descriptions are somewhat misleading. ;-) – lockstep Nov 20 '12 at 11:53
  • @lockstep I've added some more words. – egreg Nov 20 '12 at 12:35
  • 7
    @lockstep: They are not equal: \pagebreak[0] inserts a penalty of -4, \nopagebreak[0] of 4. – Reinstate Monica - M. Schröder Dec 9 '12 at 13:10
  • @MartinSchröder This is wrong. The inserted penalty is, in both cases, 0. The 4 appearing in the definition is the default value of the optional argument when not specified. You can easily check the log file from \documentclass{article} \showoutput \begin{document} a\par\pagebreak[0]b\par\nopagebreak[0]c \end{document} – egreg Sep 24 '16 at 21:13
  • I have a paragraph overflow two lines to the next page. Which command to use, and where to put it? Using \pagebreak at the end of the paragraph doesn't work – Ooker Dec 13 '17 at 17:57

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.