Skip to content

Commit

Permalink
Update Moderncv template version.
Browse files Browse the repository at this point in the history
  • Loading branch information
taschetto committed Sep 16, 2014
1 parent 4d8a292 commit 1c35712
Show file tree
Hide file tree
Showing 20 changed files with 509 additions and 83 deletions.
118 changes: 76 additions & 42 deletions moderncv.cls
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% identification
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{moderncv}[2013/02/09 v1.3.0 modern curriculum vitae and letter document class]
\ProvidesClass{moderncv}[2013/04/29 v1.5.1 modern curriculum vitae and letter document class]


%-------------------------------------------------------------------------------
Expand Down Expand Up @@ -84,17 +84,17 @@
\RequirePackage{xcolor}

% font loading
%\RequirePackage{ifxetex,ifluatex}
%\newif\ifxetexorluatex
%\ifxetex
% \xetexorluatextrue
%\else
% \ifluatex
% \xetexorluatextrue
% \else
% \xetexorluatexfalse
% \fi
%\fi
\RequirePackage{ifxetex,ifluatex}
\newif\ifxetexorluatex
\ifxetex
\xetexorluatextrue
\else
\ifluatex
\xetexorluatextrue
\else
\xetexorluatexfalse
\fi
\fi
% automatic loading of latin modern fonts
%\ifxetexorluatex
% \RequirePackage{fontspec}
Expand Down Expand Up @@ -183,6 +183,9 @@
% micro-typography (e.g., character protrusion, font expansion, hyphenatable letterspacing)
\RequirePackage{microtype}

% stack of key-value elements, used to save personal information
\RequirePackage{moderncvcollection}

% compatibility package with older versions of moderncv
\RequirePackageWithOptions{moderncvcompatibility}

