Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

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
add comment

1 Answer

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}

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

share|improve this answer
add comment

Your Answer

 
discard

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.