4

In LyX, how can I make the pages numbers start from the second page? (i.e., making the first page, which is the table of contents in my case, not having a page number on it)

Werner
  • 603,163

1 Answers1

4

Since LyX (up to recent version 2.0.x) only supports globally changing the pagestyle (in "Document > Setting... > Page Layout") using TeX code/ERT is a workaround.

If the first page should not be numbered then insert the TeX code/ERT

\thispagestyle{empty}

at the beginning of your document (before the table of contents(TOC)). This will clear the page number of that page (see also https://tex.stackexchange.com/a/44153).

(To suppress page numbers for the whole TOC \pagestyle{empty} before TOC and \pagestyle{plain} after TOC can be used. Note that the last \pagestyle command on a page will take precedence over all \pagestyle commands on that page. Depending on your case another \thispagestyle{empty} after \pagestyle{plain} might be used.)

If the page numbers should be reset at some point, you can add the TeX code

\setcounter{page}{1}

on a (new) page / after a page break.

e-birk
  • 4,373
  • Is this also valid if you have contents (whatever... perhaps a dedication page) before the ToC? And what if the ToC spans more than one page? Then \pagestyle{plain} will make the entire ToC be void of page numbers. The OP only wants the first ToC page to be without a page number. – Werner Feb 26 '13 at 22:30
  • @Werner Every page before \pagestyle{empty} will have a page number. As far as I know, the last \pagestyle on a page will take precedence over all \pagestyle commands on that page. – e-birk Feb 26 '13 at 22:40
  • Yes, the last one will prevail. But since you're placing \pagestyle{empty} before the ToC, that may fall on the last page before the ToC is set. – Werner Feb 26 '13 at 22:42
  • What is “ERT”? Is this a LyX special? – Speravir Feb 27 '13 at 03:45
  • @Speravir yes, it is a way to insert LaTeX code directly. – scottkosty Feb 27 '13 at 05:10
  • @Werner Thanks for your comments! The OP mentioned that the TOC is on the first page. In the situation when having text followed by TOC probably without page break instructions and where the page before the TOC should be numbered, one could insert \thispagestyle{plain} at a suitable point (not just before \pagestyle{empty} but earlier to avoid it falling on the TOC page). Furthermore, if the first page were the beginning of a chapter - that is not the case here - one had to do more... – e-birk Feb 27 '13 at 12:06
  • The page number on the first page of the TOC was still visible in my case, so I had to use \addtocontents{toc}{\protect\thispagestyle{empty}} besides \pagestyle{empty} – Raiyan Jan 13 '14 at 04:25