Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

wrong page numbering

59 views
Skip to first unread message

Francois Coppex

unread,
Nov 4, 2001, 7:32:15 AM11/4/01
to
I use

\pagenumbering{roman}
\setcounter{page}{1}
\tableofcontents
\pagenumbering{arabic}
\setcounter{page}{1}
\input chap1.tex

with the book document class in order to have the numbering i, ii, iii... for the table of
contents, then 1, 2, 3... for the chapters. My table of contents has more than two pages, the
first two ones being numbered correctly with roman numbers, but the third one has the number 1
instead of iii. What should I do in order to have LaTeX numbering the whole table of contents
with roman numbers ?


geofftswin

unread,
Nov 4, 2001, 12:45:00 PM11/4/01
to
"Francois Coppex" <francoi...@hotmail.com> wrote in message
news:9s3cog$59o$1...@news1.sunrise.ch...

> My table of contents has more than two pages, the
> first two ones being numbered correctly with roman numbers, but the third
one has the number 1
> instead of iii. What should I do in order to have LaTeX numbering the
whole table of contents
> with roman numbers ?
>
\pagenumbering{roman}
\setcounter{page}{1}
\tableofcontents
\input chap1.tex

\pagenumbering{arabic}
\setcounter{page}{1}

would do the trick I'd have thought - you were resetting the page numbering
on the last page of the TOC rather than the first page of the rest of the
document.

Geoffrey Swindale

Francois Coppex

unread,
Nov 4, 2001, 1:11:15 PM11/4/01
to
> \pagenumbering{roman}
> \setcounter{page}{1}
> \tableofcontents
> \input chap1.tex
> \pagenumbering{arabic}
> \setcounter{page}{1}
>
> would do the trick I'd have thought - you were resetting the page numbering
> on the last page of the TOC rather than the first page of the rest of the
> document.

Unfortunately, it doesnt work at all: now the whole chapter chap1.tex has arabic numbers. The
strange fact is that when my table of contents only had two pages, the numbering was just fine,
and this "bug" (?) occurs when the toc has more than two pages...

Donald Arseneau

unread,
Nov 4, 2001, 8:07:58 PM11/4/01
to
"Francois Coppex" <francoi...@hotmail.com> writes:

Don't use \pagenumbering or \setcounter! Use \frontmatter...
\mainmatter...\backmatter (if any).

If you insist on manual control, put \cleardoublepage after
\tableofcontents.

Donald Arseneau as...@triumf.ca


Heiko Oberdiek

unread,
Nov 4, 2001, 7:09:23 PM11/4/01
to
On Sun, 4 Nov 2001 13:32:15 +0100, "Francois Coppex"
<francoi...@hotmail.com> wrote:

> \pagenumbering{roman}
> \setcounter{page}{1}

This is already done by \pagenumbering.

> \tableofcontents
> \pagenumbering{arabic}

You execute this at the last page of \tableofcontents.
Insert a \newpage before, so \pagenumbering will
affect the new page, not the last page of the
\tableofcontents.

> \setcounter{page}{1}

This is already done by \pagenumbering.

> \input chap1.tex

You are using LaTeX:
\input{chap1}

You did not say anything about your document class.
If you are using book, so look at \frontmatter, \mainmatter.

In other cases:
\pagenumbering{roman}
\tableofcontents
\newpage
\pagenumbering{arabic}
\input{chap1}

Yours sincerely
Heiko <ober...@uni-freiburg.de>

Francois Coppex

unread,
Nov 5, 2001, 12:13:57 PM11/5/01
to
> Don't use \pagenumbering or \setcounter! Use \frontmatter...
> \mainmatter...\backmatter (if any).
>
> If you insist on manual control, put \cleardoublepage after
> \tableofcontents.

Both solutions work just fine, thank you very much. However, I'm a bit surprised that I came up
against such a problem with LaTeX: is it a "bug" or is it my fault because \pagenumbering and
\setcounter are not supposed to work with the book document class ?


Francois Coppex

unread,
Nov 5, 2001, 12:16:28 PM11/5/01
to
> You did not say anything about your document class.
> If you are using book, so look at \frontmatter, \mainmatter.
>
> In other cases:
> \pagenumbering{roman}
> \tableofcontents
> \newpage
> \pagenumbering{arabic}
> \input{chap1}

Thank you very much, both solutions solve my problem (in fact I use the book document class).


Robin Fairbairns

unread,
Nov 5, 2001, 12:47:17 PM11/5/01
to

of course they're supposed to work, and indeed they do.

what latex was doing was what you had told it to do -- the problem was
you had forgotten that (la)tex usually has some things in its buffers
awaiting completion. so you said "change the pagenumbering" and latex
did so immediately, applying it to the buffers it had.

this is why you were recommended to use the "standard techniques",
rather than mucking about with the low-level commands. the standard
techniques are programmed to save you having to remember things like
this.
--
Robin Fairbairns, Cambridge -- rf10 at cam dot ac dot uk

0 new messages