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

Licence to metadata + switch to doclicense #294

Open
zhtaihao opened this issue Mar 7, 2021 · 3 comments
Open

Licence to metadata + switch to doclicense #294

zhtaihao opened this issue Mar 7, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@zhtaihao
Copy link

zhtaihao commented Mar 7, 2021

Consider the following MWE, which inserts a CC license and image:

\documentclass{tudapub}
\usepackage{doclicense}
\begin{document}
\doclicenseThis
\clearpage Hello
\end{document}

At the very end of the document, another page gets inserted with a single comma. My testing has concluded that this happens because of the doclicense package.

Weirdly, this does not happen with other classes, I tested (scr)article, (scr)report, tudabeamer. It does however happen with tudaletter, and of course tudapub as seen in the MWE.

Because this bug does not happen in most other document classes, I resorted to reporting it here instead of at https://github.com/ypid/latex-packages/issues. But I understand if this is entirely a bug of the package instead.

@TeXhackse
Copy link
Collaborator

TeXhackse commented Mar 7, 2021

That this only happens with tudapub is not weird, it's actually quite easy. ;-)
The reason is an incompatibility between pdfx and hyperxmp which is loaded by doclicense so it only get triggered if pdfa=true. Which is expectable because both write the metadata for your pdf.

You get the same result with

\documentclass{article}
\usepackage{pdfx}
\usepackage{doclicense}
\begin{document}
\doclicenseThis
\clearpage Hello
\end{document}

Sadly doclicense doesn't support to disable the auto add of the metadata. But I think it's about the ccicons which tudapub doesn't use itself? Then I can help you with adding these without the package, same for the automatic add of the license to the metadata - which would be an idea to add that one generally.

I will think about which author to contact would be the best, currently don't know where exactly it comes from, will try to find time to have a look tomorrow. If you want to be involved let me know.

@TeXhackse TeXhackse added enhancement New feature or request question Further information is requested labels Mar 7, 2021
@TeXhackse TeXhackse changed the title Unwanted page at the end of document when using tudapub with package doclicense Licence to metadata + optional use of ccicons Mar 7, 2021
@zhtaihao
Copy link
Author

zhtaihao commented Mar 8, 2021

That's interesting, I don't know enough about hyperxmp, so this idea might not work.
In general, could a package option be added to doclicense so it doesn't mess with \hypersetup at all? Line 79 ff. seem to be relevant here. The repository seems well maintained also, so it might be worth contacting the author there.
The metadata could be added with a key-value in tudapub's \Metadata, maybe (?).
As for ccicons, they're not used in our MWEs, and personally I prefer having the images to having the icons.

Edit
I just found ypid/latex-packages#63, which might be of interest here. The following PR added hyperxmp to be loaded by default.

@TeXhackse
Copy link
Collaborator

TeXhackse commented Mar 8, 2021

@zhtaihao I don't it's a good idea to generally support two corresponding mechanisms to add the xmp metadata. The package is one thing. TUDa-CI is the other. That's why I'd like to know what you wanted to archieve using the package. because we generally have a mechanism to add license info and maybe we can extend this one to match your requirement.

If the difference is the image we could also use the images without loading the package. I just did not yet add these, because I didn't want us to blow up the texlive installation but since doclicense already provides these, we can use them.

And yes I found the corresponding change and am currently thinking about, because it seems like maybe the xmpdata package and pdfx should know from each other, which would not require any change in doclicense.

Edit: pdfx and doclicense both write the xmpdata directly without checking if it's there, so it would probably be the best to ask doclicense to add an option to disable the xmpdata or maybe the complete metadata environment. Because this is not compatible to PDF/A creation. I can add a pull request on this -> then we can also use doclicense instead of implementing our own descriptions on the CC licenses.

Working workaround for your issue would be to disable the writing of metadata of hyperxmp by setting

\makeatletter
\let\hyxmp@at@end\relax
\makeatother

after loading doclicense.

@TeXhackse TeXhackse removed the question Further information is requested label Mar 16, 2021
@TeXhackse TeXhackse changed the title Licence to metadata + optional use of ccicons Licence to metadata + switch to doclicense Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants