6

I would like to add an explanation to each chapter... like the picture...

enter image description here

Is there a way to edit the TOC in this way??

I need to have a similar result to the one shown in the picture above.

Adriano
  • 747

1 Answers1

7

I assume that the descriptions should not be used with page numbers as well, so I provide a macro named \desctotoc which writes the argument to the ToC and leaves some medium vertical space afterwards.

In order to prevent fragile commands causing errors, I used a \detokenize - approach within \addtocontents which is the 'master' macro for writing contents to a ToC - related file.

\documentclass{memoir}

\usepackage{blindtext}

\newcommand{\desctotoc}[1]{%
  \addtocontents{toc}{\medskip\noindent\detokenize{#1}\leavevmode\par\medskip}
}

\begin{document}
\tableofcontents

\chapter{Foo}
\desctotoc{%
  \begin{itemize}
    \item foo
    \item bar
  \end{itemize}
}

\chapter{Foobar}

\desctotoc{\blindtext}


\end{document}

enter image description here

  • Thanks a lot! Would it be possible to include any description AND page number?

    Anyway helped lots. thanks

    – Adriano Sep 05 '16 at 04:46
  • @Adriano - Do you know about the \pageref command to generate call-outs to page numbers? – Mico Sep 05 '16 at 05:19
  • @Mico Went looking for some help about the \pageref, but I do not know how to include the page number in its aproppriate place. – Adriano Sep 07 '16 at 22:48