Change the order of \addcontentsline
:
\newpage
\section*{Abstract}
\addcontentsline{toc}{section}{Abstract}
\newpage
\addcontentsline{toc}{section}{Table of Contents}
\tableofcontents
\newpage
\addcontentsline{toc}{section}{List of Tables}
\listoftables
\newpage
\addcontentsline{toc}{section}{List of Figures}
\listoffigures
If the hyperref
package is going to be used, you might add \phantomsection
to produce the right anchors for hyperlinks:
\newpage
\phantomsection
\addcontentsline{toc}{section}{Table of Contents}
\tableofcontents
As a suggestion, instead of using "manual" names, you could use the macros containing the pre-defined names; so instead of
\addcontentsline{toc}{section}{List of Figures}
you could say
\addcontentsline{toc}{section}{\listfigurename}
As you stated, the \thispagestyle{...}
command only affects the current page, so it will not help for a multi-page table of contents, except, as you do in your solution, if you ensure that it's called at least once on each page.
To momentarily change the page footer over several pages, you can use \pagestyle{...}
. So the first naive thing to try is:
\pagestyle{empty}
\tableofcontents
\clearpage
\pagestyle{plain}
note the \clearpage
command, so that the following \pagestyle
command only takes effect on the following page and not on the last page of the table of contents.
However, there is a catch: \tableofcontents
internally calls \chapter*{...}
, which itself calls \thispagestyle{plain}
(see book.cls
source). So the first page will still have the "plain" footer style. To hack around that, I don't have a more elegant solution than to momentarily disable the \thispagestyle
command itself; the total code block is then:
\pagestyle{empty}
{
\renewcommand{\thispagestyle}[1]{}
\tableofcontents
}
\clearpage
\pagestyle{plain}
Note the pair of braces, meant to restore the macro \thispagestyle
to its original meaning after the block.
Best Answer
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
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
on a (new) page / after a page break.