[latex3-commits] [git/LaTeX3-latex3-pdfresources] develop: improve hyperxmp patch to avoid stray comma with empty pdfauthor (281ac07)
Ulrike Fischer
fischer at troubleshooting-tex.de
Thu Dec 2 18:56:08 CET 2021
Repository : https://github.com/latex3/pdfresources
On branch : develop
Link : https://github.com/latex3/pdfresources/commit/281ac07c640670c2356c5b060aa184354c891524
>---------------------------------------------------------------
commit 281ac07c640670c2356c5b060aa184354c891524
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Thu Dec 2 18:56:08 2021 +0100
improve hyperxmp patch to avoid stray comma with empty pdfauthor
>---------------------------------------------------------------
281ac07c640670c2356c5b060aa184354c891524
firstaid/hyperxmp-patches-tmp-ltx.sty | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/firstaid/hyperxmp-patches-tmp-ltx.sty b/firstaid/hyperxmp-patches-tmp-ltx.sty
index dbb1d5a..7a12ee0 100644
--- a/firstaid/hyperxmp-patches-tmp-ltx.sty
+++ b/firstaid/hyperxmp-patches-tmp-ltx.sty
@@ -134,8 +134,15 @@
% we need to provide a few commands so that hyperxmp stops to overwrite them
% in \AtEndPreamble
+% we need also add it to the document properties to avoid stray commas
+% with empty author.
\AddToHook{begindocument/before}[pdfmanagement/firstaid/hyperxmp]{%
- \def\@pdfauthor{Author}\def\@pdftitle {Title}}
+ \def\@pdfauthor{Author}\def\@pdftitle {Title}%
+ \tl_if_blank:eT{\GetDocumentProperties{hyperref/pdfauthor}}
+ {\AddToDocumentProperties[hyperref]{pdfauthor}{Author}}
+ \tl_if_blank:eT{\GetDocumentProperties{hyperref/pdftitle}}
+ {\AddToDocumentProperties[hyperref]{pdfauthor}{Title}}
+ }
\DeclareHookRule{begindocument/before}{pdfmanagement/firstaid/hyperxmp}{before}{hyperxmp}
More information about the latex3-commits
mailing list.