241

The commands \newpage and \clearpage both force a page break. In addition, the latter command also "flushes" all pending floats from the stack, i.e., forces them to be typeset starting on the page that follows the page break.

My question is: Is it ever a mistake to use \clearpage rather than \newpage, other than in cases where one might not want any pending floats to be flushed? From a casual inspection of the definitions of the two commands (see below), I can't tell if there's any trouble lurking in always using \clearpage.

For ease of reference, here's the definition of \newpage (from latex.ltx):

\def \newpage {%
  \if@noskipsec
    \ifx \@nodocument\relax
      \leavevmode
      \global \@noskipsecfalse
    \fi
  \fi
  \if@inlabel
    \leavevmode
    \global \@inlabelfalse
  \fi
  \if@nobreak \@nobreakfalse \everypar{}\fi
  \par
  \vfil
  \penalty -\@M}

and here's the definition of \clearpage -- note that it invokes \newpage:

\def\clearpage{%
  \ifvmode
    \ifnum \@dbltopnum =\m@ne
      \ifdim \pagetotal <\topskip
        \hbox{}%
      \fi
    \fi
  \fi
  \newpage
  \write\m@ne{}%
  \vbox{}%
  \penalty -\@Mi
}

2 Answers 2

253

Technically there is nothing wrong with using \clearpage instead of \newpage. However, the two commands have different semantics and the question is which of the semantics you are interested in.

First of all, as you already mentioned \clearpage not only ends the page, but additionally it flushes out all floats that have been deferred. On the face of it that might be a good idea but consider the following situation: you have one float waiting which is just 1/3 of the page size. Now with \newpage you start a new page and then the float algorithm (see description of this algorithm for details) would kick in and try to place waiting floats onto the next page (and most likely would assign the waiting float to the top area of the next page. In contrast \clearpage would also output this float but on a page of its own.

So in situations like a chapter start it is advisable to end the previous chapter with a \clearpage (or rather start the new one with it) to flush out all floats, but in other situations this might result fairly empty pages with only floats on them which may or may not be desired.

A second difference is \clearpage actually always starts a new “page”, while \newpage really only ends the current column – and that is a big difference in twocolumn mode. Just try the following to see the difference:

\documentclass[twocolumn]{article}
\begin{document}
A test
\newpage              % ends first column but not page
A second test
\newpage

A clearpage test
\clearpage             % ends page (which has one column)
A second clearpage test
\end{document}
5
  • 1
    Ok, I must claim I didn't think of twocolumn in my answer. But honestly: using \newpage or \clearpage inside a text block like chapter is really frowned upon in my opinion and should be done very carefully.
    – yo'
    Commented Feb 24, 2012 at 13:27
  • 4
    @tohecz sure, but the question wasn't "should I use those commands at all (or when)" --- from a structural point of view they should most certainly only be used directly in a final editing stage and even then only if really necessary. Commented Feb 24, 2012 at 13:39
  • Yes, I know and somehow agree. And the truth is, \newpage is more appropriate in that case probably.
    – yo'
    Commented Feb 24, 2012 at 14:00
  • 2
    Thanks so much, Frank, for this detailed answer. I was completely unaware of the difference in the behavior of the two commands when LaTeX is in multicolumn mode, viz, \newpage forces a new column whereas \clearpage forces a new page.
    – Mico
    Commented Feb 24, 2012 at 14:01
  • 1
    I have only ever used \clearpage that I remember .... mostly in definitions, though, where the whole point is to finish with one thing before starting another. (Or because I'm lying to LaTeX about the size of something.)
    – cfr
    Commented Jun 2 at 4:42
43

In my opinion, you can use \clearpage anywhere unless "there's a special reason for not doing so". This special reason for me is when you (for aestethic or whatever reason) really want to have:

  • a really empty page, then you call for instance \newpage\leavevmode\thispagestyle{empty}\newpage
  • something placed on a specific page or whatever (\clearpage may add more than one pagebreak if there's a lot of queued floats, whereas \newpage adds only one)
  • when you want to have two pages just next to each other (I like it when chapter title in on the left page with no text, and text starts on the right page -- then I use \newpage after typesetting the chapter title).

Surely all usage of any of these two commands should be conceptional, I mean, you shouldn't need to use them in a main text of your work, you use them in macro definitions (like my \chapter mentioned above) or in preamble/...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .