3

My question seems easy : How put an asterisk at the end of all first use of glossaries occurrences in the text (or for exemple, put it in bold…) ? But only in my glossary, not in my acronyms.

\documentclass{scrbook}
\usepackage[acronyms]{glossaries}

\newglossaryentry{word}{name={word},description={def. 1}}
\newglossaryentry{other}{name={other},description={def. 2}}
\newacronym[option=description]{acr}{Acronym}{Complet}+

\begin{document}
First use of \gls{word} and second use : \gls{word}.\\
First use of \gls{other} and second use : \gls{other}.\\
First use of \gls{act} and second use : \gls{acr}.

\printglossaries
\end{document}

I want just this result :

First use of word* and second use : word.

First use of other* and second use : other.

First use of Acronym (acr) and second use : acr.

It must exist a simple command, but I don't find in the big glossaries manual… 

My problem is that I'm not english speaker. Thanks for your help.

8

You need a fairly up-to-date version of glossaries for this to work. (I think at least v4.0. The current version is 4.09.)

\documentclass{scrbook}
\usepackage[acronyms]{glossaries}

\makeglossaries
\setacronymstyle{long-short-desc}

\newglossaryentry{word}{name={word},description={def. 1}}
\newglossaryentry{other}{name={other},description={def. 2}}
\newacronym[description=description]{acr}{Acronym}{Complete}

\defglsentryfmt[main]{\glsgenentryfmt\ifglsused{\glslabel}{}{*}}

\begin{document}
First use of \gls{word} and second use : \gls{word}.\\
First use of \gls{other} and second use : \gls{other}.\\
First use of \gls{acr} and second use : \gls{acr}.

\printglossaries

\end{document}

This just overrides the format for the main glossary. It uses \glsgenentryfmt to use the generic format for displaying the entry and then checks if the entry has been used with \ifglsused. If it hasn't been used, it displays an asterisk. The above produces:

Image of document

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.