In this document, I need all of the parts before the first chapter to be numbered with roman numerals (i, ii, iii, etc.) and afterwards with arabic numerals, starting with 1. The problem I've got is in the table of contents. The page numbering correctly starts at 1, but in the table of contents, it says the first section begins on page 4 (there are 3 pages of ToC). In other words, the page numbers in the ToC don't match those actually printed on the bottoms of the pages. (Code below)

\begin{document}
\renewcommand{\thepage}{\roman{page}}
\tableofcontents
\pagebreak
\setcounter{page}{1}
\renewcommand{\thepage}{\arabic{page}}

• Welcome to TeX.sx! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. Sep 9 '13 at 23:20

If you're not using hyperref, then you should use the following sequence of commands:

\pagenumbering{roman}
\tableofcontents
\clearpage
\pagenumbering{arabic}


Depending on the document class you're using, you could also substitute the use of \pagenumbering with \frontmatter...\mainmatter. For example, book.cls defines:

\newcommand\frontmatter{%
\cleardoublepage
\@mainmatterfalse
\pagenumbering{roman}}
\newcommand\mainmatter{%
\cleardoublepage
\@mainmattertrue
\pagenumbering{arabic}}


Why is the statement about hyperref important? Resetting the page numbering to roman/arabic/whatever doesn't change the page anchor references set by hyperref. As such, there may be duplicate destinations set.