Reputation: 51
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?
Upvotes: 2
Views: 2517
Reputation: 17134
I would change the {section} part to {subsection}.
\addcontentsline{toc}{subsection}{sample text}
Upvotes: 0
Reputation: 51
The tocloft
package and its \cftchapterprecistoc
command solved my problem.
Upvotes: 3
Reputation: 101181
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.
Upvotes: 2
Reputation: 7032
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.
Upvotes: 1