5

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!

0

1 Answer 1

9

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}.
\begin{equation}
\label{whatever}
a=b.
\end{equation}

\end{document}

enter image description here

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}.
\begin{equation}
\label{whatever}
a=b.
\end{equation}

\end{document}
1
  • @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?. Feb 4, 2015 at 16:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .