% /u/sy/beebe/tex/dvi/doc/gnuindex.sty, Wed Jan  4 08:45:32 1995
% Edit by Nelson H. F. Beebe <beebe@plot79.math.utah.edu>
% Fix bug in \@WRSUBINDEX, and add space after comma in definition 
% of \secondary.
% <TEX.LATEX>GNUINDEX.STY.2, 18-Oct-86 15:44:17, Edit by BEEBE
% Indexing macros for LaTeX and TeXIDX
% Usage:
%	\INDEX{sortkey}{primaryentry}
%	\SUBINDEX{sortkey}{primaryentry}{secondaryentry}
%
% For \SUBINDEX, the {secondary} field is automatically appended
% to the sort key, but separated from it by an ASCII <TAB>
% character, so that
% \SUBINDEX{foo}{foo}{bar}
% sorts before
% \SUBINDEX{foo}{foo}{baz}
% and
% \INDEX{foo bar}{foo bar}{bar}
%
% The keys will be "foo<TAB>{bar}", "foo<TAB>{baz}", and "foo
% bar", respectively.
%
    \def\initial#1{\bigbreak{\raggedright\large\bf #1}\kern 2pt\penalty3000}
    \def\entry#1#2{\item {#1}, #2}
    \def\primary#1{\item {#1}}
    \def\secondary#1#2{\subitem {#1}, #2}

  \def\INDEX{\@bsphack\begingroup\@sanitize\@WRINDEX\@indexfile}
  \def\@WRINDEX#1#2#3{\let\thepage\relax
     \xdef\@gtempa{\write#1{\string
      \entry{#2}{\thepage}{#3}}}\endgroup\@gtempa
     \if@nobreak \ifvmode\nobreak\fi\fi\@esphack}
%
  \def\SUBINDEX{\@bsphack\begingroup\@sanitize\@WRSUBINDEX\@indexfile}
%
% \entry{#2<tab>#4} changed to \entry{#3<tab>#4} following bug
% report from Jozef A. Ghijselen, University of Gent, 
% St.-Pietersnieuwstraat 41,B-9000 Gent, Belgium, ghijselen@elmape.rug.ac.be  
% on Wed Jan 4 08:45:20 1995
  \def\@WRSUBINDEX#1#2#3#4{\let\thepage\relax
     \xdef\@gtempa{\write#1{\string
% NB: #3<tab>#4, NOT #3<space>#4 in the next line
      \entry{#3	#4}{\thepage}{#3}{#4}}}\endgroup\@gtempa
     \if@nobreak \ifvmode\nobreak\fi\fi\@esphack}