Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?
share|improve this question
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 '12 at 7:16
    
@doncherry Red boxes are generated automatically without using a special package. And that was the question, I never used \hyperref. –  PHPst May 31 '12 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 '12 at 7:38
    
@doncherry You are right. I found source of that issue, thanks –  PHPst May 31 '12 at 7:47
add comment

marked as duplicate by Andrew Stacey, Count Zero, lockstep, egreg, topskip Jun 5 '12 at 6:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 6 down vote accepted

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

enter image description here

\documentclass{article}
\usepackage{xcolor}% http://ctan.org/pkg/xcolor
\usepackage{hyperref}% http://ctan.org/pkg/hyperref
\hypersetup{
  colorlinks=true,
  linkcolor=blue!50!red,
  urlcolor=green!70!black
}
\begin{document}
\section{First section}\label{firstsec} Visit \href{http://tex.stackexchange.com}{TeX.SX}.
\section{Second section}See Section~\ref{firstsec}.
\end{document}

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).
share|improve this answer
add comment

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