I am currently writing a paper with an extended glossary. Therefore, I use the glossaries
package. I want the first appearance of a glossary entry being indicated by a symbol preceding the name of the entry. Until some recent changes to the package this could be achieved with the following code:
\defglsdisplayfirst[\glsdefaulttype]{#1}
(In above case, nothing would be changed but the content of the last brackets is responsible for the first entry's appearance, see my extended example below.)
Now, the same thing is achieved with the following code:
\renewcommand*{\glsentryfmt}{%
\ifglsused{\glslabel}{}{}
\glsgenentryfmt
}
(In this example, the first entry would not be changed but \ifglsused
makes it possible to insert anything in the second brackets which would precede the actual entry which is inserted with \glsgenentryfmt
.)
I find the new approach more difficult but it is explained in glossaries-user.pdf on page 100 at the bottom and is more flexible of course. After fiddling around with the package and doing some adjustments I found out that changing the acronym style makes \renewcommand*{\glsentryfmt}
(and so on) useless as can be tested with the following code:
\documentclass{article}
\usepackage{MnSymbol}
\newcommand{\glmarker}{$\smalltriangleright$}
\usepackage{glossaries}
\makeglossaries
% overwriting the first appearance of a glossary entry
% in previous versions this was done with
%
% \defglsdisplayfirst[\glsdefaulttype]{\glmarker\,#1}
%
% now, it is done with the following command (see glossaries-user.pdf, p. 100
% bottom)
\renewcommand*{\glsentryfmt}{%
\ifglsused{\glslabel}{}{\glmarker\,}
\glsgenentryfmt
}
\setglossarystyle{altlist}
% with setting the acronymstyle to 'long-short-desc' overwrites the adjustments
% for the first appearance of an gls entry (it does not matter whether
% \setacronymstyle is triggered before or after \renewcommand*{\glsentryfmt}
%\setacronymstyle{long-short-desc}
\newglossaryentry{example}{
name={example},
description={
an example is an example
}
}
\begin{document}
This is the first appearance of an entry in the glossary: \gls{example}. This
is the second appearance of an entry in the glossary: \gls{example}.
\printglossaries
\end{document}
Not setting the acronym style results in the following output (which I intended but displays acronyms not as long-short-desc
):
But setting the new acronym style results in the following output without the marker I would like to add before the first appearance of the entry. And the code defining the first appearance of an entry is still active!
I also tried switching the appearance of setting the new acronym style and defining the new appearance of the first entry in the code but, unfortunately, this did not result in a working example.
Is this intended and I am doing something wrong? I did not have this problem when I used the (now) out-dated variant of defining the appearance of a first entry.