Using the following bit of code in an otherwise black text:

\color[HTML]{636060}27.~Mai/1.~Juni: Gegenregierung in Kanton unter Sun Ke (☞~S.~\pageref{bio:SunKe}). Diese wird im Dez. von Nanking kooptiert.

produces the required grey paragraph, except that the referenced page number is still displayed in black.

The relevant line in the preamble is:


changing that to e.g.: \usepackage[colorlinks,filecolor=black, %linkcolor=black, citecolor=black,urlcolor=black,breaklinks,pdfa]{hyperref}

of course defaults ALL references to red. As far as the hyperref documentation is concerned “23 Localized nullifying of package” appears to be relevant. I can't make sense of that code.

Summing up the question: Is there a (simple) way of definig linkcolor (here [HTML]{636060}) for a single/few instances only?


1 Answer 1


You could change the link color locally to another color:


With the special color . the current text color is used:

{\color{red} Text \hypersetup{linkcolor=.}\pageref{...}}

Maybe you can use linkcolor=. for the document:



\section{Color test}


Black link: \pageref{sec:test}

\textcolor{red}{Red text with red link: \pageref{sec:test}}

{\color{specialtext}Gray text with gray link: \pageref{sec:test}}

Black link again: \pageref{sec:test}


enter image description here

  • Works fine as suggested.
    – AdiMeymuc
    Jul 24, 2017 at 11:07
  • 1
    I think in your second example, where you use the dot operator you also have to use linkcolor instead of the present color. at least it didn't work for me with just color. Aug 31, 2020 at 11:03
  • @NathanaelSkrepek Thanks for the hint. I have changed it.
    – esdd
    Sep 1, 2020 at 8:51

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