abhaypatil2000

twentysecondcv.cls

Jul 15th, 2020
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 8.65 KB | None | 0 0
  1. \ProvidesClass{twentysecondcv}[2017/01/08 CV class]
  2. \LoadClass{article}
  3. \NeedsTeXFormat{LaTeX2e}
  4.  
  5. %----------------------------------------------------------------------------------------
  6. %    REQUIRED PACKAGES
  7. %----------------------------------------------------------------------------------------
  8.  
  9. \RequirePackage[sfdefault]{ClearSans}
  10. \RequirePackage[T1]{fontenc}
  11. \RequirePackage{tikz}
  12. \RequirePackage{xcolor}
  13. \RequirePackage[absolute,overlay]{textpos}
  14. \RequirePackage{ragged2e}
  15. \RequirePackage{etoolbox}
  16. \RequirePackage{ifmtarg}
  17. \RequirePackage{ifthen}
  18. \RequirePackage{pgffor}
  19. \RequirePackage{marvosym}
  20. \RequirePackage{parskip}
  21.  
  22. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
  23. \ProcessOptions\relax
  24.  
  25. %----------------------------------------------------------------------------------------
  26. %    COLOURS
  27. %----------------------------------------------------------------------------------------
  28.  
  29. \definecolor{white}{RGB}{255,255,255}
  30. \definecolor{gray}{HTML}{4D4D4D}
  31. \definecolor{sidecolor}{HTML}{E7E7E7}
  32. \definecolor{mainblue}{HTML}{0E5484}
  33. \definecolor{maingray}{HTML}{B9B9B9}
  34.  
  35. %----------------------------------------------------------------------------------------
  36. %    MISC CONFIGURATIONS
  37. %----------------------------------------------------------------------------------------
  38.  
  39. \renewcommand{\bfseries}{\color{gray}} % Make \textbf produce coloured text instead
  40.  
  41. \pagestyle{empty} % Disable headers and footers
  42.  
  43. \setlength{\parindent}{0pt} % Disable paragraph indentation
  44.  
  45. %----------------------------------------------------------------------------------------
  46. %    SIDEBAR DEFINITIONS
  47. %----------------------------------------------------------------------------------------
  48.  
  49. \setlength{\TPHorizModule}{1cm} % Left margin
  50. \setlength{\TPVertModule}{1cm} % Top margin
  51.  
  52. \newlength\imagewidth
  53. \newlength\imagescale
  54. \pgfmathsetlength{\imagewidth}{5cm}
  55. \pgfmathsetlength{\imagescale}{\imagewidth/600}
  56.  
  57. \newlength{\TotalSectionLength} % Define a new length to hold the remaining line width after the section title is printed
  58. \newlength{\SectionTitleLength} % Define a new length to hold the width of the section title
  59. \newcommand{\profilesection}[1]{%
  60.     \setlength\TotalSectionLength{\linewidth}% Set the total line width
  61.     \settowidth{\SectionTitleLength}{\huge #1 }% Calculate the width of the section title
  62.     \addtolength\TotalSectionLength{-\SectionTitleLength}% Subtract the section title width from the total width
  63.     \addtolength\TotalSectionLength{-2.22221pt}% Modifier to remove overfull box warning
  64.     \vspace{8pt}% Whitespace before the section title
  65.     {\color{black!80} \huge #1 \rule[0.15\baselineskip]{\TotalSectionLength}{1pt}}% Print the title and auto-width rule
  66. }
  67.  
  68. % Define custom commands for CV info
  69. \newcommand{\cvdate}[1]{\renewcommand{\cvdate}{#1}}
  70. \newcommand{\cvmail}[1]{\renewcommand{\cvmail}{#1}}
  71.  
  72. \newcommand{\cvnumberphone}[1]{\renewcommand{\cvnumberphone}{#1}}
  73. \newcommand{\cvaddress}[1]{\renewcommand{\cvaddress}{#1}}
  74. \newcommand{\cvsite}[1]{\renewcommand{\cvsite}{#1}}
  75. \newcommand{\cvgite}[1]{\renewcommand{\cvgite}{#1}}
  76. \newcommand{\Education}[1]{\renewcommand{\Education}{#1}}
  77. \newcommand{\skills}[1]{\renewcommand{\skills}{#1}}
  78. \newcommand{\ExtraCurricular}[1]{\renewcommand{\ExtraCurricular}{#1}}
  79. \newcommand{\Course}[1]{\renewcommand{\Course}{#1}}
  80. \newcommand{\Courselist}[1]{\renewcommand{\Courselist}{#1}}
  81. \newcommand{\skillslist}[1]{\renewcommand{\skillslist}{#1}}
  82. \newcommand{\educationlist}[1]{\renewcommand{\educationlist}{#1}}
  83.  
  84.  
  85. \newcommand{\cvname}[1]{\renewcommand{\cvname}{#1}}
  86. \newcommand{\cvjobtitle}[1]{\renewcommand{\cvjobtitle}{#1}}
  87.  
  88.  
  89. % Command for printing the contact information icons
  90. \newcommand*\icon[1]{\tikz[baseline=(char.base)]{\node[shape=circle,draw,inner sep=1pt, fill=mainblue,mainblue,text=white] (char) {#1};}}
  91.  
  92. % Command for printing skill progress bars
  93.  
  94.  
  95. % Command for printing skills text
  96. \newcommand\skillstext[1]{
  97.     \renewcommand{\skillstext}{
  98.         \begin{flushleft}
  99.             \foreach [count=\i] \x/\y in {#1}{
  100.                 \x$ \star $\y
  101.             }
  102.         \end{flushleft}
  103.     }
  104. }
  105.  
  106. %----------------------------------------------------------------------------------------
  107. %    SIDEBAR LAYOUT
  108. %----------------------------------------------------------------------------------------
  109.  
  110. \newcommand{\makeprofile}{
  111.     \begin{tikzpicture}[remember picture,overlay]
  112.         \node [rectangle, fill=sidecolor, anchor=north, minimum width=9cm, minimum height=\paperheight+1cm] (box) at (-5cm,0.5cm){};
  113.     \end{tikzpicture}
  114.  
  115.     %------------------------------------------------
  116.  
  117.     \begin{textblock}{6}(0.5, 0.2)
  118.            
  119.         %------------------------------------------------
  120.        
  121.  
  122.         %------------------------------------------------
  123.  
  124.         {\Huge\color{mainblue}\cvname}
  125.  
  126.         %------------------------------------------------
  127.  
  128.         {\Large\color{black!80}\cvjobtitle}
  129.  
  130.         %------------------------------------------------
  131.  
  132.         \renewcommand{\arraystretch}{1.6}
  133.         \begin{tabular}{p{0.5cm} @{\hskip 0.5cm}p{5cm}}
  134.             \ifthenelse{\equal{\cvdate}{}}{}{\textsc{\Large\icon{\faInfoCircle}} & \cvdate\\}
  135. %           \ifthenelse{\equal{\cvmail}{}}{}{\textsc{\large\icon{@}} & \href{mailto:\cvmail}{\cvmail (link)}\\}
  136.             \ifthenelse{\equal{\cvaddress}{}}{}{\textsc{\Large\icon{@}} & \cvaddress\\}
  137.             \ifthenelse{\equal{\cvnumberphone}{}}{}{\textsc{\Large\icon{\Telefon}} & \cvnumberphone\\}
  138.             \ifthenelse{\equal{\cvsite}{}}{}{\textsc{\Large\icon{\faLinkedin}} & \cvsite\\}
  139.             \ifthenelse{\equal{\cvgite}{}}{}{\textsc{\Large\icon{\faGithub}} & \cvgite\\}
  140.             %gite stands for github
  141.            
  142.                
  143.         \end{tabular}
  144.  
  145.         %------------------------------------------------
  146.        
  147.         \ifthenelse{\equal{\Education}{}}{}{
  148.             \profilesection{Education}
  149.             \begin{flushleft}
  150.                 \educationlist
  151.                 \Education
  152.             \end{flushleft}
  153.         }
  154.  
  155.         %------------------------------------------------
  156.         \ifthenelse{\equal{\skills}{}}{}{
  157.             \profilesection{Technical-Skills}
  158.             \begin{flushleft}
  159.                 \skillslist
  160.                 \skills
  161.             \end{flushleft}
  162.         }
  163.        
  164.         \ifthenelse{\equal{\Course}{}}{}{
  165.             \profilesection{Coursework}
  166.             \begin{flushleft}
  167.                 \Courselist
  168.                 \Course
  169.             \end{flushleft}
  170.         }
  171.  
  172.  
  173.  
  174.    
  175.         %------------------------------------------------
  176.            
  177.     \end{textblock}
  178. }
  179.  
  180. %----------------------------------------------------------------------------------------
  181. %    COLOURED SECTION TITLE BOX
  182. %----------------------------------------------------------------------------------------
  183.  
  184. % Command to create the rounded boxes around the first three letters of section titles
  185. \newcommand*\round[2]{%
  186.     \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};%
  187. }
  188.  
  189. \newcounter{colorCounter}
  190. \newcommand{\sectioncolor}[1]{%
  191.     {%
  192.         \round{#1}{
  193.             \ifcase\value{colorCounter}%
  194.             mainblue\or%
  195.             mainblue\or%
  196.             mainblue\or%
  197.             mainblue\or%
  198.             mainblue\or%
  199.             mainblue\or%
  200.             mainblue\or%
  201.             mainblue\or%
  202.             mainblue\or%
  203.             mainblue\else%
  204.             mainblue\fi%
  205.         }%
  206.     }%
  207.     \stepcounter{colorCounter}%
  208. }
  209.  
  210. \renewcommand{\section}[1]{
  211.     {%
  212.         \color{gray}%
  213.         \Large\sectioncolor{#1}%
  214.     }
  215. }
  216.  
  217. \renewcommand{\subsection}[1]{
  218.     \par\vspace{.5\parskip}{%
  219.         \large\color{gray} #1%
  220.     }
  221.     \par\vspace{.25\parskip}%
  222. }
  223.  
  224. %----------------------------------------------------------------------------------------
  225. %    LONG LIST ENVIRONMENT
  226. %----------------------------------------------------------------------------------------
  227.  
  228. \setlength{\tabcolsep}{0pt}
  229.  
  230. % New environment for the long list
  231. \newenvironment{twenty}{%
  232.     \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ll}
  233. }{%
  234.     \end{tabular*}
  235. }
  236.  
  237. \newcommand{\twentyitem}[4]{%
  238.     #1&\parbox[t]{0.83\textwidth}{%
  239.         \textbf{#2}%
  240.         \hfill%
  241.         {\footnotesize#3}\\%
  242.         #4\vspace{\parsep}%
  243.     }\\
  244. }
  245.  
  246. %----------------------------------------------------------------------------------------
  247. %    SMALL LIST ENVIRONMENT
  248. %----------------------------------------------------------------------------------------
  249.  
  250. \setlength{\tabcolsep}{0pt}
  251.  
  252. % New environment for the small list
  253.  
  254. \newenvironment{twentyshort}{%
  255.     \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ll}
  256. }{%
  257.     \end{tabular*}
  258. }
  259. \newcommand{\twentyitemshort}[2]{#1&\parbox[t]{0.70\textwidth}{\csname @minipagetrue\endcsname\bfseries #2}\\}
  260. % \newcommand{\twentyitemshort}[2]{%
  261. %   #1&\parbox[t]{0.70\textwidth}{%
  262. %       \textbf{#2}%
  263. %   }\\
  264.  
  265.  
  266. %----------------------------------------------------------------------------------------
  267. %    MARGINS AND LINKS
  268. %----------------------------------------------------------------------------------------
  269.  
  270. \RequirePackage[left=7.6cm,top=0.1cm,right=1cm,bottom=0.2cm,nohead,nofoot]{geometry}
  271.  
  272. \RequirePackage{hyperref}
Add Comment
Please, Sign In to add comment