Feature Request Tracker

ID:36 🔗
Status:Closed (Not Implemented)
Category:glossaries
Submitted by:Denis Bitouzé
Date:2015-09-23 12:23:00
Summary:Provide an easier way to skip an entries from glossaries

Report

Looking for a way to not display well known acronyms in list of acronyms, I found this question:

Do not display one special acronym in list of acronyms

and saw your comment that says it is enough to define the entries as usual and use \glsmoveentry to move them to an undefined glossary, as explained here:

Moving Entries to Another Glossary

But, an easier way to skip entries from glossaries would be nice. In the spirit of \glsadd, a command such as \glsskip{label} could be nice. I agree that additional commands, such as \acrshortskip{label} could be necessary.

Evaluation

\glsadd works by adding a line to the indexing file. It's not so easy to perform the reverse operation, particularly since the possibility of hyperlinks needs to be taken into account. I have therefore decided not to implement this feature.

The simplest method is to create an ignored glossary and (for acronyms with just the base package) identify it as a list of acronyms. The acronym should then be defined with the type set to that ignored glossary. This will ensure that no hyperlinks are created for that entry (since obviously the hypertarget won't exist). It's also the best method from a semantic point of view as it clearly identifies the acronym as being somehow different from the others when it's defined (for example, too common to need an explanation).

With the glossaries-extra package you can use of combination of hyper=false,noindex when referencing the particular entries, which will prevent both the hyperlink and indexing but obviously this is a bit tedious if you reference the term multiple times.

The question really is why do you want particular acronyms to be omitted from the list? If it's because they're only referenced once then the entry counting mechanism is better. If it's because the terms are so common that they don't need to be described then it's better to have an ignored glossary. With the glossaries-extra package you don't need to identify the ignored glossary as a list of acronyms.

Examples:

  1. Use an ignored glossary with the base package:
    \documentclass{article}
    
    \usepackage[colorlinks]{hyperref}
    \usepackage[acronymlists={main,common}]{glossaries}
    
    \newignoredglossary{common}
    
    \makeglossaries
    
    \setacronymstyle{long-short}
    
    \loadglsentries[common]{example-glossaries-acronym}
    \loadglsentries{example-glossaries-acronym-desc}
    
    \begin{document}
    \gls{lid} and \gls{mal}.
    \printglossaries
    \end{document}
    
    Only the MAL entry appears in the list. The LID entry doesn't have a hyperlink. The first sentence reads "lorem ipsum dolor (LID) and morbi auctor lorem (MAL)."
  2. It's marginally simpler with the glossaries-extra package as you don't need to identify the acronym lists:
    \documentclass{article}
    
    \usepackage[colorlinks]{hyperref}
    \usepackage{glossaries-extra}
    
    \newignoredglossary{common}
    
    \makeglossaries
    
    \setabbreviationstyle[acronym]{long-short}
    
    \loadglsentries[common]{example-glossaries-acronym}
    \loadglsentries{example-glossaries-acronym-desc}
    
    \begin{document}
    \gls{lid} and \gls{mal}.
    \printglossaries
    \end{document}
    
    The result is the same as before.
  3. Entry counting with the base package:
    \documentclass{article}
    
    \usepackage[colorlinks]{hyperref}
    \usepackage{glossaries}
    
    \glsenableentrycount
    
    \makeglossaries
    
    \setacronymstyle{long-short}
    
    \loadglsentries{example-glossaries-acronym}
    \loadglsentries{example-glossaries-acronym-desc}
    
    \begin{document}
    \cgls{lid} and \cgls{mal}. Another \cgls{mal}.
    \printglossaries
    \end{document}
    
    (Document build: pdflatex, pdflatex, makeglossaries, pdflatex.) Again only the MAL entry is listed but now the first sentence is "lorem ipsum dolor and morbi auctor lorem (MAL)." If you prefer to have the full form ("lorem ipsum dolor (LID)") or just the short form ("LID") then you can redefine \cglsformat and \cglsplformat as appropriate.
  4. Entry counting with the glossaries-extra package:
    \documentclass{article}
    
    \usepackage[colorlinks]{hyperref}
    \usepackage{glossaries-extra}
    
    \makeglossaries
    
    \GlsXtrEnableEntryCounting{acronym}{1}
    
    \setabbreviationstyle[acronym]{long-short}
    
    \loadglsentries{example-glossaries-acronym}
    \loadglsentries{example-glossaries-acronym-desc}
    
    \begin{document}
    \gls{lid} and \gls{mal}. Another \gls{mal}.
    \printglossaries
    \end{document}
    
    (Document build: pdflatex, pdflatex, makeglossaries, pdflatex.)

With bib2gls, you can use record counting (instead of entry counting) or you can use filtering or you can again use an ignored glossary. However, the entry must be selected somehow in order for it to be defined even if it shouldn't be displayed in the glossary.

Add comment or return to search results.

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 search results.