[Tex/LaTex] Reference Color

cross-referencing

\documentclass[preprint,review,12pt]{elsarticle}
\usepackage[colorlinks=true, citecolor=black, linkcolor=black, urlcolor=black]{hyperref}

\begin{document}

 ... \cite{ML1986} .....

... see \hyperlink{app}{\textcolor{black}{appendix}} ....

\appendix
\hypertarget{app}{\section*{Appendix.}}

section*{Mass matrix}
     ....

\section*{Gyroscopic matrix}
     ...

 \end{document}

I get the following

enter image description here

How can I put the reference [17] in black not in blue?

Best Answer

If you are writing an official paper for this journal, you should not change their defaults. However, elsarticle checks, if hyperref is loaded. If it finds this package, it does its own color definitions \AtBeginDocument. If you just do your own \hypersetup the very moment after that, you will have forced elsarticle to use your style.

% arara: pdflatex
% arara: bibtex
% arara: pdflatex
% arara: pdflatex

\documentclass[12pt]{elsarticle}
\usepackage{filecontents}
\usepackage[colorlinks=true]{hyperref}

\begin{filecontents}{\jobname.bib}
    @book{ML1986,
        author = {Mest Lest},
        year = {1986},
        title = {Test},
    }
\end{filecontents}

\begin{document}
\hypersetup{%
    ,urlcolor=black
    ,citecolor=black
    ,linkcolor=black
    }
\cite{ML1986}
\bibliographystyle{elsarticle-harv}
\bibliography{\jobname}
\end{document}

The normal procedure, however, would be to do \usepackage[colorlinks=false, hidelinks]{hyperref}. But I guess, you want to have some colors somewhere.

Related Question