CV/lxsameer_cv.cls

260 lines
7.1 KiB
OpenEdge ABL
Raw Normal View History

2022-03-25 14:45:33 +00:00
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
% Lxsameer's CV Latex class
% Copyright (C) 2022 Sameer Rahmani <lxsameer@gnu.org>
%
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
% as published by the Free Software Foundation; either version 2
% of the License, or (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\author{Sameer Rahmani}
% moved here I guess article class causes option clash with xcolor if used after loading the class
\RequirePackage[dvipsnames]{xcolor}
\LoadClass[11pt]{article}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{lxsameer_cv}[2022/03/22 lxsameer's CV Class]
2022-03-27 17:35:51 +01:00
\RequirePackage[default,light,semibold]{sourcesanspro}
2022-03-26 18:18:26 +00:00
\setsansfont{Source Sans Pro}
2022-03-25 14:45:33 +00:00
\RequirePackage{multicol}
\RequirePackage{etoolbox}
\RequirePackage{pgffor}
\RequirePackage{titlesec}
\RequirePackage{tikz}
\RequirePackage{fontspec}
2022-03-27 20:23:27 +01:00
\RequirePackage[left=0.6in,top=0.3in,right=0.6in,bottom=0.6in]{geometry} % Document margins
2022-03-25 14:45:33 +00:00
\RequirePackage{hyperref}
2022-03-26 18:18:26 +00:00
\RequirePackage{fontawesome5}
2022-03-25 14:45:33 +00:00
\RequirePackage{mfirstuc}
\RequirePackage{ifthen}
\RequirePackage{array}
2022-03-26 18:38:00 +00:00
\RequirePackage{xcolor}
2022-03-26 18:18:26 +00:00
\RequirePackage{scrextend}
\edef\restoreparindent{\parindent=\the\parindent\relax}
\RequirePackage{parskip}
\restoreparindent{}
2022-03-25 14:45:33 +00:00
\pagestyle{empty}
2022-03-26 18:38:00 +00:00
\makeatletter
\newcommand{\globalcolor}[1]{%
\color{#1}\global\let\default@color\current@color{}
}
2022-03-26 18:18:26 +00:00
%Setup
2022-03-27 20:23:27 +01:00
\parskip=0.12cm
\changefontsizes{12pt}
2022-03-25 14:45:33 +00:00
\newcommand*{\setname}[2]{\def\@firstname{#1}\def\@lastname{#2}}
2022-03-27 13:36:18 +01:00
\newcommand*{\setjobtitle}[1]{\def\@jobtitle{#1}}
2022-03-25 14:45:33 +00:00
\newcommand*{\setaddress}[1]{\def\@address{#1}}
\newcommand*{\setmobile}[1]{\def\@mobile{#1}}
\newcommand*{\setposition}[1]{\def\@position{#1}}
\newcommand*{\setmail}[1]{\def\@mail{#1}}
2022-03-27 13:36:18 +01:00
\newcommand*{\setfirstcolor}[1]{\def\@firstcolor{#1}}
\newcommand*{\setsecondcolor}[1]{\def\secondcolor{#1}}
\newcommand*{\setthirdcolor}[1]{\def\@thirdcolor{#1}}
\newcommand*{\setfourthcolor}[1]{\def\@fourthcolor{#1}}
2022-03-25 14:45:33 +00:00
\newcommand*{\setlinkedinaccount}[1]{\def\@linkedinaccount{#1}}
\newcommand*{\setgit}[1]{\def\@git{#1}}
\newcommand*{\setwebsite}[1]{\def\@website{#1}}
2022-03-25 14:45:33 +00:00
\newcommand*{\setgithubaccount}[1]{\def\@githubaccount{#1}}
2022-03-27 13:36:18 +01:00
% Color pallet
2022-03-27 18:29:36 +01:00
\definecolor{color1}{HTML}{d80032}
2022-03-27 17:35:51 +01:00
\definecolor{color2}{HTML}{d80032}
\definecolor{color3}{HTML}{ef233c}
\definecolor{color4}{HTML}{8d99ae}
\definecolor{color5}{HTML}{edf2f4}
\definecolor{color6}{HTML}{aaaaa5}
2022-03-27 13:36:18 +01:00
% Color aliases
\colorlet{headercolor}{color2}
\colorlet{linkcolor}{color1}
\colorlet{highlightcolor}{color3}
\colorlet{highlightcolor}{color3}
\colorlet{pbemptycolor}{color5} % progress bar empty part
\colorlet{pbfullcolor}{color3} % progress bar full part
\colorlet{xpheadercolor}{color2}
\colorlet{awardcolor}{color4}
\colorlet{bulletcolor}{color1}
2022-03-27 17:35:51 +01:00
\colorlet{jobtitlecolor}{gray}
\colorlet{universitycolor}{gray}
2022-03-25 14:45:33 +00:00
2022-03-27 19:20:02 +01:00
% setup the link styles
2022-03-25 14:45:33 +00:00
\hypersetup{
colorlinks=true,
2022-03-27 13:36:18 +01:00
urlcolor=linkcolor,
2022-03-25 14:45:33 +00:00
}
% View commands
% Header
\newcommand\headerview{
2022-03-27 13:36:18 +01:00
\hspace{-2.2em}
2022-03-27 20:23:27 +01:00
\begin{minipage}{0.14\linewidth}
\profpic{0.3}{images/avatar}
2022-03-27 13:36:18 +01:00
\end{minipage}%
\name{}
\hfill
\mbox{
\begin{minipage}{0.2\linewidth}
2022-03-27 13:37:29 +01:00
\contact{}
2022-03-27 13:36:18 +01:00
\end{minipage}
}
2022-03-25 14:45:33 +00:00
}
%profilpicture
\newsavebox{\picbox}
\newcommand{\profpic}[2]{%
\savebox{\picbox}{%
\includegraphics[scale=#1]{#2}}%
\tikz\node [draw, circle,%
line width=4pt, color=white,%
minimum width=\wd\picbox,minimum height=\ht\picbox,%
path picture={ \node at (path picture bounding box.center)%
{\usebox{\picbox}};}]%
{};}
\newcommand{\name}{%
2022-03-27 13:36:18 +01:00
\begin{minipage}{0.4\linewidth}
{\huge \@firstname{} \@lastname{}} \\[0cm]
{\small \color{jobtitlecolor} \@jobtitle}
\end{minipage}
2022-03-25 14:45:33 +00:00
}
\newcommand{\contact}{%
{\color{headercolor} \scriptsize \faIcon{map-marker-alt} \@address} \\
{\color{headercolor} \scriptsize \faIcon{phone-alt} \@mobile} \\
{\color{headercolor} \scriptsize \faIcon{envelope} \@mail} \\
{\color{headercolor} \scriptsize \faIcon{link} \href{\@website}{\@website}} \\
2022-03-25 14:45:33 +00:00
}
2022-03-27 19:20:02 +01:00
% ===
2022-03-25 14:45:33 +00:00
% Helper commands
2022-03-27 19:20:02 +01:00
% ===
% a trick to put the line with <before> parameter in \titleformat
\newcommand\ruleafter[1]{#1~{\color{headercolor}\hrulefill}}
2022-03-25 14:45:33 +00:00
2022-03-27 19:20:02 +01:00
% highlight the input
2022-03-25 14:57:15 +00:00
\newcommand{\hl}[1]{%
2022-03-27 13:36:18 +01:00
{\color{highlightcolor} #1}
2022-03-25 14:57:15 +00:00
}
2022-03-27 13:36:18 +01:00
\newcommand{\coloredbullet}{{\color{bulletcolor} \textbullet}}
2022-03-25 14:45:33 +00:00
% Edit section styles
2022-03-27 13:36:18 +01:00
% Customise the \section command
\titleformat{\section}
{\large\bfseries\raggedright\color{headercolor}} % Make the \section headers large (\Large),
2022-03-25 14:45:33 +00:00
% small capitals (\scshape) and left aligned (\raggedright)
2022-03-27 20:23:27 +01:00
{}{0em} % Can be used to give a prefix to all sections, like 'Section ...'
{\ruleafter} % Can be used to insert code before the heading
2022-03-27 19:20:02 +01:00
\titlespacing*{\section}{-1pt}{0pt}{0pt}
2022-03-25 14:45:33 +00:00
2022-03-26 18:18:26 +00:00
\newcommand{\volunteer}[1]{
2022-03-27 20:23:27 +01:00
\indent \coloredbullet{} \scriptsize #1 \\
2022-03-26 18:18:26 +00:00
}
2022-03-25 14:45:33 +00:00
\newcommand{\datetext}[1]{%
2022-03-27 13:36:18 +01:00
{\textit{\scriptsize \mdseries \color{gray} #1 }}
2022-03-25 14:45:33 +00:00
}
2022-03-26 18:18:26 +00:00
\newcommand{\award}[2]{%
2022-03-26 18:38:00 +00:00
\hspace{0.2cm}
2022-03-26 18:18:26 +00:00
\begin{small}
2022-03-27 17:35:51 +01:00
{\large{\mdseries \color{awardcolor} \faIcon{medal}}}
{\textbf{#1}}
2022-03-26 18:18:26 +00:00
\end{small}
\hfill
\datetext{#2}\\[0cm]
}
\newcommand{\project}[3]{%
{\small{\href{#2}{\faIcon{link}~#1}}} \\
\vbox{\vspace{0.05cm}
\sectiondesc{#3}
}
}
2022-03-27 17:35:51 +01:00
\newcommand{\studiedat}[3]{%
2022-03-25 14:45:33 +00:00
\begin{small}
2022-03-27 17:35:51 +01:00
{\textbf{#2}}
2022-03-25 14:45:33 +00:00
\end{small}
2022-03-27 17:35:51 +01:00
{\color{universitycolor} (~\university{#1})}
2022-03-25 14:45:33 +00:00
\hfill
2022-03-27 17:35:51 +01:00
\datetext{#3}
}
\newcommand{\university}[1]{%
\mbox{\scriptsize #1}
2022-03-25 14:45:33 +00:00
}
%
\newcommand{\role}[4]{%
\vbox{
\begin{small}
2022-03-27 13:36:18 +01:00
{\noindent \hspace{1em} \textbf{\color{xpheadercolor} #1} \jobtitle{#2}}
2022-03-25 14:45:33 +00:00
\end{small}
\hfill
\datetext{#3}\\[0.2cm]
\begin{small}
#4
\end{small}
}
}
\newcommand{\jobtitle}[1]{%
2022-03-27 17:35:51 +01:00
{\scriptsize \color{jobtitlecolor} (#1)}
2022-03-25 14:45:33 +00:00
}
\newcommand{\desc}[1]{%
\begin{minipage}{0.96\linewidth} \scriptsize #1 \end{minipage} \\[0.1cm]
}
2022-03-27 13:36:18 +01:00
2022-03-26 18:18:26 +00:00
% returns minipage width minus two times \fboxsep
% to keep padding included in width calculations
% can also be used for other boxes / environments
\newcommand{\mpwidth}{\linewidth-\fboxsep-\fboxsep}
\newcommand{\skill}[2] {
\mbox{#1} \\
\begin{tikzpicture}[scale=1]
2022-03-27 13:36:18 +01:00
\fill [pbemptycolor] (0,0) rectangle (1\mpwidth, 0.15);
\fill [pbfullcolor] (0,0) rectangle (#2\mpwidth, 0.15);
2022-03-26 18:18:26 +00:00
\end{tikzpicture} \\[0.1cm]
}
\newcommand{\sectiondesc}[1]{%
\scriptsize{#1} \\[0.1cm]
}
2022-03-25 14:45:33 +00:00
\newcommand{\jobdesc}[1]{%
2022-03-27 20:23:27 +01:00
\mbox{\hspace{1.2em} \scriptsize \desc{#1}}\\[0.2cm]
2022-03-25 14:45:33 +00:00
}
\newcommand{\itemwithtext}[1]{%
\begin{minipage}{\linewidth} \footnotesize \item #1 \end{minipage}
}
\newcommand{\addblocktext}[2]{%
\section{#1}
\indent \explanationdetail{\hspace{4ex} #2}
}
2022-03-25 14:58:41 +00:00
\newcommand{\summary}[1]{%
\section{Summary}
2022-03-26 18:18:26 +00:00
\sectiondesc{#1}
2022-03-25 14:58:41 +00:00
}
2022-03-25 14:45:33 +00:00
\newcommand\createbullets[1]{%
2022-03-27 13:36:18 +01:00
\renewcommand{\labelitemi}{\coloredbullet}
2022-03-25 14:45:33 +00:00
\begin{itemize}
\makeatletter
\@for\thisitem:=#1\do{\itemwithtext{\thisitem}}
\makeatother
\end{itemize}
}