Page Breaks in LaTeX: newpage, clearpage, and pagebreak
Date Published

Page Breaks in LaTeX
Control exactly where pages end and begin in your LaTeX documents. This guide covers the four page-break commands and how they differ, how to forbid a break, how floats interact with breaks, how to print "Page 3 of 12", and how breaks work in Beamer and long tables.
Quick answer: How do you start a new page in LaTeX? Write \newpage where the page should end. Use \clearpage instead when figures or tables are still waiting to be placed: it starts a new page and prints all pending floats first. \pagebreak also breaks the page but stretches the text above to fill it, and takes an optional strength [0] to [4].
newpage vs clearpage vs pagebreak: \newpage = end the page (in two-column mode, only the column); \clearpage = end the page and flush figures and tables; \pagebreak = end the page and spread the text vertically.
New Page in LaTeX: \newpage, \clearpage and \pagebreak in One Example
Copy this complete example (use the copy button). It compiles to six pages, including a blank page made with \newpage\null\newpage:
1\documentclass{article}2\begin{document}34Text on page 1.56\newpage % start a new page here78Text on page 2.910\begin{figure}[htbp]11 \centering12 \rule{0.6\textwidth}{4cm}13 \caption{A figure LaTeX may still be holding back}14\end{figure}1516\clearpage % new page, but print every pending figure and table first1718Text on page 3.1920\pagebreak % break here and stretch page 3 to fill it (with \flushbottom)2122Text on page 4.2324\newpage25\null % an empty box, so the next \newpage makes a blank page26\newpage2728Text on page 6, after a blank page 5.2930\end{document}
Try this in Octree — free LaTeX editor with AI, compiles in your browser
The Three Main Commands
\newpage
Starts a new page immediately:
\newpage
Behavior:
- Ends current page
- Starts new page
- In two-column mode, moves to next column only
\clearpage
Stronger than newpage:
\clearpage
Behavior:
- Ends current page
- Flushes all pending floats (figures, tables)
- Starts new page
- In two-column mode, starts new page (not just column)
\pagebreak
Suggests a page break:
\pagebreak
Behavior:
- Suggests breaking here
- LaTeX may stretch text to fill page
- Can take optional strength argument
The stretching is the visible difference from \newpage: \pagebreak ends the page but still justifies it vertically, so in a \flushbottom document (the default for two-sided classes) the paragraphs are spread out to reach the bottom margin. \newpage leaves the rest of the page empty instead.
\newpage vs \clearpage vs \cleardoublepage vs \pagebreak
Command | Ends the page | Flushes pending floats | Two-column behavior | Two-sided behavior | Fills the page |
|---|---|---|---|---|---|
| yes | no | next column | next page | no, leaves space |
| yes | yes | next page | next page | no |
| yes | yes | next page | next odd page, inserting a blank page if needed | no |
| yes (optional priority) | no | next column | next page | yes, stretches to fill |
\cleardoublepage is the command \chapter uses in the book class, which is why chapters always start on a right-hand page. It only differs from \clearpage when the class is two-sided, such as book or any class with the twoside option.
When to Use Each
Use \newpage when:
- Starting a new section that should begin on fresh page
- Separating chapters or major sections
- You don't have pending floats
Use \clearpage when:
- You want all figures/tables placed before continuing
- Before a new chapter with pending floats
- Before appendices or bibliography
Use \pagebreak when:
- You want LaTeX to consider breaking here
- The break is optional/suggested
- You want text stretched to fill
Optional Arguments
\pagebreak with strength
\pagebreak[0] — suggest break (lowest priority)
\pagebreak[1] — might break
\pagebreak[2] — probably break
\pagebreak[3] — strongly prefer break
\pagebreak[4] — force break (same as no argument)
The number is a priority from 0 to 4. Values below 4 only change how attractive the break is to LaTeX's page builder; it will still break elsewhere if that produces a better page. This makes \pagebreak[2] or [3] the polite option when you want to nudge a break without guaranteeing it.
\nopagebreak
Prevent breaks:
\nopagebreak — suggest no break
\nopagebreak[4] — force no break
Keeping Lines Together: \needspace and \samepage
A heading stranded at the bottom of a page is the most common layout complaint. The needspace package solves it by asking for a minimum amount of free space and starting a new page if it is not available:
\usepackage{needspace}
\needspace{3\baselineskip} \subsection{Results}
\needspace is fast but approximate; \Needspace{5\baselineskip} measures exactly and, if it has to break, leaves the page short like \newpage. The starred \Needspace*{...} stretches the page to the bottom margin instead. Use \needspace for headings and \Needspace when the exact amount matters.
To keep a short block on one page, use the samepage environment or declaration:
\begin{samepage} Content that should stay together. \end{samepage}
\samepage works by forbidding breaks between the lines of its content. It is reliable for a few lines but cannot move a block that is longer than a page; for a heading plus the start of its text, \needspace is the better tool.
\enlargethispage: squeezing a little more onto a page
When a page is one or two lines short of holding a paragraph, extend it instead of breaking:
\enlargethispage{2\baselineskip}
It applies to the current page only. The starred form \enlargethispage*{\baselineskip} also shrinks flexible vertical space on the page so the extra lines fit, and a negative value shortens the page.
In Two-Column Documents
\newpage — next column only
\clearpage — next page (both columns)
\cleardoublepage — next odd page (for book class)
Blank Pages
Add blank page:
\newpage \thispagestyle{empty} \mbox{} \newpage
Clear to even/odd page:
\cleardoublepage — next odd page
\clearpage\ifodd\value{page}\mbox{}\clearpage\fi — next even
The second line reads: clear the page, and if the page you are now on is odd, insert an empty page so the next content lands on an even one. Swapping the test to \ifodd...\else...\fi gives the next odd page, which is just \cleardoublepage written by hand.
Controlling Float Placement
Before a section with many figures:
\FloatBarrier — from placeins package
Forces all floats to appear before this point.
Figures that force page breaks
A figure taller than about 70% of the text height cannot share a page with text, so LaTeX puts it on a float page by itself and leaves a short page behind. And \clearpage dumps every waiting float, which can produce a run of figure-only pages at the end of a chapter. Fixes:
- Scale large figures down with
\includegraphics[height=0.6\textheight]{...}so text can share the page. - Loosen the placement rules with
\begin{figure}[htbp]or thefloatpackage's[H]. - Use
\FloatBarrierinstead of\clearpagewhen you want floats placed but do not want a new page. - Load
\usepackage[section]{placeins}to put a barrier at every\sectionautomatically.
Counting Pages: \pageref{LastPage} and the Total Number of Pages
The footer "Page 3 of 12" needs the total number of pages. LaTeX does not know it on the first pass, so every method below works by writing the count to the .aux file and reading it back on the next compile. Always compile twice, or use latexmk, which repeats until the references settle.
The lastpage package
lastpage defines a label LastPage on the final page. Combine it with fancyhdr for the footer:
\usepackage{lastpage} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \cfoot{Page \thepage\ of \pageref{LastPage}}
The \ ` after `\thepage restores the space that TeX would otherwise swallow after a command name. Until the second compile, \pageref{LastPage} prints ??.
With hyperref: \pageref*
If hyperref is loaded, \pageref{LastPage} becomes a clickable link, which usually looks wrong in a footer. The starred form suppresses the link:
\cfoot{\thepage\ of \pageref*{LastPage}}
totcount and totpages
lastpage reports the number printed on the last page, so in a book with roman front matter and arabic page numbers restarting at 1, \pageref{LastPage} gives the last arabic number, not the physical total. Two alternatives:
\usepackage{totpages} provides \pageref{TotPages}, which counts physical pages shipped out regardless of numbering style. It cannot be loaded together with lastpage, so pick one.
\usepackage{totcount} is the general tool for totals of any counter: \regtotcounter{section} in the preamble and \total{section} in the text. It also accepts \regtotcounter{page}, but be aware that the page counter has already been stepped past the final page when the total is recorded, so \total{page} prints one more than the last page number. For pages, prefer lastpage or totpages.
Counting pages of an included PDF
With pdfpages, the pages of an external PDF are shipped out as ordinary pages, so they are included in \pageref{LastPage}. To count them separately, put a label before and after the include:
\usepackage{pdfpages}
Cover page.\label{before} \includepdf[pages=-, pagecommand={\thispagestyle{fancy}}]{report.pdf} \label{after}
The included PDF spans \pageref{after} minus \pageref{before} minus 1 pages. The pagecommand option matters here: by default \includepdf sets the inserted pages with \thispagestyle{empty}, so a "Page x of y" footer would vanish on them unless you pass fancy through.
Page Break Inside Environments
In tables:
Use longtable package for multi-page tables.
In lists:
\pagebreak between items
In equations:
Use \allowdisplaybreaks (from amsmath, in the preamble) to allow page breaks inside align and other multi-line environments. It accepts a priority like \pagebreak: \allowdisplaybreaks[2]. A single \\* keeps the next line attached even when breaks are allowed.
Page Breaks in Beamer and Tables
Beamer: allowframebreaks and \framebreak
A frame is a single slide, so by default content that overflows is simply cut off. The allowframebreaks option lets Beamer split a frame across as many slides as it needs, appending roman numerals to the title:
\begin{frame}[allowframebreaks]{Long frame} First part of the content. \framebreak Second part on the next slide. \end{frame}
\framebreak forces a break at that point; without it Beamer breaks wherever the slide fills up. Overlays such as \pause are not supported in breakable frames, so reserve allowframebreaks for long bibliographies and split normal content into separate frames by hand.
longtable: tables that span pages
A tabular is a single unbreakable box. longtable breaks rows across pages and repeats headers:
\usepackage{longtable}
\begin{longtable}{ll} \caption{Results}\\ \hline Name & Value \\ \hline \endfirsthead \hline Name & Value \\ \hline \endhead \hline \multicolumn{2}{r}{continued on next page} \\ \endfoot \hline \endlastfoot A & 1 \\ B & 2 \\ \end{longtable}
\endfirsthead and \endhead define the header for the first page and for continuation pages; \endfoot and \endlastfoot do the same at the bottom. Write \pagebreak or \nopagebreak after a row to influence where the split happens, or \\* to forbid a break after that row. Column widths depend on every page, so longtable needs two or three compiles to settle.
Common Patterns
Before bibliography:
\clearpage \bibliographystyle{plain} \bibliography{refs}
Before appendices:
\clearpage \appendix
Chapter starts (book class):
Chapters automatically start new page.
Troubleshooting
Problem: Floats appearing in wrong place Solution: Use \clearpage before critical sections
Problem: Too much white space Solution: Use \pagebreak instead of \newpage
Problem: Page break mid-paragraph Solution: Add \nopagebreak or use \samepage
Problem: Heading at the bottom of a page Solution: \needspace{3\baselineskip} before the heading
Problem: \pageref{LastPage} prints ?? Solution: Compile a second time, or run latexmk
Problem: \pagebreak ignored inside a table Solution: Switch from tabular to longtable
Common Page Break Errors in LaTeX
\newpage twice does not give a blank page
LaTeX discards a page that has nothing on it, so \newpage\newpage produces a single break. Fix: put an invisible box on the empty page, \newpage\null\newpage (or \mbox{} instead of \null), and add \thispagestyle{empty} if the page number should not show.
\newpage only moves to the next column
In a twocolumn document (or inside multicols) \newpage ends the column, not the page. Fix: use \clearpage to jump to the top of the next page, or \onecolumn / \twocolumn, which always start a new page.
Underfull \hbox (badness 10000) before \newpage
Ending the last line with \\ right before \newpage (as in Text.\\ \newpage) creates an empty line and the warning "Underfull \hbox (badness 10000) in paragraph". Fix: drop the \\ and leave a blank line before \newpage.
Underfull \vbox or huge gaps after \pagebreak
\pagebreak stretches the space between paragraphs so the short page reaches the bottom margin, which shows up as big gaps and "Underfull \vbox (badness 10000) has occurred while \output is active". Fix: use \newpage when the page should stay short, or put \raggedbottom in the preamble.
Keep Content Together
\begin{samepage} Content that should stay together. \end{samepage}
Or:
\nopagebreak Following line stays with previous.
Frequently Asked Questions
How do I start a new page in LaTeX?
Write \newpage where the break should happen. If figures or tables are still waiting to be placed, use \clearpage instead so they are printed before the new page starts.
What is the difference between \newpage and \clearpage?
\newpage ends the page; \clearpage ends the page and also outputs every pending float. In two-column mode \newpage moves to the next column while \clearpage moves to the next page.
How do I force a page break in LaTeX?
\newpage, \clearpage and \pagebreak all force one. The difference is that \pagebreak stretches the current page vertically to fill it and accepts a priority from 0 to 4; \newpage leaves the remaining space blank.
How do I prevent a page break?
Use \nopagebreak between paragraphs, wrap the material in a samepage environment, or reserve space with \needspace{...} from the needspace package before a heading.
How do I show the total number of pages?
Load lastpage and write \thepage\ of \pageref{LastPage} in a fancyhdr footer. Compile twice. Use \pageref*{LastPage} to remove the hyperlink when hyperref is loaded, and totpages instead of lastpage if you need the physical count across differently numbered sections.
Why does my figure jump to the next page?
It is too tall to share a page with text, or it reached a \clearpage. Reduce its height, allow more placement options with [htbp], or use \FloatBarrier from placeins to pin it before a section.
What is the difference between \newpage and \pagebreak?
Both end the page. \newpage fills the rest of the page with empty space, so the text stays at the top. \pagebreak stretches the vertical space so the text reaches the bottom margin (in two-sided and \flushbottom documents), and with an argument below 4 it is only a suggestion. Mid-paragraph, \pagebreak breaks after the current line while \newpage breaks immediately.
How do I add a blank page in LaTeX?
Write \newpage\null\thispagestyle{empty}\newpage. The \null gives the page content so LaTeX does not skip it. In the book class, \cleardoublepage inserts a blank page automatically when the next chapter needs to start on an odd page.
Control Pages with Octree
Octree helps with page layout:
- Visual page break indicators
- Preview pagination instantly
- AI suggests break placement
- Export polished PDFs
Try it at https://useoctree.com
Try this in Octree — free LaTeX editor with AI, compiles in your browser

Learn LaTeX in 2025 with modern AI-powered tools. From setup to advanced tips, this guide helps you write papers, resumes, and documents like a pro.

Introducing Octree — an open-source AI-LaTeX editor with smart BibTeX management, TikZ visualization, and AI-assisted writing.

Discover how Octree compares to Overleaf — from AI-assisted LaTeX writing and TikZ/BibTeX automation to open-source flexibility and offline editing for researchers.