From fa003e1738374d3096dfc796175c5f7e28c1401b Mon Sep 17 00:00:00 2001 From: David Date: Sun, 17 Jan 2021 00:23:16 +0100 Subject: [PATCH] add working cvmatrix for all styles but fancy --- moderncvbodyiii.sty | 4 ++ moderncvbodyiiiskillmatrix.sty | 124 +++++++++++++++++++++++++++++++++ moderncvbodyiskillmatrix.sty | 33 +++++---- moderncvbodyiv.sty | 4 ++ moderncvbodyivskillmatrix.sty | 124 +++++++++++++++++++++++++++++++++ moderncvbodyvskillmatrix.sty | 119 +++++++++++++++++++++++++++++++ 6 files changed, 393 insertions(+), 15 deletions(-) create mode 100644 moderncvbodyiiiskillmatrix.sty create mode 100644 moderncvbodyivskillmatrix.sty create mode 100644 moderncvbodyvskillmatrix.sty diff --git a/moderncvbodyiii.sty b/moderncvbodyiii.sty index a2de047..e86ad1b 100644 --- a/moderncvbodyiii.sty +++ b/moderncvbodyiii.sty @@ -87,6 +87,9 @@ % used by \cvlistdoubleitem \@initializelength{\listdoubleitemcolumnwidth} +%% include moderncv Skillmatrix code +\input{moderncvbodyiiiskillmatrix.sty} + % commands \renewcommand*{\recomputecvbodylengths}{% % body lengths @@ -96,6 +99,7 @@ \setlength{\doubleitemcolumnwidth}{0.5\doubleitemcolumnwidth}% \setlength{\listdoubleitemcolumnwidth}{\maincolumnwidth-\listitemsymbolwidth-\separatorcolumnwidth-\listitemsymbolwidth}% \setlength{\listdoubleitemcolumnwidth}{0.5\listdoubleitemcolumnwidth}% + \recomputecvskillmatrixlengths % regular lengths \setlength{\parskip}{0\p@}} diff --git a/moderncvbodyiiiskillmatrix.sty b/moderncvbodyiiiskillmatrix.sty new file mode 100644 index 0000000..6c0e880 --- /dev/null +++ b/moderncvbodyiiiskillmatrix.sty @@ -0,0 +1,124 @@ +% some packages required for this code +\RequirePackage{tikz} +% needed for the dashed lines +\RequirePackage{arydshln} + +%%% The code for the Skilllevel illustration with the little boxes. +% This is idea stolen from the limecv package +\@initializelength{\cvSkillRectangleSize} +\setlength{\cvSkillRectangleSize}{1.2ex} +\newcount\my@repeat@count +\NewDocumentCommand{\cvSkill}{m}{% + \begingroup + \my@repeat@count=\z@ + \@whilenum\my@repeat@count<#1\do{\tikz\filldraw[color1] (0, 0) rectangle (\cvSkillRectangleSize, \cvSkillRectangleSize);\advance% + \my@repeat@count\@ne\,}% + \my@repeat@count=\numexpr5-\z@\relax + \@whilenum\my@repeat@count>#1\do{\tikz\filldraw[color2!30] (0, 0) rectangle (\cvSkillRectangleSize, \cvSkillRectangleSize);\advance% + \my@repeat@count\m@ne\,}% + \endgroup +} + +\@initializelength{\cvskillwidth} +\@initializelength{\cvskilldescriptorwidth} +\@initializelength{\cvskilllegenddescriptorwidth} +\@initializelength{\cvskillexperiencewidth} +\@initializelength{\skillmatrixcolumnwidth} +\@initializelength{\skillmatrixcommentwidth} +\@initializelength{\skillmatrixcommentpadding} +\@initializelength{\skillmatrixhintscolumnwidth} +\@initializelength{\skilllegendhintscolumnwidth} +\NewDocumentCommand{\recomputecvskillmatrixlengths}{}{% + \setlength{\skillmatrixcommentpadding}{1ex} + \setlength{\separatorcolumnwidth}{\skillmatrixcommentpadding} + \setlength{\skillmatrixhintscolumnwidth}{\widthof{``Languages''}} + \setlength{\skilllegendhintscolumnwidth}{\skillmatrixhintscolumnwidth} %0.175\textwidth +% \setlength{\skillmatrixhintscolumnwidth}{0.14\textwidth} %0.175\textwidth + \setlength{\cvskillwidth}{\widthof{\cvSkill{5}}} + \setlength{\cvskillexperiencewidth}{\widthof{``Jahre''}} + \@initializelength{\matrixbodylength} + \setlength{\matrixbodylength}{\maincolumnwidth-\skillmatrixhintscolumnwidth-\separatorcolumnwidth} + \setlength{\skillmatrixcolumnwidth}{0.45\matrixbodylength}% + \setlength{\cvskilldescriptorwidth}{\skillmatrixcolumnwidth-\cvskillwidth-\cvskillexperiencewidth} + \setlength{\skillmatrixcommentwidth}{\matrixbodylength-\skillmatrixcolumnwidth-\skillmatrixcommentpadding}% + \setlength{\cvskilllegenddescriptorwidth}{0.5\matrixbodylength-\cvskillwidth-\skillmatrixcommentpadding} + % regular lengths + \setlength{\parskip}{0\p@}} + +\RequirePackage{multirow} +\NewDocumentCommand\legendFontSize{}{\scriptsize} +\NewDocumentCommand\cvSkillMatrixLegend{s +O{.25em} +O{basic knowledge} +O{intermediate knowledge with experience in projects} +O{extensive experience in projects} +O{deep expert knowledge} +O{expert/guru} +m}{% + \IfBooleanTF#1% + {% if a star is given, add dashed line + \begingroup + \arrayrulecolor{color1} + \begin{tabular}{@{}p{\skilllegendhintscolumnwidth} + @{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{};{.6pt/1pt}p{\cvskilllegenddescriptorwidth} @{\hspace{2\skillmatrixcommentpadding}}p{\cvskillwidth}@{};{.6pt/1pt}p{\cvskilllegenddescriptorwidth}@{}}% + \raggedleft\hintstyle{#8} & \cvSkill{1}\, & \,{\legendFontSize #3} & \cvSkill{3}\, &\,{\legendFontSize #5 } \\ + % + & \cvSkill{2}\, & \,\multirow{2}{\cvskilllegenddescriptorwidth}{{\legendFontSize #4}} & \cvSkill{4}\, &\,{\legendFontSize #6 } \\ + % + & & & \cvSkill{5}\, &\,{\legendFontSize #7 } + \end{tabular}% + \endgroup + \par\addvspace{#2} + } + {% if no star is given, do not add dashed line + \begin{tabular}{@{}p{\skilllegendhintscolumnwidth} + @{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}p{\cvskilllegenddescriptorwidth} @{\hspace{2\skillmatrixcommentpadding}}p{\cvskillwidth}@{}p{\cvskilllegenddescriptorwidth}@{}}% + \raggedleft\hintstyle{#8} & \cvSkill{1}\, & \,{\legendFontSize #3} & \cvSkill{3}\, &\,{\legendFontSize #5 } \\ + % + & \cvSkill{2}\, & \,\multirow{2}{\cvskilllegenddescriptorwidth}{{\legendFontSize #4}} & \cvSkill{4}\, &\,{\legendFontSize #6 } \\ + % + & & & \cvSkill{5}\, &\,{\legendFontSize #7 } + \end{tabular}% + \par\addvspace{#2} + } + } +\NewDocumentCommand\cvSkillMatrixHeadFont{}{\normalfont} +\NewDocumentCommand\cvSkillMatrixHead{s O{.25em} +O{Level} +O{Skill} +O{Years} +O{Comment}}{% + \IfBooleanTF#1% + {% if a star is given, add dashed line + \begingroup + \renewcommand{\arraystretch}{1.25} + \arrayrulecolor{color1} + \begin{tabular}{@{}p{\skillmatrixhintscolumnwidth} + @{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}}p{\skillmatrixcommentwidth}@{}}% + & \centering{\cvSkillMatrixHeadFont #3} & \centering{\cvSkillMatrixHeadFont #4} & \centering{\cvSkillMatrixHeadFont #5} & {\cvSkillMatrixHeadFont #6} \\\cdashline{2-5}[.6pt/1pt] + \end{tabular}% + \endgroup + \par\addvspace{#2} + } + {%if star is not given, do not add dashed line + \begingroup + \renewcommand{\arraystretch}{1.25} + \begin{tabular}{@{}p{\skillmatrixhintscolumnwidth} + @{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}}p{\skillmatrixcommentwidth}@{}}% + & \centering{\cvSkillMatrixHeadFont #3} & \centering{\cvSkillMatrixHeadFont #4} & \centering{\cvSkillMatrixHeadFont #5} & {\cvSkillMatrixHeadFont #6} + \end{tabular}% + \endgroup + \par\addvspace{#2} + } + } + + +\NewDocumentCommand\cvSkillMatrixEntry{s O{.25em} +m +m +m +m +m}{% + %test for the star * in the command + \IfBooleanTF#1% + {% If a star is seen a dotted line is drawn above the entry + \begingroup + \renewcommand{\arraystretch}{1.25} + \arrayrulecolor{color1} + \begin{tabular}{@{}p{\skillmatrixhintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}} p{\skillmatrixcommentwidth}@{}}% + \cdashline{2-5}[.6pt/1pt] + \raggedleft\hintstyle{#3} &\centering \cvSkill{#4} &\centering {#5} & \centering {#6} &{\itshape#7}% + \end{tabular}% + \endgroup + \par\addvspace{#2}} +% + {% If no star is seen no line is drawn + \begin{tabular}{@{}p{\skillmatrixhintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}} p{\skillmatrixcommentwidth}@{}}% + \raggedleft\hintstyle{#3} &\centering \cvSkill{#4} &\centering {#5} & \centering {#6} &{\itshape#7}% + \end{tabular}% + \par\addvspace{#2}} +} diff --git a/moderncvbodyiskillmatrix.sty b/moderncvbodyiskillmatrix.sty index 7f7df3f..ea8fe62 100644 --- a/moderncvbodyiskillmatrix.sty +++ b/moderncvbodyiskillmatrix.sty @@ -26,14 +26,12 @@ \@initializelength{\skillmatrixcolumnwidth} \@initializelength{\skillmatrixcommentwidth} \@initializelength{\skillmatrixcommentpadding} +\@initializelength{\skillmatrixhintscolumnwidth} +\@initializelength{\skilllegendhintscolumnwidth} \NewDocumentCommand{\recomputecvskillmatrixlengths}{}{% -% % body lengths -% \setlength{\maincolumnwidth}{\textwidth-\leftskip-\rightskip-\separatorcolumnwidth-\hintscolumnwidth}% -% \setlength{\listitemcolumnwidth}{\maincolumnwidth-\listitemsymbolwidth}% -% \setlength{\doubleitemcolumnwidth}{\maincolumnwidth-\hintscolumnwidth-\separatorcolumnwidth-\separatorcolumnwidth}% -% \setlength{\doubleitemcolumnwidth}{0.5\doubleitemcolumnwidth}% -% \setlength{\listdoubleitemcolumnwidth}{\maincolumnwidth-\listitemsymbolwidth-\separatorcolumnwidth-\listitemsymbolwidth}% -% \setlength{\listdoubleitemcolumnwidth}{0.5\listdoubleitemcolumnwidth}% + \setlength{\skillmatrixhintscolumnwidth}{\hintscolumnwidth} + \setlength{\skilllegendhintscolumnwidth}{\hintscolumnwidth} %0.175\textwidth +% \setlength{\skillmatrixhintscolumnwidth}{0.14\textwidth} %0.175\textwidth \setlength{\cvskillwidth}{\widthof{\cvSkill{5}}} \setlength{\cvskillexperiencewidth}{\widthof{``Jahre''}} \setlength{\skillmatrixcolumnwidth}{0.45\maincolumnwidth}% @@ -45,22 +43,25 @@ \setlength{\parskip}{0\p@}} \RequirePackage{multirow} -\NewDocumentCommand\legendFontSize{}{\small} +\NewDocumentCommand\legendFontSize{}{\scriptsize} \NewDocumentCommand\cvSkillMatrixLegend{s +O{.25em} +O{basic knowledge} +O{intermediate knowledge with experience in projects} +O{extensive experience in projects} +O{deep expert knowledge} +O{expert/guru} +m}{% \IfBooleanTF#1% {% if a star is given, add dashed line - \begin{tabular}{@{}p{\hintscolumnwidth} - @{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{};{.6pt/1pt}p{0.9\cvskilllegenddescriptorwidth} @{\hspace{2\skillmatrixcommentpadding}}p{\cvskillwidth}@{};{.6pt/1pt}p{1.1\cvskilllegenddescriptorwidth}@{}}% + \begingroup + \arrayrulecolor{color1} + \begin{tabular}{@{}p{\skilllegendhintscolumnwidth} + @{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{};{.6pt/1pt}p{\cvskilllegenddescriptorwidth} @{\hspace{2\skillmatrixcommentpadding}}p{\cvskillwidth}@{};{.6pt/1pt}p{\cvskilllegenddescriptorwidth}@{}}% \raggedleft\hintstyle{#8} & \cvSkill{1}\, & \,{\legendFontSize #3} & \cvSkill{3}\, &\,{\legendFontSize #5 } \\ % & \cvSkill{2}\, & \,\multirow{2}{\cvskilllegenddescriptorwidth}{{\legendFontSize #4}} & \cvSkill{4}\, &\,{\legendFontSize #6 } \\ % & & & \cvSkill{5}\, &\,{\legendFontSize #7 } \end{tabular}% + \endgroup \par\addvspace{#2} } {% if no star is given, do not add dashed line - \begin{tabular}{@{}p{\hintscolumnwidth} + \begin{tabular}{@{}p{\skilllegendhintscolumnwidth} @{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}p{\cvskilllegenddescriptorwidth} @{\hspace{2\skillmatrixcommentpadding}}p{\cvskillwidth}@{}p{\cvskilllegenddescriptorwidth}@{}}% \raggedleft\hintstyle{#8} & \cvSkill{1}\, & \,{\legendFontSize #3} & \cvSkill{3}\, &\,{\legendFontSize #5 } \\ % @@ -77,7 +78,8 @@ {% if a star is given, add dashed line \begingroup \renewcommand{\arraystretch}{1.25} - \begin{tabular}{@{}p{\hintscolumnwidth} + \arrayrulecolor{color1} + \begin{tabular}{@{}p{\skillmatrixhintscolumnwidth} @{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}}p{\skillmatrixcommentwidth}@{}}% & \centering{\cvSkillMatrixHeadFont #3} & \centering{\cvSkillMatrixHeadFont #4} & \centering{\cvSkillMatrixHeadFont #5} & {\cvSkillMatrixHeadFont #6} \\\cdashline{2-5}[.6pt/1pt] \end{tabular}% @@ -87,7 +89,7 @@ {%if star is not given, do not add dashed line \begingroup \renewcommand{\arraystretch}{1.25} - \begin{tabular}{@{}p{\hintscolumnwidth} + \begin{tabular}{@{}p{\skillmatrixhintscolumnwidth} @{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}}p{\skillmatrixcommentwidth}@{}}% & \centering{\cvSkillMatrixHeadFont #3} & \centering{\cvSkillMatrixHeadFont #4} & \centering{\cvSkillMatrixHeadFont #5} & {\cvSkillMatrixHeadFont #6} \end{tabular}% @@ -103,7 +105,8 @@ {% If a star is seen a dotted line is drawn above the entry \begingroup \renewcommand{\arraystretch}{1.25} - \begin{tabular}{@{}p{\hintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}} p{\skillmatrixcommentwidth}@{}}% + \arrayrulecolor{color1} + \begin{tabular}{@{}p{\skillmatrixhintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}} p{\skillmatrixcommentwidth}@{}}% \cdashline{2-5}[.6pt/1pt] \raggedleft\hintstyle{#3} &\centering \cvSkill{#4} &\centering {#5} & \centering {#6} &{\itshape#7}% \end{tabular}% @@ -111,7 +114,7 @@ \par\addvspace{#2}} % {% If no star is seen no line is drawn - \begin{tabular}{@{}p{\hintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}} p{\skillmatrixcommentwidth}@{}}% + \begin{tabular}{@{}p{\skillmatrixhintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}} p{\skillmatrixcommentwidth}@{}}% \raggedleft\hintstyle{#3} &\centering \cvSkill{#4} &\centering {#5} & \centering {#6} &{\itshape#7}% \end{tabular}% \par\addvspace{#2}} diff --git a/moderncvbodyiv.sty b/moderncvbodyiv.sty index 20af5e4..210d527 100644 --- a/moderncvbodyiv.sty +++ b/moderncvbodyiv.sty @@ -48,6 +48,9 @@ % used by \cvlistdoubleitem \@initializelength{\listdoubleitemcolumnwidth} +%% include moderncv Skillmatrix code +\input{moderncvbodyivskillmatrix.sty} + % commands \renewcommand*{\recomputecvbodylengths}{% % body lengths @@ -57,6 +60,7 @@ \setlength{\doubleitemcolumnwidth}{0.5\doubleitemcolumnwidth}% \setlength{\listdoubleitemcolumnwidth}{\maincolumnwidth-\listitemsymbolwidth-\separatorcolumnwidth-\listitemsymbolwidth}% \setlength{\listdoubleitemcolumnwidth}{0.5\listdoubleitemcolumnwidth}% + \recomputecvskillmatrixlengths % regular lengths \setlength{\parskip}{0\p@}} diff --git a/moderncvbodyivskillmatrix.sty b/moderncvbodyivskillmatrix.sty new file mode 100644 index 0000000..6358a53 --- /dev/null +++ b/moderncvbodyivskillmatrix.sty @@ -0,0 +1,124 @@ +% some packages required for this code +\RequirePackage{tikz} +% needed for the dashed lines +\RequirePackage{arydshln} + +%%% The code for the Skilllevel illustration with the little boxes. +% This is idea stolen from the limecv package +\@initializelength{\cvSkillRectangleSize} +\setlength{\cvSkillRectangleSize}{1.2ex} +\newcount\my@repeat@count +\NewDocumentCommand{\cvSkill}{m}{% + \begingroup + \my@repeat@count=\z@ + \@whilenum\my@repeat@count<#1\do{\tikz\filldraw[color1] (0, 0) rectangle (\cvSkillRectangleSize, \cvSkillRectangleSize);\advance% + \my@repeat@count\@ne\,}% + \my@repeat@count=\numexpr5-\z@\relax + \@whilenum\my@repeat@count>#1\do{\tikz\filldraw[color2!30] (0, 0) rectangle (\cvSkillRectangleSize, \cvSkillRectangleSize);\advance% + \my@repeat@count\m@ne\,}% + \endgroup +} + +\@initializelength{\cvskillwidth} +\@initializelength{\cvskilldescriptorwidth} +\@initializelength{\cvskilllegenddescriptorwidth} +\@initializelength{\cvskillexperiencewidth} +\@initializelength{\skillmatrixcolumnwidth} +\@initializelength{\skillmatrixcommentwidth} +\@initializelength{\skillmatrixcommentpadding} +\@initializelength{\skillmatrixhintscolumnwidth} +\@initializelength{\skilllegendhintscolumnwidth} +\NewDocumentCommand{\recomputecvskillmatrixlengths}{}{% + \setlength{\skillmatrixcommentpadding}{1ex} + \setlength{\separatorcolumnwidth}{\skillmatrixcommentpadding} + \setlength{\skillmatrixhintscolumnwidth}{\widthof{``Languages''}} + \setlength{\skilllegendhintscolumnwidth}{\skillmatrixhintscolumnwidth} +% \setlength{\skillmatrixhintscolumnwidth}{0.14\textwidth} %0.175\textwidth + \setlength{\cvskillwidth}{\widthof{\cvSkill{5}}} + \setlength{\cvskillexperiencewidth}{\widthof{``Jahre''}} + \@initializelength{\matrixbodylength} + \setlength{\matrixbodylength}{\maincolumnwidth-\skillmatrixhintscolumnwidth-\separatorcolumnwidth} + \setlength{\skillmatrixcolumnwidth}{0.45\matrixbodylength}% + \setlength{\cvskilldescriptorwidth}{\skillmatrixcolumnwidth-\cvskillwidth-\cvskillexperiencewidth} + \setlength{\skillmatrixcommentwidth}{\matrixbodylength-\skillmatrixcolumnwidth-\skillmatrixcommentpadding}% + \setlength{\cvskilllegenddescriptorwidth}{0.5\matrixbodylength-\cvskillwidth-\skillmatrixcommentpadding} + % regular lengths + \setlength{\parskip}{0\p@}} + +\RequirePackage{multirow} +\NewDocumentCommand\legendFontSize{}{\scriptsize} +\NewDocumentCommand\cvSkillMatrixLegend{s +O{.25em} +O{basic knowledge} +O{intermediate knowledge with experience in projects} +O{extensive experience in projects} +O{deep expert knowledge} +O{expert/guru} +m}{% + \IfBooleanTF#1% + {% if a star is given, add dashed line + \begingroup + \arrayrulecolor{color1} + \begin{tabular}{@{}p{\skilllegendhintscolumnwidth} + @{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{};{.6pt/1pt}p{\cvskilllegenddescriptorwidth} @{\hspace{2\skillmatrixcommentpadding}}p{\cvskillwidth}@{};{.6pt/1pt}p{\cvskilllegenddescriptorwidth}@{}}% + \raggedleft\hintstyle{#8} & \cvSkill{1}\, & \,{\legendFontSize #3} & \cvSkill{3}\, &\,{\legendFontSize #5 } \\ + % + & \cvSkill{2}\, & \,\multirow{2}{\cvskilllegenddescriptorwidth}{{\legendFontSize #4}} & \cvSkill{4}\, &\,{\legendFontSize #6 } \\ + % + & & & \cvSkill{5}\, &\,{\legendFontSize #7 } + \end{tabular}% + \endgroup + \par\addvspace{#2} + } + {% if no star is given, do not add dashed line + \begin{tabular}{@{}p{\skilllegendhintscolumnwidth} + @{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}p{\cvskilllegenddescriptorwidth} @{\hspace{2\skillmatrixcommentpadding}}p{\cvskillwidth}@{}p{\cvskilllegenddescriptorwidth}@{}}% + \raggedleft\hintstyle{#8} & \cvSkill{1}\, & \,{\legendFontSize #3} & \cvSkill{3}\, &\,{\legendFontSize #5 } \\ + % + & \cvSkill{2}\, & \,\multirow{2}{\cvskilllegenddescriptorwidth}{{\legendFontSize #4}} & \cvSkill{4}\, &\,{\legendFontSize #6 } \\ + % + & & & \cvSkill{5}\, &\,{\legendFontSize #7 } + \end{tabular}% + \par\addvspace{#2} + } + } +\NewDocumentCommand\cvSkillMatrixHeadFont{}{\normalfont} +\NewDocumentCommand\cvSkillMatrixHead{s O{.25em} +O{Level} +O{Skill} +O{Years} +O{Comment}}{% + \IfBooleanTF#1% + {% if a star is given, add dashed line + \begingroup + \renewcommand{\arraystretch}{1.25} + \arrayrulecolor{color1} + \begin{tabular}{@{}p{\skillmatrixhintscolumnwidth} + @{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}}p{\skillmatrixcommentwidth}@{}}% + & \centering{\cvSkillMatrixHeadFont #3} & \centering{\cvSkillMatrixHeadFont #4} & \centering{\cvSkillMatrixHeadFont #5} & {\cvSkillMatrixHeadFont #6} \\\cdashline{2-5}[.6pt/1pt] + \end{tabular}% + \endgroup + \par\addvspace{#2} + } + {%if star is not given, do not add dashed line + \begingroup + \renewcommand{\arraystretch}{1.25} + \begin{tabular}{@{}p{\skillmatrixhintscolumnwidth} + @{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}}p{\skillmatrixcommentwidth}@{}}% + & \centering{\cvSkillMatrixHeadFont #3} & \centering{\cvSkillMatrixHeadFont #4} & \centering{\cvSkillMatrixHeadFont #5} & {\cvSkillMatrixHeadFont #6} + \end{tabular}% + \endgroup + \par\addvspace{#2} + } + } + + +\NewDocumentCommand\cvSkillMatrixEntry{s O{.25em} +m +m +m +m +m}{% + %test for the star * in the command + \IfBooleanTF#1% + {% If a star is seen a dotted line is drawn above the entry + \begingroup + \renewcommand{\arraystretch}{1.25} + \arrayrulecolor{color1} + \begin{tabular}{@{}p{\skillmatrixhintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}} p{\skillmatrixcommentwidth}@{}}% + \cdashline{2-5}[.6pt/1pt] + \raggedleft\hintstyle{#3} &\centering \cvSkill{#4} &\centering {#5} & \centering {#6} &{\itshape#7}% + \end{tabular}% + \endgroup + \par\addvspace{#2}} +% + {% If no star is seen no line is drawn + \begin{tabular}{@{}p{\skillmatrixhintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}} p{\skillmatrixcommentwidth}@{}}% + \raggedleft\hintstyle{#3} &\centering \cvSkill{#4} &\centering {#5} & \centering {#6} &{\itshape#7}% + \end{tabular}% + \par\addvspace{#2}} +} diff --git a/moderncvbodyvskillmatrix.sty b/moderncvbodyvskillmatrix.sty new file mode 100644 index 0000000..08d68e3 --- /dev/null +++ b/moderncvbodyvskillmatrix.sty @@ -0,0 +1,119 @@ +% some packages required for this code +\RequirePackage{tikz} +% needed for the dashed lines +\RequirePackage{arydshln} + +%%% The code for the Skilllevel illustration with the little boxes. +% This is idea stolen from the limecv package +\@initializelength{\cvSkillRectangleSize} +\setlength{\cvSkillRectangleSize}{1.2ex} +\newcount\my@repeat@count +\NewDocumentCommand{\cvSkill}{m}{% + \begingroup + \my@repeat@count=\z@ + \@whilenum\my@repeat@count<#1\do{\tikz\filldraw[color1] (0, 0) rectangle (\cvSkillRectangleSize, \cvSkillRectangleSize);\advance% + \my@repeat@count\@ne\,}% + \my@repeat@count=\numexpr5-\z@\relax + \@whilenum\my@repeat@count>#1\do{\tikz\filldraw[color2!30] (0, 0) rectangle (\cvSkillRectangleSize, \cvSkillRectangleSize);\advance% + \my@repeat@count\m@ne\,}% + \endgroup +} + +\@initializelength{\cvskillwidth} +\@initializelength{\cvskilldescriptorwidth} +\@initializelength{\cvskilllegenddescriptorwidth} +\@initializelength{\cvskillexperiencewidth} +\@initializelength{\skillmatrixcolumnwidth} +\@initializelength{\skillmatrixcommentwidth} +\@initializelength{\skillmatrixcommentpadding} +\@initializelength{\skillmatrixhintscolumnwidth} +\@initializelength{\skilllegendhintscolumnwidth} +\NewDocumentCommand{\recomputecvskillmatrixlengths}{}{% + \setlength{\skillmatrixcommentpadding}{1ex} + \setlength{\separatorcolumnwidth}{\skillmatrixcommentpadding} + \setlength{\skillmatrixhintscolumnwidth}{\widthof{``Languages''}} + \setlength{\skilllegendhintscolumnwidth}{\skillmatrixhintscolumnwidth} %0.175\textwidth +% \setlength{\skillmatrixhintscolumnwidth}{0.14\textwidth} %0.175\textwidth + \setlength{\cvskillwidth}{\widthof{\cvSkill{5}}} + \setlength{\cvskillexperiencewidth}{\widthof{``Jahre''}} + \@initializelength{\matrixbodylength} + \setlength{\matrixbodylength}{\maincolumnwidth-\skillmatrixhintscolumnwidth-\separatorcolumnwidth} + \setlength{\skillmatrixcolumnwidth}{0.45\matrixbodylength}% + \setlength{\cvskilldescriptorwidth}{\skillmatrixcolumnwidth-\cvskillwidth-\cvskillexperiencewidth} + \setlength{\skillmatrixcommentwidth}{\matrixbodylength-\skillmatrixcolumnwidth-\skillmatrixcommentpadding}% + \setlength{\cvskilllegenddescriptorwidth}{0.5\matrixbodylength-\cvskillwidth-\skillmatrixcommentpadding} + % regular lengths + \setlength{\parskip}{0\p@}} + +\RequirePackage{multirow} +\NewDocumentCommand\legendFontSize{}{\scriptsize} +\NewDocumentCommand\cvSkillMatrixLegend{s +O{.25em} +O{basic knowledge} +O{intermediate knowledge with experience in projects} +O{extensive experience in projects} +O{deep expert knowledge} +O{expert/guru} +m}{% + \IfBooleanTF#1% + {% if a star is given, add dashed line + \begin{tabular}{@{}p{\skilllegendhintscolumnwidth} + @{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{};{.6pt/1pt}p{\cvskilllegenddescriptorwidth} @{\hspace{2\skillmatrixcommentpadding}}p{\cvskillwidth}@{};{.6pt/1pt}p{\cvskilllegenddescriptorwidth}@{}}% + \raggedleft\hintstyle{#8} & \cvSkill{1}\, & \,{\legendFontSize #3} & \cvSkill{3}\, &\,{\legendFontSize #5 } \\ + % + & \cvSkill{2}\, & \,\multirow{2}{\cvskilllegenddescriptorwidth}{{\legendFontSize #4}} & \cvSkill{4}\, &\,{\legendFontSize #6 } \\ + % + & & & \cvSkill{5}\, &\,{\legendFontSize #7 } + \end{tabular}% + \par\addvspace{#2} + } + {% if no star is given, do not add dashed line + \begin{tabular}{@{}p{\skilllegendhintscolumnwidth} + @{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}p{\cvskilllegenddescriptorwidth} @{\hspace{2\skillmatrixcommentpadding}}p{\cvskillwidth}@{}p{\cvskilllegenddescriptorwidth}@{}}% + \raggedleft\hintstyle{#8} & \cvSkill{1}\, & \,{\legendFontSize #3} & \cvSkill{3}\, &\,{\legendFontSize #5 } \\ + % + & \cvSkill{2}\, & \,\multirow{2}{\cvskilllegenddescriptorwidth}{{\legendFontSize #4}} & \cvSkill{4}\, &\,{\legendFontSize #6 } \\ + % + & & & \cvSkill{5}\, &\,{\legendFontSize #7 } + \end{tabular}% + \par\addvspace{#2} + } + } +\NewDocumentCommand\cvSkillMatrixHeadFont{}{\normalfont} +\NewDocumentCommand\cvSkillMatrixHead{s O{.25em} +O{Level} +O{Skill} +O{Years} +O{Comment}}{% + \IfBooleanTF#1% + {% if a star is given, add dashed line + \begingroup + \renewcommand{\arraystretch}{1.25} + \begin{tabular}{@{}p{\skillmatrixhintscolumnwidth} + @{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}}p{\skillmatrixcommentwidth}@{}}% + & \centering{\cvSkillMatrixHeadFont #3} & \centering{\cvSkillMatrixHeadFont #4} & \centering{\cvSkillMatrixHeadFont #5} & {\cvSkillMatrixHeadFont #6} \\\cdashline{2-5}[.6pt/1pt] + \end{tabular}% + \endgroup + \par\addvspace{#2} + } + {%if star is not given, do not add dashed line + \begingroup + \renewcommand{\arraystretch}{1.25} + \begin{tabular}{@{}p{\skillmatrixhintscolumnwidth} + @{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}}p{\skillmatrixcommentwidth}@{}}% + & \centering{\cvSkillMatrixHeadFont #3} & \centering{\cvSkillMatrixHeadFont #4} & \centering{\cvSkillMatrixHeadFont #5} & {\cvSkillMatrixHeadFont #6} + \end{tabular}% + \endgroup + \par\addvspace{#2} + } + } + + +\NewDocumentCommand\cvSkillMatrixEntry{s O{.25em} +m +m +m +m +m}{% + %test for the star * in the command + \IfBooleanTF#1% + {% If a star is seen a dotted line is drawn above the entry + \begingroup + \renewcommand{\arraystretch}{1.25} + \begin{tabular}{@{}p{\skillmatrixhintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}} p{\skillmatrixcommentwidth}@{}}% + \cdashline{2-5}[.6pt/1pt] + \raggedleft\hintstyle{#3} &\centering \cvSkill{#4} &\centering {#5} & \centering {#6} &{\itshape#7}% + \end{tabular}% + \endgroup + \par\addvspace{#2}} +% + {% If no star is seen no line is drawn + \begin{tabular}{@{}p{\skillmatrixhintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\cvskillwidth}@{}@{}p{\cvskilldescriptorwidth}@{} p{\cvskillexperiencewidth} @{\hspace{\skillmatrixcommentpadding}} p{\skillmatrixcommentwidth}@{}}% + \raggedleft\hintstyle{#3} &\centering \cvSkill{#4} &\centering {#5} & \centering {#6} &{\itshape#7}% + \end{tabular}% + \par\addvspace{#2}} +}