Bug Tracker
I’m currently working on a major new version of the datatool package. This may take a while. Please be patient. (Experimental version available for testing.)
ID | 28🔗 |
---|---|
Date: | 2013-07-07 05:08:05 |
Status | Closed (Fixed) |
Category | glossaries |
Version | 3.06 |
Summary | \Glsentry... doesn't work in arguments of sectioning commands |
Sign in to subscribe to notifications about this report.
Description
\Glsentryname
, \Glsentrytext
, \Glsentryplural
give errors in arguments of sectionning commands:
! Undefined control sequence. \makefirstuc #1->\def \gls@argi
MWE
Download (347B)
\listfiles \documentclass{article} \usepackage{glossaries} \newglossaryentry{foo}{% name=foo, plural=foox, description=bar } \begin{document} \section{\glsentryname{foo}} \section{\glsentrytext{foo}} \section{\glsentryplural{foo}} \section{\Glsentryname{foo}} % \section{\Glsentrytext{foo}} % \section{\Glsentryplural{foo}} \end{document}
Evaluation
The commands that uppercase the first letter are fragile and need to be protected in moving arguments.
\documentclass{article} \usepackage{glossaries} \newglossaryentry{foo}{% name=foo, plural=foox, description=bar } \begin{document} \section{\glsentryname{foo}} \section{\glsentrytext{foo}} \section{\glsentryplural{foo}} \section{\protect\Glsentryname{foo}} \section{\protect\Glsentrytext{foo}} \section{\protect\Glsentryplural{foo}} \end{document}
Update 2013-10-09
As from version 3.09a (experimental release) these commands are now robust. I'll upload the package to CTAN when it's stabilized.
Update 2013-11-14
I've uploaded glossaries v4.0 to CTAN.
Comments
2 comments.
Date: 2013-12-24 12:40:00
Yes, it's the optional argument of sectioning commands that's the moving argument. If the optional argument isn't used, it's assumed to be the same as the mandatory argument, so for old versions of glossaries you can do \section[\protect\Glsentryname{foo}]{\Glsentryname{foo}}
because when the optional argument is used, only the fragile commands in the optional argument need protecting.
Note: if you're using hyperref as well, have a look at I get the message "Token not allowed in a PDF string (PDFDocEncoding)".
Add Comment
Page permalink: https://www.dickimaw-books.com/bugtracker.php?key=28
Date: 2013-12-22 22:47:56
Hi Nicola,
just a small note: while your workaround works fine for section (etc.) names, it does not work in the optional argument, e.g.
\section[\protect\Glsentryname{foo}]{\acf{foo}}
The new version fixed both problems though, but maybe you wanna comment on the optional arguments for those who can not or don't want to upgrade.
regards, Stefan