In LaTeX, creating a new page is a common operation, especially when organizing content or structuring documents. There are several commands available for this purpose, each with its specific usage.
The \newpage
command is used to create a new page in LaTeX. However, it will only generate a new page if there is content to be displayed on that page. It's important to note that even a simple space or \quad
(a space equivalent to the width of a character 'M') counts as content.
\documentclass{article} \begin{document} How do I create a new page in \LaTeX{}? \newpage The \newpage command creates a new page. \newpage \quad % Without \quad, this page would not be inserted! \newpage But only if there is content on the page! It could be as simple as a space or a quad. \end{document}
We start with the document class declaration (\documentclass{article}
) and begin the document with \begin{document}.
To create a new page in LaTeX, we use the \newpage
command. This command instructs LaTeX to start a new page at that point in the document.
In the provided example, we use \newpage
twice. The first \newpage
command creates a new page after the text "How do I create a new page in LaTeX?" The second \newpage command is followed by \quad
, which inserts a space on the page. This illustrates that a new page is created only if there is content on the page. Finally, we end the document with \end{document}
.
The \clearpage
and \cleardoublepage
commands also initiate a page break like \newpage
. Additionally, any floating objects (such as images, tables, etc.) that have not yet been output will be placed on the next page.
The difference between \clearpage
and \cleardoublepage
is that \cleardoublepage
ensures that the next page is an odd-numbered (right-hand) page. And \clearpage
is used for one-side (e.g. article) and \cleardoublepage
for so-called two-side documents (e.g. book). These commands are commonly used to organize page breaks between the title page, tables of contents, and appendices, or when dealing with pages containing tables or images.
These commands are used similarly to \newpage
. They can be placed in the document where a page break is desired.