In LaTeX, if you want the first page to be devoid of page numbers while displaying them on all subsequent pages, you can achieve this by using the command \thispagestyle{empty}
. This command suppresses the page number only on the current page. However, it's important to note that the page is still counted in the numbering sequence. Notably, this command can be applied not only to the first page but to any other page as well.
Example
\documentclass{article}
\begin{document}
\thispagestyle{empty}
Test text to have content on the first page.
\newpage
Test text to have content on the subsequent page.
\end{document}
This LaTeX code creates a document where the first page has no page number displayed, while subsequent pages show page numbers as usual.
- \documentclass{article}: This line specifies the type of document you're creating, in this case, it's an article.
- \begin{document} and \end{document}: These lines mark the beginning and end of the document, respectively. Everything between them is part of the document.
- \thispagestyle{empty}: This command tells LaTeX not to display any page number or headers/footers on the current page.
- Test text to have content on the first page.: This is the text that will appear on the first page.
- \newpage: This command tells LaTeX to start a new page.
- Test text to have content on the subsequent page.: This is the text that will appear on the second page.
If you also wish to exclude the first page from the page count so that the second page starts with page number 1, you need to manipulate the page counter. By using \setcounter{page}{1}
, you reset the page counter to one.
\documentclass[a4paper, 12pt, twoside]{report}
\begin{document}
\thispagestyle{empty}
Test text to have content on the first page.
\newpage
\setcounter{page}{1}
Test text to have content on the subsequent page.
\newpage
Test text to have content on another subsequent page.
\end{document}
This LaTeX code generates a document with specific page settings:
- \documentclass[a4paper, 12pt, twoside]{report}: This line sets up the document class, specifying properties like paper size (A4), font size (12pt), and layout (twoside for double-sided printing).
- \begin{document} and \end{document}: These lines mark the beginning and end of the document, respectively.
- \thispagestyle{empty}: This command removes page numbers and headers/footers from the first page.
Test text to have content on the first page.: This is the text displayed on the first page.
- \newpage: This command starts a new page.
- \setcounter{page}{1}: This line manually sets the page number to 1. It's typically not needed since LaTeX automatically numbers pages starting from 1.
- Test text to have content on the subsequent page.: This text appears on the second page.
- Test text to have content on another subsequent page.: This text appears on the third page.