Latest news 2019-11-04: The giveaway of two signed copies of “Quack, quack, quack. Give my hat back!” has closed and the winning entrants have been selected. Thank you to everyone who took part.

Feature Request Tracker

ID10
StatusClosed (Implemented)
Categoryglossaries
SummaryVariable pronoun

Report

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,
Nicolas

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.

Evaluation

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.

Add comment.

Watch This Report

If you would like to be notified whenever updates are made to this report, please fill in your email address in the box below and click on "Notify Me of Changes" button. (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 supply your name, it will be used in the email greeting, which provides a more personal message, otherwise you'll just get a generic greeting. If you have previously supplied your name when signing up for notifications, you don't need to resupply it unless you want to change it.

If you have previously subscribed to notifications for this report, you can unsubscribe by clicking on the "Stop Notification" button.

The "Confirm Topic ID" field helps to protect against spambots. Please enter the feature request ID (which you can find at the top of this page).

(Optional.)
E mail:
Confirm E mail:
Confirm Topic ID:

To unsubscribe from all notifications use the notifications page.

Comment

You can append a comment to this report using the form below. Comments are checked first before being added. Any spam or offensive content will be removed first according to this site's Terms of Website Use. Please bear in mind that I develop and maintain free software in my spare time. If you want commerical level support then you can hire a TeX consultant.

The "Confirm Feature Request ID" field helps to protect against spambots. Please enter the feature request ID (which you can find at the top of this page).

(Optional. If provided, it will be shown with the comment.)
Confirm Feature Request ID:

You can use the following markup:

[pre]Displayed verbatim[/pre]
[tt]monospace text[/tt]
[em]emphasized text[/em]
[b]bold text[/b]
[url]web address[/url]

Ordered list:
[ol]
[li]first item[/li]
[li]second item[/li]
[/ol]

Unordered list:
[ul]
[li]first item[/li]
[li]second item[/li]
[/ul]

Click on the Preview button to preview the message.

Return to list.

© 2019 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 Cookies Site Map FAQs