Question

I'd like to use LaTeX's \tableofcontents command (or some equivalent) to automatically generate a table of contents, but I'd also like to add a sentence or two to each line in the table of contents that describes what the referenced section is about. How can I do this?

Was it helpful?

Solution

The tocloft package and its \cftchapterprecistoc command solved my problem.

OTHER TIPS

Try

\addcontentsline{toc}{section}{sample text}

Follwoing Oliver and simon's advice:

You could redefine the sectioning commands to take a second (possibly optional) argument, and use that to build your argument to \addtocontentsline, and then involk the cooresponding section* command.

I expect you can brute force and ignorance something using addcontentsline. eg:

\addcontentsline{toc}{section}{text}

however, this will conflict with automagically generated lines if you don't use the starred versions of sections it refers to.

Anything more clean will require messing about with the relevant macros....unless I'm missing something.

I would change the {section} part to {subsection}.

\addcontentsline{toc}{subsection}{sample text}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top