# Odd behavior generating TOC, perhaps a LaTeX bug

Compiling a Table of Contents for my article, has led to a very strange behavior. After the second compile to produce the TOC, I get the following Error:

LaTeX Error: Something's wrong--perhaps a missing \item.

I am using the ACM-small format: http://www.acm.org/publications/latex_style/

In the sample called v2-acmsmall-sample.tex:
And I have reduced the problem to the following:

By just adding a \tableofcontents after the \document tag:

\begin{document}
\tableofcontents


And also the offending code directly after the \maketitle tag :

\maketitle
\section{Introduction}
\paragraph{The para}
\section{Secondary}


I can reproduce the error. The odd behavior is that when adding a \subsection before the \section, the error disappears.

\maketitle
\section{Introduction}
\paragraph{The para}
\subsection{THE FIX}
\section{Secondary}


It would be nice to know if this is a bug in the ACM template or LaTeX itself. I am compiling using MacTex, latest version.

As Ulrike mentions in her comment, a definition for \l@paragraph is missing in the class (also the class is missing \l@subparagraph); you can provide the definitions (I provided some sensible values in the definition but they will not be used since tocdepth is set to 3 by the class):

\documentclass{acmsmall}

\makeatletter
\newcommand*\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
\newcommand*\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
\makeatother

\begin{document}

\tableofcontents

\section{Introduction}
\paragraph{The paragraph}
%\subsection{A subsection}
%\subsubsection{A subsubsection}
\section{Secondary}

\end{document}

• I primarily wanted to avoid the compile error. Would be nice if the error was more specific. Judging by the 800 views the related question has, I'm definitely not the only one with this hick-up. Thank you! =) – PLG Jan 28 '14 at 15:46