From 19b2d7d90094fbc85b6282f6be53e4bb10f6ab70 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sat, 12 Jul 2014 22:22:08 +0000
Subject: cv4tw (12jul14)

git-svn-id: svn://tug.org/texlive/trunk@34577 c570f23f-e606-0410-a88d-b1316a301751
---
 .../tex/latex/cv4tw/cv4tw-theme-core.sty           | 86 +++++++++++++++++++++-
 1 file changed, 83 insertions(+), 3 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/cv4tw/cv4tw-theme-core.sty')

diff --git a/Master/texmf-dist/tex/latex/cv4tw/cv4tw-theme-core.sty b/Master/texmf-dist/tex/latex/cv4tw/cv4tw-theme-core.sty
index 27ba36c8163..24011b03451 100644
--- a/Master/texmf-dist/tex/latex/cv4tw/cv4tw-theme-core.sty
+++ b/Master/texmf-dist/tex/latex/cv4tw/cv4tw-theme-core.sty
@@ -9,13 +9,49 @@
 \RequirePackage{fontawesome}
 \RequirePackage{realboxes}
 \RequirePackage{array}
+\RequirePackage{forloop}
+
+\setcvcontactszone[main]{%
+\rendercontactifdefined{custom0}%
+\rendercontactifdefined{custom1}%
+\rendercontactifdefined{custom2}%
+\rendercontactifdefined{email}%
+\rendercontactifdefined{homepage}%
+\rendercontactifdefined{homepagessl}%
+\rendercontactifdefined{customhomepage}%
+\rendercontactifdefined{cellphone}%
+\rendercontactifdefined{phone}%
+\rendercontactifdefined{fax}%
+}%
+
+\setcvcontactszone[social]{%
+\rendercontactifdefined{custom3}%
+\rendercontactifdefined{custom4}%
+\rendercontactifdefined{custom5}%
+\rendercontactifdefined{github}%
+\rendercontactifdefined{linkedin}%
+\rendercontactifdefined{twitter}%
+\rendercontactifdefined{googleplus}%
+\rendercontactifdefined{facebook}%
+\rendercontactifdefined{vk}%
+\rendercontactifdefined{pinterest}%
+}%
+\setcvcontactszone[extra]{%
+\rendercontactifdefined{custom6}%
+\rendercontactifdefined{custom7}%
+\rendercontactifdefined{custom8}%
+\rendercontactifdefined{custom9}%
+\rendercontactifdefined{age}%
+\rendercontactifdefined{spokenlanguages}%
+\rendercontactifdefined{address}%
+}%
 
 \AtBeginDocument{\maketitle}
 
 % Set \emph command with "em" color
 \DeclareTextFontCommand{\emph}{\color{main}}
 
-% Default header
+% Default header & footer
 \fancypagestyle{cvsimple}{
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}
@@ -30,9 +66,17 @@
 %Useful lengths
 \newlength{\cvleftwidth}\setlength{\cvleftwidth}{4.5cm}
 \newlength{\cvrightwidth}\setlength{\cvrightwidth}{14cm}
+\newlength{\cvfielditemparskip}\setlength{\cvfielditemparskip}{0.5em}
 \newlength{\cvskillitemparskip}\setlength{\cvskillitemparskip}{-0.8em}
 \newlength{\cvmissionsitemsep}\setlength{\cvmissionsitemsep}{0em}
+\newlength{\cvfieldsep}\setlength{\cvfieldsep}{0em}
+\newlength{\sectionrule}\setlength{\sectionrule}{\textwidth}
+\setlength{\parindent}{0cm}
 
+\newcounter{currentrate}
+\newcounter{fieldsbyrow}
+\newcounter{maxrate}
+\newcounter{fieldscurrentcolumn}
 % Set \emph command with "em" color
 \DeclareTextFontCommand{\emph}{\color{main}}
 
@@ -41,7 +85,7 @@
 \needspace{4\baselineskip}
 \begin{center}
   {\mystyle[sectiontitle] #1}\\[-0.8em]
-  {\color{sectionrule}\rule{\textwidth}{0.05pt}}
+  {\color{sectionrule}\rule{\sectionrule}{0.05pt}}
 \end{center}
 }
 
@@ -67,10 +111,46 @@
 			{\mystyle[cvstorydescription] #5}
 		\fi
 	\end{minipage}
-	\\
 	\end{flushleft}
 }
 
+% Rate fields related to a profile
+\renewenvironment*{fields}[3]{
+	\setcounter{fieldsbyrow}{#2}
+	\addtocounter{fieldsbyrow}{-1}
+	\setcounter{maxrate}{#3}
+	\addtocounter{maxrate}{-1}
+	\setcounter{fieldscurrentcolumn}{0}
+	\newcommand{\formatfieldcell}[2]{
+	\makeatletter
+		\ifnum\value{fieldscurrentcolumn}=\value{fieldsbyrow}
+			\setcounter{fieldscurrentcolumn}{0}
+			\expandafter\@firstoftwo
+		\else
+			\stepcounter{fieldscurrentcolumn}
+			\expandafter\@secondoftwo
+		\fi
+		{{\mystyle[field] ##1} & ##2 \\[\cvfielditemparskip] }
+		{{\mystyle[field] ##1} & ##2 & }
+			
+	\makeatother
+	}
+
+	\newcommand*{\field}[2]{
+		\formatfieldcell{##1}{
+			\forloop{currentrate}{0}{\value{currentrate} < #3}{
+			\ifnum##2>\value{currentrate}\mystyle[fieldratefull]\else\mystyle[fieldrateempty]\fi
+			}
+		}
+	}
+	\begin{minipage}[t]{\textwidth}
+	{\hspace*{\cvleftwidth}\mystyle[subsectiontitle] #1}\\[1.5em]
+	\begin{tabular}[t]{*{#2}{rl}}
+}{
+	\end{tabular}\\[2em]
+	\end{minipage}
+}
+
 % Describe missions related to a job
 \renewenvironment*{missions}{
 	\begin{list}{\mystyle[missionbullet]}{ \setlength{\itemsep}{\cvmissionsitemsep} \setlength{\leftmargin}{2em}\mystyle[mission] }
-- 
cgit v1.2.3

