1

I would like to make a custom TOC so that:

    Introduction


    I.CHAPTER
    II. CHAPTER
      1. Section
      2. Section
    III. CHAPTER


    List of figures
    List of tables
    Notes

The main idea is that chapters without numbers have different spacing (before or after) between other chapters. How can I achieve this?

Ludovic C.
  • 8,888

1 Answers1

1

You can insert content into the ToC using \addcontentsline{<toc>}{<section>}{<title>} and \addtocontents{<toc>}{<stuff>}:

enter image description here

\documentclass{article}
\newcommand{\inserttocgap}{\addtocontents{toc}{\protect\addvspace{2\baselineskip}}}
\begin{document}
\tableofcontents
\section*{Introduction}
\addcontentsline{toc}{section}{Introduction}\inserttocgap
\section{A section}
\section{Another section}
\inserttocgap
\section*{An unnumbered section}
\addcontentsline{toc}{section}{An unnumbered section}
\end{document}

The above works for article, but can be updated to work for book or report that defines \chapter. Just use

\addcontentsline{toc}{chapter}{<title>}

\inserttocgap inserts a 2\baselineskip gap. In order to survive writing to the ToC (and expansion), \protect it.

Werner
  • 603,163