Testing bookmark glyphs (testbmgl.tex) fails

bookmarkshyperrefunicode

After installing TeX Live 2022, I pdflatexed (twice) a local copy of https://github.com/latex3/hyperref/blob/main/test/testbmgl.tex. The resulting bookmarks are quite different to the one created by TeX Live 2015:

bookmarks

Is the test broken or my installation (and how do I fix it)?

The log file is this:

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex 2022.5.30)  30 MAY 2022 11:03
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**testbmgl.tex
(./testbmgl.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-02-24>
File: testbmgl.tex 2008/09/11 v1.3 Test bookmark glyphs (HO)

(m:/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(m:/2022/texmf-dist/tex/latex/base/size12.clo
File: size12.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
)
\c@part=\count185
\c@section=\count186
\c@subsection=\count187
\c@subsubsection=\count188
\c@paragraph=\count189
\c@subparagraph=\count190
\c@figure=\count191
\c@table=\count192
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
)
(m:/2022/texmf-dist/tex/latex/hyperref/hyperref.sty
Package: hyperref 2022-02-21 v7.00n Hypertext links for LaTeX

(m:/2022/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty
Package: ltxcmds 2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
)
(m:/2022/texmf-dist/tex/generic/iftex/iftex.sty
Package: iftex 2022/02/03 v1.0f TeX engine tests
)
(m:/2022/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty
Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO
)

(m:/2022/texmf-dist/tex/generic/infwarerr/infwarerr.sty
Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO)
)
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
)
(m:/2022/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks16
)
(m:/2022/texmf-dist/tex/generic/kvsetkeys/kvsetkeys.sty
Package: kvsetkeys 2019/12/15 v1.18 Key value parser (HO)
)
(m:/2022/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty
Package: kvdefinekeys 2019-12-19 v1.6 Define keys (HO)
)
(m:/2022/texmf-dist/tex/generic/pdfescape/pdfescape.sty
Package: pdfescape 2019/12/09 v1.15 Implements pdfTeX's escape features (HO)
)
(m:/2022/texmf-dist/tex/latex/hycolor/hycolor.sty
Package: hycolor 2020-01-27 v1.10 Color options for hyperref/bookmark (HO)
)
(m:/2022/texmf-dist/tex/latex/letltxmacro/letltxmacro.sty
Package: letltxmacro 2019/12/03 v1.6 Let assignment for LaTeX macros (HO)
)
(m:/2022/texmf-dist/tex/latex/auxhook/auxhook.sty
Package: auxhook 2019-12-17 v1.6 Hooks for auxiliary files (HO)
)
(m:/2022/texmf-dist/tex/latex/kvoptions/kvoptions.sty
Package: kvoptions 2020-10-07 v3.14 Key value format for package options (HO)
)
\@linkdim=\dimen139
\Hy@linkcounter=\count193
\Hy@pagecounter=\count194

(m:/2022/texmf-dist/tex/latex/hyperref/pd1enc.def
File: pd1enc.def 2022-02-21 v7.00n Hyperref: PDFDocEncoding definition (HO)
Now handling font encoding PD1 ...
... no UTF-8 mapping file for font encoding PD1
)
(m:/2022/texmf-dist/tex/generic/intcalc/intcalc.sty
Package: intcalc 2019/12/15 v1.3 Expandable calculations with integers (HO)
)
(m:/2022/texmf-dist/tex/generic/etexcmds/etexcmds.sty
Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)
)
\Hy@SavedSpaceFactor=\count195

(m:/2022/texmf-dist/tex/latex/hyperref/puenc.def
File: puenc.def 2022-02-21 v7.00n Hyperref: PDF Unicode definition (HO)
Now handling font encoding PU ...
... no UTF-8 mapping file for font encoding PU
)
Package hyperref Info: Option `bookmarks' set `true' on input line 4018.
Package hyperref Info: Option `colorlinks' set `true' on input line 4018.
Package hyperref Info: Hyper figures OFF on input line 4137.
Package hyperref Info: Link nesting OFF on input line 4142.
Package hyperref Info: Hyper index ON on input line 4145.
Package hyperref Info: Plain pages OFF on input line 4152.
Package hyperref Info: Backreferencing OFF on input line 4157.
Package hyperref Info: Implicit mode ON; LaTeX internals redefined.
Package hyperref Info: Bookmarks ON on input line 4390.
\c@Hy@tempcnt=\count196

(m:/2022/texmf-dist/tex/latex/url/url.sty
\Urlmuskip=\muskip16
Package: url 2013/09/16  ver 3.4  Verb mode for urls, etc.
)
LaTeX Info: Redefining \url on input line 4749.
\XeTeXLinkMargin=\dimen140

