[Tex/LaTex] How to avoid numbering the first page of the document

page-numbering

I have two sections before the table of contents.

\documentclass{article}
\usepackage{lipsum}
\begin{document}
\thispagestyle{empty}
\section*{First random title} \lipsum[1]
\section*{Second random title} \lipsum[2]
\clearpage
\tableofcontents
\section{First section} \lipsum[3]
\section{Second section} \lipsum[4]
\section{Last section} Wombat \lipsum[5]
\end{document}

The problem is, that LaTeX starts the page numbering on the first page and I don't want that. I want the page numbering to start after the table of contents. How can I do this?

Best Answer

\pagenumbering can be helpful in removing page numbers and resetting it, at the same time. The following minimal example, using the article document class, removes the page numbers until the ToC, and then starts it again at 1 (set using \arabic):

enter image description here

\documentclass{article}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\begin{document}
\pagenumbering{gobble}% Remove page numbers (and reset to 1)
\clearpage
\thispagestyle{empty}
\section*{First random title} \lipsum[1]
\section*{Second random title} \lipsum[2]
\clearpage
\pagenumbering{arabic}% Arabic page numbers (and reset to 1)
\tableofcontents
\section{First section} \lipsum[3]
\section{Second section} \lipsum[4]
\section{Last section} \lipsum[5]
\end{document}

\pagenumbering{gobble} sets the "page number printing macro" to \@gobble, which eats its argument/contents. \pagenumbering{arabic} resets this to \arabic{page}.

The principle holds for other (standard) document classes as well.