Latest news 2024-10-15: New blog post: Tales for Our Times Book Launch.

Bug Tracker RSS feed

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 277🔗
Date: 2024-08-01 11:31:45
Last update: 2024-08-04 13:56:15
Status Closed (Not a Bug)
Category glossaries-extra
Version 1.53
Summary Uppercase macros not expanding with hyperref
Cross Ref 271

Sign in to subscribe to notifications about this report.

Description

Uppercase commands for section headings (e.g., \Glsfmtshort or \Glsfmtlong) are not fully expanded and produce invalid PDF strings:
Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref)                removing `\glsentryshort' on input line 11.


Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref)                removing `\glsentrylong' on input line 13.
The respective PDF bookmarks only show the entry label.
The not uppercased commands work as expected.
I'm not sure if this is related in any way to #271 Bug Tracker

Is there a workaround other than using \texorpdfstring in every section heading explicitly?

MWE

Download (323B)

\documentclass{article}
\usepackage{hyperref}
\usepackage{glossaries-extra}

\setabbreviationstyle{long-hyphen-short-hyphen}

\newabbreviation{label}{SHORTFORM}{long form}

\begin{document}
\section{\glsfmtshort{label}}
\section{\Glsfmtshort{label}}
\section{\glsfmtlong{label}}
\section{\Glsfmtlong{label}}
\end{document}

Evaluation

I'm sorry, I've not been able to reproduce the problem, but I notice that we have slightly different versions of some packages. Both \glsentryshort and \glsentrylong are expandable so they shouldn't cause that warning. \Glsfmtshort{label} is effectively doing:

\texorpdfstring
  {\Glsxtrtitleshort{label}}
  {\MFUsentencecase{\glsentryshort {label}}}
where \MFUsentencecase is also expandable and defined to simply use \text_titlecase_first:n. I think there have been some changes to the LaTeX3 code that may have affected expansion of the case-changing commands. Adding \listfiles to the start of your mwe I get:
 *File List*
 article.cls    2024/02/08 v1.4n Standard LaTeX document class
  size10.clo    2024/02/08 v1.4n Standard LaTeX file (size option)
hyperref.sty    2024-07-10 v7.01j Hypertext links for LaTeX
   iftex.sty    2022/02/03 v1.0f TeX engine tests
  keyval.sty    2022/05/29 v1.15 key=value parser (DPC)
kvsetkeys.sty    2022-10-05 v1.19 Key value parser (HO)
kvdefinekeys.sty    2019-12-19 v1.6 Define keys (HO)
pdfescape.sty    2019/12/09 v1.15 Implements pdfTeX's escape features (HO)
 ltxcmds.sty    2023-12-04 v1.26 LaTeX kernel commands for general use (HO)
pdftexcmds.sty    2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO)
infwarerr.sty    2019/12/03 v1.5 Providing info/warning/error messages (HO)
 hycolor.sty    2020-01-27 v1.10 Color options for hyperref/bookmark (HO)
 nameref.sty    2023-11-26 v2.56 Cross-referencing by name of section
refcount.sty    2019/12/15 v3.6 Data extraction from label references (HO)
gettitlestring.sty    2019/12/15 v1.6 Cleanup title references (HO)
kvoptions.sty    2022-06-15 v3.15 Key value format for package options (HO)
etoolbox.sty    2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
stringenc.sty    2019/11/29 v1.12 Convert strings between diff. encodings (HO)
  pd1enc.def    2024-07-10 v7.01j Hyperref: PDFDocEncoding definition (HO)
 intcalc.sty    2019/12/15 v1.3 Expandable calculations with integers (HO)
   puenc.def    2024-07-10 v7.01j Hyperref: PDF Unicode definition (HO)
     url.sty    2013/09/16  ver 3.4  Verb mode for urls, etc.
  bitset.sty    2019/12/09 v1.3 Handle bit-vector datatype (HO)
bigintcalc.sty    2019/12/15 v1.5 Expandable calculations on big integers (HO)
atbegshi-ltx.sty    2021/01/10 v1.0c Emulation of the original atbegshi
package with kernel methods
 hpdftex.def    2024-07-10 v7.01j Hyperref driver for pdfTeX
atveryend-ltx.sty    2020/08/19 v1.0a Emulation of the original atveryend packa
ge
with kernel methods
rerunfilecheck.sty    2022-07-10 v1.10 Rerun checks for auxiliary files (HO)
uniquecounter.sty    2019/12/15 v1.4 Provide unlimited unique counter (HO)
glossaries-extra.sty    2023/09/29 v1.53 (NLCT)
 xkeyval.sty    2022/06/16 v2.9 package option processing (HA)
 xkeyval.tex    2014/12/03 v2.7a key=value parser (HA)
glossaries.sty    2024/04/03 v4.54 (NLCT)
  ifthen.sty    2024/03/16 v1.1e Standard LaTeX ifthen package (DPC)
mfirstuc.sty    2022/10/14 v2.08 (NLCT)
    xfor.sty    2009/02/05 v1.05 (NLCT)
datatool-base.sty    2019/09/27 v2.32 (NLCT)
 amsmath.sty    2024/05/23 v2.17q AMS math features
 amstext.sty    2021/08/26 v2.01 AMS text
  amsgen.sty    1999/11/30 v2.0 generic functions
  amsbsy.sty    1999/11/29 v1.2d Bold Symbols
  amsopn.sty    2022/04/08 v2.04 operator names
  substr.sty    2009/10/20 v1.2 Handle substrings
datatool-fp.sty    2019/09/27 v2.32 (NLCT)
      fp.sty    1995/04/02
