# Creating additional color for moderncv

I'm trying to create an additional color for moderncv, but am seeing unexpected behaviour.

I've created a file called moderncvcolorburgundy.sty, by copying the file for the purple color. I've changed all references to the word purple and changed the color definitions. The file contains the following code:

%% 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{color2}{rgb}{0.45,0.45,0.45}% dark grey
\endinput
%% end of file moderncvcolorburgundy.sty'.

However, when I choose burgundy as a color, the end result is purple! Even though the correct file is loaded (i don't get an error, which i do get if i remove the burgundy file) and I've updated the file name database and file formats.

I have no idea why the color is wrong. In fact, I don't even understand where the purple color is coming from...even if I remove the purple color style to a thumb drive it still turns up purple, even though the color definition for purple is not defined anywhere anymore...

How can I create an additional color and why is this not working?

An example document can be generated with the code below. Note that the moderncvcolorburgundy.sty file must exist in the same folder as the other style files.

\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'
\usepackage[scale=0.75]{geometry}

\name{John}{Doe}
\title{title}                               % 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
\phone[mobile]{+1~(234)~567~890}                   % 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}

Note that education and the box around it are purple and not burgundy/darkred.

The error in the log file:

("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\moderncv\moderncvcolorburgundy.st
y"

LaTeX Warning: You have requested package moderncvcolorburgundy',
but the package provides moderncvcolorpurple'.
• Have you looked at your log if the new file is used? – Juri Robl Apr 18 '13 at 21:22
• @DavidCarlisle; I've added an example document . – Mythio Apr 18 '13 at 21:23
• @JuriRobl; it contains an error I've added to the question, I don't know why or how to resolve this tough. – Mythio Apr 18 '13 at 21:26
• I get ! Undefined control sequence. l.7 \name {John}{Doe} – David Carlisle Apr 18 '13 at 21:27
• The log you have edited indicates that your file has \ProvidesPackage{moderncvcolorpurple} but the one you posted does not you should check your files perhaos you hav emultiple copies. You should not really put locally modified files in the standard miktex moderncv tree it will get lost or mess up on update, just leave it in the same folder as your document. – David Carlisle Apr 18 '13 at 21:30

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.)

• That did the trick for some reason...although I have no clue why this would work and what I tried didnt. The colors are not very similar, as the definition for purple is \definecolor{color1}{rgb}{0.50,0.33,0.80}% purple, which is quite far of in green and blue. Also, I think the problem with outdated is because of the example provided with the package. The version I'm using is up to date, but the packed example is not. Thanks for the fix though! – Mythio Apr 18 '13 at 21:50
• @Mythio I would guess that the purple version was an original and the burgundy pdf just never got made because of the fatal errors in the preamble due to the \name syntax. – David Carlisle Apr 18 '13 at 21:53
• It is weird, but I'm glad its solved. Hopefully others can use your answer when trying to define their own colors. – Mythio Apr 18 '13 at 22:03
• @Mythio A calibrated screen is actually not that expensive to get (you can get a good colorimeter for less than \$200) and IMHO greatly recommended for any typography or photography lover like I am. A calibrated printer, well, that's another story... :) – Xavier Apr 19 '13 at 2:08
• @Xavier; Are you the xavier that developed the package? Cause if you are, perhaps you have an idea of WHY it behaved like it did for future reference :-) – Mythio Apr 19 '13 at 6:44