GeneralIncluding starred sections in a TOC

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
dmt
Posts: 82
Joined: Sat Mar 15, 2008 8:13 pm

Including starred sections in a TOC

Post by dmt »

Hi, I have a document class report doc I am working on where all the headers use the starred version. I would still like to generate a table of contents which the corresponding page numbers, but the TOC ignores by default all headers with stars, and I don't really want to go through and add each one by hand at the end now.

Is there a way to automatically force the TOC to include starred headers?

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

pandammonium
Posts: 55
Joined: Thu Oct 30, 2008 4:12 pm

Including starred sections in a TOC

Post by pandammonium »

Try this:

Code: Select all

\addcontentsline{toc}{section}{Section heading}
\section*{Section heading}
Is this what you want?
dmt
Posts: 82
Joined: Sat Mar 15, 2008 8:13 pm

Re: Including starred sections in a TOC

Post by dmt »

Right, but the idea was not to have to go through the entire report and hand code that for every single chapter and section. I ended up doing it this time, but I was hoping there was a global method to do it automatically which would be nice to have.
pandammonium
Posts: 55
Joined: Thu Oct 30, 2008 4:12 pm

Re: Including starred sections in a TOC

Post by pandammonium »

Oh, I see. I can't think of any way of doing that that doesn't involve writing a macro each for chapters and sections (and subsections and...) that takes an argument that is the heading. Sorry not to be more helpful :( but I wish you luck on your quest!
Post Reply