LaTeX forum ⇒ Curricula Vitae / RésumésColored links within the main body? Topic is solved

ModernCV, Friggeri, Plasmati, Classicthesis-CV, and more
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

Colored links within the main body?

Postby templateuser » Mon Mar 16, 2015 12:52 pm

Hi everyone,

First of all, a huge thanks for this beautiful template and to those who have helped document things here. I am trying to include a link to a webpage in the education section of the template and I would like the link to be colored. I am using the package hyperref as follows:

  1. \usepackage{hyperref}
  2. \hypersetup{
  3. colorlinks=true,
  4. linkcolor=linkblue,
  5. citecolor=linkblue,
  6. filecolor=linkblue,
  7. urlcolor = linkblue}


where linkblue is some color I have defined. However, when I use \href, the link is not colored as it should be. In fact, it appears that I cannot get any colored font at all. For example, \textcolor{red}{text} does not produce red text. Does anyone have an ideas for a workaround? I'm in the style file and I know the relevant bit of code is in the list environment, but I can't figure it out.

Thanks!

mindthegap

Tags:

User avatar
Vel
Site Moderator
Posts: 454
Joined: Fri Jun 29, 2012 1:20 am
Location: Sydney, Australia
Contact:

Postby Vel » Mon Mar 16, 2015 12:52 pm

Hey,

To set the color of any piece of text in this template, you'll need to do it like this:

\addfontfeature{Color=red} some text}

To enable hyperlinks (\href{}{}) to be colored with hyperref, add this just after the \RequirePackage{hyperref} at the bottom of friggeri-cv.cls:

  1. \makeatletter
  2. \def\HyColor@@@@UseColor#1\@nil{\addfontfeatures{Color=#1}}
  3. \makeatother


This was caused by the invocation of "Color=textcolor" in the \setmainfont command which overrides the color in \href (as well as \textcolor and \color!).

Cheers,
Vel
Founder and administrator of LaTeXTemplates.com and LaTeXTypesetting.com


Return to “Curricula Vitae / Résumés”

Who is online

Users browsing this forum: No registered users and 2 guests