[texhax] Uppercase index entries

Michael Barr mbarr at math.mcgill.ca
Thu Mar 3 20:14:15 CET 2005


Wonderful!  You almost got it right, except I don't want to change the 
case of any other character.  So the slightly modified

\makeindex
\let \Index = \index
\def \index #1{\parse #1\endparse}
\def \parse #1#2\endparse
     {%
         \uppercase {\def \HEAD {#1}}%
         \def \TAIL {#2}%
         \edef \INDEXENTRY {\HEAD \TAIL}%
         \expandafter \expandafter \expandafter \Index
             \expandafter {\INDEXENTRY}%
     }

\begin {document}

aaa
\index{AAA}
\newpage
bbb
\index{Bbb}
\newpage
ccc
\index{ccc}
\newpage
ddd
\index{ddD}

\end {document}


produced the following .ind file, exactly what I wanted:

\begin{theindex}

  \item AAA, 1

  \indexspace

  \item Bbb, 2

  \indexspace

  \item Ccc, 3

  \indexspace

  \item DdD, 4

\end{theindex}

Michael Barr



More information about the texhax mailing list