2

This question is related to this post: Adding parentheses to figure references

How can I have black parentheses when the references are in blue when using the mentioned macro?

I have applied the blue color to my all references but I get that the parentheses for the figure references turn blue contrary to the ones of the author and equation references that keep the black color.

\documentclass{article}
\usepackage{hyperref}
\hypersetup{backref=true,
    colorlinks=true,
         linkcolor=blue,
          }

\makeatletter
\renewcommand\p@figure{\expandafter\counter@parenthesize}
\newcommand\counter@parenthesize[1]{(#1)}
\makeatother

\begin{document}

\begin{figure}
\caption{X}\label{X}
\end{figure}

See Figure~\ref{X}.

\end{document}

enter image description here

Thanks

3

I think a simple method is to use a separate color of for the parenthese. This can be achieved by:

\newcommand\counter@parenthesize[1]{\textcolor{black}{(}#1\textcolor{black}{)}}

enter image description here

  • 1
    It works! thanks very much for your prompt help Marco Daniel! – Alan Mar 31 '17 at 17:02

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.