-
Notifications
You must be signed in to change notification settings - Fork 2
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
Optional loading of hyperref #5
base: main
Are you sure you want to change the base?
Conversation
Add package options hyperref (default) and nohyperref
I also tried to implement something with Before merging, I would also like to add some documentation changes to this PR to tell users in the README about the options and what they mean regarding hyperref. I'd love to hear your thoughts on this |
I'm not sure about this to be honest adding the package option mechanism seems a relatively heavyweight solution. Documenting doi should be late is not really any different than documenting hyperref should be loaded late. This is already documented in the package comments:
I am not sure how the package option really helps. If the document author has to edit to add a nohyperref option but still load hyperref later, it would be simpler for them to not add the option and move the doi package after hyperref. If you wanted to change the code here it would I suspect be possible for the package to use \AtBeginDocument to delay loading hyperref. |
My rationale for this is that I use I agree that a package option is probably overkill and not ideal either, but I'm not sure if using P.S. Regarding documentation of this:
From the README.md of this repo, the only documentation available on CTAN, it is not immediately obvious that this package loads |
not loading hyperref and doing a run-time check would have been OK as an original design but if we do that now, potentially existing documents using doi package but not explicitly loading hyperref would lose hyperref features and break. We can certainly do something but I'm not sure what (definitely we can improve the readme) Perhaps @u-fischer might have a more informed view as she's closer to hyperref internals currently. I probably can't think about this for a couple of days in any case so I'll leave this open. Feel free to add any additional thoughts you have (but I may not respond to each post) |
Makes hyperlink creation optional and dependent on the user having loaded hyperref
Thanks for the feedback, curious to hear from @u-fischer. I just played around with my local copy of |
I don't understand why you need this package if you use biblatex. Biblatex has its own commands to link a doi, e.g. in biblatex.def you can find
|
This package relies on
hyperref
for thehref
command. However, loading it directly with\RequirePackage{hyperref}
can cause problems for authors who place\usepackage{doi}
early in their preamble and thus violate the rule that hyperref should be loaded last. One workaround is to load doi after hyperref, but this is not documented in thedoi
package.This PR adds the package options
hyperref
andnohyperref
. The former matches the default (legacy) behaviour to call\RequirePackage{hyperref}
while the latter omits this and leaves it up to the user to include thehyperref
package separately.