[Tex/LaTex] How to get acronyms description with lowercase letters within text, but uppercase letters at the acronyms list

acronymsglossaries

Using glossaries package, I would like to define acronyms in the text using lowercase letters as follows:
sample acronym (SA)
degrees of freedom (DOF)
While recurrences will be displayed as:
SA
DOF

However, at the acronyms list, I would like it to appear with uppercase letters as:
SA – Sample Acronym
DOF – Degrees of Freedom

A simple example should look like this:
enter image description here

Using the following code, I can't get it right:

\documentclass{article}
\usepackage[acronym]{glossaries} 
\makeglossaries

\newglossaryentry{sample}{name=sample,description=a sample entry}

\newacronym{sa}{SA}{Sample Acronym}
\newacronym{dof}{DOF}{Degrees of Freedom}

\begin{document}

This is a \gls{sample}. And this is a \gls{sa}, while another one will be \gls{dof}.
Recurrences are \gls{sa} and \gls{dof}.

\renewcommand{\glsnamefont}[1]{\makefirstuc{#1}}
\printglossary

\printglossary[type=acronym,style = super]
\end{document}

The results are:
enter image description here

Best Answer

With glossaries-extra, you can just set the glossdesc attribute.

\documentclass{article}

\usepackage[abbreviations]{glossaries-extra}
\glssetcategoryattribute{general}{glossdesc}{firstuc}
\glssetcategoryattribute{abbreviation}{glossdesc}{title}

\makeglossaries

\newglossaryentry{sample}{name=sample,description=a sample entry}

\newabbreviation{sa}{SA}{sample acronym}
\newabbreviation{dof}{DOF}{degrees {}of freedom}

\begin{document}

This is a \gls{sample}. And this is a \gls{sa}, while another one will be \gls{dof}.
Recurrences are \gls{sa} and \gls{dof}.

\renewcommand{\glsnamefont}[1]{\makefirstuc{#1}}
\printglossary

\printglossary[type=abbreviations, style=super]

\end{document}

MWE output

Related Question