TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When using *in a headline you remove the section from the toc. But sometimes you just want to remove a certain level of headlines. Rather than to remove every single headline individually, it would be more pleasant to change one superordinate headline to serve that purpose.

I was wondering if it would be possible to create a *-based command that removes deeper level headlines without removing the level to where it is applied.

For example:


The asdf-headline will be displayed in the toc while the subsection will be removed. Both, section B and section C are part of the toc either.

Ideally, the command would not redefine the \section*{but would offer an alternative to allow being used at the same time as with an other command that was recently defined (Removing Subordinated Headline Levels From The ToC Automatically When Using *).

share|improve this question
This question is a little unclear. What do you hope to achieve that the tocvsec2 package doesn't already do? See especially the \maxtocdepth and \settocdepth commands, which should be used after \begin{document}. – jon Aug 15 '12 at 0:03
I am also curious about this sentence: 'Both, section B and section C are part of the toc either.' It almost seems to be missing a 'not' (i.e., 'are not part of the toc either'), which is a very different question! – jon Aug 15 '12 at 3:51

Perhaps this does what you need (based on your code snippet):




\settocdepth{chapter} % <-- comment this line to see the difference



(Remember to compile twice to see how things change in the table of contents.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.