The glossaries bundle is supplied with the package mfirstuc which provides the command:
This makes the first object of <stuff> uppercase unless <stuff> starts with a control sequence followed by a non-empty group, in which case the first object in the group is converted to uppercase. Examples:
produces ABC (first object is {\em abc} so equivalent to \MakeUppercase{\em abc}), and
produces abc (\em doesn’t have an argument therefore first object is \em so equivalent to {\MakeUppercase{\em}abc}).
Note that non-Latin or accented characters appearing at the start of the text must be placed in a group (even if you are using the inputenc package) due to expansion issues.
Note also that
produces: ABC. This is because the first object in the argument of \makefirstuc is \abc, so it does \MakeUppercase{\abc}. Whereas:
produces: Abc. There is a short cut command which will do this:
This is equivalent to \expandafter\makefirstuc\expandafter{<stuff>}. So
produces: Abc.
If you use mfirstuc without the glossaries package, the standard \MakeUppercase command is used. If used with glossaries, \MakeTextUppercase (defined by textcase the package) is used instead. If you are using mfirstuc without the glossaries package and want to use \MakeTextUppercase instead, you can redefine
For example:
Remember to also load textcase (glossaries loads this automatically).
New to mfirstuc v1.06:
This command apply \makefirstuc to each word in <text> where the space character is used as the word separator. Note that it has to be a plain space character, not another form of space, such as ~ or \space. Note that no expansion is performed on <text>.
This is a short cut for \expandafter\capitalisewords\expandafter{<text>}.
If you want to provide an alternative for the PDF bookmark, you can use hyperref’s \texorpdfstring command. See the hyperref manual for further details.
Examples:
produces: A Book Of Rhyme.
produces: A Book of Rhyme.
produces: A BOOK OF RHYME. (No expansion is performed on \mytitle, so <text> consists of just one “word”.) Compare with next example:
produces: A Book of Rhyme.