I am writing a small book and try to build up an index reference. To make it a little easier I wrote a small script that enables my to type a word and also add it to the index:

\newcommand{\toindex}[1]{\index{#1}\indexlayout{#1}}


However this results in words added to the index that don't start with a capital letter. This makes the index looks a little bit dirty. Is there a way to generate a string out of parameter #1 that switches the first character to its uppercase counterpart and leave the rest of the string the same?

-
Have you read this: Command to uppercase the first letter of each word in a sentence? –  Werner Sep 27 '11 at 18:39
Thanks! Nearly the same, but it looks all words get an uppercase character, I will try to convert the script that only the first character gets an uppercase. –  CommuSoft Sep 27 '11 at 18:49

For \toindex the optional argument can be used for the cases when the word to be indexed is special, for instance

\toindex[equipe@\'Equipe]{\'equipe}


However, I don't see the necessity to capitalize words in the index. Look at the TeXbook, for an example. :)

-
Well it's not that much the fact that an index starts with a capital letter, but more the fact that when you use an item twice (with lowercase and uppercase), two items are added to the index... –  CommuSoft Jan 27 at 4:45