# Highlighting some reference in .bib file

I have a tex file which goes like this:

\documentclass[aip,sd,amsmath,amssymb,reprint]{revtex4-1}
\usepackage{datetime,xcolor}
\begin{document}
\preprint{AIP/123-QED}
\title{Title}
\date{\today}
\maketitle
\section{Introduction}\label{Intro}
Several studies had been undertaken to understand various processes in this region\cite{Ness1965,Michel1968}. WIND satellite, which was launched in November 1, 1994 significantly increased the understanding of Lunar wake\cite{Bosqued1996}. Initially it was thought that beyond 4 lunar radii, evidence of lunar wake will not be observable\cite{Ness1972}, however, WIND spacecraft observations\cite{Owen1996, Ogilvie1996} have shown the presence of lunar wake at a distance of $\sim$ 6.8 $R_L$, where $R_L$ stands for lunar radius. Simulation studies by Farrell et al.\cite{Farrell1998} have shown the presence of counter streaming ion beams and rarefaction wave emanating outward from the wake which were consistent with the satellite observations\cite{Ogilvie1996}. \textcolor{red}{The existence of ion and} electron rarefaction waves and an increase in the temperature of the electrons were observed by Birch and Chapman\cite{Birch2001} in their simulations. Recently, Xie et al.\cite{Xie2013} studied the interaction between the Moon and the solar wind under three different IMF conditions using three-dimensional MHD simulation.
\bibliography{references}
\end{document}


My bib file is references.bib and goes like:

@article{Ness1965,
author="Ness, Norman F.",
journal="J. Geophys. Res.",
volume="70",
number="3",
issn="2156-2202",
pages="517--534",
year="1965",
doi="10.1029/JZ070i003p00517",
}
@article{Michel1968,
author="Michel, F. C.",
journal="J. Geophys. Res.",
volume="73",
number="23",
issn="2156-2202",
pages="7277--7283",
year="1968",
doi="10.1029/JA073i023p07277",
}
@article{Bosqued1996,
author="Bosqued, J. M. and Lormant, N. and Rème, H. and d'Uston, C. and Lin, R. P. and Anderson, K. A. and Carlson, C. W. and Ergun, R. E. and Larson, D. and McFadden, J. and McCarthy, M. P. and Parks, G. K. and Sanderson, T. R. and Wenzel, K.P.",
journal="Geophys. Res. Lett.",
issn="1944-8007",
volume="23",
pages="1259--1262",
number="10",
year="1996",
doi="10.1029/96GL00303",
}
@book{Ness1972,
author="Ness, N. F.",
editor="Dyer, E. R.",
title="Interaction of the Solar Wind with the Moon",
bookTitle="Solar-Terrestrial Physics/1970: Proceedings of the International Symposium on Solar-Terrestrial Physics held in Leningrad, U.S.S.R. 12--19 May 1970",
publisher="Springer Netherlands",
pages="347--393",
year="1972",
doi="10.1007/978-94-009-3693-5_21",
}
@article{Owen1996,
author="Owen, C. J. and Lepping, R. P. and Ogilvie, K. W. and Slavin, J. A. and Farrell, W. M. and Byrnes, J. B.",
journal="Geophys. Res. Lett.",
volume="23",
number="10",
issn="1944-8007",
pages="1263--1266",
year="1996",
doi="10.1029/96GL01354",
}
@article{Ogilvie1996,
author="Ogilvie, K. W. and Steinberg, J. T. and Fitzenreiter, R. J. and Owen, C. J. and Lazarus, A. J. and Farrell, W. M. and Torbert, R. B.",
journal="Geophys. Res. Lett.",
volume="23",
number="10",
issn="1944-8007",
pages="1255--1258",
year="1996",
doi="10.1029/96GL01069",
}
@article{Farrell1998,
author="Farrell, W. M. and Kaiser, M. L. and Steinberg, J. T. and Bale, S. D.",
journal="J. Geophys. Res.",
volume="103",
number="A10",
issn="2156-2202",
doi="10.1029/97JA03717",
pages="23653--23660",
year="1998",
}
@article{Ogilvie1996,
author="Ogilvie, K. W. and Steinberg, J. T. and Fitzenreiter, R. J. and Owen, C. J. and Lazarus, A. J. and Farrell, W. M. and Torbert, R. B.",
journal="Geophys. Res. Lett.",
volume="23",
number="10",
issn="1944-8007",
pages="1255--1258",
year="1996",
doi="10.1029/96GL01069",
}
@article{Birch2001,
author="Birch, Paul C. and Chapman, Sandra C.",
journal="Geophys. Res. Lett.",
volume="28",
number="2",
issn="1944-8007",
pages="219--222",
year="2001",
doi="10.1029/2000GL011958",
}
@article{Xie2013,
author="Xie, L. and Li, L. and Zhang, Y. and De Zeeuw, D. L.",
journal="Sci. China Earth Sci.",
number="2",
pages="330--338",
volume="56",
issn="1869-1897",
year="2013",
doi="10.1007/s11430-012-4383-6",
}


