-
Notifications
You must be signed in to change notification settings - Fork 35
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
recent update (2023-10-21 v7.01c) leads to warnings with amsthm #304
Comments
Apparently, the appearance of warnings like "pdfTeX warning (dest):" or "pdfTeX warning (ext4):" that appeared (as in my case) in abundance in hyperref v7.01c is caused by the following code fragment implemented in version 7.01c
in the command definition \newcommand\Hy@theorem@refstepcounter[1]. This fragment differs from the corresponding fragment in version 7.01b by the presence of the hook \AddToHookNext{cmd/item/before}. A temporary fix for this situation until a fixed version of hyperref becomes available is this:
or
\makeatletter In both cases, compilation will proceed without additional warnings like pdfTeX warning (dest): or pdfTeX warning (ext4): |
Sorry for the delay, I was a bit busy. I just sent a new version to ctan which should reinstate the old behaviour if amsthm is used. But generally a better solution for targets in theorems is needed. Depending on which package(s) are used you loose the targets or they are on the wrong page or they affect spacing and if one repairs one case it breaks something else. I will try to convince the various players here to support hyperref directly so that hyperref can stop to patch around. |
Thanks! |
7.01d still produces a warning
when a theorem contains enumerate in amsart. Here is a minimal example:
|
Confirm @ivanovakur . My recepy with commenting the line |
@ivanovakur I see, the patch added in d3b8d4a only applies to \makeatletter
\AddToHook{class/amsart/after}
{
\renewcommand\Hy@theorem@refstepcounter[1]
{%
\H@refstepcounter{#1}%
\hyper@makecurrent{#1}%
\global\let\Hy@dth@currentHref\@currentHref
\AddToHookNext{cmd/deferred@thm@head/before}
{\AddToHookNext{para/begin}
{\let\Hy@tempa\@currentHref
\MakeLinkTarget*{\Hy@dth@currentHref}%
\global\let\@currentHref\Hy@tempa
}%
}%
}
}
\makeatother @u-fischer Would it be better to change |
@kozyakin Thanks, that fixed the "duplicate" warning. Now I see the "does not exist" warning when using \marginpar in theorems, which I probably missed before.
MWE is below, same warning with and without your \AddToHook.
|
Dear @ivanovakur I noticed a long ago that warnings like
very often can be “cured” by adding the following command to the preamble of the tex file
In your case, it also works: the following tex-code
in my system was compiled without warning |
By the way, the hook |
@kozyakin Thanks, \phantomsection cures that warning in my real document as well. @mbertucci47 @kozyakin I messed up the attribution of the fix in my previous message, sorry. Just to avoid confusion, what I meant is that the fix by @mbertucci47
fixes "duplicate" warning. |
@kozyakin @ivanovakur if you plant \phantomsection everywhere you break autoref. And you get also wrong target location. Here the first link will jump below the chapter title.
Apart from this, I guess you now realize how complicated it is to properly support theorems. And do not believe that it worked previously properly. E.g. it could happen (and still can happen if you use cleveref) that the target is on the page before the actual theorem. And in other cases targets were lost. I will sent a new version to ctan which will support also the ams-classes. But generally it would be better if the classes would support that natively, so write their maintainer too. |
@u-fischer I absolutely argee with you that putting \phantomsection before every \label is not the best idea. My advice was just for immediate closing the @ivanovakur problem. Will eagerly wait for your new submission. |
This should be resolved in version 7.01f (but I take no bets that all theorem variants behave). |
The recent update seems to have broken hyperref support for amsthm. Here's an example file showing the issue with referencing a theorem (no issue with referencing a section):
This results in the warning
Here's the log:
The text was updated successfully, but these errors were encountered: