How to do page break and create new page in LaTeX?

Page breaks become very important from time to time for proper document structure and formatting.

In this tutorial, we will explore three primary methods to insert page breaks in LaTeX: \newpage, \clearpage, and \pagebreak. We will also discuss best practices for using these commands effectively.

Use ‘\newpage’ Command

Simplest and most commonly used method to create a page break in LaTeX is use \newpage command. This command forces LaTeX to end the current page and start a new one immediately.

It is straightforward to use, you just need to insert this command at the desired location in your LaTeX document.

\documentclass{article}
\usepackage{graphicx} % For insert image in document
\usepackage[margin=1.5cm]{geometry} % for margin
\usepackage{lipsum} % For placeholder text, remove in your actual document
\begin{document}

\title{Use of newpage command}
\author{Physics Raed}
\date{\today}

\maketitle

\section{Introduction}
\lipsum[1]
\vspace{1cm}
\lipsum[2]
\begin{figure}[htbp]
  \centering
  \includegraphics[width=1\textwidth]{example-image}
  \caption{Sample Image}
  \label{fig:sample_image}
\end{figure}
\newpage

\section{Methodology}
\lipsum[2]
\subsection{Data Collection}
\lipsum[3]
\subsection{Data Preprocessing}
\lipsum[4]
\vspace{1cm}
\begin{figure}[htbp]
  \centering
  \includegraphics[width=.5\textwidth]{example-image}
  \caption{Sample Image}
  \label{fig:sample_image}
\end{figure}

\newpage

\section{Results}
\lipsum[5]
\subsection{Table}
Here is an example of a table:
\begin{table}[htbp]
  \centering
  \caption{Sample Table}
  \begin{tabular}{|c|c|c|}
    \hline
    \textbf{Column 1} & \textbf{Column 2} & \textbf{Column 3} \\
    \hline
    1 & A & \$100 \\
    2 & B & \$200 \\
    3 & C & \$300 \\
    \hline
  \end{tabular}
\end{table}


\subsection{Image}
Here is an example of an image:

\newpage

\section{Discussion}
\lipsum[6]
\subsection{Analysis}
\lipsum[7]
\subsection{Conclusion}
\lipsum[8]

\end{document}

Output :

In this example, the content following \newpage command will start on a new page. You can use this command multiple times to insert multiple page breaks wherever necessary.

But, not all cases will work the same. Let’s say you create a two column document, which is most commonly used.

In this case, when you use \newpage command, Next elements of this command will move to next column instead of going to the new page.

\documentclass[twocolumn]{article}
\usepackage{lipsum} % For placeholder text, remove in your actual document
\usepackage[left=1cm,top=1cm,right=1cm]{geometry} % for page margin
\begin{document}

\section{Introduction}
\lipsum[1]
\section{Methodology}
\lipsum[3]
\vspace{1cm}
\lipsum[5]

\newpage % Page break to start a new column

\section{Results}
\lipsum[7-8]
\subsection{Analysis}
\lipsum[9]
\subsection{Conclusion}
\lipsum[10]

\newpage % Page break to start a new column

\section{Discussion}
\lipsum[11-12]
\section{References}
\lipsum[13]

\end{document}

Output:

Use ‘\pageclear’ Command

Before exploring second method, you should have an understanding of LaTeX’s float element.

In LaTeX, a float is a type of element that does not have a fixed position within the text and can “float” to a more suitable place in the document, typically to avoid large gaps or empty spaces. Most common types of floats are figures and tables.

The \clearpage command, similar to \newpage, also creates a page break. However, it goes a step further by ensuring that all pending floats (such as figures and tables) are processed and placed before starting the new page.

This can be particularly useful when you want to ensure that all figures and tables are displayed before the next section of your document.

\documentclass{article}
\usepackage{lipsum,graphicx} % For generating dummy text
\usepackage[margin=1.5cm]{geometry}
\begin{document}
\section{Introduction}
\lipsum[1]
\vspace{1cm}
\lipsum[3]
\vspace{1cm}
\lipsum[6-7]
\begin{figure}[h]
  \centering
  \includegraphics[width=1\textwidth]{example-image-a}
  \caption{Example Figure A}
