Uppercase word in glossary, lowercase in text
There is a simple solution. You can set the text that appears in the glossary and the text that appears in the... text separatly.
\newglossaryentry{uppercase}{
name={Uppercase},
text={uppercase},
description={Appears uppercase in the glossary and lowercase in the text}
}
For future users encountering same trouble:
I ran into the problem myself and found this question and its duplicate. @Nitram's solution was useful in the case of a first word defined as a macro. However:
- I didn't want to duplicate all the name entries,
- I did want to keep control of what is capitalized and what isn't (case of mathematical symbols as first characters),
- I wanted to keep the usual behaviour if nothing is specifically asked.
From an answer by @nicola-talbot there, I found a simple redefinition that does the trick:
\usepackage{mfirstuc}
\renewcommand{\glsnamefont}[2][]{\capitalisewords{#1}\xspace#2}
Examples:
Usage: outputs "First word capitalized" in the glossary, and \gls{firstexample} in-text outputs "first word capitalized":
\newglossaryentry{firstexample}{
name={first}{word capitalized}
}
This won't work with a macro (will capitalize whole word), hence use of text field:
\newglossaryentry{boite}{
name={\Boite de valeurs},
text={\boite de valeurs}
}
I have maths first, normal use of name: both in the glossary and in-text \gls{firstexample} output "$i$-th blabla":
\newglossaryentry{iblabla}{
name={$i$-th blabla}
}
I've used Nicola's answer, since none of the answers here worked for me.
The glossaries-extra
package allows to easily setup the capitalization with firstuc
.
I didn't had to change much of my previews code, nor calls. Just change the package and add the following code:
\setglossarystyle{long}
\setabbreviationstyle[acronym]{long-short}
\glssetcategoryattribute{acronym}{glossdesc}{firstuc}