I am using the glossaries
package in pdfLaTeX. I am trying to
-
use the acronyms written in small caps in the body text
and
-
for the index, make the first letter of each entry name in the glossary uppercase.
I have already tried to look around but I could not find a solution.
To obtain the glossary I run the command makeindex
defined as following:
"/usr/texbin/makeglossaries" %
Normally, I load my entries from 2 external files but I do not think that this is the problem since I get the same issue also after running my MWE. Anyway, to show the commands I'm using I inserted them as comments in the MWE.
Also, I'm not sure if this is important, but I use MinionPro as my main font and KOMA-Script.
My MWE is based on this thread:
http://www.latex-community.org/forum/viewtopic.php?f=5&t=9966
\documentclass{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[toc=true,smallcaps,section,nonumberlist,acronym,nomain]{glossaries}
\newglossary{slg}{sym}{syb}{Nomenclature}
% \input{./text/glossary}
% \loadglsentries{./text/symbols}
\makeglossaries
\newacronym{pcm} {PCM} {phase change material}
\newglossaryentry{sym:hfus}{type=slg,sort={pl:h},
name = {\null$\Delta H_{fus}$},
description={latent heat of fusion}}
\begin{document}
Sample: \gls{sym:hfus}. \gls{sym:hfus}. \gls{pcm}. \gls{pcm}.
\textsc{This is small caps. PCM pcm }
\renewcommand{\glsnamefont}[1]{\makefirstuc{#1}}
\printglossary[type=slg, style=long, nonumberlist=true]
\renewcommand{\glsnamefont}[1]{\MakeUppercase{#1}}
\printglossary[type=acronym, style=long]
\end{document}
Here's the result:
The only thing that gets capitalized is Fus from the math environment and I really do not understand how this happens. Everything else (smallcaps option and uppercases of description) is just not working.
Someone can please explain me what I'm doing wrong?
Best Answer
As mentioned in the comments, your acronyms aren't appearing in small caps because you've defined them using upper case. You said that the upper casing of the description hasn't worked. That's because you haven't made any changes relating to the description.
\glsnamefont
is applied to the name not the description. You need to define a new style that makes the description start with an upper case letter:This produces:
The following defines a style that makes the initial letters of the description upper case:
Result:
If you have at least version 4.22 of
glossaries
, you can use\glsentrytitlecase
instead:With
glossaries-extra
you can make use of theglossdesc
attribute: