I need to differentiate some specific references from the others, for both the text and the reference list at the end of the document. Let's say I want the "regular" ones in blue and the specific (i.e. mine actually) in orange. There is way with BibTeX see here: Different style/color for some specific references using Bibtex
But I'd like to do similar things with natbib
.
(Following is similar to the previous post but it now concerns natbib
instead of BibTeX)
I have something quite standard like this:
in the .tex
file:
\usepackage[authoryear,colon,square]{natbib}
\bibliographystyle{dcu}
\begin{document}
Something to say \citep{one_regular_ref01,another_regular_ref02,my_specific01}.
My .bib
is normal as I parsed the entries from journal's website.
This gives me something like this:
Something to say [RegRef et al, 2001; aRegRef et al, 2002; My_paper, 2010].
Everything has the same color. But I'd like my own ref in a different one.
Ok I can edit the .bib
file but it seems odd to me as I can potentially use the same .bib
for another document without this very specific need.
I was thinking that adding *
(for instance) to the end of the citation call (i.e. \citep{my_specific01*}
) could be a way to discriminate the specific citations but now how can I tell natbib
to change the way these references are displayed (again in the text and the reference list) to a different color or potentially any font style.
I did not find anything on the web that treat and solve this very specific task using natbib
but any ideas would be more than appreciated.
thanks
Best Answer
EDITED to totally replace my earlier attempt, which did not meet the OP's specifications. EDITED to provide 2nd TRIAL VERSION.
SAFE VERSION:
With the 1st (safer) version, I was unable to make the year in the cite colored, because apparently it uses a sorting pattern on that field (the
#3
argument to\harvarditem
), and therefore must remain alphabetic. I accomplished what I did by redefining\harvarditem
to call on\[ref]color
where[ref]
is the cite key. These colors are defined by\refcolor{A01}{green}
which, for example, defines a macro\A01color
as{green}
.TRIAL UPDATE:
By redefining
as such, I get the desired result for this MWE. However, I am not sure what I may have broken in the process... year-based sorting, I presume. Clearly I fixed the year delimiters as
[]
but there may be other things, too. But here it is, if it suits.