6

I have defined a custom script environment, and would like to include an index in the output listing all scripts with their titles. How can I create such an index?

The custom environment looks like:

\newcounter{script}
\def\thescript{\thechapter-\arabic{script}}
\newenvironment{script}[2][]{
\colorbox{orange}
  {\refstepcounter{script}\textbf{Script~\thescript #1: #2}}\nobreak}
  {}

1 Answers1

5

Have a look at the tocloft package. There is, in particular, a \newlistof command to do exactly what you're looking for. Read section 2.4 of it's documentation for the full details (on how to make it work with your own environment).

Juan A. Navarro
  • 62,139
  • 32
  • 140
  • 169