6

I wish to change the color of boxed links to red. But the code below still produces cyan links. What am I doing wrong?

\documentclass{article}
\usepackage{xcolor}
\usepackage{hyperref}
\hypersetup{%
  colorlinks=false,
  linkbordercolor=red
}
\begin{document}
\href{http://www.tex.stackexchange.com}{Stack exchange link}
\end{document}
8

The linkbordercolor option is used for internal links, e.g. for the TOC, equation numbers etc.

For a 'true' hyperlink to a web site use the urlbordercolor option, either with

  • urlbordercolor=red combined with a colour name
  • urlbordercolor=[1 0 0] with some RGB colour specification (values from 0 to 1 allowed)

If all link borders should appear in red colour use the option allborders=red instead


\documentclass{article}
\usepackage{xcolor}
\usepackage{hyperref}
\hypersetup{%
  colorlinks=false,
%  urlbordercolor=1 0 0  %  possible also
  urlbordercolor=red
}
\begin{document}
\href{http://www.tex.stackexchange.com}{Stack exchange link}
\end{document}

enter image description here

  • 1
    Just in case the OP's objective is to make the color of all hyperlink boxes red (and not just those of URL links), you may want to mention the option allcolors. E.g., setting allcolors=red will make all hyperlink box markers red. – Mico Jan 4 '15 at 11:12
  • @Mico: I know of that option, but I restricted to the url boxes so far. – user31729 Jan 4 '15 at 11:13

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.