3

I'm using the report class, and because of this, my table of contents is also displayed as a chapter (i.e. using a chapter heading for "Contents"). This is overly large, and just causes my ToC to wrap to a new page.

Instead, I would like to use the regular heading from \section. What would be the best way to achieve this?

1

You can take the definition of \tableofcontents from report.cls and change chapter to section, see the following example:

\documentclass{report}

\makeatletter
\renewcommand\tableofcontents{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \section*{\contentsname
        \@mkboth{%
           \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
    \@starttoc{toc}%
    \if@restonecol\twocolumn\fi
    }
\makeatother

\begin{document}
\tableofcontents
\chapter{A chapter}
\section{A section}
\subsection{A subsection}
\end{document}
  • 1
    I ended up doing something similar by using {\let\chapter\section\tableofcontents}, effectively doing it the other way around: in that case, chapter becomes section in this scope. – Joost May 22 '15 at 10:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.