(m:/2022/texmf-dist/tex/generic/bitset/bitset.sty
Package: bitset 2019/12/09 v1.3 Handle bit-vector datatype (HO)

(m:/2022/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty
Package: bigintcalc 2019/12/15 v1.5 Expandable calculations on big integers (HO
)
))
\Fld@menulength=\count197
\Field@Width=\dimen141
\Fld@charsize=\dimen142
Package hyperref Info: Hyper figures OFF on input line 6027.
Package hyperref Info: Link nesting OFF on input line 6032.
Package hyperref Info: Hyper index ON on input line 6035.
Package hyperref Info: backreferencing OFF on input line 6042.
Package hyperref Info: Link coloring ON on input line 6045.
Package hyperref Info: Link coloring with OCG OFF on input line 6052.
Package hyperref Info: PDF/A mode OFF on input line 6057.
LaTeX Info: Redefining \ref on input line 6097.
LaTeX Info: Redefining \pageref on input line 6101.

(m:/2022/texmf-dist/tex/latex/base/atbegshi-ltx.sty
Package: atbegshi-ltx 2021/01/10 v1.0c Emulation of the original atbegshi
package with kernel methods
)
\Hy@abspage=\count198
\c@Item=\count199
\c@Hfootnote=\count266
)
Package hyperref Info: Driver (autodetected): hpdftex.

