Latest news 2019-12-05: new blog post "RSS Feeds and Other Notifications."

Bug Tracker

ID85
StatusClosed (Not a Bug)
Categoryglossaries
Version4.15
SummaryFirst use \Gls capitalizes all

Report

According to the manual chapter 13, a \newacronym command uses the 'short', 'shortplural', 'long' and 'longplural' items in \newglossaryentry, and defines it as being of type=\acronymtype. Therefore, to allow a glossary entry to show up with a full description in the glossaries list but act as acronyms in the text, it should be possible to use \newglossaryentry with these fields specified. Unfortunately, doing so breaks the working of the capitalization: on first use with \Gls it capitalizes the full 'long' entry instead of only the first letter of the entry. The second time \Gls is used (on the 'short' entry), it does work correctly (capitalizing only the first letter).

Joost

MWE

\documentclass{article}

\usepackage{glossaries}

\makeglossaries

\newglossaryentry{slns} {
	name = {slns},
	type = \acronymtype,
	description = {This is the description of the glossary entry, but it acts as an acronym},
	short = {SLNS},
	shortplural = {SLNSs},
	long = {some long named system},
	longplural = {some long named systems},
	first = {\glsentrylong{slns} (\glsentryshort{slns})},
	firstplural = {\glsentrylongpl{slns} (\glsentryshortpl{slns})},
}

\begin{document}

\printglossaries

This capitalises everything of the 'long' entry: \Gls{slns}. But this one only capitalises the first letter of the 'short' entry: \Gls{slns}.

\glsresetall
The same for the plural versions: \Glspl{slns} followed by \Glspl{slns}.

\end{document}

Evaluation

This doesn't work because \Gls{slns} is effectively trying to do
\makefirstuc{\glsentrylong{slns} (\glsentryshort{slns})}
According to the design of \makefirstuc this does
\glsentrylong{\MakeUppercase slns} (\glsentryshort{slns})
So this isn't a bug in glossaries but is a feature of \makefirstuc. This is why the generic acronym style redefines \newacronym to expand the value of the long key before internally applying \newglossaryentry.

You need to try one of the following instead:

  1. Switch on the expansion of the fields (which means protecting any fragile commands).
  2. Use a method similar to \SetGenericNewAcronym described more fully in section 1.18 of the documented code.
  3. Define an acronym style (which internally uses \SetGenericNewAcronym) with \newacronymstyle.
The best approach is the last one, which was implemented to avoid this issue. The final argument of \newacronymstyle can include something like:
\renewcommand*{\GenericAcronymFields}{first={\the\glslongtok\space(\the\glsshorttok)}}

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 Bug ID" field helps to protect against spambots. Please enter the bug ID (which you can find at the top of this page).

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

To unsubscribe from all notifications use the notifications page.

Comment

You can append a comment to the 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 Bug ID" field helps to protect against spambots. Please enter the bug ID (which you can find at the top of this page).

(Optional. If provided, it will be shown with the comment.)
Confirm Bug 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