TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two sections before the table of contents, for which I use the following code:


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

share|improve this question
A Minimal working example please. – Simurgh12 May 4 '12 at 5:16
Have you tried to remove the horizontal bar at the top by issuing the following: \renewcommand{\headrulewidth}{0pt} ? – bennettr Jun 26 '12 at 0:28
up vote 107 down vote accepted

\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

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

\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.

share|improve this answer
This however can cause problem when hyperref is used. – egreg May 4 '12 at 8:41
There is one problem left. Between the last section and the table of contents, I get one blank page with a horizontal bar at the top. The horizontal bar comes from fancyhdr. How can I clear also fancyhdr styles before the table of contents? See: i49.tinypic.com/23mvg3t.jpg – Chris May 5 '12 at 14:53
@Chris: Use \renewcommand{\headrulewidth}{0pt} to remove the header rule, and \renewcommand{\headrulewidth}{.4pt} to re-insert it. If this doesn't solve your problem completely, please update your original post with a complete, minimal example. – Werner Jun 26 '12 at 1:10
@egreg: So how can this be done if the hyperref package is used? I'm using that package and I'm getting the warning destination with the same identifier (name{page.}) has been already used, duplicate ignored<to be read again>... – StrawberryFieldsForever Apr 26 '13 at 13:40
@StrawberryFieldsForever Use \pagenumbering{Alph}, for instance, and \pagestyle{empty} for the duration. – egreg Apr 26 '13 at 13:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.