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?
8 Answers
With \usepackage[hidelinks]{hyperref}
you get active links in \textcolor
(usually black) without a box around them.
-
100I 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.– user13436Commented Apr 10, 2012 at 1:50 -
108@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 optionhidelinks
, 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 optiondraft
, which will influence e.g.graphicx
andhyperref
, or perhaps a language option likengerman
. Commented May 19, 2012 at 23:41 -
8What if other packages refer to hidelinks, that you may not want to disable? Commented Dec 20, 2012 at 9:02
-
5The suggested solution causes an "option clash" if you use the classicthesis package. In that case the comment of @user13436 solves the issue. Commented Sep 19, 2017 at 8:09
-
8
I use something like
\usepackage{xcolor}
\hypersetup{
colorlinks,
linkcolor={red!50!black},
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.
-
142I really think something like this should be the default rather than the neon boxed links. Commented Nov 26, 2011 at 21:32
-
17The use of dark colours here is also important: brighter colours, like the defaults, usually come out too pale when printing. Commented Dec 3, 2012 at 1:17
-
4@einpoklum, at the time the "hypertext" was popularized not long ago, the idea was to highlight it as much as possible, just because it was new. Remember that hyperlinks in web pages used to be highlighted and underlined in bright blue.– alfCCommented Sep 9, 2015 at 18:49
-
14
-
7
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]{hyperref}
or
\hypersetup{hidelinks}
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{
colorlinks = true, %Colours links instead of ugly boxes
urlcolor = blue, %Colour for external hyperlinks
linkcolor = blue, %Colour of internal links
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.
-
8This is a real solution, otherwise how is the reader supposed to distinguish clickable links from plain text? Thank you– neurinoCommented Jan 9, 2013 at 23:06
-
-
@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?– GilsonCommented Aug 20, 2014 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.– CanageekCommented Aug 20, 2014 at 18:31
-
\hypersetup{
colorlinks=false,
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.
-
7Besides \hypersetup you may provides those settings as options when loading the hyperref package.– Stefan Kottwitz ♦Commented Aug 2, 2010 at 17:03
-
6Although 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.– SharpieCommented Aug 2, 2010 at 17:26
-
3I 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. Commented Aug 11, 2010 at 21:24
-
7I 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 thelinkcolor
option to make the colours more palatable to humans.– kahenCommented Dec 2, 2010 at 14:39 -
2Congrats! 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! Commented Sep 8, 2011 at 17:15
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
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.
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.
-
1Thank you for your idea of implementing line-breakable
ocgcolorlinks
! It is the basis for further refinement made in theocgx2
package, allowing for ocg colour links that also wrap around page breaks and which can be nested. Also the empty-link issue could be solved. See here .– AlexGCommented Apr 13, 2017 at 10:49
For the sake of completion, if you use qpdfview, check that the option Decorate links is unselected (Edit -> Settings). I spent quite some time finding this was the actual problem!
-
3Thanks! I was about to debug the
hyperref
package as none of the above work to hide the decoration around links and refs.– scrutariCommented Mar 21, 2019 at 17:15
qpdfview
show boxes around links. So disable this first or make sure with other viewers that these boxes are actually in the PDF before you try to remove them.qpdfview
deselect the setting: Edit->Settings->Grapics->General->Decorate linksqpdfviewer
). Links to references (green) and to figures & tables table of content (both red) and external links (cyan) all remain marked in in the program. (Though I if I view the same PDF in e.g. chromium then there are no color markings.)