I want to highlight 3rd and 6th reference using different color, say red. How can I do it?

I have tried to do something with this link and this link, but couldn't get expected results. Any help will be really appreciable.

By the bye, I am using Texstudio and TexWorks..

Two parts: 1- colour of the cite in the body text, and 2- colour of the bibliograhy entry.

Part1

I did this (you already have this in your tex file, but not applied to a cite.):

\textcolor{red}{\cite{Ness1965,Michel1968}}


It changed the citation text to red in the text body for me. Basically, just wrap the cite in textcolor command.

You can make a new command in your premable like:

\newcommand{\rc}[1]{\textcolor{red}{#1}}


Then in your text, you can do:

\rc{\cite{Ness1965,Michel1968}}


This makes it a little less painful to use, and won't clutter your text body as much as a longer command would.

(You have a duplicated ref in your bib sample that you could remove.)

Part2

If you want to change the color of a reference defined in the bibliography, you can change your bib definitions to bibitems, like this:

\documentclass[aip,sd,amsmath,amssymb,reprint]{revtex4-1}
\usepackage{datetime,xcolor,etoolbox}
\usepackage{etoolbox}
\begin{document}
\preprint{AIP/123-QED}
\title{Title}
\date{\today}
\maketitle
\section{Introduction}\label{Intro}
Several studies had been undertaken to understand various processes in this region\cite{Ness1965,Michel1968}. WIND satellite, which was launched in November 1, 1994 significantly increased the understanding of Lunar wake\cite{Bosqued1996}. Initially it was thought that beyond 4 lunar radii, evidence of lunar wake will not be observable\cite{Ness1972}, however, WIND spacecraft observations\cite{Owen1996, Ogilvie1996} have shown the presence of lunar wake at a distance of $\sim$ 6.8 $R_L$, where $R_L$ stands for lunar radius. Simulation studies by Farrell et al.\cite{Farrell1998} have shown the presence of counter streaming ion beams and rarefaction wave emanating outward from the wake which were consistent with the satellite observations\cite{Ogilvie1996}. \textcolor{red}{The existence of ion and} electron rarefaction waves and an increase in the temperature of the electrons were observed by Birch and Chapman\cite{Birch2001} in their simulations. Recently, Xie et al.\cite{Xie2013} studied the interaction between the Moon and the solar wind under three different IMF conditions using three-dimensional MHD simulation.
% \bibliography{references}

\begin{thebibliography}{99}

\bibitem{Birch2001}
Paul~C. Birch and Sandra~C. Chapman.
\newblock {\em Geophys. Res. Lett.}, 28(2):219--222, 2001.

\bibitem{Bosqued1996}
J.~M. Bosqued, N.~Lormant, H.~Rème, C.~d'Uston, R.~P. Lin, K.~A. Anderson,
C.~W. Carlson, R.~E. Ergun, D.~Larson, J.~McFadden, M.~P. McCarthy, G.~K.
Parks, T.~R. Sanderson, and K.P. Wenzel.
\newblock {\em Geophys. Res. Lett.}, 23(10):1259--1262, 1996.

\bibitem{Farrell1998}
W.~M. Farrell, M.~L. Kaiser, J.~T. Steinberg, and S.~D. Bale.
\newblock {\em J. Geophys. Res.}, 103(A10):23653--23660, 1998.

{\color{red}
\bibitem{Michel1968}
F.~C. Michel.
\newblock {\em J. Geophys. Res.}, 73(23):7277--7283, 1968.
}

{\color{green}
\bibitem{Ness1972}
N.~F. Ness.
\newblock {\em Interaction of the Solar Wind with the Moon}.
\newblock Springer Netherlands, Dordrecht, 1972.
}

\bibitem{Ness1965}
Norman~F. Ness.
\newblock {\em J. Geophys. Res.}, 70(3):517--534, 1965.

{\color{blue}
\bibitem{Ogilvie1996}
K.~W. Ogilvie, J.~T. Steinberg, R.~J. Fitzenreiter, C.~J. Owen, A.~J. Lazarus,
W.~M. Farrell, and R.~B. Torbert.
\newblock {\em Geophys. Res. Lett.}, 23(10):1255--1258, 1996.
}

\bibitem{Owen1996}
C.~J. Owen, R.~P. Lepping, K.~W. Ogilvie, J.~A. Slavin, W.~M. Farrell, and
J.~B. Byrnes.
\newblock {\em Geophys. Res. Lett.}, 23(10):1263--1266, 1996.

\bibitem{Xie2013}
L.~Xie, L.~Li, Y.~Zhang, and D.~L. De~Zeeuw.
\newblock {\em Sci. China Earth Sci.}, 56(2):330--338, 2013.

\end{thebibliography}

\end{document}


This allows you to trivially specify a specific bibitem to colour by using parenthesis and setting the colour to red. Revtex makes the cite' package incompatible with your document so you miss out on its customization features, as far as i know.

To convert your bib file to bibitems i made the following simple tex file, and then compiled it. There will be a .bbl file produced with your bibliography formatted simply as bibitems. So, back to your own document, if you would rather the bibitems be defined in a separate file you can just do this command: \input{your-bbl-filename.bbl}, instead of "\begin{thebibliography}{99}...\end{thebibliography}". (have a look inside the .bbl file).

If you choose the input' command, make sure you put the color commands to the bibitems inside the file. If you rebuild the bbl file and your bib, you will have to make the color changes again.

\documentclass{article}

\begin{document}

\nocite{*}

\bibliographystyle{plain}
\bibliography{references}

\end{document}

• Many thanks for spending time to look into this issue. The passage about \newcommand was very useful. But could you just elaborate from word "To convert...". Actually it is mandatory that we need to have separate .bib file. That is why i asked this question... – sreeraj t Jun 2 '18 at 2:18
• Compile your document using a bib file produces a .bbl file containing `bibitems'. The method in the answer just does this separately to get you a nicely formatted (plain) bbl file. The reason i went this route is that this presents an easy method for colouring your references. The document class you are using is not compatible with some other cite packages that allow formatting of references. The bbl file is in a separate file, but if you require a .bib file, can you just submit that in addition to your other files? Someone else may have an answer if you must compile your doc from a .bib. – Dunk the Lunk Jun 2 '18 at 3:17
• Okay. If I am not mistaken, then the take-away message is that revtex4-1 package cannot color the reference, if done in the above mentioned fashion. Is this correct ?? – sreeraj t Jun 2 '18 at 6:21
• Not really. It means you have to find a solution that works with the revtex class. My answer is all i can come up with for now. Perhaps someone more familiar with how revtex works, can find another way. It certainly does not mean that it is not possible. – Dunk the Lunk Jun 2 '18 at 7:14