cv/twentysecondcv.cls

272 lines
8.3 KiB
OpenEdge ABL
Raw Normal View History

2019-12-31 20:35:37 +01:00
\ProvidesClass{twentysecondcv}[2017/01/08 CV class]
\LoadClass{article}
\NeedsTeXFormat{LaTeX2e}
%-------------------------------------------------------------------------------
% REQUIRED PACKAGES
%-------------------------------------------------------------------------------
\RequirePackage[sfdefault]{ClearSans}
\RequirePackage[T1]{fontenc}
\RequirePackage{tikz}
\RequirePackage{xcolor}
\RequirePackage[absolute,overlay]{textpos}
\RequirePackage{ragged2e}
\RequirePackage{etoolbox}
\RequirePackage{ifmtarg}
\RequirePackage{ifthen}
\RequirePackage{pgffor}
\RequirePackage{marvosym}
\RequirePackage{parskip}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
%-------------------------------------------------------------------------------
% COLOURS
%-------------------------------------------------------------------------------
\definecolor{white}{RGB}{255,255,255}
\definecolor{gray}{HTML}{4D4D4D}
\definecolor{sidecolor}{HTML}{E7E7E7}
\definecolor{mainblue}{HTML}{0E5484}
\definecolor{maingray}{HTML}{B9B9B9}
%-------------------------------------------------------------------------------
% MISC CONFIGURATIONS
%-------------------------------------------------------------------------------
\renewcommand{\bfseries}{\color{gray}} % Make \textbf produce coloured text instead
\pagestyle{empty} % Disable headers and footers
\setlength{\parindent}{0pt} % Disable paragraph indentation
%-------------------------------------------------------------------------------
% SIDEBAR DEFINITIONS
%-------------------------------------------------------------------------------
\setlength{\TPHorizModule}{1cm} % Left margin
\setlength{\TPVertModule}{1cm} % Top margin
\newlength\imagewidth
\newlength\imagescale
\pgfmathsetlength{\imagewidth}{5cm}
\pgfmathsetlength{\imagescale}{\imagewidth/600}
% Define a new length to hold the remaining line width after the section title is printed
\newlength{\TotalSectionLength}
% Define a new length to hold the width of the section title
\newlength{\SectionTitleLength}
\newcommand{\profilesection}[1]{
2019-12-31 21:06:56 +01:00
% Set the total line width
\setlength\TotalSectionLength{\linewidth}
% Calculate the width of the section title
\settowidth{\SectionTitleLength}{\huge #1 }
% Subtract the section title width from the total width
\addtolength\TotalSectionLength{-\SectionTitleLength}
% Modifier to remove overfull box warning
\addtolength\TotalSectionLength{-2.22221pt}
% Whitespace before the section title
\vspace{8pt}
% Print the title and auto-width rule
{\color{black!80} \huge #1 \rule[0.15\baselineskip]{\TotalSectionLength}{1pt}}
2019-12-31 20:35:37 +01:00
}
% Define custom commands for CV info
\newcommand{\cvdate}[1]{\renewcommand{\cvdate}{#1}}
\newcommand{\cvmail}[1]{\renewcommand{\cvmail}{#1}}
\newcommand{\cvnumberphone}[1]{\renewcommand{\cvnumberphone}{#1}}
\newcommand{\cvaddress}[1]{\renewcommand{\cvaddress}{#1}}
\newcommand{\cvsite}[1]{\renewcommand{\cvsite}{#1}}
\newcommand{\aboutme}[1]{\renewcommand{\aboutme}{#1}}
\newcommand{\profilepic}[1]{\renewcommand{\profilepic}{#1}}
\newcommand{\cvname}[1]{\renewcommand{\cvname}{#1}}
\newcommand{\cvjobtitle}[1]{\renewcommand{\cvjobtitle}{#1}}
% Command for printing the contact information icons
\newcommand*\icon[1]{\tikz[baseline=(char.base)]{\node[shape=circle,draw,inner sep=1pt, fill=mainblue,mainblue,text=white] (char) {#1};}}
% Command for printing skill progress bars
\newcommand\skills[1]{
2019-12-31 21:06:56 +01:00
\renewcommand{\skills}{
\begin{tikzpicture}
\foreach [count=\i] \x/\y in {#1}{
\draw[fill=maingray,maingray] (0,\i) rectangle (6,\i+0.4);
\draw[fill=white,mainblue](0,\i) rectangle (\y,\i+0.4);
\node [above right] at (0,\i+0.4) {\x};
}
\end{tikzpicture}
}
2019-12-31 20:35:37 +01:00
}
% Command for printing skills text
\newcommand\skillstext[1]{
2019-12-31 21:06:56 +01:00
\renewcommand{\skillstext}{
\begin{flushleft}
\foreach [count=\i] \x/\y in {#1}{
\x$ \star $\y
}
\end{flushleft}
}
2019-12-31 20:35:37 +01:00
}
%-------------------------------------------------------------------------------
% SIDEBAR LAYOUT
%-------------------------------------------------------------------------------
\newcommand{\makeprofile}{
2019-12-31 21:06:56 +01:00
\begin{tikzpicture}[remember picture,overlay]
\node [rectangle, fill=sidecolor, anchor=north, minimum width=9cm, minimum height=\paperheight+1cm] (box) at (-5cm,0.5cm){};
\end{tikzpicture}
2019-12-31 20:35:37 +01:00
2019-12-31 21:06:56 +01:00
%------------------------------------------------
2019-12-31 20:35:37 +01:00
2019-12-31 21:06:56 +01:00
\begin{textblock}{6}(0.5, 0.2)
2019-12-31 20:35:37 +01:00
2019-12-31 21:06:56 +01:00
%------------------------------------------------
2019-12-31 20:35:37 +01:00
2019-12-31 21:06:56 +01:00
\ifthenelse{\equal{\profilepic}{}}{}{
\begin{center}
\begin{tikzpicture}[x=\imagescale,y=-\imagescale]
\clip (600/2, 567/2) circle (567/2);
\node[anchor=north west, inner sep=0pt, outer sep=0pt] at (0,0) {\includegraphics[width=\imagewidth]{\profilepic}};
\end{tikzpicture}
\end{center}
}
2019-12-31 20:35:37 +01:00
%------------------------------------------------
{\Huge\color{mainblue}\cvname}
%------------------------------------------------
{\Large\color{black!80}\cvjobtitle}
%------------------------------------------------
\renewcommand{\arraystretch}{1.6}
\begin{tabular}{p{0.5cm} @{\hskip 0.5cm}p{5cm}}
2019-12-31 21:06:56 +01:00
\ifthenelse{\equal{\cvdate}{}}{}{\textsc{\Large\icon{\Info}} & \cvdate\\}
\ifthenelse{\equal{\cvaddress}{}}{}{\textsc{\Large\icon{\Letter}} & \cvaddress\\}
\ifthenelse{\equal{\cvnumberphone}{}}{}{\textsc{\Large\icon{\Telefon}} & \cvnumberphone\\}
\ifthenelse{\equal{\cvsite}{}}{}{\textsc{\Large\icon{\Mundus}} & \href{\cvsite}{\cvsite}\\}
\ifthenelse{\equal{\cvmail}{}}{}{\textsc{\large\icon{@}} & \href{mailto:\cvmail}{\cvmail}}
2019-12-31 20:35:37 +01:00
\end{tabular}
%------------------------------------------------
2019-12-31 21:06:56 +01:00
\ifthenelse{\equal{\aboutme}{}}{}{
\profilesection{About me}
\begin{flushleft}
\aboutme
\end{flushleft}
}
2019-12-31 20:35:37 +01:00
%------------------------------------------------
2019-12-31 21:06:56 +01:00
\profilesection{Skills}
2019-12-31 20:35:37 +01:00
\skills
2019-12-31 21:06:56 +01:00
\skillstext
\scriptsize
(*)[The skill scale is from 0 (Fundamental Awareness) to 6 (Expert).]
2019-12-31 20:35:37 +01:00
2019-12-31 21:06:56 +01:00
%------------------------------------------------
2019-12-31 20:35:37 +01:00
2019-12-31 21:06:56 +01:00
\end{textblock}
2019-12-31 20:35:37 +01:00
}
%-------------------------------------------------------------------------------
% COLOURED SECTION TITLE BOX
%-------------------------------------------------------------------------------
% Command to create the rounded boxes around the first three letters of section titles
\newcommand*\round[2]{%
2019-12-31 21:06:56 +01:00
\tikz[baseline=(char.base)]\node[anchor=north west, draw,rectangle, rounded corners, inner sep=1.6pt, minimum size=5.5mm, text height=3.6mm, fill=#2,#2,text=white](char){#1};%
2019-12-31 20:35:37 +01:00
}
\newcounter{colorCounter}
\newcommand{\sectioncolor}[1]{%
2019-12-31 21:06:56 +01:00
{%
\round{#1}{
\ifcase\value{colorCounter}%
maingray\or%
mainblue\or%
maingray\or%
mainblue\or%
maingray\or%
mainblue\or%
maingray\or%
mainblue\or%
maingray\or%
mainblue\else%
maingray\fi%
2019-12-31 20:35:37 +01:00
}%
2019-12-31 21:06:56 +01:00
}%
\stepcounter{colorCounter}%
2019-12-31 20:35:37 +01:00
}
\renewcommand{\section}[1]{
2019-12-31 21:06:56 +01:00
{%
\color{gray}%
\Large\sectioncolor{#1}%
}
2019-12-31 20:35:37 +01:00
}
\renewcommand{\subsection}[1]{
2019-12-31 21:06:56 +01:00
\par\vspace{.5\parskip}{%
\large\color{gray} #1%
}
\par\vspace{.25\parskip}%
2019-12-31 20:35:37 +01:00
}
%-------------------------------------------------------------------------------
% LONG LIST ENVIRONMENT
%-------------------------------------------------------------------------------
\setlength{\tabcolsep}{0pt}
% New environment for the long list
\newenvironment{twenty}{%
2019-12-31 21:06:56 +01:00
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ll}
}{%
\end{tabular*}
2019-12-31 20:35:37 +01:00
}
\newcommand{\twentyitem}[4]{%
2019-12-31 21:06:56 +01:00
#1&\parbox[t]{0.83\textwidth}{%
2019-12-31 20:35:37 +01:00
\textbf{#2}%
2019-12-31 21:06:56 +01:00
\hfill%
{\footnotesize#3}\\%
#4\vspace{\parsep}%
}\\
}
2019-12-31 20:35:37 +01:00
2019-12-31 21:06:56 +01:00
%-------------------------------------------------------------------------------
2019-12-31 20:35:37 +01:00
% SMALL LIST ENVIRONMENT
%-------------------------------------------------------------------------------
\setlength{\tabcolsep}{0pt}
% New environment for the small list
\newenvironment{twentyshort}{%
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ll}
2019-12-31 21:06:56 +01:00
}{%
2019-12-31 20:35:37 +01:00
\end{tabular*}
2019-12-31 21:06:56 +01:00
}
2019-12-31 20:35:37 +01:00
\newcommand{\twentyitemshort}[2]{%
2019-12-31 21:06:56 +01:00
#1&\parbox[t]{0.83\textwidth}{%
2019-12-31 20:35:37 +01:00
\textbf{#2}%
2019-12-31 21:06:56 +01:00
}\\
}
2019-12-31 20:35:37 +01:00
%-------------------------------------------------------------------------------
% MARGINS AND LINKS
%-------------------------------------------------------------------------------
\RequirePackage[left=7.6cm,top=0.1cm,right=1cm,bottom=0.2cm,nohead,nofoot]{geometry}
\RequirePackage{hyperref}