10

I want most of my citation to be blue in color. So I used

\usepackage{hyperref}
\hypersetup{colorlinks,linkcolor={blue},citecolor={blue},urlcolor={red}}  

But I need some of my citation in a different color(say yellow). I tried

{\color{yellow} \cite{eg} }

to change the specific citation brutally but it doesn't work. What should I do.

11
... \hypersetup{citecolor=yellow}\cite{eg}\hypersetup{citecolor=blue} ...

should do.

| improve this answer | |
  • 4
    (+1) . optional you also could use a new command for this: preamble: \newcommand{\citeColored}[2]{\hypersetup{citecolor=#1}\cite{#2}\hypersetup{citecolor=blue}} and in text: \citeColored{yellow}{eg}. – Bobyandbob Apr 27 '17 at 12:48
6

I like my option slightly better because you don't need to worry about the previous colour:

\newcommand{\citeColored}[2]{{\hypersetup{citecolor=#1}\cite{‌​#2}}}
| improve this answer | |
  • 1
    Works really well, indeed. – AlexG Nov 1 '17 at 11:10

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.