After reading the hyperref documentation, I have set several coloring options to hyperref using:


All links, references are colored now as expected.

The problem is that I also find some of the colored places are undesirable. I either want to remove the color or color it differently.

For example, the title page, where carefully designed rest of the colors get disturbed by few email addresses that I do want to link within.

Note that I want to keep links, but only color/discolor them against the rest of the links. Is there a way to do it?

I guess any solution should work which is capable of force coloring/discoloring a particular text element, overriding the formats/colors that are going to be applied on a global scale later on.


From the answers available at hyperref changing the linkcolor locally in the toc and disable colorlinks locally or just for the toc, here is the more specific answer by myself the OP.

Hopefully it is more comprehensible and reachable than the ones above. (especially for the questions being ToC-specific, which could have been the reason why I didn't find in the first place)

The main take-away is that \hypersetup{}, which is for setting any option of the package hyperref outside \usepackage[..]{hyperref} call, works not only globally within the header, but also locally within the main body of text. So surrounded with braces, it applies those options to any block of text.

Accordingly the specific solution to coloring problem is to use something as below.

For discoloring:


For coloring differently:


Some examples with emails, URL-with-anchor, URLs, citations, references, an entire Table-of-contents, or an entire section respectively:

<TEXT-OF-INTEREST>  =  \href{mailto:xxxx@xyz.com}{xxxx@xyz.com} 
<TEXT-OF-INTEREST>  =  \href{www.URL.com}{anchor-text} 
<TEXT-OF-INTEREST>  =  \url{www.URL.com} 
<TEXT-OF-INTEREST>  =  \tableofcontents
<TEXT-OF-INTEREST>  =  \section{....} ....... block of text .....

Thanks to @Torbjørn T.

If needed often, or not, you may prefer to use it as a user-command.

For discoloring:


Usage: \discolorlinks{<TEXT-OF-INTEREST>}

For coloring differently:

The most general one (as a copy of \textcolor syntax) in the context of forcing a specific color on all links/urls/citations within a block of text (may customize more as you need with options such as citecolor, urlcolor,linkcolor):


Example usage: \colorlinks{red}{<TEXT-OF-INTEREST>}

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.