Christof93 / SciKGTeX

SciKGTeX is a LuaTeX package which introduces commands to mark research contributions in scientific documents. SciKGTeX will enrich the document by adding your contributions to PDF metadata in a structured XMP format which can be picked up by Search Engines and Knowledge Graphs.
MIT License
18 stars 0 forks source link

Incompability with other xmp metadata #6

Closed u-fischer closed 1 year ago

u-fischer commented 1 year ago

The package writes directly into the PDF catalog:

pdf.setcatalog(catalog..string.format('/Metadata %s 0 R', metadata_obj))

That means that it is not compatible with the other packages handling Metadata: pdfx, hyperxmp and the XMP support in the LaTeX PDF management as you would end up with two /Metadata key in the catalog.

This is a problem if authors want to follow some standard like pdf/A and imho this restriction should be mentioned in the readme.

If you want to add support for the LaTeX PDF management. Additional XMP-metadata can be added basically like this:

\DocumentMetadata{uncompress}%loads the pdf management.
\documentclass{article}
\ExplSyntaxOn
\pdfmeta_xmp_xmlns_new:nn{orkg}{http://orkg.org/core\c_hash_str}
\pdfmeta_xmp_add:n{<orkg:hasAuthor>Helen~R.~Keller</orkg:hasAuthor>}
\ExplSyntaxOff
\begin{document}
xxx
\end{document}

If more support is needed (e.g. to add a schema declaration), make a feature request at https://github.com/latex3/pdfresources.

Christof93 commented 1 year ago

Yes! this is clearly an issue. Thanks for the hints on how to solve it! Didn't know about LaTeX PDF management. Will look into it.

For PDF/A compatibility I would need to add XMP extension schemas from what I understood. Not sure how I could achieve that yet...

Christof93 commented 1 year ago

A compatibility mode has been added in version 2.2 and described in documentation.