## LaTeX forum ⇒ LyX ⇒ Wrong page numbers in ToC of unnumbered sections Topic is solved

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
sascq
Posts: 2
Joined: Wed Aug 21, 2019 10:50 pm

### Wrong page numbers in ToC of unnumbered sections

Hi all,

I am a LyX user and wanted to list an unnumbered chapter and sections to the table of content, document class "Book".
So I added this in the LaTeX Preamble:

`\addcontentsline{toc}{chapter}{Title}\addcontentsline{toc}{section}{Title}`

In the PDF everything is ok, except for the fact that in the ToC the chapter and all following sections are listed under page number 1. How can I add (the correct) page numbers? It should be 7, 13, 16 etc. instead of 1, 1, 1 ...

Stefan Kottwitz
Posts: 9521
Joined: Mon Mar 10, 2008 9:44 pm
Hi sascq,

welcome to the forum!

Put such commands as TeX code (ERT) into the document at the beginning of the corresponding chapter or section.

Stefan