GeneralExclude a headline from the ToC, but keep the section number

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Kishmet
Posts: 1
Joined: Tue Jun 03, 2008 12:40 am

Exclude a headline from the ToC, but keep the section number

Post by Kishmet »

Hi, I'm trying to put my university report together in latex, and I've run into an issue I dont know how to solve.

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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
otoomet
Posts: 15
Joined: Sun Apr 01, 2007 9:39 am

Re: Exclude a headline from the ToC, but keep the section number

Post by otoomet »

Hi Kishmet,

try:

\section*{foo}
\stepcounter{section}

the latter command should increase the section counter.

Best,
Ott
hanshdk
Posts: 11
Joined: Wed Aug 26, 2009 2:40 pm

Re: Exclude a headline from the ToC, but keep the section number

Post by hanshdk »

Hi

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
hanshdk
Posts: 11
Joined: Wed Aug 26, 2009 2:40 pm

Re: Exclude a headline from the ToC, but keep the section number

Post by hanshdk »

Ok I found a solution myself

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!
Post Reply