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.

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?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

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
share|improve this answer
    
Beautiful. Thanks. One day I will understand \makeatletter. –  vy32 Feb 13 at 20:44
    
@vy32 You're welcome. Regarding \makeatletter, \makeatother, you can read the answers to tex.stackexchange.com/q/8351/3954 –  Gonzalo Medina Feb 13 at 20:45

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.