[Tex/LaTex] Changing cite color in elsarticle

citingelsarticle

I like using elsarticle in writing a paper and I like cite color of the Elsevier published journals as shown below.enter image description here

However, I cannot change the citecolor by using the following command in latex:

\usepackage[colorlinks=true,linkcolor=black, citecolor=<my_color>, urlcolor=blue]{hyperref}

In addition, I also don't know what color it is in the above picture.

Please anyone advise how to do this.

Thank you very much.

Best Answer

You need to set the color at begin document, otherwise elsarticle chooses its own.

\begin{filecontents*}{\jobname.bib}
@article{GBU,
  author={Eastwood, Clint and Van Cleef, Lee and Wallach, Eli},
  title={How to find a tomb with a treasure},
  journal={J. Treasure Searching},
  year=1966,
}
@article{SLIH,
  author={Curtis, Tony and Lemmon, Jack},
  title={How to play bass and saxophone},
  journal={J. Chicago Mafia},
  year=1959,
}
\end{filecontents*}

\documentclass[authoryear]{elsarticle}

\usepackage[x11names]{xcolor}
\usepackage[
  colorlinks,
]{hyperref}

\AtBeginDocument{\hypersetup{citecolor=DodgerBlue4}}

\begin{document}

\begin{frontmatter}
\title{A title}
\author{A. Uthor}
\end{frontmatter}

We cite \citet{GBU} \citep{SLIH}.

\bibliographystyle{plainnat}
\bibliography{\jobname}

\end{document}

enter image description here