5

I am writing a rather long literature review for submission to ACM Computing Surveys and we are putting a table of contents on it for the benefits of our internal reviewers. The table of contents is including text from the \paragraph tags. I don't want it to, but I can't get rid of it.

Here is a sample document:

\documentclass[prodmode,acmcsur]{acmsmall} % Aptara syntax
\begin{document}
\tableofcontents
\section{A Section}
\subsection{A Subsection}
\subsubsection{A SubSubSection}
\paragraph{First Paragraph} Some text.
\paragraph{Second Paragraph} Some text.
\paragraph{Third Paragraph} Some text.
\subsubsection{Another SubSubSection}
\end{document}

And here is what it looks like: table of contents

I've tried to get rid of the paragraph text with \setcounter{tocdepth}{3} and that doesn't help. (It removes the subsubsection, but not the paragraph.) I've also tried \setcounter{secnumdepth}{3}. No luck.

What's the solution?

Werner
  • 603,163
vy32
  • 4,780

1 Answers1

6

Define \l@paragraph (and \l@subparagraph) to do nothing (the class not defining \l@paragraph nor \l@subparagraph is a bug):

\documentclass[prodmode,acmcsur]{acmsmall} % Aptara syntax
\makeatletter
\newcommand\l@paragraph[2]{}
\newcommand\l@subparagraph[2]{}
\makeatother
\begin{document}
\tableofcontents
\section{A Section}
\subsection{A Subsection}
\subsubsection{A SubSubSection}
\paragraph{First Paragraph} Some text.
\paragraph{Second Paragraph} Some text.
\paragraph{Third Paragraph} Some text.
\subsubsection{Another SubSubSection}
\end{document}

enter image description here

Since the acmsmall class sets tocdepth to 3 (subsubsection level), paragraph and suparagraph title won't go to the ToC, so one can in fact provide a sensible definition for \l@paragraph and \l@subparagraph, in case one decides to include those entries in the ToC by changing tocdepth; in this case, one would have to say

\makeatletter
\newcommand*\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
\newcommand*\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
\makeatother
Gonzalo Medina
  • 505,128