LaTeX forum ⇒ LyXWrong 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

Postby sascq » Wed Sep 04, 2019 11:05 am

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:

  1. \addcontentsline{toc}{chapter}{Title}
  2. \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 ...

Thanks in advance!

User avatar
Stefan Kottwitz
Site Admin
Posts: 9434
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Sep 04, 2019 3:31 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
Site admin

sascq
Posts: 2
Joined: Wed Aug 21, 2019 10:50 pm

Postby sascq » Sat Sep 07, 2019 1:06 pm

Thank you so much! Problem solved!


Return to “LyX”

Who is online

Users browsing this forum: No registered users and 1 guest