I would like to achieve table of contents with additional description for chapters/sections (see screenshot). What way would you go to achieve this? I'm wondering if it is possible to wrap the \chapter
, \section
etc. commands with custom taking 2 parameters. But how to generate the ToC then?
[Tex/LaTex] Table of Contents with additional description of entries
table of contents
Best Answer
You can use
\addcontentsline{toc}{<sec_unit>}{<text>}
or directly\addtocontents{toc}{<text>}
to enter text to the.toc
file. The only issue is to indent to text correctly.Below some code which uses the
book
class and its internal macros. Its adds ''info'' lines which use basically the same formatting macros as the sectioning lines (for identical indention), but avoid the '.... (page number)' part. If you really want to give\chapter
etc. two arguments you can do something likeHere the code:
Result:
If this is required by more people I would be ready to make a small package out of it. I could try to also support the koma script or other classes.