General ⇒ Exclude a headline from the ToC, but keep the section number
Exclude a headline from the ToC, but keep the section number
Is there a way to give a header a number, the sectional numbering, and leave it out of the Table of Content?
I've tried the \section*{something} but it leaves out both the number and the entry in the ToC, and I would very much like to keep the numbering of the sections (and subsection + subsubsections).
Is there a possible solution for this matter? (Keep headline number, exclude from the ToC)
/Kish
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Re: Exclude a headline from the ToC, but keep the section number
try:
\section*{foo}
\stepcounter{section}
the latter command should increase the section counter.
Best,
Ott
Re: Exclude a headline from the ToC, but keep the section number
Did that solve your problem Kishmet?
Because I have the same problem, but the suggested solution cannot be used. I want a section number! If I use
\section*{}
It drops the sectionnumber. Using \stepcounter{section} just solves the problem for the nest section...
I.e. I want a toc like this:
1. Title 1
2. Title 2
And my text like this:
1. Title 1
2. Title 2
3. Title 3
Is that not possible?
Kind regards Hans
Re: Exclude a headline from the ToC, but keep the section number
It is possible to use \settocdepth{section}
in the document. This enables us to change the tocdepth for parts of the document. In my case this would be:
Contents
1. Title 1
2. Title 2
And my text like this:
1. Title 1
2. Title 2
\settocdepth{chapter}
3. Title 3
\settocdepth{section}
Hope this makes sense!