Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hard to use doclicense in class file #104

Open
kmccurley opened this issue Aug 31, 2023 · 2 comments · May be fixed by #105
Open

Hard to use doclicense in class file #104

kmccurley opened this issue Aug 31, 2023 · 2 comments · May be fixed by #105

Comments

@kmccurley
Copy link

I'm finding it impossible to use use doclicense in a cls file because of fact that doclicense is so tightly dependent on hyperxmp. I have attached stripped down files to illustrate the problem. Suppose you have a cls file test.cls that does this:

\LoadClass{article}
\RequirePackage{etoolbox}
\AtEndPreamble{
  \RequirePackage{hyperref}
  \RequirePackage{hyperxmp}
  \RequirePackage[type={CC},modifier={by},version={4.0}]{doclicense}
}

Note that hyperref insists on being loaded last, which is why we have to put the load in \AtEndPreamble (there are a few exceptions to this rule, but we handle those in a way that is extraneous to this issue). The following file exhibits the problem:

\documentclass{test}
\begin{document}
This is a document.
\end{document}

If you compile this, it complains because \doclicenseLongTextForHyperref is defined after the calls to \hypersetup in \AtEndPreamble. I think this is caused by the fact that the \AtEndPreamble gets executed immediately when it is within \AtEndPreamble, and \doclicenseLongTextForHyperref has not been defined yet.

Note that the acmart cls file solved this problem by only having a dependency on doclicense for the images.

I can think of two possible solutions:

  1. delay the invocations of \hypersetup using \AtBeginDocument so that the entire doclicense package can finish loading.
  2. completely decouple doclicense from hyperxmp. The hyperxmp package is in a troubled state, and the author is having a hard time maintaining it in the face of changes to hyperref. Moreover, hyperxmp is being slowly replaced by the new pdfmanagement project in LaTeX.
@kmccurley
Copy link
Author

Now that I see there is an option to \RequirePackage of hyperxmp=false, it's more clear how to proceed. The pdfmanagement-firstaid file now has a fix for this to set pdfcopyright and pdflicenseurl, so I think this can just be closed. You may still wish to wind back the integration of hyperxmp to be opt-in instead of opt-out, since hyperxmp is probably going bye-bye.

@ypid
Copy link
Owner

ypid commented Sep 6, 2023

Thanks for reporting. I am not actively using TeX anymore (sadly) so I am also not to active using and testing doclicense. I opened #105. Can you test that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants