# Change the color of cite number in bibliography

Does anyone know know how to change the color of the cite number in the bibliography?

\documentclass{book}
\usepackage[square, numbers, comma, sort&compress]{natbib}  % Use the "Natbib"

\begin{document}
How can I change the cite count number to blue~\cite{ref1}?

\label{References}
\bibliographystyle{unsrtnat}  % Use the "unsrtnat" BibTeX style for formatting
\bibliography{Bibliography}

\end{document}


And here is the content of the bib file

@article{ref1,
author = {John Clark},
title = {Learn to use Latex},
journal = {Latex Journal},
volume = {1},
number = {1},
year = {2014},
pages = {1-2}
}


How can I change the "[1]" to blue

• Please show a MWE of your code for see what are you using for work with bibliographies: bibtex or biblatex. – Aradnix Aug 21 '14 at 7:28
• Sorry, I'm a noob. What is MWE? I am using natbib – wererabit Aug 21 '14 at 9:21

I don't know why you'd want to do it, but here it is:

\begin{filecontents*}{\jobname.bib}
@article{ref1,
author = {John Clark},
title = {Learn to use {\LaTeX}},
journal = {{\LaTeX} Journal},
volume = {1},
number = {1},
year = {2014},
pages = {1-2},
}
\end{filecontents*}

\documentclass{book}
\usepackage[square, numbers, comma, sort&compress]{natbib}
\usepackage{xcolor,xpatch}

\makeatletter
\xpatchcmd{\@lbibitem}
{\item[\hfil}
{\item[\hfil\color{red}}
{}{}
\makeatother
\begin{document}

How can I change the cite count number to blue~\cite{ref1}?

\bibliographystyle{unsrtnat}  % Use the "unsrtnat" BibTeX style for formatting
\bibliography{\jobname}

\end{document}


The filecontents* environment is just to avoid clobbering my files, use the external .bib file as usual. Change red into whatever color you prefer, using the features provided by xcolor.

• Redefine biblabel also work! \def\@biblabel#1{\textcolor{red}{[#1]}} – Say OL Oct 8 '17 at 15:57
• Is it possible to do the same for some specific entry, not all of them? I'm using biber. – Sigur Mar 16 at 0:11

It's not clear to me if you want the citation call-out number to be set in blue or, instead, you wish to have the number that precedes the corresponding bibliographic entry set in blue.

If it's the former you want, an easy solution involves loading the hyperref package, setting its option colorlinks to true, and specifying the additional option citecolor=blue. As a separate (and probably quite important) benefit, the citation callouts will be made into hyperlinks to the corresponding entries.

(In the MWE below I've changed the document class from book to article purely to enable all output to be typeset on the same page.)

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{Bibliography.bib}
@article{ref1,
author = {John Clark},
title = {Learn to use {\LaTeX}},
journal = {LaTeX Journal},
volume = {1},
number = {1},
year = {2014},
pages = {1-2}
}
\end{filecontents*}
\usepackage[square, numbers, comma, sort&compress]{natbib}
\bibliographystyle{unsrtnat}  % Use "unsrtnat" BibTeX style