+%
+% \subsubsection{Index}
+%
+% \begin{environment}{theindex}
+% The environment |theindex| can be used for indices. It makes an
+% index with two columns, with each entry a separate paragraph. At
+% the user level the commands |\item|, |\subitem| and |\subsubitem|
+% are used to produce index entries of various levels. When a new
+% letter of the alphabet is encountered an amount of |\indexspace|
+% white space can be added.
+%
+% Override \cls{book}'s version, adding a line to the table of
+% contents. We split out the section-creation code into
+% |\bib@heading| for \pkg{natbib} compatibility.
+% (\file{classes.dtx}, L4107).
+% \begin{macrocode}
+\renewenvironment{theindex}
+ {\if@twocolumn
+ \@restonecolfalse
+ \else
+ \@restonecoltrue
+ \fi
+% \end{macrocode}
+% Here we add our TOC entry, and setup two-columness by hand
+% to avoid the |\clearpage| in \LaTeX's default |\twocolumn|.
+% \begin{macrocode}
+ \listed@schapter{\indexname}
+ \global\columnwidth\textwidth
+ \global\advance\columnwidth-\columnsep
+ \global\divide\columnwidth\tw@
+ \global\hsize\columnwidth
+ \global\linewidth\columnwidth
+ \global\@twocolumntrue
+ \global\@firstcolumntrue
+ \col@number \tw@
+% \end{macrocode}
+% Parameter changes to |\columnseprule| and |\columnsep| have to be
+% done after |\twocolumn| has acted. Otherwise they can affect the
+% last page before the index.
+% \begin{macrocode}
+ \parindent\z@
+ \parskip\z@ \@plus .3\p@\relax
+ \columnseprule \z@
+ \columnsep 35\p@
+ \let\item\@idxitem}
+% \end{macrocode}
+% When the document continues after the index and it was a one
+% column document we have to switch back to one column after the
+% index.
+% \begin{macrocode}
+ {\if@restonecol\onecolumn\else\@DUT@clearpage\fi}
+% \end{macrocode}
+% \end{environment}
+%
+%