-1

I am writing my thesis in latex. But I wanna change "some" citation numbers color in text. my citation number color setting is as follows:

    \usepackage[unicode=true,pagebackref=true,
colorlinks,linkcolor=blue,citecolor=blue,final]{hyperref}
    %\usepackage{todonotes}
    \usepackage[firstpage]{draftwatermark}
    \SetWatermarkText{\ \ \ pishnevis}
    \SetWatermarkScale{1.2}
}
{ 
    \usepackage[pagebackref=false,colorlinks,
    linkcolor=blue,citecolor=blue,urlcolor=blue]{hyperref}
    %\usepackage[disable]{todonotes} % final without TODOs
}

as you see, the above setting makes my citation number color to blue. but I want to change some citation colors to black.

for example only:

\cite{turnow2012flow}

changes to black not blue.

3

You can use the \hypersetup command to change the citation command. Enclosing it in a group {...} will make the change. Thus for example

\newcommand{\redcite}[1]{{\hypersetup{citecolor=red}\cite{#1}}}

provides a basic citation command that prints the citation in red instead of the current default.

Sample output

\documentclass{article}

\usepackage[colorlinks=true,citecolor=blue]{hyperref}

\newcommand{\redcite}[1]{{\hypersetup{citecolor=red}\cite{#1}}}

\begin{document}

\cite{article-minimal}

\redcite{article-minimal}

\cite{article-minimal}

\bibliographystyle{plain}
\bibliography{xampl}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.