# Command To Remove Just Deeper Level Headlines From The ToC

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:

\section*{asdf}
\subsection{fdsa}
\section{B}
\subsection{C}


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 *).

-
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):

\documentclass{report}
\usepackage{tocvsec2}
\begin{document}

\maxtocdepth{subsection}
\tableofcontents

\section*{asdf}
\subsection{fdsa}

\settocdepth{chapter} % <-- comment this line to see the difference
\chapter{A}
\section{B}
\subsection{C}

\settocdepth{subsection}
\chapter{D}
\section{E}
\subsection{F}

\end{document}