(m:/2022/texmf-dist/tex/latex/hyperref/hpdftex.def
File: hpdftex.def 2022-02-21 v7.00n Hyperref driver for pdfTeX

(m:/2022/texmf-dist/tex/latex/base/atveryend-ltx.sty
Package: atveryend-ltx 2020/08/19 v1.0a Emulation of the original atveryend pac
kage
with kernel methods
)
\Fld@listcount=\count267
\c@bookmark@seq@number=\count268

(m:/2022/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty
Package: rerunfilecheck 2019/12/05 v1.9 Rerun checks for auxiliary files (HO)

(m:/2022/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty
Package: uniquecounter 2019/12/15 v1.4 Provide unlimited unique counter (HO)
)
Package uniquecounter Info: New unique counter `rerunfilecheck' on input line 2
86.
)
\Hy@SectionHShift=\skip49
)
(m:/2022/texmf-dist/tex/latex/psnfss/times.sty
Package: times 2020/03/25 PSNFSS-v9.3 (SPQR) 
)
\c@alias=\count269
\c@symlist=\count270
\c@symbol=\count271
LaTeX Font Info:    Trying to load font information for OT1+ptm on input line 1
53.

(m:/2022/texmf-dist/tex/latex/psnfss/ot1ptm.fd
File: ot1ptm.fd 2001/06/04 font definitions for OT1/ptm.
)
(m:/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2022-02-07 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count272
\l__pdf_internal_box=\box50
) (./testbmgl.aux)
\openout1 = `testbmgl.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 153.
LaTeX Font Info:    ... okay on input line 153.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 153.
LaTeX Font Info:    ... okay on input line 153.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 153.
LaTeX Font Info:    ... okay on input line 153.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 153.
LaTeX Font Info:    ... okay on input line 153.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 153.
LaTeX Font Info:    ... okay on input line 153.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 153.
LaTeX Font Info:    ... okay on input line 153.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 153.
LaTeX Font Info:    ... okay on input line 153.
LaTeX Font Info:    Checking defaults for PD1/pdf/m/n on input line 153.
LaTeX Font Info:    ... okay on input line 153.
LaTeX Font Info:    Checking defaults for PU/pdf/m/n on input line 153.
LaTeX Font Info:    ... okay on input line 153.

(m:/2022/texmf-dist/tex/latex/graphics/color.sty
Package: color 2021/12/07 v1.3c Standard LaTeX Color (DPC)

(m:/2022/texmf-dist/tex/latex/graphics-cfg/color.cfg
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package color Info: Driver file: pdftex.def on input line 149.

(m:/2022/texmf-dist/tex/latex/graphics-def/pdftex.def
File: pdftex.def 2020/10/05 v1.2a Graphics/color driver for pdftex

(m:/2022/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count273
\scratchdimen=\dimen143
\scratchbox=\box51
\nofMPsegments=\count274
\nofMParguments=\count275
\everyMPshowfont=\toks17
\MPscratchCnt=\count276
\MPscratchDim=\dimen144
\MPnumerator=\count277
\makeMPintoPDFobject=\count278
\everyMPtoPDFconversion=\toks18
)))
Package hyperref Info: Link coloring ON on input line 153.
 (m:/2022/texmf-dist/tex/latex/hyperref/nameref.sty
Package: nameref 2021-04-02 v2.47 Cross-referencing by name of section

(m:/2022/texmf-dist/tex/latex/refcount/refcount.sty
Package: refcount 2019/12/15 v3.6 Data extraction from label references (HO)
)
(m:/2022/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty
Package: gettitlestring 2019/12/15 v1.6 Cleanup title references (HO)
)
\c@section@level=\count279
)
LaTeX Info: Redefining \ref on input line 153.
LaTeX Info: Redefining \pageref on input line 153.
LaTeX Info: Redefining \nameref on input line 153.

(./testbmgl.out) (./testbmgl.out)
\@outlinefile=\write3
\openout3 = `testbmgl.out'.


Processing glyphs 000..007
Processing glyphs 010..017
Processing glyphs 020..027
Processing glyphs 030..037

Package hyperref Warning: Glyph not defined in PU encoding,
(hyperref)                removing `\textcircumflex' on input line 185.

Processing glyphs 040..047
Processing glyphs 050..057
Processing glyphs 060..067
Processing glyphs 070..077
Processing glyphs 100..107
Processing glyphs 110..117
Processing glyphs 120..127
Processing glyphs 130..137
Processing glyphs 140..147
Processing glyphs 150..157
Processing glyphs 160..167
Processing glyphs 170..177
Processing glyphs 200..207
Processing glyphs 210..217
Processing glyphs 220..227
Processing glyphs 230..237
Processing glyphs 240..247
Processing glyphs 250..257
Processing glyphs 260..267
Processing glyphs 270..277
Processing glyphs 300..307
Processing glyphs 310..317
Processing glyphs 320..327
Processing glyphs 330..337

Package hyperref Warning: Glyph not defined in PU encoding,
(hyperref)                removing `\textbeta' on input line 445.

Processing glyphs 340..347
Processing glyphs 350..357

Package hyperref Warning: Glyph not defined in PU encoding,
(hyperref)                removing `\textcircumflex' on input line 465.

Processing glyphs 360..367
Processing glyphs 370..377
Processing symbol list 1
Processing symbol list 2
Processing symbol list 3
LaTeX Font Info:    Trying to load font information for TS1+ptm on input line 4
96.
(m:/2022/texmf-dist/tex/latex/psnfss/ts1ptm.fd
File: ts1ptm.fd 2001/06/04 font definitions for TS1/ptm.
) [1

{m:/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./testbmgl.aux)
Package rerunfilecheck Info: File `testbmgl.out' has not changed.
(rerunfilecheck)             Checksum: 4F62B0D1B4D31DFC0F0DF116521661C8;67321.
 ) 
Here is how much of TeX's memory you used:
 8584 strings out of 478268
 127024 string characters out of 5854337
 484055 words of memory out of 5000000
 26375 multiletter control sequences out of 15000+600000
 479032 words of font info for 42 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 59i,5n,63p,361b,410s stack positions out of 10000i,1000n,20000p,200000b,200000s
{m:/2022/texmf-dist/fonts/enc/dvips/base/8r.enc}<m:/2022/texmf-dist/fonts/typ
e1/urw/times/utmb8a.pfb><m:/2022/texmf-dist/fonts/type1/urw/times/utmr8a.pfb><m
:/2022/texmf-dist/fonts/type1/urw/times/utmri8a.pfb>
Output written on testbmgl.pdf (1 page, 68512 bytes).
PDF statistics:
 1504 PDF objects out of 1728 (max. 8388607)
 1480 compressed objects within 15 object streams
 356 named destinations out of 1000 (max. 500000)
 2753 words of extra memory for PDF output out of 10000 (max. 10000000)

Just pdflatexing

\documentclass{article}
\usepackage[bookmarks=true,unicode=true]{hyperref}
\usepackage[open]{bookmark}
\begin{document}
\section{\texorpdfstring{$\alpha \beta$}{\textalpha \textbeta}}
\end{document}

gives

(m:/2022/texmf-dist/tex/latex/hyperref/pd1enc.def
File: pd1enc.def 2022-02-21 v7.00n Hyperref: PDFDocEncoding definition (HO)
Now handling font encoding PD1 ...
... no UTF-8 mapping file for font encoding PD1
)

and

! Undefined control sequence.
<argument> \textalpha 
                      \textbeta 
l.5 ...ring{$\alpha \beta$}{\textalpha \textbeta}}
                                                  
? s
OK, entering \scrollmode...

Package hyperref Warning: Glyph not defined in PU encoding,
(hyperref)                removing `\textbeta' on input line 5.

So, do I need a "UTF-8 mapping file for font encoding PD1"? Where can I get or how can I create one?

Best Answer

Edit 2023

The support for greek is now done by the babel-greek maintainer. It is normally loaded if you use any option that activates greek (e.g. use greek with babel, or if you load the LGR font encoding).

You can load the psdextra set which defines a small set of greek command names:

\documentclass{article}
\PassOptionsToPackage{psdextra}{hyperref}
\usepackage[open]{bookmark}

\begin{document}
\section{\texorpdfstring{$\alpha \beta$}{\textalpha \textbeta αβ  𝛼𝛽}}
\end{document}

hyperref will load the support if it detects that \textBeta is defined. So you can also do something like this to load puenc-greek.def:

\documentclass{article}
\providecommand\textBeta{}
\usepackage[open]{bookmark}

\begin{document}
\section{\texorpdfstring{$\alpha \beta$}{\textalpha \textbeta αβ  𝛼𝛽}}
\end{document}

Old answer

The test file assumes that the option unicode is set to false -- this is no longer the case in hyperref as it now uses unicode always. You can force it back by adding unicode=false (we do that in the real testsuite).

hyperref doesn't load the greek text definitions by default but only if greek as language is detected. You can load them manually. Or you can use the chars directly

\documentclass{article}

\usepackage[open]{bookmark}
\input{puenc-greekbasic.def}

\begin{document}
\section{\texorpdfstring{$\alpha \beta$}{\textalpha \textbeta αβ  𝛼𝛽}}
\end{document}

enter image description here

Related Question