That is because moderncv.cls
sets pdfborder
to 0 0 0
at the beginning of the document; here's the relevant code:
\AtEndPreamble{
\@ifpackageloaded{CJK}
{\RequirePackage[CJKbookmarks]{hyperref}}
{\RequirePackage[pdftex]{hyperref}}
\AtBeginDocument{
\hypersetup{
breaklinks,
baseurl = http://,
pdfborder = 0 0 0,
pdfpagemode = UseNone,% do not show thumbnails or bookmarks on opening
% pdfstartview = FitH,
pdfstartpage = 1,
pdfcreator = \LaTeX{} with `moderncv' package,
pdfproducer = \LaTeX{},
bookmarksopen = true,
pdfauthor = \@firstname~\@familyname,
pdftitle = \@title,
pdfsubject = \@firstname~\@familyname,
pdfkeywords = \@firstname~\@familyname{} curriculum vit\ae{}}}
\pagenumbering{arabic}% has to be issued after loading hyperref
}
EDIT: now I understand the request a little bit better (I hope); initially I thought that all the urls should have a colored border and I proposed some solution, now I see that it's just about some urls being colored. Taking this into account, I offer another solution:
I defined a new command \Colorhref
with one optional argument (the color for the urls, default=cyan
) and two mandatory arguments that will be passed to the standard \href
command (\Colorhref
also takes care of the change in font size). In your document you can use \Colorhref
if you want your url with color and \href
otherwise. Use the standard moderncv
class:
\documentclass[11pt,a4paper]{moderncv}
\moderncvtheme[blue]{casual}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.8]{geometry}
\firstname{Adam}
\familyname{Matan}
\email{adam@matan.name}
\homepage{www.matan.name}
\newcommand\Colorhref[3][cyan]{\href{#2}{\small\color{#1}#3}}
\begin{document}
\maketitle
\section{Professional network}
\cvline{Linkedin.com} {\Colorhref{http://www.linkedin.com/in/adamatan} {Adam Matan} - Professional profile and links. }
\cvline{Stackoverflow.com} {\small\href{http://stackoverflow.com/users/51197/adam-matan} {Adam Matan} - My software questions and answers. }
\cvline{twitter.com} {\Colorhref[red]{http://twitter.com/justnoticed}{@justnoticed} - My tech tweets.}
\end{document}
Here's the result of the compilation of the above example code:

With the following MWE everything works fine for me (the new file moderncvcolorburgundy.sty
is placed in your current directory but you can also put it in your local TEXMF-tree).
I have the current version of moderncv
installed (moderncv 2013/02/09 v1.3.0
) and I recommend an update, if you use an older one!
Your errors for \name
and \phone
means, that this macros are not defined (in your used document class). @Xavier said in a comment, that \name
and \phone
will be new commands in version 1.4.0, not yet available on CTAN. One of the benefits being that you can specify as many phone numbers as you want, a common request.
With version 1.3.0 you have to use the macros I used in my MWE.
The second error seems to be, that your color burgundy
seems to be very near to purple
. To check whether your burgundy file works delete the comment sign in line
%\definecolor{color1}{rgb}{0.2,0.2,0.2}% Testcolor
and add it in the line before. On my system now the color changes significantly ...
\RequirePackage{filecontents}
\begin{filecontents*}{moderncvcolorburgundy.sty}
%% start of file `moderncvcolorburgundy.sty'.
%% Copyright 2006-2013 Xavier Danaux (xdanaux@gmail.com).
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at http://www.latex-project.org/lppl/.
%-------------------------------------------------------------------------------
% identification
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvcolorburgundy}[2013/02/09 v1.3.0 modern curriculum vitae and letter color scheme: burgundy]
%-------------------------------------------------------------------------------
% color scheme definition
%-------------------------------------------------------------------------------
\definecolor{color0}{rgb}{0,0,0}% black
\definecolor{color1}{rgb}{0.545098,0,0}% burgundy
%\definecolor{color1}{rgb}{0.2,0.2,0.2}% Testcolor
\definecolor{color2}{rgb}{0.45,0.45,0.45}% dark grey
\endinput
%% end of file `moderncvcolorburgundy.sty'.
\end{filecontents*}
\documentclass[11pt,a4paper,sans]{moderncv}
% moderncv themes
\moderncvstyle{classic} % style options are 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{burgundy} % color options 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black' burgundy
\usepackage[scale=0.75]{geometry}
\firstname{John}
\familyname{Doe}
\title{Curriculum Vitae} % optional, remove / comment the line if not wanted
\address{street and number}{postcode city}{country}% optional, remove / comment the line if not wanted; the "postcode city" and and "country" arguments can be omitted or provided empty
\mobile{+1~(234)~567~890} % optional, remove / comment the line if not wanted
\phone{+2~(345)~678~901} % optional, remove / comment the line if not wanted
\fax{+3~(456)~789~012} % optional, remove / comment the line if not wanted
\email{john@doe.org} % optional, remove / comment the line if not wanted
\homepage{www.johndoe.com} % optional, remove / comment the line if not wanted
\extrainfo{additional information} % optional, remove / comment the line if not wanted
\photo[64pt][0.4pt]{example-image-a} % optional, remove / comment the line if not wanted
\quote{Some quote} % optional, remove / comment the line if not wanted
\begin{document}
\makecvtitle
\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description} % arguments 3 to 6 can be left empty
\end{document}
It seems that you haved mixed different versions of moderncv
. Just do not do this. If you want to change files of a package, do never change the files in your system TeXFM tree, copy them in your local tree or copy (if possible) it in your current directory with your current cv. A new color file can be placed in the current directory or a local TeXMF-tree.
The warning
LaTeX Warning: You have requested package `moderncvcolorburguny',
but the package provides `moderncvcolorpurple'.
shows you, that you have called a file moderncvcolorburguny.sty
but the macro \ProvidesPackage
named it moderncvcolorpurple
. Seems that you forgot to change the name there when receiving this warning. (BTW: I never got this message with your given MWE.)
Best Answer
If you use the
moderncv
class, there is no need to specify a colour scheme. So, by default, the colour scheme is black (or{rgb}{0,0,0}
). That's what is contained inmoderncv.cls
:However, if you choose a specific colour scheme, these colours are (re)defined to be something else.
Black /
moderncvcolorblack.sty
:Actually, nothing new here, but I'm showing it just for completeness.
Blue /
moderncvcolorblue.sty
:Green /
moderncvcolorgreen.sty
:Grey /
moderncvcolorgrey.sty
:Orange /
moderncvcolororange.sty
:Purple /
moderncvcolorpurple.sty
:Red /
moderncvcolorred.sty
:The "tertiary colour scheme" is never used, even though it is defined.