LyXWrong page numbers in ToC of unnumbered sections

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

Wrong page numbers in ToC of unnumbered sections

Post by sascq »

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 ...

Thanks in advance!

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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

Wrong page numbers in ToC of unnumbered sections

Post by Stefan Kottwitz »

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
LaTeX.org admin
sascq
Posts: 3
Joined: Wed Aug 21, 2019 10:50 pm

Wrong page numbers in ToC of unnumbered sections

Post by sascq »

Thank you so much! Problem solved!
Post Reply