Capitalization of index entries

David Carlisle d.p.carlisle at
Sun Mar 15 22:11:07 CET 2020

You could do it in tex but I think I'd do a one-off edit to correct
your source. Any editor ought to be able to change all the instances
in the document  with a single replace command, or you could use an
external tool such as sed or perl

sed -e 's/\\index{\(.\)/\\index{\u\1/g'

probably does what you want

$ echo '\index{abcd} abc \index{xyz}' | sed -e 's/\\index{\(.\)/\\index{\u\1/g'
\index{Abcd} abc \index{Xyz}


On Sun, 15 Mar 2020 at 21:05, Djones9976 via texhax <texhax at> wrote:
> I completed a manuscript for a book making entries for words I wanted to index using the command \index{xxxxx} or \index{Xxxxx} if I wanted to capitalize the word in the index.  Now I find that the generally accepted rule is to capitalize all words whether they are capitalized in the text or not.   Is there a way that I can correct all my \index{xxxxx} entries to read \index{Xxxxx} without changing them one by one?
> Many thanks.
> D. W. Jones

More information about the texhax mailing list.