Expand Down Expand Up @@ -216,56 +219,86 @@
% overall design commands definitions
%-------------------------------------------------------------------------------
% elements
%---------
% defines one's name
% usage: \name{<firstname>}{<lastname>}
\newcommand*{\name}[2]{\def\@firstname{#1}\def\@lastname{#2}}

% defines one's title (optional)
% usage: \title{<title>}
\renewcommand*{\title}[1]{\def\@title{#1}}

% defines one's address (optional)
% usage: \address{<street>}{<city>}{<country>}
% where the <city> and <country> arguments can be omitted or provided empty
\NewDocumentCommand{\address}{mG{}G{}}{\def\@addressstreet{#1}\def\@addresscity{#2}\def\@addresscountry{#3}}
% adds a mobile/fixed/fax number to one's personal information (optional)
% usage: \phone[<optional type>]{<number>}
% where <optional type> should be either "mobile", "fixed" or "fax
\RequirePackage{collection}
\collectionnew{phones}
\newcommand*{\phone}[2][fixed]{\collectionadd[#1]{phones}{#2}}

% defines one's email (optional)
% usage: \email{<email adress>}
\newcommand*{\email}[1]{\def\@email{#1}}

% defines one's home page (optional)
% usage: \homepage{<url>}
\newcommand*{\homepage}[1]{\def\@homepage{#1}}

% adds a fixed/mobile/fax number to one's personal information (optional)
% usage: \phone[<optional type>]{<number>}
% where <optional type> should be either "fixed" (default), "mobile" or "fax
\collectionnew{phones}
\newcommand*{\phone}[2][fixed]{\collectionadd[#1]{phones}{#2}}

% adds a social link to one's personal information (optional)
% usage: \social[<optional type>][<optional url>]{<account name>}
% where <optional type> should be either "linkedin", "twitter" or "github"
\collectionnew{socials}
\NewDocumentCommand{\social}{O{}O{}m}{%
\ifthenelse{\equal{#2}{}}%
{%
\ifthenelse{\equal{#1}{linkedin}}{\collectionadd[linkedin]{socials}{\protect\httplink[#3]{www.linkedin.com/in/#3}}}{}%
\ifthenelse{\equal{#1}{twitter}} {\collectionadd[twitter]{socials} {\protect\httplink[#3]{www.twitter.com/#3}}} {}%
\ifthenelse{\equal{#1}{github}} {\collectionadd[github]{socials} {\protect\httplink[#3]{www.github.com/#3}}} {}%
}
{\collectionadd[#1]{socials}{\protect\httplink[#3]{#2}}}}

% defines additional personal information (optional)
% usage: \extrainfo{<text>}
\newcommand*{\extrainfo}[1]{\def\@extrainfo{#1}}

% colors
%-------
\definecolor{color0}{rgb}{0,0,0}% main default color, normally left to black
\definecolor{color1}{rgb}{0,0,0}% primary theme color
\definecolor{color2}{rgb}{0,0,0}% secondary theme color
\definecolor{color3}{rgb}{0,0,0}% tertiary theme color
\definecolor{color1}{rgb}{0,0,0}% primary scheme color
\definecolor{color2}{rgb}{0,0,0}% secondary scheme color
\definecolor{color3}{rgb}{0,0,0}% tertiary scheme color

% symbols
% itemize labels (the struts were added to correct inter-item spacing (works for single line items, until a solution is found for multi-line ones...)
\newcommand*{\labelitemi}{\strut\textcolor{color1}{\large\rmfamily\textbullet}}% the \rmfamily is required to force Latin Modern fonts when using sans serif, as OMS/lmss/m/n is not defined and gets substituted by OMS/cmsy/m/n
\newcommand*{\labelitemii}{\strut\textcolor{color1}{\large\bfseries-}}
\newcommand*{\labelitemiii}{\strut\textcolor{color1}{\rmfamily\textperiodcentered}}% alternative: \textasteriskcentered; the \rmfamily is required to force Latin Modern fonts when using sans serif, as OMS/lmss/m/n is not defined and gets substituted by OMS/cmsy/m/n
\newcommand*{\labelitemiv}{\labelitemiii}
% enumerate labels
\renewcommand{\theenumi}{\@arabic\c@enumi}
\renewcommand{\theenumii}{\@alph\c@enumii}
\renewcommand{\theenumiii}{\@roman\c@enumiii}
\renewcommand{\theenumiv}{\@Alph\c@enumiv}
% other symbols
\newcommand*{\listitemsymbol}{\labelitemi~}
\newcommand*{\addresssymbol}{}
\newcommand*{\mobilephonesymbol}{}
\newcommand*{\fixedphonesymbol}{}
\newcommand*{\faxphonesymbol}{}
\newcommand*{\emailsymbol}{}
\newcommand*{\homepagesymbol}{}

%--------
% itemize labels (the struts were added to correct inter-item spacing (works for single line items, until a solution is found for multi-line ones...)
\newcommand*{\labelitemi} {\strut\textcolor{color1}{\large\rmfamily\textbullet}}% the \rmfamily is required to force Latin Modern fonts when using sans serif, as OMS/lmss/m/n is not defined and gets substituted by OMS/cmsy/m/n
\newcommand*{\labelitemii} {\strut\textcolor{color1}{\large\bfseries-}}
\newcommand*{\labelitemiii} {\strut\textcolor{color1}{\rmfamily\textperiodcentered}}% alternative: \textasteriskcentered; the \rmfamily is required to force Latin Modern fonts when using sans serif, as OMS/lmss/m/n is not defined and gets substituted by OMS/cmsy/m/n
\newcommand*{\labelitemiv} {\labelitemiii}

% enumerate labels
\renewcommand{\theenumi} {\@arabic\c@enumi}
\renewcommand{\theenumii} {\@alph\c@enumii}
\renewcommand{\theenumiii} {\@roman\c@enumiii}
\renewcommand{\theenumiv} {\@Alph\c@enumiv}

% other symbols
\newcommand*{\listitemsymbol} {\labelitemi~}
\newcommand*{\addresssymbol} {}
\newcommand*{\mobilephonesymbol} {}
\newcommand*{\fixedphonesymbol} {}
\newcommand*{\faxphonesymbol} {}
\newcommand*{\emailsymbol} {}
\newcommand*{\homepagesymbol} {}
\newcommand*{\linkedinsocialsymbol}{}
\newcommand*{\twittersocialsymbol} {}
\newcommand*{\githubsocialsymbol} {}

% other
%------
% fonts
\AtBeginDocument{\normalfont\color{color0}}

Expand Down Expand Up @@ -466,8 +499,9 @@
\cvitem{}{%
\begin{tabular}{\cvcolumns@def}%
\if@cvcolumns@head@empty\else%
\cvcolumns@head\\[-.8em]%
{\color{color1}\rule{\maincolumnwidth}{.25pt}}\\\fi%
\cvcolumns@head%\\[-.8em]%
% {\color{color1}\rule{\maincolumnwidth}{.25pt}}%
\\\fi%
\cvcolumns@content%
\end{tabular}}}

Expand Down
85 changes: 85 additions & 0 deletions moderncvcollection.sty
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
%% start of file `moderncvcollection.sty'.
%% Copyright 2013-2013 Xavier Danaux ([email protected]).
%
% 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{moderncvcollection}[2013/04/29 v1.5.1 moderncv collections]


%-------------------------------------------------------------------------------
% requirements
%-------------------------------------------------------------------------------


\RequirePackage{ifthen}


%-------------------------------------------------------------------------------
% code
%-------------------------------------------------------------------------------

% creates a new collection
% usage: \collectionnew{<collection name>}
\newcommand*{\collectionnew}[1]{%
\newcounter{collection@#1@count}}

% adds an item to a collection
% usage: \collectionadd[<optional key>]{<collection name>}{<item to add>}
\newcommand*{\collectionadd}[3][]{%
\expandafter\def\csname collection@#2@item\roman{collection@#2@count}\endcsname{#3}%
\if\relax\noexpand#1\relax% if #1 is empty
\else\expandafter\def\csname collection@#2@key\roman{collection@#2@count}\endcsname{#1}\fi%
\stepcounter{collection@#2@count}}

% returns the number of items in a collection
% usage: \collectioncount{<collection name>}
\newcommand*{\collectioncount}[1]{%
\value{collection@#1@count}}

% gets an item from a collection
% usage: \collectiongetitem{<collection name>}{<element id>}
% where <element id> is an integer between 0 and (collectioncount-1)
\newcommand*{\collectiongetitem}[2]{%
\csname collection@#1@item\romannumeral #2\endcsname}

% gets a key from a collection
% usage: \collectiongetkey{<collection name>}{<element id>}
% where <element id> is an integer between 0 and (collectioncount-1)
\newcommand*{\collectiongetkey}[2]{%
\csname collection@#1@key\romannumeral #2\endcsname}

% loops through a collection and perform the given operation on every element
% usage: \collectionloop{<collection name>}{<operation sequence>}
% where <operation sequence> is the code sequence to be evaluated for each collection item,
% code which can refer to \collectionloopid, \collectionloopkey, \collectionloopitem and
% \collectionloopbreak
\newcounter{collection@iterator}
\newcommand*{\collectionloopbreak}{\let\iterate\relax}
\newcommand*{\collectionloop}[2]{%
\setcounter{collection@iterator}{0}%
\loop\ifnum\value{collection@iterator}<\value{collection@#1@count}%
\def\collectionloopid{\arabic{collection@iterator}}%
\def\collectionloopitem{\collectiongetitem{#1}{\collectionloopid}}%
\def\collectionloopkey{\collectiongetkey{#1}{\collectionloopid}}%
#2%
\stepcounter{collection@iterator}%
\repeat}

% loops through a collection and finds the (first) element matching the given key
% usage: \collectionfindbykey{<collection name>}{key>}
\newcommand*{\collectionfindbykey}[2]{%
\collectionloop{#1}{%
\ifthenelse{\equal{\collectionloopkey}{#2}}{\collectionloopitem\collectionloopbreak}{}}}


\endinput


%% end of file `moderncvcollection.cls'.
2 changes: 1 addition & 1 deletion moderncvcolorblack.sty
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% identification
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvcolorblack}[2013/02/09 v1.3.0 modern curriculum vitae and letter color scheme: black]
\ProvidesPackage{moderncvcolorblack}[2013/04/29 v1.5.1 modern curriculum vitae and letter color scheme: black]


%-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion moderncvcolorblue.sty
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% identification
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvcolorblue}[2013/02/09 v1.3.0 modern curriculum vitae and letter color scheme: blue]
\ProvidesPackage{moderncvcolorblue}[2013/04/29 v1.5.1 modern curriculum vitae and letter color scheme: blue]


%-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion moderncvcolorgreen.sty
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% identification
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvcolorgreen}[2013/02/09 v1.3.0 modern curriculum vitae and letter color scheme: green]
\ProvidesPackage{moderncvcolorgreen}[2013/04/29 v1.5.1 modern curriculum vitae and letter color scheme: green]


%-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion moderncvcolorgrey.sty
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% identification
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvcolorgrey}[2013/02/09 v1.3.0 modern curriculum vitae and letter color scheme: grey]
\ProvidesPackage{moderncvcolorgrey}[2013/04/29 v1.5.1 modern curriculum vitae and letter color scheme: grey]


%-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion moderncvcolororange.sty
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% identification
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvcolororange}[2013/02/09 v1.3.0 modern curriculum vitae and letter color scheme: orange]
\ProvidesPackage{moderncvcolororange}[2013/04/29 v1.5.1 modern curriculum vitae and letter color scheme: orange]


%-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion moderncvcolorpurple.sty
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% identification
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvcolorpurple}[2013/02/09 v1.3.0 modern curriculum vitae and letter color scheme: purple]
\ProvidesPackage{moderncvcolorpurple}[2013/04/29 v1.5.1 modern curriculum vitae and letter color scheme: purple]


%-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion moderncvcolorred.sty
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% identification
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvcolorred}[2013/02/09 v1.3.0 modern curriculum vitae and letter color scheme: red]
\ProvidesPackage{moderncvcolorred}[2013/04/29 v1.5.1 modern curriculum vitae and letter color scheme: red]


%-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion moderncvcompatibility.sty
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% identification
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvcompatibility}[2013/02/09 v1.3.0 modern curriculum vitae and letter compatibility patches]
\ProvidesPackage{moderncvcompatibility}[2013/04/29 v1.5.1 modern curriculum vitae and letter compatibility patches]


%-------------------------------------------------------------------------------
Expand Down
54 changes: 54 additions & 0 deletions moderncvdebugtools.sty
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
%% start of file `moderncvdebugtools.sty'.
%% Copyright 2013-2013 Xavier Danaux ([email protected]).
%
% 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{moderncvdebugtools}[2013/04/29 v1.5.1 modern curriculum vitae and letter debug tools]


%-------------------------------------------------------------------------------
% required packages
%-------------------------------------------------------------------------------
\RequirePackage{tikz}


%-------------------------------------------------------------------------------
% debug tools
%-------------------------------------------------------------------------------
% code of \tracedebugvrule and \tracedebughrule provided by Gonzalo Medina on TeX.SX (cfr tex.stackexchange.com/a/110805/10102)
\newcounter{debugrule}
\pgfdeclarelayer{background}
\pgfsetlayers{background,main}

\DeclareDocumentCommand{\tracedebugvrule}{oO{0pt}}{%
\stepcounter{debugrule}%
\begin{tikzpicture}[remember picture,overlay]
\begin{pgfonlayer}{background}
\coordinate (a\thedebugrule);
\draw[red,thin,#1]
([xshift=#2]a\thedebugrule|-current page.north) -- ([xshift=#2]a\thedebugrule|-current page.south);
\end{pgfonlayer}
\end{tikzpicture}}

\DeclareDocumentCommand{\tracedebughrule}{oO{0pt}}{%
\stepcounter{debugrule}%
\begin{tikzpicture}[remember picture,overlay]
\begin{pgfonlayer}{background}
\coordinate (b\thedebugrule);
\draw[red,thin,#1]
([yshift=#2]b\thedebugrule-|current page.west) -- ([yshift=#2]b\thedebugrule-|current page.east);
\end{pgfonlayer}
\end{tikzpicture}}


\endinput


%% end of file `moderncvdebugtools.sty'.
Loading

0 comments on commit 1c35712

Please sign in to comment.