Free Software
News (2017-09-10): New application bib2gls for use with glossaries-extra.sty.

Feature Request Tracker

ID 10
Status Closed (Implemented)
Category glossaries
Summary Variable pronoun


I am using glossaries to define recurring acronyms and link them to a glossary section.

One of my acronyms is the following:

\newacronym[longplural=Markov decision processes]{mdp}{MDP}{Markov decision process}
The indeterminate pronoun to use with this construction depends if the acronym is used (an MDP) or not (a Markov decision process). Would it be possible to have this encoded in glossaries, the same way that long plurals are defined?

Thanks in advance,

Comment from Nicola Talbot

I suggest defining commands like the following:

\newcommand{\agls}[2][]{\ifglsused{#2}{an \gls[#1]{#2}}{a \gls[#1]{#2}}}
\newcommand{\Agls}[2][]{\ifglsused{#2}{An \gls[#1]{#2}}{A \gls[#1]{#2}}}
Unfortunately there are too many different variations of grammar and languages to accommodate all constructs without adding extra overhead to the package.

Comment from Nicolas
Date: 2013-09-24 12:23:49 CDT

This unfortunately cannot work. The macro `\agls` does not differentiate between the four possible cases: (a, a), (a, an), (an, a), (an, an). The two components of a tuble being (abbreviated, non abbreviated).

Comment from anonymous
Date: 2013-09-24 12:42:45 CDT

The closest I could get to a desirable result is:

\newacronym[longplural=Markov decision processes, user1=an, user2=a, user3=An, user4=A]{mdp}{MDP}{Markov decision process}

\newcommand{\agls}[2][]{\ifglsused{#2}{\glsuseri{#2} \gls[#1]{#2}}{\glsuserii{#2} \gls[#1]{#2}}}
\newcommand{\Agls}[2][]{\ifglsused{#2}{\glsuseriii{#2} \gls[#1]{#2}}{\glsuseriv{#2} \gls[#1]{#2}}}

I will look into adding some news keys to my glossary entries.

Comment from Nicolas Dudebout
Date: 2013-09-24 16:21:20 CDT

I have a working implementation at the following address https://gist.github.com/dudebout/648241fe7b8cc3fb0b30
The new code is only the first 40 lines. I had to redefine \newglossaryentry only in two locations to plug in my new keys.

I think that this case of indefinite article is very similar to specific plurals. I would gladly rework any part you want if that helps with merging it upstream.

By the way, as I wrote this I saw some code redundancy. For example, in the definition of \Glsuseri (more specifically @Glsuseri) you duplicate the macro \Glsentryuseri. This is done in all the user variables as far as I can tell.

Let me know your thoughts.

Comment from Nicolas Dudebout
Date: 2013-10-01 11:14:56 CDT

I have deleted the gist and created a new repository for my extension: https://github.com/dudebout/latex_ddbglossaries

If you want to continue discussion please open an issue there as I do not get any notifications from dickimaw-books.com.


In experimental version 3.14a, I've add a new package glossaries-prefix that is a more generic approach. When the version has stabilized it will be uploaded to CTAN as version 4.0.

Update 2013-11-14

I've now uploaded glossaries version 4.0 to CTAN.

Watch This Request

If you would like to be notified whenever updates are made to this feature request, please fill in your email address in the box below and click on "Notify Me of Changes". (Please ensure the address is valid.) Your details won't be passed on to third parties in line with this site's Privacy Policy.


If you would like to add a comment regarding this feature request, please fill in the form below, but don't use it for a different bug or feature request, even if it's related. Instead fill out a new bug report or feature request.

Name (Optional)

I'm sorry, some spammers have cracked the captcha, so here's a test to check if you're human.
Please enter the ID number of this report in the confirm key box below.

Confirm key:

Note: the free software provided here (including my class files and packages on CTAN) are funded by my book sales. While I'm keen to improve my code, book production has to take priority, so please don't expect a rapid response.

© 2012 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Site Map FAQs