Curricula Vitae / RésumésColored links within the main body?

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

Colored links within the main body?

Post by templateuser »

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:

Code: Select all

\usepackage{hyperref}
\hypersetup{
    colorlinks=true,       
    linkcolor=linkblue,          
    citecolor=linkblue,        
    filecolor=linkblue,      
    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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Vel
Site Moderator
Posts: 463
Joined: Fri Jun 29, 2012 1:20 am

Colored links within the main body?

Post by Vel »

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:

Code: Select all

\makeatletter
\def\HyColor@@@@UseColor#1\@nil{\addfontfeatures{Color=#1}}
\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
Post Reply