# Capitalize first letter of each word when printing list of acronyms

I use the glossaries package and when I print the acronyms using \printglossary[type=\acronymtype,title={List of Abbreviations}], part of the output I get is as shown below.

I have specified acronyms in a separate file as follows:

\newacronym{brdf}{BRDF}{bidirectional reflectance distribution function}
\newacronym{cnn}{CNN}{convolutional neural network}


Is there a way to capitalize first letter of all words in the list of acronyms ONLY, when printing? (And have them in lower-case in the text)

Edit:

example

\documentclass[a4paper,oneside,12pt]{report}
% Abbreviations
\usepackage[acronym,style=super,nogroupskip,nonumberlist,toc]{glossaries}

\makeglossaries

\begin{document}
% abstract, toc, list of figures here
\renewcommand{\glsnamefont}[1]{\textbf{#1}}
\printglossary[type=\acronymtype,title={List of Abbreviations}]

\chapter*{Example Usage}
\gls{brdf}, \gls{awgn}, \gls{psnr}, \gls{cnn}
% chapters
\end{document}


def_abr.tex file:

\newacronym{brdf}{BRDF}{bidirectional reflectance distribution function}
\newacronym{cnn}{CNN}{convolutional neural network}
\newacronym{psnr}{PSNR}{peak-signal-to-noise ratio}
\newacronym{snr}{SNR}{signal to noise ratio}

• Show a complete example that can be used for tests. That makes it much easier to help you. – Ulrike Fischer Mar 25 at 9:24
• @UlrikeFischer added. – Sndn Mar 25 at 9:44
• That's not a complete example. It has no \documentclass command, I can't compile it due to the reference to an external file and as it doesn't use the acronyms the list will be empty. – Ulrike Fischer Mar 25 at 9:46
• @UlrikeFischer Apologies. Is update ok? – Sndn Mar 25 at 11:06
• Acronym psnr not defined. – Steven B. Segletes Mar 25 at 11:07

Here's an alternative approach that uses glossaries-extra (an extension to the glossaries package):

\documentclass[a4paper,oneside,12pt]{report}
% Abbreviations
\usepackage[acronym,style=super,nogroupskip,nonumberlist]{glossaries-extra}

\makeglossaries
\setabbreviationstyle[acronym]{long-short}

\glssetcategoryattribute{acronym}{glossdesc}{title}

\begin{document}
% abstract, toc, list of figures here
\renewcommand{\glsnamefont}[1]{\textbf{#1}}
\printglossary[type=\acronymtype,title={List of Abbreviations}]

\chapter*{Example Usage}
\gls{brdf}, \gls{awgn}, \gls{psnr}, \gls{cnn}
% chapters
\end{document}


(I've omitted the toc option as it's the default for glossaries-extra).

This produces on page 1:

and page 2:

The glossaries package automatically loads mfirstuc (which was originally developed as part of the glossaries package). The title attribute uses \capitalisewords to convert the case. You can control whether or not to capitalise the hyphenated parts of words using \MFUhyphentrue and \MFUhyphenfalse. The default is the false setting, which is why the above has "Peak-signal-to-noise".

The following switches it on:

\documentclass[a4paper,oneside,12pt]{report}
% Abbreviations
\usepackage[acronym,style=super,nogroupskip,nonumberlist]{glossaries-extra}

\makeglossaries
\setabbreviationstyle[acronym]{long-short}

\glssetcategoryattribute{acronym}{glossdesc}{title}
\MFUhyphentrue

\begin{document}
% abstract, toc, list of figures here
\renewcommand{\glsnamefont}[1]{\textbf{#1}}
\printglossary[type=\acronymtype,title={List of Abbreviations}]

\chapter*{Example Usage}
\gls{brdf}, \gls{awgn}, \gls{psnr}, \gls{cnn}
% chapters
\end{document}


This produces:

To prevent words like "to" from being changed use the mfirstuc-english package or set up exceptions with \MFUnocap (for example, \MFUnocap{to}).

• Elegant solution! However with \MFUnocap{to} and \MFUhyphentrue exception didn't work for me. – Sndn Mar 27 at 20:30
• @Sndn Sorry I should've checked that. I'll look into it. – Nicola Talbot Mar 30 at 10:03

You can use \titlecap to capitalize the 1st letter of each word in the List of Abbreviations. You can even exclude words like to from being capitalized. The key is to turn on the meaning of \titlecap for the glossary print, and turn it off elsewhere.

I am not a glossaries user, but I am sure there is a way to automate the process so that the \titlecap macro need not be added to each entry.

\documentclass[a4paper,oneside,12pt]{report}
\usepackage{titlecaps}
\usepackage{filecontents}
\begin{filecontents*}{glsfile}
\newacronym{brdf}{BRDF}{\titlecap{bidirectional reflectance distribution function}}
\newacronym{cnn}{CNN}{\titlecap{convolutional neural network}}
\newacronym{psnr}{PSNR}{\titlecap{peak-signal-\relax to-noise ratio}}
\newacronym{snr}{SNR}{\titlecap{signal to noise ratio}}
\end{filecontents*}
% Abbreviations
\usepackage[acronym,style=super,nogroupskip,nonumberlist,toc]{glossaries}

\makenoidxglossaries
\begin{document}
% abstract, toc, list of figures here
\renewcommand{\glsnamefont}[1]{\textbf{#1}}
\printnoidxglossary[type=\acronymtype,title={List of Abbreviations}]
\renewcommand\titlecap[1]{#1}

\chapter*{Example Usage}
\gls{brdf}, \gls{awgn}, \gls{psnr}, \gls{cnn}, \gls{snr}
% chapters
\end{document}


A possible solution is to redefine the \glossentry command that is used to print the entries in the glossary table. In the MWE below I have used the \makefirstuc command from the mfirstuc package to make the first letter of the entry upper case. The definitions in the text remain lower case.

The code is not very clean but I could not figure out how to apply the \makefirstuc command directly on the \glossentrydesc command or on the argument of this command so I opted for a similar construct as in the mfirstuc package manual.

Edit: on closer reading the OP asked to capitalize all words. mfirstuc has a command for that (\capitalisewords), and also has a shortcut for expansion (\ecapitalisewords).

MWE:

\documentclass[a4paper,oneside,12pt]{report}
% Abbreviations
\usepackage[acronym,style=super,nogroupskip,nonumberlist,toc]{glossaries}
\usepackage{mfirstuc}

\makeglossaries

\begin{document}
\gls{brdf}, \gls{awgn}, \gls{psnr}, \gls{cnn}

\renewcommand*{\glossentry}[2]{%  Change the displayed items
\glstarget{#1}{\glossentryname{#1}} %
& \ecapitalisewords{\glossentrydesc{#1}}% Description
\tabularnewline
}

\printglossary[type=\acronymtype,title={List of Abbreviations}]
\end{document}


Result:

Sources:

glossaries: How to customize list of symbols with additional column for units?

Is there a command to make first letter upper case?

Note that the first question redefines \glossentry in the context of a glossarystyle, that is probably better if you use multiple types of glossaries (or in general if you prefer cleaner code).