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

Passing macro as key to \kv@parse@normalized caused compatibility issue with thmtools #275

Closed
muzimuzhi opened this issue Feb 19, 2023 · 2 comments

Comments

@muzimuzhi
Copy link
Contributor

Both hyperref and thmtools use kvsetkeys as key-val setting mechanism. Unfortunately thmtools globally patches kvsetkeys to prevent expansion of key name, which causes compatibility issue with how hyperref handlers unknown key passed to pdfinfo. See a detailed analysis in muzimuzhi/thmtools#34 (comment).

I fully understand that it's all thmtools' fault to patch hence change the behavior of kvsetkeys. But given currently it's hard to know why such patch was needed at that time (at least 10 years ago) and whether removing or modifying it will cause regression problems, could hyperref adapt to not use macro as key passed to \kv@parse@normalized?

diff --git a/hyperref.dtx b/hyperref.dtx
index 33c8fa1..ca6e373 100644
--- a/hyperref.dtx
+++ b/hyperref.dtx
@@ -6390,14 +6390,14 @@
           \HyInfo@AddonList
           \HyInfo@do{\HyInfo@Key}%
         }%
-        \kv@parse@normalized{%
+        \expandafter\kv@parse@normalized\expandafter{%
           \HyInfo@Key={#2}%
         }{%
           \kv@processor@default{pdfinfo}%
         }%
       \fi
     \else
-      \kv@parse@normalized{%
+      \expandafter\kv@parse@normalized\expandafter{%
         \HyInfo@Key={#2}%
       }{%
         \kv@processor@default{pdfinfo}%
@u-fischer
Copy link
Member

sure no problem. In the long run hyperref will stop to use kvoptions anyway. Regarding theorems: I'm testing in the testthm branch if one can simplify the theorem patches and correct the problem that destinations are lost if a theorem starts with a list. Could you test if this gives (obvious) problems with thmtools?

@muzimuzhi
Copy link
Contributor Author

Regarding theorems: I'm testing in the testthm branch if one can simplify the theorem patches and correct the problem that destinations are lost if a theorem starts with a list. Could you test if this gives (obvious) problems with thmtools?

Sure. And maybe https://github.com/T-F-S/tcolorbox can be informed as well.

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

2 participants