Suppose I have a document looking like this:



\subsection{A.A}    \subsection{A.B}
\subsection{B.A}    \subsection{B.B}


I would like to add a short summary for each section, and produce a second table of contents after the first one, that would include this summary. The end result could look like this:

[normal table of contents]

1 A
This section is about stuff.

2 B
This section is about whatever.

[rest of the document]

Obviously I can achieve the result by hand, but I'd rather not. For example it would be great if I could put the summary at the beginning of the section (in the code) and have it automatically be put in the "summary toc" at the right place.

Bonus question: I'd like to do all of that with a KOMA-script class. So if possible, no memoir-specific magic should be used.

1 Answer 1


You can do these things with etoc:

Note: for an elaboration (incorporating the remark below) of the technique see my answer to Expanded toc-like environment

Remark: The code below defines a command \sectionsummary which ultimately writes things to the .toc file. It thus has the same difficulties with fragile commands that the \section command has. To get the material given as argument to \sectionsummary find its way unexpanded to the .toc file, one can use the following which uses the e-TeX primitive \unexpanded.


With this variant, material given as argument to \sectionsummary will only get expanded when the Summary gets typeset.


\etocsetlevel {sectionsummary}{6}




\etocsettocstyle {\bigskip\noindent\bfseries\sffamily\Large 

% section headings exactly as in the standard TOC
    \etocsetstyle {section}{}{}% cf etoc manual, "Another compatibility mode"

% now setting a style to print the summaries:
\etocsetlevel {sectionsummary}{2}
\etocsetstyle {sectionsummary}{\parindent1.5em\normalfont}

% subsections a priori at level 2, need to be moved out of the way
\etocsetlevel {subsection}{6}

\etocsettocdepth {sectionsummary}
% can be located anywhere in the document. 
% (but if before the main TOC, or before some other TOC, put everything in a
% group, to limit the scope of our style changes)

\sectionsummary{This section is about stuff.}% one paragraph only please.
\sectionsummary{Oh, and I forgot to say that also.}% another paragraph.



\sectionsummary{This section is about whatever.}

\subsection{B.A}    \subsection{B.B}


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .