1

I am currently working on a geometrically small book in which I don't want the TOC to be too long.

I don't know yet if I will omit section entries from the TOC, but I am considering it.

Without having to resort to commenting out all of the \addcontentsline{toc}{section}{} commands, I would like to know if there is an efficient way to prevent all the TOC section entries from being displayed.

Consider the MWE

\documentclass[10pt]{book}
\usepackage[showframe,margin=.3in,paperwidth=4in,paperheight=6in]{geometry}
\textheight=5.25in
\usepackage[frame,noinfo,center]{crop}

\usepackage{tocloft}

% To extend the dots in the Table of Contents over to the Page no.
\renewcommand{\cftchapleader}{\bfseries\dotfill}

\renewcommand{\cftchapfont}{\normalfont \bfseries} % Changes chapter font in TOC.
\renewcommand{\cftchappagefont}{\bfseries\small} % Changes font\fontsize for chapter page number in TOC.

\begin{document}
\normalsize
\tableofcontents
\newpage

\centering\textbf{Chapter Title}
\addcontentsline{toc}{chapter}{CHAPTER I}
\addcontentsline{toc}{section}{Section 1.}
\addcontentsline{toc}{section}{Section 2.}
\addcontentsline{toc}{section}{Section 3.}
\end{document}

which produces the TOC:

enter image description here

QUESTION: Without commenting out all of the \addcontentsline{toc}{section}{} commands, how may I efficiently suppress the TOC section entries from being displayed?

Thank you.

2
  • 1
    \setcounter{tocdepth}{0} Nov 16, 2022 at 13:26
  • Many thanks @UlrikeFischer Nov 16, 2022 at 13:39

0

You must log in to answer this question.

Browse other questions tagged .