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?
views:
1130answers:
6
+1
A:
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.
simon
2009-04-17 16:32:26
+2
A:
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.
dmckee
2009-04-17 18:51:37
Thanks! Using your method, I can make it look like this:http://i43.tinypic.com/34jcaat.png -- not perfect, since it would be preferable if the page numbers and dots were in line with the headings, but much better than no annotations!
Andreas
2009-04-17 19:59:12
+3
A:
The tocloft
package and its \cftchapterprecistoc
command solved my problem.
Andreas
2009-04-17 22:04:22
The memoir class also provides this functionality (since it's by the same author)
Will Robertson
2009-04-18 04:46:20
A:
I would change the {section} part to {subsection}.
\addcontentsline{toc}{subsection}{sample text}
Selinap
2009-05-23 16:30:16