# Having several different colored borders for internal links

My question is: Is is possible to change the color of the borders of one or several internal links in LaTeX, without changing them all? I know it is possible to define a different colored borders for different kinds of links (one color for internal links, one color for URL links, one color for file links, etc). But is it possible to take one internal link (\ref{whatever}) and change the color of its border, without changing the color of all the borders for all other internal links?

I am convinced that this isn't possible, but it would be great if someone happens to know a way to make it possible!

## 1 Answer

Sure it is possible; you can use \hypersetup inside a group to locally change the color:

\documentclass{article}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{hyperref}

\begin{document}

As we see, equation~{\hypersetup{linkbordercolor=cyan}\eqref{whatever}} is identical to equation~\eqref{whatever}.
$$\label{whatever} a=b.$$

\end{document}


And, of course, you can define dedicated commands:

\documentclass{article}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{hyperref}

\newcommand\cyaneqref[1]{{\hypersetup{linkbordercolor=cyan}\eqref{#1}}}
\begin{document}

As we see, equation~\cyaneqref{whatever} is identical to equation~\eqref{whatever}.
$$\label{whatever} a=b.$$

\end{document}

• @Lauren You're welcome. Don't forget that you can accept the answer, if you consider it solved your problem, by clicking the checkmark to its left. In case of doubt, please see How do you accept an answer?. – Gonzalo Medina Feb 4 '15 at 16:27