[Tex/LaTex] Glossaries package: small caps in body and normal caps in the acronym list

acronymsglossariessmall-caps

I want a list of acronyms to be printed in normal caps. However, I want small caps acronyms in the body text. I use glossaries package as the following example. Would you please help?

\documentclass[a4paper]{report}
\usepackage[style=long, toc, smallcaps]{glossaries}
\makeglossaries
\newacronym{acr}{acr}{Acronym}
\begin{document}
This is an \gls{acr}. An \gls{acr} should be in small caps.
The first column in the follwoing list of acronyms should be in normal caps.
\printglossary[title={List of Acronyms}]
\end{document}

Best Answer

Page 123 of the glossaries' user manual reads:

\glossaryentryfield{<label>}{<formatted name>}{<desc>}{<symbol>}{<number list>}

This macro indicates what to do for a given glossary entry. Note that <formatted name> will always be in the form \glsnamefont{<name>}. This allows the user to set a given font for the entry name, regardless of the glossary style used.

With this in mind, one solution to your problem is to change the definition of \glsnamefont:

\documentclass[a4paper]{report}
\usepackage[style=long,smallcaps]{glossaries}

\newacronym{acr}{acr}{Acronym}

\renewcommand{\glsnamefont}[1]{\MakeUppercase{#1}}

\immediate\write18{makeglossaries \jobname} % run (pdf)latex twice with --shell-escape
\makeglossaries

\begin{document}
\gls{acr}; \gls{acr}.
\printglossary[title={List of Acronyms}]
\end{document}

enter image description here