# Remove ugly borders around clickable cross-references and hyperlinks

I know that I can use `hyperref` to make cross-references and hyperlinks clickable. That makes the clickable areas outlined in fluorescent green, however. How can I make the green boxes go away?

-
Seeing what an important and popular question this is, I suggest choosing @meep.meep's answer as the accepted answer because it does exactly the same as Jukka's (which is nonetheless correct), but in a much more elegant way. Many new and unexperienced users will come across this question so it's worth thinking about it. –  doncherry Aug 30 '11 at 16:28
And what if I want to keep them even for printing? How can i do that, please? –  Perlnika May 26 '13 at 18:06

With `\usepackage[hidelinks]{hyperref}` you get active links in `\textcolor` (usually black) without a box around them.

-
It's great that you posted this answer here, too. –  Hendrik Vogt Mar 1 '11 at 17:58
I think there is no need for using `\usepackage[hidelinks]{hyperref}`. This problem may be fixed by just adding `[hidelinks]` as a global option to the `\documentclass` declaration (for instance: `\documentclass[hidelinks,12pt]{report}`). I read this in the quick help of MiKTeX 2.9. –  user13436 Apr 10 '12 at 1:50
@AhmedNaji: This is because global options, specified with the document class, will be passed down to the packages. However, I'm not aware of any package other than `hyperref` that knows an option `hidelinks`, so imho it isn't really helpful to move the option to the document class. An example where it does make sense to specify such an option globally (i.e. with the document class) is the option `draft`, which will influence e.g. `graphicx` and `hyperref`, or perhaps a language option like `ngerman`. –  doncherry May 19 '12 at 23:41
What if other packages refer to hidelinks, that you may not want to disable? –  Nicholas Hamilton Dec 20 '12 at 9:02
I tried this `hidelinks` option in both the `hyperref` package and the global options. however, the red boxes around section numbers referred to are still present. What should I do to remove them? –  Fang Jing Oct 10 '14 at 15:04

I use something like

``````\usepackage{xcolor}
\hypersetup{
citecolor={blue!50!black},
urlcolor={blue!80!black}
}
``````

This gets rid of the ugly color boxes, but uses dark colored fonts which still make it clear that they are clickable.

-
I really think something like this should be the default rather than the neon boxed links. –  einpoklum Nov 26 '11 at 21:32
The use of dark colours here is also important: brighter colours, like the defaults, usually come out too pale when printing. –  Peter LeFanu Lumsdaine Dec 3 '12 at 1:17
Your solution yields an error for me: ./main.tex:59: Package xcolor Error: Undefined color `{blue'. Line 59 is the place, where I use \href command for the first time. Any ideas why? –  Artem Pelenitsyn Feb 14 at 17:34
No idea. Maybe you should try to create a minimal example and post a new question. –  Juan A. Navarro Feb 18 at 9:01
``````\hypersetup{
pdfborder={0 0 0},
}
``````

Edit: Fortunately, this is no longer needed. Since 2011-02-05 (hyperref version 6.82a), you can use the `hidelinks` option to achieve the same result; see this answer.

-
Besides \hypersetup you may provides those settings as options when loading the hyperref package. –  Stefan Kottwitz Aug 2 '10 at 17:03
Although I find them helpful- otherwise some people wouldn't know that clicking on a reference will take them to a bibliography entry. They don't show up in the printed copies. –  Sharpie Aug 2 '10 at 17:26
I agree with Sharpie. It's better to change the borders and/or colours to something more pleasing but still visible (see Juan's answer), than to get rid of them entirely. –  ShreevatsaR Aug 11 '10 at 21:24
I personally use `\ifpdf\usepackage[pdftex,pdfborderstyle={/S/U/W 1},hyperfootnotes=false]{hyperref}\fi`. This gets rid of the box by making links underlined instead. You can then use the `linkcolor` option to make the colours more palatable to humans. –  kahen Dec 2 '10 at 14:39
Congrats! The fact that your answer was un-accepted got you the first Populist badge ever awarded here, this is quite a funny turn. Referring to the more up-to-date answer is really good style though, kudos for that! –  doncherry Sep 8 '11 at 17:15

Well, I see there are a lot of answers already, and they work, however I thought I'd give more detail:

As above, you can use

``````\usepackage[hidelinks=true]{hyperref}
``````

or

``````\hypersetup{hidelinks=true}
``````

However, if your problem is with the ugly green boarder there are very nice ways to remove that, without making it unclear what is a hyperlink.

I like

``````\hypersetup{
urlcolor     = blue, %Colour for external hyperlinks
citecolor   = red %Colour of citations
}
``````

That should be pretty self-explanatory, since I've commented everything so I can keep track of it.

There is also

``````\hypersetup{frenchlinks=true}
``````

Which replaces the colour with small caps. No idea why it is French, or why small caps, but it is also an option.

There, I felt this helps complete the above answers; Yes, you can remove the box by hiding all the links, but there are other choices out there.

-
This is a real solution, otherwise how is the reader supposed to distinguish clickable links from plain text? Thank you –  neurino Jan 9 '13 at 23:06
You are very welcome. –  Canageek Jan 10 '13 at 17:10
@Canageek, I used your suggestion and it worked perfectly, but it changed also all text color from black (dark) to grey. How can I control this problem? I mean, what should I do to have the black (dark) color in the text? –  Gilson Aug 20 '14 at 2:33
@Gilson I've not had that problem, at least, not that I've noticed. Could you make a new question with a MWE so I can test it out? Tag me in the comment please. –  Canageek Aug 20 '14 at 18:31
@Canageek, ok, I will do it. thank you. –  Gilson Aug 20 '14 at 19:03

As Canageek mentions, there are already a bunch of answers here, but there's another option that I developed in answer to another question, which you can see here: it refines the experimental "ocgcolorlinks" option so that the text is highlighted on screen and not in print, but avoids the boxing that caused weird line-wrapping of the current ocgcolorlinks implementation.

-

If you are using a modern release of LyX, then these options can be set in Document -> Settings -> PDF Properties -> Hyperlinks -> No frames around links.

-

You can also use `\usepackage[colorlinks=true, urlcolor=blue, pdfborder={0 0 0}]{hyperref}`.

Can add any options of your choice, in order to only have urls without color or anything, use only `pdfborder={0 0 0}` option

-
Welcome to TeX.SX. You can highlight code by selecting it and clicking the `{}` button above the text field. Inline code is delimited by backtick (```), blocks are indented with four spaces. –  Torbjørn T. Jun 16 '13 at 9:37