doclicense and pdfmanagement
Opened this issue · 2 comments
The newest pdfmanagement-testphase version no longer contains a patch for hyperxmp. Instead it uses its own code to add xmp-metadata. The loading of hyperxmp is suppressed as the package is incompatible.
doclicense should therefore not assume that hyperref is loaded through hyperxmp but load it itself.
\DocumentMetadata{%
testphase=phase-II,
uncompress,
lang=en-US,
pdfstandard=a-2u}
\documentclass{article}
%\IfDocumentMetadataTF{\usepackage{hyperref}}{} %load hyperref is pdfmanagement is used
\usepackage[type={CC},modifier={by-nc-nd},version={4.0},lang={english}]{doclicense}
\begin{document}
Hello
\end{document}
doclicense should therefore not assume that hyperref is loaded through hyperxmp but load it itself.
Does it really assume that? When I look at the code
latex-packages/doclicense/doclicense.dtx
Lines 695 to 729 in 4bb0436
Can you propose a patch/pull request that fixes it for you? I currently don’t have the latest TeX Live installed so I cannot test your example.
sorry I got a bit lost in your various if-clauses and so tried to fix the problem it the wrong way. I will update the pdfmanagement to remove the error there.
But it remains the problem that hyperxmp is not loaded and so your hypersetup is lost. I suggest that you replace
\@ifpackageloaded{hyperxmp}{%
% The following options are only defined when the hyperxmp package was loaded.
\hypersetup{%
pdfcopyright = {\doclicenseLongTextForHyperref},
pdflicenseurl = {\doclicenseURL},
}
}{}
by
\IfDocumentMetadataTF
{
\hypersetup{%
pdfcopyright = {\doclicenseLongTextForHyperref},
pdflicenseurl = {\doclicenseURL},
}
}
{
\@ifpackageloaded{hyperxmp}{%
\hypersetup{%
pdfcopyright = {\doclicenseLongTextForHyperref},
pdflicenseurl = {\doclicenseURL},
}}{}
}