-
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
[Feature] Supports custom style hyperlink commands #350
Comments
And, the most frustrating thing is that if I define my own commands, I also need to reprocess special characters to avoid warnings and errors, which is exactly the job that this package has perfectly completed. Reinventing the wheel really doesn't make much sense... |
you are mixing two link types. Special chars are only relevant if you handle urls. If you load the pdfmanagement and its driver it is easy to change their border color and styles:
For internal links special characters are not relevant, and you can easily define your own command that accepts keys to change whatever you want. It is not trivial in the standard definitions to change the link style only of footnotes, but with the new footnote code in latex-lab you can change its type and then use a hook to adapt the links:
|
@Mikachu2333 You need |
Thank you, under your guidance, I found a way to fix it. And, I finally go back to the custom command as the following code shows for its convenience... These code would only underline the \usepackage{xcolor}% or use color package for color defs
\usepackage[allbordercolors=black, hidelinks]{hyperref}
\newcommand{\uhref}[2]{%
\hypersetup{pdfborderstyle={/S/U/W 1}}%
\href{#1}{#2}%
\hypersetup{pdfborderstyle={/S 0}, hidelinks}%
}
\newcommand{\uref}[2]{%
\hypersetup{pdfborderstyle={/S/U/W 1}}%
\hyperref[#1]{#2}%
\hypersetup{pdfborderstyle={/S 0}, hidelinks}%
} |
Background:
I want the hyperref package to underline my links when using
\href{url}{text}
and\hyperref[ref]{text}
, but not add any extra styling when using\footnote{}
or\footnotemark
as the following shows.This is an extremely simple implementation without any additional special character handling, and should only be used for testing.
What I want
Something like
\hyperref[pdfborderstyle={/S/U/W 1},allbordercolors={0 0 0}]{ref}{text}
and
\href[pdfborderstyle={/S/U/W 1},allbordercolors={0 0 0}]{url}{text}
OR just
\usepackage[hidelink={footnote},pdfborderstyle={/S/U/W 1},allbordercolors={0 0 0}]{hyperref}
Anything else
Thanks to @muzimuzhi and @u-fischer here #195 (comment) , but that issues would change the footnote ref to be underlined both (with the command
\AddToHook{pdfannot/link/GoTo/before}{\hypersetup{urlbordercolor=black,pdfborderstyle={/S/U/W 1}}}
if I'd want to underline the/ref
separately)...The text was updated successfully, but these errors were encountered: