[Tex/LaTex] Beamer ignores citecolor from hyperref

beamerbibliographieshyperref

How do I make citation links green in Beamer? It seems that Beamer ignores the hyperref option citecolor. I tried using the linkcolor option instead, but that affects all links (such as the link to the next slide, see example below). I want to change only the citation color.

\documentclass{beamer}

\hypersetup{
  colorlinks = true,
% linkcolor = green,
  citecolor = green
}

\begin{document}

\begin{frame}
This is a great result~\cite{Paper}.
But this is a link to slide~\ref{Bib}.
\end{frame}

\begin{frame}{Bibliography}\label{Bib}
\begin{thebibliography}{}
  \bibitem[Author, 1942]{Paper}
    Author. B.
    \newblock The great result.
\end{thebibliography}
\end{frame}

\end{document}

Best Answer

You could redefine \@cite to locally change the link color:

\documentclass{beamer}

\hypersetup{
  colorlinks = true,
  linkcolor = red
}

\makeatletter
\let\@mycite\@cite
\def\@cite#1#2{{\hypersetup{linkcolor=green!60!black}[{#1\if@tempswa , #2\fi}]}}
\makeatother

\begin{document}

\begin{frame}
This is a great result~\cite{Paper}.
But this is a link to slide~\ref{Bib}.
\end{frame}

\begin{frame}{Bibliography}\label{Bib}
\begin{thebibliography}{}
  \bibitem[Author, 1942]{Paper}
    Author. B.
    \newblock The great result.
\end{thebibliography}
\end{frame}

\end{document}

enter image description here