Release 2.0.0

This commit is contained in:
Xavier Danaux
2015-07-29 00:51:44 -07:00
parent 1729d384b6
commit f50d1cff32
44 changed files with 2649 additions and 1056 deletions

View File

@ -1,5 +1,5 @@
%% start of file `moderncv.cls'.
%% Copyright 2006-2013 Xavier Danaux (xdanaux@gmail.com).
%% Copyright 2006-2015 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,
@ -10,7 +10,7 @@
% identification
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{moderncv}[2013/04/29 v1.5.1 modern curriculum vitae and letter document class]
\ProvidesClass{moderncv}[2015/07/28 v2.0.0 modern curriculum vitae and letter document class]
%-------------------------------------------------------------------------------
@ -146,6 +146,8 @@
\newcommand*{\nopagenumbers}{\@displaypagenumbersfalse}
\AtEndPreamble{%
\AtBeginDocument{%
% fancyhdr length
\renewcommand{\headwidth}{\textwidth}
\if@displaypagenumbers%
\@ifundefined{r@lastpage}{}{%
\ifthenelse{\pageref{lastpage}>1}{%
@ -316,14 +318,14 @@
\RequirePackage[#1]{moderncvstyle#2}}
% loads a header variant
% usage: \moderncvhead{<header variant number>}
\newcommand*{\moderncvhead}[1]{
\expandafter\RequirePackage\expandafter{\expandafter moderncvhead\romannumeral #1}}
% usage: \moderncvhead[<optional head option>]{<header variant number>}
\newcommand*{\moderncvhead}[2][]{
\expandafter\RequirePackage\expandafter[\expandafter#1\expandafter]{\expandafter moderncvhead\romannumeral #2}}
% loads a body variant
% usage: \moderncvbody{<body variant number>}
\newcommand*{\moderncvbody}[1]{
\expandafter\RequirePackage\expandafter{\expandafter moderncvbody\romannumeral #1}}
% usage: \moderncvbody[<optional body option>]{<body variant number>}
\newcommand*{\moderncvbody}[2][]{
\expandafter\RequirePackage\expandafter[\expandafter#1\expandafter]{\expandafter moderncvbody\romannumeral #2}}
% loads a footer variant
% usage: \moderncvfoot{<footer variant number>}
@ -347,12 +349,19 @@
\newcommand*{\recomputelengths}{\recomputecvlengths}
\AtBeginDocument{\recomputelengths{}}
% creates a command if not yet defined
\newcommand*{\@initializecommand}[2]{%
\ifdefined#1
\renewcommand{#1}{#2}%
\else%
\newcommand*{#1}{#2}\fi}
% creates a length if not yet defined
\newcommand*{\@initializelength}[1]{%
\ifdefined#1
\setlength{#1}{0pt}%
\else%
\newlength{#1}\fi}
\newlength{#1}\fi%
\setlength{#1}{0pt}}
% creates a box if not yet defined
\newcommand*{\@initializebox}[1]{%
@ -363,13 +372,14 @@
% creates an if switch if not yet defined
\newcommand*{\@initializeif}[1]{%
\ifdefined#1
\else%
\newif#1\fi}
% \ifdefined#1% not working due to the nested \if
% \else%
\newif#1%\fi
}
% custom strut for spacing; the first argument is the vertical offset of the strut, the second its total height (both as a fraction of \baselineskip)
% custom strut for spacing; the first argument is the vertical offset of the strut, the second its total height
\newcommand*{\@moderncvstrut}[2]{%
\rule[-#1\baselineskip]{0pt}{#2\baselineskip}}
\rule[-#1]{0pt}{#2}}
%-------------------------------------------------------------------------------
@ -418,20 +428,20 @@
% internal maketitle command to issue a new line only when required
\newif\if@firstdetailselement\@firstdetailselementtrue
\newcommand*{\makenewline}{
\newcommand*{\makenewline}[1][0pt]{%
\if@firstdetailselement%
\strut% to ensure baseline alignment, e.g. with when put in the margin vs sections that also contains a \strut
\else%
\\\fi%
\\[#1]\fi%
\@firstdetailselementfalse}
% makes the resume title
% usage: \makecvtitle
\newcommand*{\makecvtitle}{}
% makes the resume footer
% usage: \makecvfooter
\newcommand*{\makecvfooter}{\makefooter}
\newcommand*{\makecvtitle}{%
\makecvhead%
\makecvfoot}
\newcommand*{\makecvhead}{}
\newcommand*{\makecvfoot}{}
% makes a resume section
% usage: \section{<title>}
@ -508,7 +518,7 @@
\setcounter{cvcolumnsautowidthcounter}{0}%
\setlength{\cvcolumnsautowidth}{\cvcolumnsdummywidth}%
\setlength{\cvcolumnautowidth}{0pt}%
\@cvcolumns@head@emptytrue}%
\@cvcolumns@head@emptytrue\ignorespaces}%
{% at environment closing: typeset environment
% compute the width of each cvcolumn, considering a spacing of \separatorcolumnwidth and the columns with set width
\ifnum\thecvcolumnscounter>0%
@ -550,7 +560,7 @@
% create the tabular
\cvitem{}{%
% \begin{tabular}{\cvcolumns@def}% this conflicts with the "colortbl" package (loaded by xcolor when passing the "table" option), and requires the below 2 lines to expand \cvcolumns@def
\def\begincvcolumns{\begin{tabular}}
\def\begincvcolumns{\begin{tabular}[t]}% "[t]" is required for some body styles; the default alignment is "[c]"
\expandafter\begincvcolumns\expandafter{\cvcolumns@def}%
\if@cvcolumns@head@empty\else%
\cvcolumns@head%\\[-.8em]%
@ -575,7 +585,8 @@
\expandafter\expandafter\expandafter\def\expandafter\csname cvcolumn\roman{cvcolumnscounter}@head\endcsname{\protect\parbox[b]{#1\cvcolumnswidth}{\protect\subsectionstyle{#2}}}}%
\ifthenelse{\equal{#2}{}}{}{\@cvcolumns@head@emptyfalse}%
\expandafter\expandafter\expandafter\def\expandafter\csname cvcolumn\roman{cvcolumnscounter}@content\endcsname{\protect\cvcolumncell{#3}}%
\stepcounter{cvcolumnscounter}}
\stepcounter{cvcolumnscounter}%
\ignorespaces}
% internal cvcolumncell command, that enables a cvcolumn cell to contain paragraph commands (lists, newlines, etc)
\newcommand*{\cvcolumncell}[1]{{% put cell inside a group, so that command redefinitions are only local
@ -597,6 +608,10 @@
\newenvironment{thebibliography}[1]{}{}
\newcommand*{\newblock}{\hskip .11em\@plus.33em\@minus.07em}
\let\@openbib@code\@empty
%% fix a bug (hardcoded bib label) in \@bibitem
%\renewcommand\@bibitem[1]{%
% \item\if@filesw \immediate\write\@auxout
% {\string\bibcite{#1}{\theenumiv}}\fi\ignorespaces}% replaced "\the\value{\@listctr}" with "\theenumiv"
% itemize, enumerate and description environment
\setlength{\leftmargini} {1em}
@ -659,11 +674,11 @@
% makes the letter title
% usage: \makelettertitle
\newcommand*{\makelettertitle}{}
% makes the letter footer
% usage: \makeletterfooter
\newcommand*{\makeletterfooter}{\makefooter}
\newcommand*{\makelettertitle}{%
\makeletterhead%
\makeletterfoot}
\newcommand*{\makeletterhead}{}
\newcommand*{\makeletterfoot}{}
% makes the letter closing
% usage: \makeletterclosing