Possible Duplicate:
Remove ugly borders around clickable crossreferences and hyperlinks

When I generate PDF, a red border surround all links (internal and external).

  • Which package draws this borders around links automatically ?
  • How I can change this behavior, so link text become blue, instead of putting in box?
  • 1
    -1: Please do your research more thoroughly before posting a question here. It is trivial to go through the packages you're using and single out the one responsible for the borders, hyperref. Once you've figured that out, you find all the options you need in the hyperref manual.
    – doncherry
    May 31, 2012 at 7:16
  • @doncherry Red boxes are generated automatically without using a special package. And that was the question, I never used \hyperref. May 31, 2012 at 7:23
  • 1
    @Reza: I Disagree, this generates no boxes: \documentclass{article} \begin{document} \section{Foo}\label{Foo}\ref{Foo} \end{document}. Hence, your document class (≠ article) might be loading hyperref. As for external links, which macro do you use? It must be provided by some package as well.
    – doncherry
    May 31, 2012 at 7:38
  • @doncherry You are right. I found source of that issue, thanks May 31, 2012 at 7:47
  • It takes a lot less time to google this question than to go through the packages, so asking this question for others to read makes the world better. Dec 31, 2019 at 16:32

1 Answer 1


The hyperref package provides all of the functionality you seek. Here's a minimal example:

enter image description here

\usepackage{xcolor}% http://ctan.org/pkg/xcolor
\usepackage{hyperref}% http://ctan.org/pkg/hyperref
\section{First section}\label{firstsec} Visit \href{http://tex.stackexchange.com}{TeX.SX}.
\section{Second section}See Section~\ref{firstsec}.

colorlinks=true provides coloured links (rather than bordered links), after which you can specify a variety of colours, depending on the link type. From the hyperref documentation:

  • linkcolor: default is red; Colour for normal internal links.
  • anchorcolor: default is black; Colour for anchor text.
  • citecolor: default is green; Colour for bibliographical citations in text.
  • filecolor: default is cyan; Colour for URLs which open local files.
  • menucolor: default is red; Colour for Acrobat menu items.
  • runcolor: default is filecolor; Colour for run links (launch annotations).
  • urlcolor: default is magenta; Colour for linked URLs.
  • allcolors: set all colour options (without border and field options).

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