不希望我的目录中出现某些 subsections/ sub subsections,使得目录过于庞大
使用tocvsec2
包用于更改目录中单元深度,可以做到编号的部分单元不出现在目录中
\documentclass{article}
\usepackage{tocvsec2}
\begin{document}
\tableofcontents
\section{Test section in ToC}
\subsection{Test subsection in ToC}
\settocdepth{part}
\subsection{Test subsection not in ToC}
\resettocdepth
\section{Another test section in ToC}
\settocdepth{part}
\section{Test section not in ToC}
\resettocdepth
\section{Yet another test section in ToC}
\end{document}
但请注意,现在目录看起来很奇怪,因为编号不连续。