\end{figure}
\lipsum[4]
\begin{table}[h]
    \centering
    \caption{A 6,5 Table Example}
    \vspace{10px}
    \begin{tabular}{|c|c|c|c|c|c|}
        \hline
        Column 1 & Column 2 & Column 3 & Column 4 & Column 5 & Column 6 \\
        \hline
        Item 1 & 100 & 200 & 300 & 400 & 500 \\
        \hline
        Item 2 & 101 & 201 & 301 & 401 & 501 \\
        \hline
        Item 3 & 102 & 202 & 302 & 402 & 502 \\
        \hline
        Item 4 & 103 & 203 & 303 & 403 & 503 \\
        \hline
        Item 5 & 104 & 204 & 304 & 404 & 504 \\
        \hline
        Item 6 & 105 & 205 & 305 & 405 & 505 \\
        \hline
    \end{tabular}
\end{table}
\lipsum[3]
\clearpage
\section{Methods}
\lipsum[5]
\end{document}

Output:

Use ‘\pagebreak’ Command

By default, \pagebreak command doesn’t take any arguments and behaves similarly to \newpage, inserting a page break without clearing any pending floats. For example

\documentclass{article}
\usepackage[margin=1.5cm]{geometry} % for page margin
\usepackage{lipsum} % For generating dummy text

\begin{document}

\section*{Section 1: 1st Page}
\lipsum[1] % Generates 1` paragraphs of dummy text
\vspace{1cm}
\lipsum[2-3]
\vspace{1cm}
\lipsum[4]
\pagebreak % Forces a page break
\section*{Section 2 : Start New page}
\lipsum[4-6] % Generates 3 more paragraphs of dummy text
\end{document}

But, \pagebreak command allows for more fine-grained control over page breaks. Unlike previous two commands, \pagebreak takes an optional argument that specifies how desirable a page break is at that particular location. And argument can be a number from 0 to 4, where 0 means “not desirable” and 4 means “very desirable.”

Here’s the syntax for using optional argument:

\pagebreak[]

[0]: This is default behavior when no priority is specified. It suggests a page break, but it is not an absolute demand. LaTeX will try to find a suitable place to break page based on other factors like available content and float placement rules.

[1-3]: These intermediate priority values indicate a stronger suggestion for a page break. As you increase the priority value from 1 to 3, the likelihood of LaTeX breaking page at that point increases. However, LaTeX will still consider other factors and may not always honor page break at the specified location.

[4]: Using a priority of 4 makes page break almost an absolute demand. LaTeX will prioritize breaking page at this point over other considerations, and it becomes more likely that the page break will happen where you specify it.

\documentclass{article}
\usepackage[margin=1.5cm]{geometry}
\usepackage{lipsum} % 

\begin{document}

\section*{Section 1}
\lipsum[1-3]

\pagebreak[3] % Suggest page break with priority 3

\section*{Section 2}
\lipsum[4-6]

\pagebreak[1] % Suggest page break with priority 1

\section*{Section 3}
\lipsum[7-9]

\pagebreak[4] % Suggest page break with priority 4

\section*{Section 4}
\lipsum[10-12]

\end{document}

Output:

In this example, we use different priority values with \pagebreak before each section.

Before Section 1: Since Priority is 3, there is a relatively strong suggestion to break page here, but LaTeX may still consider other factors.

Before Section 2: Priority is 1, so LaTeX may or may not break page at this point, depending on other factors.

Before Section 3: With priority 4, Page break here becomes almost an absolute demand, and LaTeX will likely honor it.

Before Section 4: No priority is specified here, so it behaves like \newpage, and LaTeX will break page if necessary.

Best Practices

Use \newpage for standard page breaks: For most cases, \newpage command is sufficient for creating standard page breaks. Use it when you want to ensure that the content following it starts on a new page.

Utilize \clearpage when dealing with floats: If your document contains many floats (figures and tables), use \clearpage when you want to force all pending floats to be displayed before the next page begins.

Reserve \pagebreak for fine-tuning: \pagebreak command with optional arguments can be used for fine-tuning page breaks, but it’s generally not necessary for routine usage. Reserve it for situations where you need more control over the page breaks.

Let LaTeX handle most page breaks automatically: In normal circumstances, it’s best to let LaTeX handle page breaks automatically. Trust its typesetting algorithms to produce a well-formatted document.

Consider document class options: Some document classes, such as twocolumn, have specific page layout settings. Be mindful of the document class you are using, as it may affect page breaks and formatting.

Md Jidan Mondal

LaTeX expert with over 10 years of experience in document preparation and typesetting. Specializes in creating professional documents, reports, and presentations using LaTeX.

Leave a Comment

Your email address will not be published. Required fields are marked *