2

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?

Kara
  • 6,115
  • 16
  • 50
  • 57
Andreas
  • 51
  • 6

5 Answers5

3

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

Andreas
  • 51
  • 6
2

Try

\addcontentsline{toc}{section}{sample text}
Oliver Michels
  • 2,837
  • 1
  • 19
  • 14
2

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 --- ex-moderator kitten
  • 98,632
  • 24
  • 142
  • 234
  • 1
    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 Apr 17 '09 at 19:59
1

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
  • 7,044
  • 2
  • 28
  • 30
0

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

\addcontentsline{toc}{subsection}{sample text}
riza
  • 16,274
  • 7
  • 29
  • 29