% index.cd % Anders G S Svensson % Source: index.nw % $Revision: 1.4 $ % $Date: 1996/02/19 19:08:56 $ \usecarrot{auxfile} \def\newindexfile{\bgroup\@ignorewhitespace@\index@newindexfile@} \def\index@newindexfile@#1{\egroup \newauxfile{#1dx}% \@def@{read#1dx}{\index@readind@{#1}\global\@let@{read#1dx}\relax}% \@def@{read#1nd}{\@cs@{read#1dx}}} \def\index@readind@#1{% \IfFileExists{\jobname.#1nd}% {\input\jobname.#1nd\relax}% {}} \def\readindexfile{\bgroup\@ignorewhitespace@\index@readindexfile@} \def\index@readindexfile@#1{\egroup \@ifundefined@{auxfile@aux@#1dx}% {\@Warning{Undeclared index file: #1}}% {\@cs@{read#1dx}}} \def\writeindexentry{\bgroup\@ignorewhitespace@\index@writeindexentry@} \def\index@writeindexentry@#1{\egroup \@ifundefined@{auxfile@aux@#1dx}% {\@Warning{Undeclared index file: #1}\@eat@}% {\index@writeidx@{#1}}} \def\index@writeidx@#1#2{% \@cs@{open#1dx}% \def\@tmp@{\indexentry{#2}}% \edef\@action@{% \expandafter\noexpand\csname write#1dx\endcsname{% \@meaning@\@tmp@{\noexpand\folio}}}% \@action@} \newindexfile{i} \def\index{\writeindexentry{i}}