From 4074c92546608f0fe061e5ed04572e58269ee8b7 Mon Sep 17 00:00:00 2001 From: Xavier Danaux Date: Sat, 17 Dec 2011 22:08:36 +0100 Subject: [PATCH] Clean-up of length calculations thanks to xcalc --- moderncv.cls | 10 +++---- moderncvstylecasual.sty | 14 ++++----- moderncvstyleclassic.sty | 61 ++++++++-------------------------------- 3 files changed, 23 insertions(+), 62 deletions(-) diff --git a/moderncv.cls b/moderncv.cls index 4abfff4..d9eb27c 100644 --- a/moderncv.cls +++ b/moderncv.cls @@ -185,11 +185,11 @@ % other symbols \newcommand*{\listitemsymbol}{\labelitemi} \newcommand*{\addresssymbol}{} -\newcommand*{\mobilesymbol}{\Mobilefone} -\newcommand*{\phonesymbol}{\Telefon} -\newcommand*{\faxsymbol}{\FAX} -\newcommand*{\emailsymbol}{\Letter} -\newcommand*{\homepagesymbol}{{\Large\ComputerMouse}} +\newcommand*{\mobilesymbol}{\Mobilefone~} +\newcommand*{\phonesymbol}{\Telefon~} +\newcommand*{\faxsymbol}{\FAX~} +\newcommand*{\emailsymbol}{\Letter~} +\newcommand*{\homepagesymbol}{{\Large\ComputerMouse}~} % colors \definecolor{color0}{rgb}{0,0,0}% main default color, normally left to black diff --git a/moderncvstylecasual.sty b/moderncvstylecasual.sty index 6a04454..71c3dea 100644 --- a/moderncvstylecasual.sty +++ b/moderncvstylecasual.sty @@ -39,7 +39,7 @@ \newcommand*{\footersymbol}{% \if@firstfooterelement% \else% - { ~~\color{color1}\textbullet~~~}\fi\@firstfooterelementfalse}% \textbullet forces the use of the CMSY font, even when lmodern fonts are used :( + {~~~\color{color1}\textbullet~~~}\fi\@firstfooterelementfalse}% \textbullet forces the use of the CMSY font, even when lmodern fonts are used :( \renewcommand*{\makefooter}{% \fancypagestyle{plain}{% \fancyfoot[c]{% @@ -47,14 +47,14 @@ \centering% \addressfont\color{color2}% \ifthenelse{\isundefined{\@addressstreet}}{}{% - \addresssymbol~\@addressstreet% + \addresssymbol\@addressstreet% \@firstfooterelementfalse% \ifthenelse{\isundefined{\@addresscity}}{}{~--~\@addresscity}\\\@firstfooterelementtrue}% - \ifthenelse{\isundefined{\@mobile}}{}{\footersymbol\mobilesymbol~\@mobile\@firstfooterelementfalse}% - \ifthenelse{\isundefined{\@phone}}{}{\footersymbol\phonesymbol~\@phone\@firstfooterelementfalse}% - \ifthenelse{\isundefined{\@fax}}{}{\footersymbol\faxsymbol~\@fax\@firstfooterelementfalse}% - \ifthenelse{\isundefined{\@email}}{}{\footersymbol\emailsymbol~\emaillink{\@email}\@firstfooterelementfalse}% - \ifthenelse{\isundefined{\@homepage}}{}{\footersymbol\homepagesymbol~\httplink{\@homepage}\@firstfooterelementfalse}% + \ifthenelse{\isundefined{\@mobile}}{}{\footersymbol\mobilesymbol\@mobile\@firstfooterelementfalse}% + \ifthenelse{\isundefined{\@phone}}{}{\footersymbol\phonesymbol\@phone\@firstfooterelementfalse}% + \ifthenelse{\isundefined{\@fax}}{}{\footersymbol\faxsymbol\@fax\@firstfooterelementfalse}% + \ifthenelse{\isundefined{\@email}}{}{\footersymbol\emailsymbol\emaillink{\@email}\@firstfooterelementfalse}% + \ifthenelse{\isundefined{\@homepage}}{}{\footersymbol\homepagesymbol\httplink{\@homepage}\@firstfooterelementfalse}% \ifthenelse{\isundefined{\@extrainfo}}{}{\footersymbol\@extrainfo\@firstfooterelementfalse}}}% }% \pagestyle{plain}} diff --git a/moderncvstyleclassic.sty b/moderncvstyleclassic.sty index ae427c5..10f7157 100644 --- a/moderncvstyleclassic.sty +++ b/moderncvstyleclassic.sty @@ -21,37 +21,6 @@ %------------------------------------------------------------------------------- % package options %------------------------------------------------------------------------------- -% color options -% blue (default option) -%\DeclareOption{blue}{} -% orange -\newif\if@colororange\@colororangefalse -%\DeclareOption{orange}{\@colororangetrue} -% green -\newif\if@colorgreen\@colorgreenfalse -%\DeclareOption{green}{\@colorgreentrue} -% red -\newif\if@colorred\@colorredfalse -%\DeclareOption{red}{\@colorredtrue} -% purple -\newif\if@colorpurple\@colorpurplefalse -%\DeclareOption{purple}{\@colorpurpletrue} -% grey -\newif\if@colorgrey\@colorgreyfalse -%\DeclareOption{grey}{\@colorgreytrue} -% black -\newif\if@colorblack\@colorblackfalse -%\DeclareOption{black}{\@colorblacktrue} - -% unused options -%\DeclareOption*{ -% \PackageWarning{moderncvstyleclassic}{Unknown option '\CurrentOption'}} - -% execute default options -%\ExecuteOptions{} - -% process given options -%\ProcessOptions\relax %------------------------------------------------------------------------------- @@ -92,20 +61,14 @@ \renewcommand*{\recomputelengths}{% \setlength{\quotewidth}{0.65\textwidth}% % main lenghts - \setlength{\maincolumnwidth}{\textwidth}% - \addtolength{\maincolumnwidth}{-\separatorcolumnwidth}% - \addtolength{\maincolumnwidth}{-\hintscolumnwidth}% + \setlength{\maincolumnwidth}{\textwidth-\separatorcolumnwidth-\hintscolumnwidth}% % listitem lengths - \setlength{\listitemmaincolumnwidth}{\maincolumnwidth}% - \addtolength{\listitemmaincolumnwidth}{-\listitemsymbolwidth}% + \setlength{\listitemmaincolumnwidth}{\maincolumnwidth-\listitemsymbolwidth}% % doubleitem lengths - \setlength{\doubleitemmaincolumnwidth}{\maincolumnwidth}% - \addtolength{\doubleitemmaincolumnwidth}{-\hintscolumnwidth}% - \addtolength{\doubleitemmaincolumnwidth}{-\separatorcolumnwidth}% + \setlength{\doubleitemmaincolumnwidth}{\maincolumnwidth-\hintscolumnwidth-\separatorcolumnwidth}% \setlength{\doubleitemmaincolumnwidth}{0.5\doubleitemmaincolumnwidth}% % listdoubleitem lengths - \setlength{\listdoubleitemmaincolumnwidth}{\maincolumnwidth}% - \addtolength{\listdoubleitemmaincolumnwidth}{-\listitemsymbolwidth}% + \setlength{\listdoubleitemmaincolumnwidth}{\maincolumnwidth-\listitemsymbolwidth}% \setlength{\listdoubleitemmaincolumnwidth}{0.475\listdoubleitemmaincolumnwidth}% % fancyhdr lengths \renewcommand{\headwidth}{\textwidth}} @@ -122,13 +85,13 @@ \newbox{\maketitledetailsbox}% \savebox{\maketitledetailsbox}{% \begin{tabular}[b]{@{}r@{}}% - \ifthenelse{\isundefined{\@addressstreet}}{}{\maketitledetailsnewline\addresssymbol~\@addressstreet}% + \ifthenelse{\isundefined{\@addressstreet}}{}{\maketitledetailsnewline\addresssymbol\@addressstreet}% \ifthenelse{\isundefined{\@addresscity}}{}{\maketitledetailsnewline\@addresscity}% - \ifthenelse{\isundefined{\@mobile}}{}{\maketitledetailsnewline\mobilesymbol~\@mobile}% - \ifthenelse{\isundefined{\@phone}}{}{\maketitledetailsnewline\phonesymbol~\@phone}% - \ifthenelse{\isundefined{\@fax}}{}{\maketitledetailsnewline\faxsymbol~\@fax}% - \ifthenelse{\isundefined{\@email}}{}{\maketitledetailsnewline\emailsymbol~\emaillink{\@email}}% - \ifthenelse{\isundefined{\@homepage}}{}{\maketitledetailsnewline\homepagesymbol~\httplink{\@homepage}}% + \ifthenelse{\isundefined{\@mobile}}{}{\maketitledetailsnewline\mobilesymbol\@mobile}% + \ifthenelse{\isundefined{\@phone}}{}{\maketitledetailsnewline\phonesymbol\@phone}% + \ifthenelse{\isundefined{\@fax}}{}{\maketitledetailsnewline\faxsymbol\@fax}% + \ifthenelse{\isundefined{\@email}}{}{\maketitledetailsnewline\emailsymbol\emaillink{\@email}}% + \ifthenelse{\isundefined{\@homepage}}{}{\maketitledetailsnewline\homepagesymbol\httplink{\@homepage}}% \ifthenelse{\isundefined{\@extrainfo}}{}{\maketitledetailsnewline\@extrainfo}% \end{tabular} }% @@ -193,8 +156,6 @@ \hspace*{\separatorcolumnwidth}% \begin{minipage}[t]{\doubleitemmaincolumnwidth}#5\end{minipage}}} -%\renewcommand*{\cvlistitem}[2][\listitemsymbol]{% -% \cvitem[0pt]{}{#1~\begin{minipage}[t]{\listitemmaincolumnwidth}#2\end{minipage}}} \renewcommand*{\cvlistitem}[2][.25em]{% \cvitem[#1]{}{\listitemsymbol~\begin{minipage}[t]{\listitemmaincolumnwidth}#2\end{minipage}}} @@ -206,7 +167,7 @@ {#1~\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#3\end{minipage}}}} \renewcommand*{\cventry}[6]{% - \cvline{#1}{% + \cvitem{#1}{% {\bfseries#2}% \ifthenelse{\equal{#3}{}}{}{, {\slshape#3}}% \ifthenelse{\equal{#4}{}}{}{, #4}%