defpattern.sty    1994/10/12
fp-basic.sty    1996/05/13
fp-addons.sty    1995/03/15
 fp-snap.sty    1995/04/05
  fp-exp.sty    1995/04/03
fp-trigo.sty    1995/04/14
  fp-pas.sty    1994/08/29
fp-random.sty    1995/02/23
  fp-eqn.sty    1995/04/03
  fp-upn.sty    1996/10/21
 fp-eval.sty    1995/04/03
glossary-hypernav.sty    2024/04/03 v4.54 (NLCT)
glossary-list.sty    2024/04/03 v4.54 (NLCT)
glossary-long.sty    2024/04/03 v4.54 (NLCT)
longtable.sty    2024-04-26 v4.20 Multi-page Table package (DPC)
glossary-super.sty    2024/04/03 v4.54 (NLCT)
supertabular.sty    2024/07/20 v4.2c the supertabular environment
glossary-tree.sty    2024/04/03 v4.54 (NLCT)
glossaries-extra-abbrstyles.def    2023/06/28 v1.52 (NLCT)
l3backend-pdftex.def    2024-05-08 L3 backend support: PDF output (pdfTeX)

Comments

1 comment.

🔗Comment from anonymous
Date: 2024-08-04 09:29:05

Thank you for the fast response. You are correct that this is indeed an issue of version incompatibilities (I falsely assumed that I had the latest version). With the newest version, everything works as expected. Sorry for any inconvenience, and thanks for your support!

Version diff:

< LaTeX2e <2023-11-01> patch level 1
< L3 programming layer <2024-02-20>
---
> LaTeX2e <2024-06-01> patch level 2
> L3 programming layer <2024-05-27>


<  article.cls    2023/05/17 v1.4n Standard LaTeX document class
<   size10.clo    2023/05/17 v1.4n Standard LaTeX file (size option)
< hyperref.sty    2024-01-20 v7.01h Hypertext links for LaTeX
---
>  article.cls    2024/02/08 v1.4n Standard LaTeX document class
>   size10.clo    2024/02/08 v1.4n Standard LaTeX file (size option)
> hyperref.sty    2024-07-10 v7.01j Hypertext links for LaTeX


<   pd1enc.def    2024-01-20 v7.01h Hyperref: PDFDocEncoding definition (HO)
---
>   pd1enc.def    2024-07-10 v7.01j Hyperref: PDFDocEncoding definition (HO)


<    puenc.def    2024-01-20 v7.01h Hyperref: PDF Unicode definition (HO)
---
>    puenc.def    2024-07-10 v7.01j Hyperref: PDF Unicode definition (HO)


<  hpdftex.def    2024-01-20 v7.01h Hyperref driver for pdfTeX
---
>  hpdftex.def    2024-07-10 v7.01j Hyperref driver for pdfTeX


< glossaries.sty    2023/09/29 v4.53 (NLCT)
<   ifthen.sty    2022/04/13 v1.1d Standard LaTeX ifthen package (DPC)
---
> glossaries.sty    2024/04/03 v4.54 (NLCT)
>   ifthen.sty    2024/03/16 v1.1e Standard LaTeX ifthen package (DPC)


<  amsmath.sty    2023/05/13 v2.17o AMS math features
---
>  amsmath.sty    2024/05/23 v2.17q AMS math features


< glossary-hypernav.sty    2023/09/29 v4.53 (NLCT)
< glossary-list.sty    2023/09/29 v4.53 (NLCT)
< glossary-long.sty    2023/09/29 v4.53 (NLCT)
< longtable.sty    2023-11-01 v4.19 Multi-page Table package (DPC)
< glossary-super.sty    2023/09/29 v4.53 (NLCT)
< supertabular.sty    2020/02/02 v4.1g the supertabular environment
< glossary-tree.sty    2023/09/29 v4.53 (NLCT)
---
> glossary-hypernav.sty    2024/04/03 v4.54 (NLCT)
> glossary-list.sty    2024/04/03 v4.54 (NLCT)
> glossary-long.sty    2024/04/03 v4.54 (NLCT)
> longtable.sty    2024-04-26 v4.20 Multi-page Table package (DPC)
> glossary-super.sty    2024/04/03 v4.54 (NLCT)
> supertabular.sty    2024/07/20 v4.2c the supertabular environment
> glossary-tree.sty    2024/04/03 v4.54 (NLCT)


< l3backend-pdftex.def    2024-02-20 L3 backend support: PDF output (pdfTeX)
---
> l3backend-pdftex.def    2024-05-08 L3 backend support: PDF output (pdfTeX)
Replying to Comment #144:

Name (optional):

Are you human? Please confirm the bug report ID (which can be found at the top of this page) or login if you have an account.

Comment:


You can use the following markup:

Block:

[pre]Displayed verbatim[/pre]
[quote]block quote[/quote]

In line:

[tt]code[/tt]
[file]file/package/class name[/file]
[em]emphasized text[/em]
[b]bold text[/b]
[url]web address[/url] [sup]superscript[/sup]
[sub]subscript[/sub]

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

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

You can use the Preview button to review your message formatting before submitting.


Add Comment

Name (optional):

Are you human? Please confirm the bug report ID (which can be found at the top of this page) or login if you have an account.

Comment:


You can use the following markup:

Block:

[pre]Displayed verbatim[/pre]
[quote]block quote[/quote]

In line:

[tt]code[/tt]
[file]file/package/class name[/file]
[em]emphasized text[/em]
[b]bold text[/b]
[url]web address[/url] [sup]superscript[/sup]
[sub]subscript[/sub]

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

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

You can use the Preview button to review your message formatting before submitting.

Page permalink: https://www.dickimaw-books.com/bugtracker.php?key=277