5

Using the KOMA-Script class I'ld like to add chapter descriptions to the table of contents to provide a short description of this chapter right in the TOC.

I've already found the "memoir" document class with the \chapterprecis{...} command, but this would make it impossible to use KOMA-Script, as it is a class, too.

The "tocloft" package provides a similar command, but forces to print the precis under the chapter title in the text with a quite bad positioning.

Is there any package around that works with KOMA-Script or a solution in the KOMA-Script class itself to provide this behaviour?

  • 2
    Does this question help? – lockstep Aug 31 '11 at 11:23
  • 1
    Have a look at this thread, it's the same questions, and the answers only requite the etoolbox or tocloft packages – Tom Bombadil Aug 31 '11 at 11:24
  • Thanks Tom (I've heard that name before g), the example was helpful! I skipped the command "\cftchapterprecistoc" when evaluating the tocloft package, only found "\cftchapterprecis". – Christoph Jüngling Aug 31 '11 at 11:37
  • Also thanks to lockstep. Sorry, I overlooked your answer, as I assumed your name to be some kind of a Stack Exchange function with the time my question will be locked for any unknown reason :-) – Christoph Jüngling Aug 31 '11 at 11:47
  • 2
    @Christoph Jüngling: You are a German so I think you will understand the post of Markus Kohm. He has a pacakge screxperimental which allows you to set the toc separately. The code is insert in KOMA-Script v3.10. here the link: http://www.komascript.de/node/1231 – Marco Daniel Aug 31 '11 at 12:05
  • 1
    "Some kind of function" -- that's a new one. :-) – lockstep Aug 31 '11 at 14:29

2 Answers2

5

Something like

\newcommand{\chapterprecis}[1]{\addtocontents{toc}{%
  \unexpanded{\unexpanded{{\small#1\par}}}}}

should work. One has to customize the appearance of the precis and, perhaps, make sure that there's no page break between the chapter and the precis:

\chapter{A title}
\chapterprecis{A precis}
egreg
  • 1,121,712
2

I now use the "tocloft" package with its command \cftchapterprecistoc{text}.

Additionally I found a recommendation to create a similar command \cftsectionprecistoc{text}:

\makeatletter
\newcommand{\cftsectionprecistoc}[1]{\addtocontents{toc}{%
  {\leftskip \cftsecindent\relax
   \advance\leftskip \cftsecnumwidth\relax
   \rightskip \@tocrmarg\relax
   \textit{#1}\protect\par}}}
\makeatother

This now works fine even that \cftchapterprecis{text} (without "toc" at the end!), which additionally writes the precis under the chapter heading itself, doesn't consider the correct distance between the lines.