LyXPage number appears on first page of TOC

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
steun
Posts: 2
Joined: Wed Jan 11, 2012 11:50 am

Page number appears on first page of TOC

Post by steun »

I have found a thread about this subject already but my problem is different.
http://www.latex-community.org/forum/vi ... TOC#p53771

My table of contents is 3 pages long. And I followed the instructions on the wiki and now I get a page number on the first page only. I should get none at all. If I look at the thread I found here I did nothing wrong.

Document type is report.

This is how my document looks like:

Code: Select all

\pagestyle{empty}

Table of contents

Acknowledgements
\pagestyle{headings}
\pagenumbering{roman}

..some more chapters

CHAPTER1 Introduction
\pagenumbering{arabic}
Last edited by Stefan Kottwitz on Wed Jan 11, 2012 12:12 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Page number appears on first page of TOC

Post by Stefan Kottwitz »

Hi steun,

welcome to the board!

Just add at the beginning of your document:

Code: Select all

\addtocontents{toc}{\protect\thispagestyle{empty}}
This sets the page style for the first ToC page. Otherwise it would have page style plain, as usually first pages of chapters have.

Stefan
LaTeX.org admin
steun
Posts: 2
Joined: Wed Jan 11, 2012 11:50 am

Page number appears on first page of TOC

Post by steun »

Thanks a lot Stefan! I couldn't wish for a faster response. It works!

Maybe I am blind but this wiki doesn't show that command you wrote, the wiki states that with \pagestyle{empty} it should work.

http://wiki.lyx.org/FAQ/Numbering#startpage
Suppose you want to have some pages without pagination (e.g. title pages, TOC) and want to start with page "1" afterwards. Just suppress, if necessary, the pagination on those pages with \thispagestyle{empty} (if it's only one page) or \pagestyle{empty} (if it concerns multiple pages). Then, start the pagination with \setcounter{page}{1} on the desired page. Note that you might eventually need to reset the pagestyle on that page to get a page number, e.g. by \pagestyle{fancy} or \pagestyle{headings}.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Re: Page number appears on first page of TOC

Post by Stefan Kottwitz »

At least it mentions \thispagestyle{empty}. In this case, I used \addtocontents to write this command to the .toc file, so it's read in together with the ToC entries.

The wiki is not wrong, it even provides information in this direction (just combine \thispagestyle{empty} and \pagestyle{empty}), however it doesn't deal with this case. It's a wiki, so users can extend it. ;-)

Stefan
LaTeX.org admin
Post Reply