LaTeX forum ⇒ GeneralSetting link colors with hyperref Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
User avatar
drpartha
Posts: 25
Joined: Wed Dec 02, 2009 1:41 am

Setting link colors with hyperref

Postby drpartha » Mon Jul 28, 2014 1:13 pm

I am trying to setup a hyperlinked pdf file using hyperref. I would like to set all the hyperlinks to a colour defined by me with xcolor, I am able to set all colors except the color of \cite links. cite links continue to be in the default green. How do I force citelinks to be also my wine red color ?

I enclose a copy of the preamble I use.

Thanks for any pointers ,

partha

  1. \documentclass[a4paper,12pt]{article}
  2. \usepackage{hyperref}
  3.  
  4. %\hypersetup{
  5. % colorlinks=false,
  6. % pdfborder={0 0 0},
  7. %}
  8. \usepackage{hyperref,xcolor}% http://ctan.org/pkg/{hyperref,xcolor}
  9. \usepackage{makeidx}
  10. \definecolor{winered}{rgb}{0.5,0,0}
  11.  
  12. \hypersetup
  13. {
  14. pdfauthor={Dr. Partha},
  15. pdfsubject={Hyperlinks in LaTeX},
  16. pdftitle={myhyper.tex},
  17. pdfkeywords={LaTeX, PDF, hyperlinks}
  18. % colorlinks=false,
  19. pdfborder={0 0 0},
  20. %You can set individual colors for links as below:
  21. colorlinks=true,
  22. linkcolor=winered,
  23. urlcolor={winered},
  24. filecolor={winered},
  25. %citecolor={winered} %Gives errors when turned on
  26. %allcolors={winered} %Gives errors when turned on
  27. linktoc=all,
  28. }
  29. \makeindex
  30. \begin{document}
  31. Lorem ipsum agfagfg afag agf aggf agfagfaga
  32. \end{document}
Last edited by Stefan Kottwitz on Mon Jul 28, 2014 2:18 pm, edited 1 time in total.
Reason: code marked

Tags:

esdd
Posts: 36
Joined: Sat Jan 25, 2014 9:13 pm

Postby esdd » Mon Jul 28, 2014 3:09 pm

Maybe there is only a missing coma behind citecolor={winered}?

  1. \hypersetup
  2. {
  3. pdfauthor={Dr. Partha},
  4. pdfsubject={Hyperlinks in LaTeX},
  5. pdftitle={myhyper.tex},
  6. pdfkeywords={LaTeX, PDF, hyperlinks}
  7. % colorlinks=false,
  8. pdfborder={0 0 0},
  9. %You can set individual colors for links as below:
  10. colorlinks=true,
  11. linkcolor=winered,
  12. urlcolor={winered},
  13. filecolor={winered},
  14. citecolor={winered},
  15. allcolors={winered}
  16. }


works for me.

Best regards
Elke

User avatar
drpartha
Posts: 25
Joined: Wed Dec 02, 2009 1:41 am

Postby drpartha » Tue Jul 29, 2014 4:43 am

It worked ! Thank you

I should have been more careful.

partha


Return to “General”

Who is online

Users browsing this forum: No registered users and 12 guests