Hi,
I have been having some trouble in trying to capitalize just the first character of the acronym in the final listing alone.
i.e. I want the acronym to be small in the normal text but for the List of Acronym, the listing should have the first character of each word in the text to be capitalized.
e.g. a sample acronym (ABC)
Whereas, in the listing (\printglossaries) it should be:
ABC A Sample Acronym
Any help or lead in the right direction would be great
Thanks
General ⇒ glossaries | Capitalize first Character in final List
NEW: TikZ book now 40% off at Amazon.com for a short time.

glossaries | Capitalize first Character in final List
I think the easiest way is to use the custom acronym style:
Regards
Nicola Talbot
Code: Select all
\documentclass{article}
\usepackage{glossaries}
\renewcommand*{\CustomAcronymFields}{%
name={\the\glsshorttok},%
description={\noexpand\makefirstuc{\the\glslongtok}},%
first={\noexpand\acrfullformat{\the\glslongtok}{\the\glsshorttok}},%
firstplural={\noexpand\acrfullformat
{\the\glslongtok\noexpand\acrpluralsuffix}{\the\glsshorttok}}%
text={\the\glsshorttok},%
plural={\the\glsshorttok\noexpand\acrpluralsuffix}%
}
\SetCustomStyle
\makeglossaries
\newacronym{ABC}{ABC}{a sample acronym}
\begin{document}
Test: \gls{ABC}. \gls{ABC}.
\printglossaries
\end{document}
Nicola Talbot
LaTeX Resources: http://www.dickimaw-books.com/latexresources.html
Creating a Minimal Example: http://www.dickimaw-books.com/latex/minexample/
Creating a Minimal Example: http://www.dickimaw-books.com/latex/minexample/
Re: glossaries | Capitalize first Character in final List
HI,
Thanks a lot for your response.
I tried playing around with \makefirstuc and \glsmakefirstuc or \xmakefirstuc.
Though the description field only seems to apply it to the first word in the acronym.
Is there any way to make each word in the list of acronym start with an upper case.
e.g. ABC A Sample Acronym, should be in the listing, whereas the text will have a sample acronym.
Thanks for your help,
Thanks a lot for your response.
I tried playing around with \makefirstuc and \glsmakefirstuc or \xmakefirstuc.
Though the description field only seems to apply it to the first word in the acronym.
Is there any way to make each word in the list of acronym start with an upper case.
e.g. ABC A Sample Acronym, should be in the listing, whereas the text will have a sample acronym.
Thanks for your help,
glossaries | Capitalize first Character in final List
Try this:
Regards
Nicola Talbot
Code: Select all
\documentclass{article}
\usepackage{glossaries}
\usepackage{etoolbox}
\DeclareListParser{\wordlist}{ }%
\DeclareRobustCommand{\capitalise}[1]{%
\def\addspace{}%
\renewcommand*{\do}[1]{\addspace\makefirstuc{##1}\def\addspace{ }}%
\wordlist{#1}%
}
\renewcommand*{\CustomAcronymFields}{%
name={\the\glsshorttok},%
description={\capitalise{\the\glslongtok}},%
first={\noexpand\acrfullformat{\the\glslongtok}{\the\glsshorttok}},%
firstplural={\noexpand\acrfullformat
{\the\glslongtok\noexpand\acrpluralsuffix}{\the\glsshorttok}}%
text={\the\glsshorttok},%
plural={\the\glsshorttok\noexpand\acrpluralsuffix}%
}
\SetCustomStyle
\makeglossaries
\newacronym{ABC}{ABC}{a sample acronym}
\begin{document}
Test: \gls{ABC}. \gls{ABC}.
\printglossaries
\end{document}
Nicola Talbot
LaTeX Resources: http://www.dickimaw-books.com/latexresources.html
Creating a Minimal Example: http://www.dickimaw-books.com/latex/minexample/
Creating a Minimal Example: http://www.dickimaw-books.com/latex/minexample/
Re: glossaries | Capitalize first Character in final List
Hi,
Thanks a lot, that works just fine for my picky requirements!
Never thought about trying with a capitalize and creating custom command, as was done in the above code.
Great package!
Thanks a lot, that works just fine for my picky requirements!
Never thought about trying with a capitalize and creating custom command, as was done in the above code.
Great package!