Among LaTeX’s page-break commands, \newpage and \pagebreak differ inside latex.ltx by exactly one \vfil. \newpage is \vfil \penalty -10000; \pagebreak is the same \penalty -10000 without the \vfil. That single infinitely stretchable space is the whole difference between throwing the rest of the page away as white and stretching the text down to the bottom margin. \clearpage goes one step further and drops \penalty -10001 — a value one greater than TeX’s infinity, and that is the trick which forces the pending floats out. This page covers \pagebreak[n], \newpage, \clearpage, \cleardoublepage, \nopagebreak[n], \samepage, needspace and \enlargethispage, with the results of actually compiling them.
Let us be clear about the layer. This page owns the commands that intervene in a page break on the spot. Document-wide rhythm — \widowpenalty and \clubpenalty (both defaulting to 150 in the standard classes), the choice between \raggedbottom and \flushbottom, how much of a page floats may occupy, and the diagnosis of why a page ended where it did — is treated in depth on the page-break design page. Its central rule holds here too: tune page breaks last. Add a single character and every subsequent break shifts, so scattering \newpage before the text has settled leaves odd gaps behind after each revision. Treat everything below as final-stage tooling.
\pagebreak versus \newpage: stretch the rest, or throw it away
Both end the page at that point, but they treat the leftover vertical space in opposite ways. \newpage puts a \vfil there before breaking, and that infinitely stretchable space soaks up everything left, so the foot of the page is simply left blank. \pagebreak places no \vfil, so the glue already on the page — the leading between lines and the like — is stretched instead, and the text spreads down to the bottom margin. Choose \newpage when you mean “stop here”, as at the end of a chapter, and \pagebreak when you would rather open the leading slightly than leave the page short. One side effect: \pagebreak can break in the middle of a paragraph.
The n in \pagebreak[n] uses exactly the same machinery as \linebreak[n] on the line side: it goes through \@getpen in latex.ltx and, with the values in article.cls, translates into 0, 51, 151, 301 and 10000. \pagebreak inserts them negative, \nopagebreak positive; omit the argument and both default to 4, that is ∓10000. It is enough to remember that [0] is permission to break here and only [4] is an order. Note that in a document under \flushbottom — a twoside article, or book by default — \pagebreak can leave the page unable to fill, reporting Underfull \vbox (badness 10000) has occurred while \output is active. Measured: that line appeared in the log as soon as a mid-paragraph \pagebreak was placed in a twoside article. Under \raggedbottom the warning never fires, because a short page is allowed.
\clearpage versus \newpage: why a figure gets stranded in the next section
\clearpage outputs every pending float (figure and table) before it breaks; \newpage does not. How much that changes is easy to see. Take a document with body text, Figure A, Figure B and then a \section*, and compile it three ways. With nothing inserted, page 1 carries the section heading and Figure A, page 2 carries Figure B. Insert \newpage and the document still runs to two pages, but the heading and Figure B now share page 2 — the section that was supposed to come after the figures has jumped ahead of Figure B. Insert \clearpage and it becomes three pages: Figure A on page 1, Figure B on page 2, and only then the heading on page 3. When the order of figures carries meaning, the boundary between sections wants \clearpage.
\begin{figure}[b]\centering\rule{4cm}{3cm}\caption{Figure A}\end{figure}
\begin{figure}[b]\centering\rule{4cm}{3cm}\caption{Figure B}\end{figure}
% \newpage -> heading and Figure B end up together on page 2
% \clearpage -> Figure A p.1, Figure B p.2, heading p.3
\clearpage
\section*{This section must come after its figures}The trick is the definition itself. \clearpage calls \newpage and then places \write\m@ne{}, an empty \vbox{}, and \penalty -\@Mi. \@Mi is 10001 — one greater than TeX’s infinity — which makes the output routine run once more and drains the queue of deferred floats. One warning here. In two-column mode \newpage ends only the column. Measured: in a twocolumn article, text after a \newpage dropped into the right-hand column of the same page and the page did not change; \clearpage in the same document was the first thing that moved to the next page. If you want a new page in two columns, use \clearpage or \cleardoublepage.
\cleardoublepage: always open a chapter on a right-hand page
\cleardoublepage runs \clearpage and then, only under twoside, inserts a blank page so the next body text starts on an odd-numbered (right-hand) page. The definition is short enough to read aloud: after \clearpage, if twoside is in force and the page number is even, do \hbox{}\newpage. That \hbox{} exists to make the page look non-empty; without it the blank page would be discarded rather than printed. In two-column mode the step is repeated twice. This is the mechanism behind bound books whose chapters always open on the recto, and \chapter in the book class calls it by default. Under one-sided printing the condition never holds, so it behaves exactly like \clearpage.
Forbidding a page break here: \nopagebreak works, \samepage does not
\samepage cannot hold consecutive paragraphs together. The measurement is unforgiving, so here it is first. In a document with six one-line paragraphs near the foot of a page, the plain version puts BLOCK1–4 on page 1 and BLOCK5–6 on page 2. Wrap those six paragraphs in \begin{samepage} … \end{samepage}, or group them as {\samepage …}, and the split is exactly the same. The definition explains why: \samepage is a declaration that sets nine parameters — \interlinepenalty, \predisplaypenalty, \postdisplaypenalty, \interdisplaylinepenalty, \@beginparpenalty, \@endparpenalty, \@itempenalty, \@secpenalty and \interfootnotelinepenalty — to \@M (10000), and none of those nine governs the seam between one paragraph and the next. It protects the inside of a paragraph, the gaps between list items, and the space around a displayed formula; an ordinary paragraph break passes straight through.
To protect one specific seam, \nopagebreak[n] is the right answer. In the same experiment, dropping a \nopagebreak at the BLOCK4/BLOCK5 boundary moved the break to between 3 and 4, and BLOCK4 travelled to the next page with BLOCK5 and 6. Putting it just before or just after the paragraph made no difference. \nopagebreak only places a penalty at that point — through \vadjust in horizontal mode, directly in vertical mode — which makes it the most reliable tool when you know exactly which seam must not be torn: between a heading and the text that follows it, or between a figure and its explanation. For the different request “keep this whole block of N lines together”, needspace below is the better fit.
% Measured: six one-line paragraphs at the foot of a page split 4 | 5.
% \samepage around all six changes nothing.
% \nopagebreak at the seam moves the split to 3 | 4.
BLOCK4\par\nopagebreak
BLOCK5\par
% Reserve room instead of forbidding a break:
\usepackage{needspace}
\needspace{6\baselineskip}
% Or make just this one page one line taller:
\enlargethispage{\baselineskip}The needspace package: “start a new page unless six lines still fit”
\needspace{6\baselineskip} is a conditional: “if six lines’ worth of height does not remain between here and the foot of the page, break now.” Add \usepackage{needspace} to the experiment where \samepage failed and put \needspace{6\baselineskip} before the six paragraphs, and all of BLOCK1 through 6 moved to page 2. Because it reserves room rather than forbidding a break, it never fails silently the way \samepage does. Expressing the length as a multiple of \baselineskip is the intuitive choice, though pt or cm work too. There is also \Needspace{...}, which reserves the space more exactly, and \Needspace*{...}, which keeps a short page flush at the foot under \flushbottom; those two are used between paragraphs. This is the most straightforward way to stop a heading being stranded alone at the bottom of a page.
\enlargethispage: make this one page a line taller
\enlargethispage{\baselineskip} temporarily enlarges the \textheight of the current page only, letting one more line fit. The effect is countable. In an article fed 120 one-line paragraphs, the last line on page 1 was LINE46 untouched. Add \enlargethispage{\baselineskip} and it becomes LINE47; {2\baselineskip} gives LINE48; a negative {-\baselineskip} shrinks the page to LINE45 instead. Exactly what was asked for. The implementation is refreshingly honest: latex.ltx fools the page’s target height by pushing a negative \vskip into an insert named \@kludgeins — LaTeX itself calls the mechanism a kludge, which says a good deal about the command’s character. When you must squeeze a line in even at the cost of tightening the spacing, use the starred \enlargethispage*{\baselineskip}.
The usual occasion for this command is cleaning up a stranded line. When the last line of a paragraph is left alone at the top of the next page — a widow — making that page one line taller with \enlargethispage{\baselineskip} pulls the runaway back and the widow disappears. You can also forbid widows document-wide by raising \widowpenalty to 10000, but the price — page feet that no longer line up, and an Underfull \vbox under \flushbottom — is compared with measurements on the page-break design page. The rule for the final pass is: settle the majority with a global setting, then treat the few survivors individually with \enlargethispage. Always leave a comment beside a hand-placed line. After the text is revised, only that comment will tell you whether the fix has become harmful.
| Command | What it does | Watch out |
|---|---|---|
\pagebreak[n] | Inserts penalty −(0/51/151/301/10000); no \vfil, so the text stretches to the foot | Can break mid-paragraph; may report Underfull \vbox under \flushbottom |
\newpage | \vfil \penalty -10000; leaves the rest of the page blank | In two columns it ends only the column; it does not flush floats |
\clearpage | \newpage plus \penalty -10001; outputs every pending float before breaking | Belongs at a section boundary; mid-text it leaves a large hole |
\cleardoublepage | \clearpage, then under twoside resumes on an odd (right) page, inserting a blank if needed | Identical to \clearpage under oneside; the step runs twice in two columns |
\nopagebreak[n] | Inserts penalty +(0/51/151/301/10000) at that point | Most reliable when one specific seam must not tear — a heading and its text |
\samepage | A declaration setting nine penalties to 10000 (also usable as an environment) | Does not act between paragraphs. Measured: it failed to stop a BLOCK4/5 split |
\needspace{N\baselineskip} | Break now unless N lines’ worth of space remains (from the needspace package) | Reserves rather than forbids — ideal for keeping a heading with its first lines |
\enlargethispage{\baselineskip} | Temporarily enlarges only this page’s \textheight; measured, LINE46 became LINE47 | A negative length shrinks it; the starred form squeezes a line in |
The pagination pass: what to inspect, in what order
Start the pagination pass only when the body, the floats and the bibliography are all in place. There is an order. First look for floats backing up, and flush them with \clearpage where needed. Next protect any heading that would be stranded at the foot of a page, using needspace. Last, treat the conspicuous stranded lines individually with \enlargethispage. Scatter \newpage only where the structure of the chapters genuinely demands it. Leave a comment giving the reason wherever you intervened — six months from now you will not remember why that \enlargethispage is there.
- Use
\clearpageor\cleardoublepageat chapter and appendix boundaries. It stops figures drifting into the next part; in two columns\newpageis not enough. - Reserve about
\needspace{3\baselineskip}before a heading. Reserve room rather than forbid a break, and do not count on\samepage. - When one specific seam must hold, use
\nopagebreak. A figure and its explanation; a heading and its first paragraph. - For a single stranded line,
\enlargethispage{\baselineskip}. Check both the amount of white and the alignment of the page feet before applying it. - Comment every hand-placed page break. That one line is the only thing that will tell you whether to remove it after the text changes.