Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
  {}
share|improve this question
1  
A few details could be helpful. How did you create that environment? Is it a float environment like figure or table? –  Thorsten Donig Oct 8 '10 at 10:06
    
Added my custom environment. –  Egon Willighagen Oct 8 '10 at 10:29
add comment

1 Answer

up vote 5 down vote accepted

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).

share|improve this answer
    
Works like a charm! thanx! –  Egon Willighagen Oct 9 '10 at 13:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.