Page Layout ⇒ Formatting Table of Contents
Formatting Table of Contents
I have some sections that are not numbered using the \section*{SECTION_NAME} command. But I want them to appear in the table of contents.
I have used the \addcontentsline{toc}{section}{SECTION_NAME} command which does add the correct section but the page number that it gives is that of the table of contents not the page the section is on.
Does anyone know why this is the case and/or can fix it.
Thanks.
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
Re: Formatting Table of Contents
I had put the commands just before the \include tableofcontents command which is where is takes its reference.
By moving the command to just after the \section{} command then it picks up the correct page number.