4

I read that "\pagebreak tries to make the part of the page that’s above the page break the same height as other pages if it’s possible (by stretching intervals between paragraphs etc) and \newpage just fills the page with empty space." in the accepted answer to this question: \pagebreak vs \newpage: enter image description here

However, when I tried using them myself with the following code:

\documentclass{article}
\usepackage{lipsum}

\begin{document}

\section{} \lipsum[1-2]

\pagebreak \section{} \lipsum[3-4]

\newpage \section{} \lipsum[1-2]

\end{document}

I don't think the text on any of my pages has spread out: enter image description here enter image description here enter image description here

What is happening? Is it that I'm using the 2 commands incorrectly?

Claire
  • 157

1 Answers1

5

You are using article class in its default onside setting so \raggedbottom is in effect. Add \flushbottom to see the effect that you were expecting.

It is not really that \pagebreak spreads things out it just doesn't add any extra space to leave the page short. It is like \linebreak in linebreaking. If the paragraph is being justified, \linebreak forces a line break and the line will be spread out to maintain justification, but if the paragraph is being set ragged then \linebreak will act in more or less the same way as \newline or \\ and leave the line short.

Here \pagebreak forces a page break and does nothing about space so the line is stretched or not depending on whether \raggedbottom or \flushbottom is being used. Conversely \newpage adds stretch space so the page is left short even when flush bottom is in effect, just as \newline forces a short line even in justified paragraphs.

palapapa
  • 103
David Carlisle
  • 757,742