I have been instructed to use the ACM style latex template for an assignment. In the .cls file they provide, I can find the following warning:
%%% 4) Marginal paragraphs, tables of contents, lists of figures and tables,
%%% and page headings are all forbidden.
Even though we have been instructed to use the ACM template, however silly it may be, we are required to insert a table of contents.
I attempt to add \tableofcontents
as follows:
\documentclass{acm_proc_10ptArticle-sp}
\begin{document}
\clearpage
\tableofcontents
\newpage
\section{Introduction}
Lipsum
\section{Conclusion}
Lipsum
\end{document}
When I compile, I receive the following error:
! TeX capacity exceeded, sorry [input stack size=5000].
\@latexerr #1#2->\GenericError
{\space \space \space \@spaces \@spaces \@spa...
l.38 \tableofcontents
If you really absolutely need more capacity,
you can ask a wizard to enlarge me.
Additionally, i find the following section in the .cls
file:
\def\tableofcontents{\@latexerr{\tableofcontents: Tables of contents are not
allowed in the `acmconf' document style.}\@eha}
I was hoping to find a solution for this without having to use a different template file. Is there anything I can do to add a table of contents regardless of their warning?
Best Answer
The
.cls
file you provided defines\tableofcontents
to produce an error message (the class designers really wanted to discourage producing a ToC):You can override this by providing (in your
.tex
file) a sensible definition for\tableofcontents
; something along the linesA complete example:
The result, showing the generated ToC: