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

Load hyperref before hyperxmp ? #505

Open
scottkosty opened this issue Sep 15, 2023 · 21 comments
Open

Load hyperref before hyperxmp ? #505

scottkosty opened this issue Sep 15, 2023 · 21 comments

Comments

@scottkosty
Copy link

After a tlmgr update, with acmart I now get:

! Package hyperxmp Error: hyperref must be loaded before hyperxmp.

Indeed, it seems this was an intentional change if you look at the the change log in the documentation of hyperxmp: http://mirrors.ctan.org/macros/latex/contrib/hyperxmp/hyperxmp.pdf

In acmart.cls, if I manually change:

\RequirePackage{hyperxmp}
\let\@footnotemark@nolink\@footnotemark
\let\@footnotetext@nolink\@footnotetext
\RequirePackage[bookmarksnumbered,unicode]{hyperref}

to:

\let\@footnotemark@nolink\@footnotemark
\let\@footnotetext@nolink\@footnotetext
\RequirePackage[bookmarksnumbered,unicode]{hyperref}
\RequirePackage{hyperxmp}

I no longer get the error. That said, I have no idea what I'm doing.

Unfortunately, I wonder if the following issue is still relevant, which is also related to the ordering: #425.

@shuhaoliu
Copy link

I also encountered the same issue using the latest version of acmart (2023/06/11 v1.90a). The error occurs after my recent (manual) TexLive package update, which upgrades hyperxmp package to v5.12.

My current workaround: revert back acmart to 2020/02/22 v1.70, since I have that .cls file at hand. My guess is that reverting back hyperxmp should also work.

Treeniks added a commit to Treeniks/tyranny-of-types-type-classes that referenced this issue Sep 27, 2023
@jonsterling
Copy link

I am facing this issue too. Can we get an official fix @borisveytsman ?

@lizhuohua
Copy link

My guess is that reverting back hyperxmp should also work.

I confirm that reverting back hyperxmp works for me.

@swaroopjcse
Copy link

swaroopjcse commented Oct 3, 2023

I, too, reverted hyperxmp (to revision 65980), and it worked.

@jonsterling
Copy link

I think it is important that packages work on a fresh and up to date install of the TeXLive distribution, so i do not plan to downgrade anything (as this will make it harder for my collaborators to get their own installation working!). I locally patched acmart, but hopefully there can be a proper fix distributed soon.

@melkyades
Copy link

Having this error when building a paper through the use of github actions CI (builds just started failing without doing anything). Is there a suggested way to solve this problem?

@scottkosty
Copy link
Author

Is there a suggested way to solve this problem?

@melkyades You can edit the cls as suggested in the original post, or you can revert hyperxmp.

@fuhrmanator
Copy link

I use MikTeX with VSCode's LaTeX Workshop plugin on Windows and also hit this snag. The PDF gets built, but latexmk is borked and there are lots of side effects and errors from the hyperref before hyperxmp problem. I sync via git with Overleaf, (builds there don't show any problems, probably because of the version of latex/hyperxmp) for now).

Changing the .cls file as OP did solves the problem in my config.

@krusche
Copy link

krusche commented Oct 14, 2023

I experienced the same issue, and would appreciate a fix. Especially shortly before the deadline, this is really unfortunate and it's also difficult to find a solution online about how to fix the issue. It took me several hours until I stumbled upon this issue

@u-fischer
Copy link

u-fischer commented Oct 16, 2023

well the comment in the hyperxmp code documentation that recent changes in hyperref and the LaTeX kernel ... are causing the problem and now force hyperxmp to be loaded after hyperref is not really true. The method hyperxmp used to hook into hyperref's option handling was flawed from the begin on. See e.g. https://tex.stackexchange.com/a/694606/2388.

An alternative is to load the LaTeX PDF-management with \DocumentMetadata{}:

\DocumentMetadata{}
\documentclass{acmart} 
 
\begin{document}
some text
\end{document}

This will suppress hyperxmp and create the xmp-metadata with the in-built LaTeX code.

@shuhaoliu
Copy link

It seems that this issue has been fixed in the recent v1.92 update. Thanks for the help!

@Rimole
Copy link

Rimole commented Nov 29, 2023

@scottkosty Can you confirm that it has been fixed, and close this issue, please?

@scottkosty
Copy link
Author

@Rimole I couldn't reproduce the issue after a tlmgr update. I'm not sure if we should close this though. Maybe we should let the developer take a look and close since they know more? For example, sometimes developers want to close after they add a regression test. @borisveytsman can we close?

@adcsilva
Copy link

adcsilva commented Jan 8, 2024

I found the same issue with a fresh MixTeX and TeXstudio installation. TeXstudio 4.7.2 (git 4.7.2). Using Qt Version 6.6.1, compiled with Qt 6.6.1 R. I changed the order of hyperref and hyperxmp as suggested by the error message and apparently everthing is fine.

@SamuelMarks
Copy link

Found the same issue on a fresh TeXLive install (on Linux).

@u-fischer's solution worked.

@kaimast
Copy link

kaimast commented Mar 21, 2024

I see this too now after updating texlive 2024.0 on Arch Linux. @u-fischer solution works, but this should probably be fixed asap...

@ulysses4ever
Copy link

I'm getting it with TeX Live 2023 on NixOS unstable. A big problem of the workaround with \DocumentMetadata{} is that my teammates with a little older TeX Live's get an error of unknown macro.

@u-fischer
Copy link

@ulysses4ever yes you need a current system if you want to use the xmp-support of the LaTeX kernel after all it is new.

But if you can't do that: simply ensure what the error message say: load hyperref first. With a current version of acmart this should happen automatically, so if you can update the class.

@ulysses4ever
Copy link

@u-fischer, I don't know what xmp-support means and I doubt I need it. I simply wish that acmart worked across a couple of consecutive versions of TeX Live.

Your comment prompted me to update acmart in our repo, and indeed it seemed to solve the issue (waiting on my friends with older TeX Live's to check).

I wonder how one is supposed to get "a current version" of acmart. I never tried to build acmart.cls manually, and the README in this repo is not helping. I tried to call make on the repo (which, according to my understanding of the Makefile, should produce asmart.cls) but I'm getting an error:

! Package xkeyval Error: halid' undefined in families blx@opt@pre'.

And then couple more. But in the end, it produced acmart.cls that seems to work.

Alternatively, I noticed that https://www.acm.org/publications/proceedings-template has a very recent version of the class. Maybe I should just always go there first before even searching the bug tracker...

@u-fischer
Copy link

I don't know what xmp-support means and I doubt I need it.

Well you need them. A PDF must contain metadata like the title and the author, and this is done now in the XMP-metadata. acmart loads the hyperxmp package for this.

I wonder how one is supposed to get "a current version" of acmart.

In the same way you got the newer hyperxmp version which brought the problems: By using the update manager of your tex system. I got it with tlmgr from my texlive system.

@dongchirua
Copy link

well the comment in the hyperxmp code documentation that recent changes in hyperref and the LaTeX kernel ... are causing the problem and now force hyperxmp to be loaded after hyperref is not really true. The method hyperxmp used to hook into hyperref's option handling was flawed from the begin on. See e.g. https://tex.stackexchange.com/a/694606/2388.

An alternative is to load the LaTeX PDF-management with \DocumentMetadata{}:

\DocumentMetadata{}
\documentclass{acmart} 
 
\begin{document}
some text
\end{document}

This will suppress hyperxmp and create the xmp-metadata with the in-built LaTeX code.

i confirm that this works for me!

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

No branches or pull requests