I want to highlight some citations by putting them in blue, while the others are in black. I managed to do so by defining this command:
\newcommand\mycite[1]{\hypersetup{citecolor=blue}\cite{#1}\hypersetup{citecolor=black}
It works as intended, but if I have more than one cite, one of which should be marked and the others not, this does not help.
Here is a minimal example
\documentclass{article}
\usepackage[colorlinks,citecolor=black]{hyperref}
\newcommand\mycite[1]{\hypersetup{citecolor=blue}\cite{#1}\hypersetup{citecolor=black}}
\begin{document}
This is OK: \mycite{one} \cite{two}
But I have to chose between \mycite{one,two} or \cite{one,two}
\bibliographystyle{apalike}
\bibliography{biblio}
\end{document}
The content of biblio.bib
is:
@misc{one,
author = "Author one",
title = "The reference to this should be in blue",
howpublished = "Not at all",
year = "2022"
}
@misc{two,
author = "Author two",
title = "The reference to this should be in black",
howpublished = "Not at all",
year = "2022"
}
This is what I get. I would like in the second case to have one, 2022 in blue and two, 2022 in black.
Best Answer