# Number on all pages of table of content

I have this issue with a LaTeX document: I want to have page numbers on every page of the Table of Content. In my case the ToC is displayed across two pages because of many chapters in the text, but the first page of the ToC does not show a page number (the second page does). I generate the ToC like this:

\newpage
\pagestyle{plain}
\setcounter{page}{5}
\tableofcontents

-

## migrated from stackoverflow.comFeb 18 '12 at 16:30

This question came from our site for professional and enthusiast programmers.

What happens if you remove \pagestyle{plain}? –  phimuemue Feb 18 '12 at 14:43
it's completely without page numbers. Probably because of \pagestyle{empty} on previous screens. –  Jiří Vlašimský Feb 18 '12 at 14:53
@JiříVlašimský: What document class are you using (perhaps memoir? It is customary for the first page of the ToC to be set similarly to what a regular \chapter* should look like. And these have their first pages set to plain using \thispagestyle. However, subsequent page should follow whatever \pagestyle you set before it. –  Werner Feb 18 '12 at 16:12
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Feb 18 '12 at 16:33
Sorry, but your question is unclear. Do you want to set the page number of your toc? –  Martin Schröder Feb 18 '12 at 17:42

\makeatletter
\newenvironment{keeppage}{\let\thispagestyle=\@gobble}{}
\makeatother


\begin{keeppage}