# Citation colour with Beamer + Hyperref + Natbib

I'm using natbib for citation with a custom bibstyle. I'm working on a presentation using LaTeX beamer and for some reason the citation marker doesn't have the colour that is specified to hyperref. The citation marker is black instead of green. I'll give you a MWE:

\documentclass{beamer}
\hypersetup{
citecolor=green,
}

\usepackage{filecontents}
\begin{filecontents}{mybib.bib}
@ARTICLE{Bar2011,
author = {F. Foo and F. Bar},
title = {Foo and Bar},
journal = {Journal of Foo},
year = {2011},
volume = {1},
pages = {1--3}
}
\end{filecontents}

\usepackage[comma,numbers,sort&compress]{natbib}
\bibliographystyle{plain}

\begin{document}
Dummy referefence to~\cite{Bar2011}
\bibliography{mybib}
\end{document}


For the purpose of the MWE I have selected the plain bibstyle, however, changing that to something else (including the custom style I want to use) doesn't affect the label colour.

Is there any patch for this problem?

• I had the same problem recently. See the answer here. – Māris Ozols May 13 '13 at 18:56
• @MārisOzols you may have noticed that I specified that I'm using natbib which you do not. – elemakil May 13 '13 at 19:10

The solution offered by samcarter did not quite work for me. But I was successful by putting the following lines into the preamble:

\let\oldcite=\cite
\renewcommand{\cite}[1]{\textcolor[rgb]{.7,.7,.7}{\oldcite{#1}}}


I do not remember where, but sometime ago, I found this workaround:

\documentclass{beamer}

\usepackage[comma,numbers,sort&compress]{natbib}
\bibliographystyle{plain}

\hypersetup{
citecolor=green,
backref=true
}

\let\oldbibitem=\bibitem
\renewcommand{\bibitem}[2][]{\label{#2}\oldbibitem[#1]{#2}}
\let\oldcite=\cite
\let\oldcitep=\citep
\let\oldciteauthor=\citeauthor

\usepackage{filecontents}
\begin{filecontents}{mybib.bib}
@ARTICLE{Bar2011,
author = {F. Foo and F. Bar},
title = {Foo and Bar},
journal = {Journal of Foo},
year = {2011},
volume = {1},
pages = {1--3}
}
\end{filecontents}

\begin{document}
Dummy referefence to~\cite{Bar2011}
\bibliography{mybib}
\end{document}