latex3 / pdfresources

LaTeX PDF resource management
LaTeX Project Public License v1.3c
22 stars 5 forks source link

hyperref: `DocumentMetadata` ignore `pdfusetitle` option #64

Closed liudongmiao closed 6 months ago

liudongmiao commented 6 months ago
\DocumentMetadata{pdfstandard=A-2b}
\documentclass{article}
\usepackage[pdfusetitle]{hyperref}
\title{Title}
\author{Author}
\begin{document}
\maketitle
\LaTeX
\end{document}

There is not pdftitle nor pdfauthor in genreated pdf. If we remove DocumentMetadata, it works.

It seems custom driver doesn't set pdftitle and pdfauthor like other driver call \Hy@UseMaketitleInfos.

Package hyperref Info: Driver (custom): hgeneric-testphase.

(/usr/local/texlive/2023/texmf-dist/tex/latex/pdfmanagement-testphase/hgeneric-
testphase.def
File: hgeneric-testphase.def 2023-12-09 v0.96d generic Hyperref driver for the
LaTeX PDF management testphase bundle
jpcirrus commented 6 months ago

This is a documented issue/feature. pdfauthor and pdftitle need to be set explicitly in \hypersetup. See hyperref-doc.pdf section 5:

Be aware that some of the options do nothing or have changed behaviour if the new pdfmanagement and so the new generic hyperref driver is used.

and hyperref-generic.pdf section 3:

...the driver will • Not try deduce author and title from documents. They have to be set in \hypersetup with pdfauthor and pdftitle.

u-fischer commented 6 months ago

Sorry I missed or forgot that issue. As @jpcirrus wrote, it is by design. The generic driver avoids to patch the \title command. Instead we plan to redefine the \title command in the kernel so that the PDF management can set the pdftitle with and without hyperref. This will probably happen with the next LaTeX release.