% FortySecondsCV LaTeX class % Copyright © 2019-2022 René Wirnata % Licensed under the 3-Clause BSD License. See LICENSE file for details. % % Please visit https://github.com/PandaScience/FortySecondsCV for the most % recent version! For bugs or feature requests, please open a new issue on % github. % % Contributors: % https://github.com/PandaScience/FortySecondsCV/graphs/contributors % % Attributions % ------------ % * fortysecondscv is based on the twentysecondcv class by Carmine Spagnuolo % (cspagnuolo@unisa.it), released under the MIT license and available under % https://github.com/spagnuolocarmine/TwentySecondsCurriculumVitae-LaTex % * further attributions are indicated immediately before corresponding code %------------------------------------------------------------------------------- % CLASS NAME AND VERSION %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} \ProvidesClass{fortysecondscv}[2020/10/19 CV class] %------------------------------------------------------------------------------- % PROCESS CLASS OPTIONS %------------------------------------------------------------------------------- %% first load all packages absolutely required to parse class options % for easy color definitions; provides \definecolor; load before background pkg \RequirePackage[dvipsnames, svgnames, x11names]{xcolor} % for positioning text within the side column | use showboxes for visible frame \RequirePackage[absolute,overlay]{textpos} % provides key-value class options via \DeclareOptionX \RequirePackage{xkeyval} % provides \ifnumgreater{}{}{}{}, % \apptocmd{}{}{}{} and \newtoggle{} \RequirePackage{etoolbox} % provides basic conditional expressions \RequirePackage{ifthen} % enable simple math like +/- etc. on lengths \RequirePackage{calc} % change page margins \RequirePackage[ nohead, nofoot, nomarginpar, ]{geometry} % pre-define some colors the user can choose from \definecolor{cvblue}{HTML}{0E5484} \definecolor{cvgreen}{HTML}{007170} \definecolor{cvred}{HTML}{8B0000} \definecolor{cvsidecolor}{HTML}{E7E7E7} \definecolor{cvsectioncolor}{HTML}{0395DE} \definecolor{cvsubsectioncolor}{HTML}{4D4D4D} % set default values \colorlet{maincolor}{cvblue} \colorlet{sidecolor}{cvsidecolor} \colorlet{sidetextcolor}{black} \colorlet{sectioncolor}{cvsectioncolor} \colorlet{subsectioncolor}{cvsubsectioncolor} \colorlet{itemtextcolor}{black!90} % colors for document body (right column) % let user define main color \DeclareOptionX{maincolor}{\colorlet{maincolor}{#1}} \DeclareOptionX{sidecolor}{\colorlet{sidecolor}{#1}} \DeclareOptionX{sidetextcolor}{\colorlet{sidetextcolor}{#1}} \DeclareOptionX{sectioncolor}{\colorlet{sectioncolor}{#1}} \DeclareOptionX{subsectioncolor}{\colorlet{subsectioncolor}{#1}} \DeclareOptionX{itemtextcolor}{\colorlet{itemtextcolor}{#1}} % set page margins \newlength\sidebarwidth% \newlength\topbottommargin% \newlength\leftrightmargin% \newlength\sidebartextwidth % default values \setlength{\sidebarwidth}{0.34\paperwidth} \setlength{\topbottommargin}{0.02\paperheight} \setlength{\leftrightmargin}{0.02\paperwidth} % user overwrites \DeclareOptionX{sidebarwidth}{\setlength{\sidebarwidth}{#1}} \DeclareOptionX{topbottommargin}{\setlength{\topbottommargin}{#1}} \DeclareOptionX{leftrightmargin}{\setlength{\leftrightmargin}{#1}} % profile picture settings \newlength\profilepicsize% \setlength{\profilepicsize}{0.7\sidebarwidth} \DeclareOptionX{profilepicsize}{\setlength{\profilepicsize}{#1}} \newlength\profilepicborderwidth% \setlength{\profilepicborderwidth}{3.5pt} \DeclareOptionX{profilepicborderwidth}{\setlength{\profilepicborderwidth}{#1}} \newcommand*{\profilepicstyle}{} \DeclareOptionX{profilepicstyle}{\renewcommand{\profilepicstyle}{#1}} \newcommand*{\profilepiczoom}{} \DeclareOptionX{profilepiczoom}{\renewcommand{\profilepiczoom}{#1}} \newlength\profilepicxshift \setlength{\profilepicxshift}{0mm} \DeclareOptionX{profilepicxshift}{\setlength{\profilepicxshift}{#1}} \newlength\profilepicyshift \setlength{\profilepicyshift}{0mm} \DeclareOptionX{profilepicyshift}{\setlength{\profilepicyshift}{#1}} \newlength\profilepicrounding \setlength{\profilepicrounding}{0.15\sidebarwidth} \DeclareOptionX{profilepicrounding}{\setlength{\profilepicrounding}{#1}} % sidebar settings \newcommand*{\sidebarplacement}{} \DeclareOptionX{sidebarplacement}{\renewcommand{\sidebarplacement}{#1}} \newcommand*{\sidesectionsize}{\huge} \DeclareOptionX{sidesectionsize}{% \expandafter\renewcommand{\sidesectionsize}{\csname #1\endcsname}% } % \DeclareOptionX{sidesectionsize}{\renewcommand{\sidesectionsize}{\small}} % logo settings \newlength\logowidth% \setlength{\logowidth}{\profilepicsize} \DeclareOptionX{logowidth}{\setlength{\logowidth}{#1}} \newlength\logospace% \DeclareOptionX{logospace}{\setlength{\logospace}{#1}} \newcommand*{\logoposition}{} \DeclareOptionX{logoposition}{\renewcommand{\logoposition}{#1}} % show sidebar and page margins \newtoggle{tshowframes} \togglefalse{tshowframes} \DeclareOptionX{showframes}{ \geometry{showframe} \TPoptions{showboxes=true} \toggletrue{tshowframes} % adding \hline in \newenvironment directly doesn't work, so do it here... \AtBeginDocument{\apptocmd{\personaldata}{\hline}{}{}} } % draw vertical guideline \newcommand{\plotvline}{} \DeclareOptionX{vline}{% % must be defined here as macro, b/c tikz won't expand absolute length in % \backgroundsetup -- BUG? \renewcommand{\plotvline}{% \draw [thick, red, opacity=0.7] (\leftrightmargin + #1, 0) -- (\leftrightmargin + #1, -\paperheight); } } % date column width \newlength\datecolwidth \setlength{\datecolwidth}{0.17\textwidth} \DeclareOptionX{datecolwidth}{\setlength{\datecolwidth}{#1}} % pass further options to base class and load it \DeclareOptionX*{\PassOptionsToClass{\CurrentOption}{article}} \ProcessOptionsX\relax \LoadClass{article} % compute "inner" margin of sidebar automatically; % must come after \sidebarwidth and \leftrightmargin possibly changed by user \setlength{\sidebartextwidth}{\sidebarwidth - 2\leftrightmargin} % let geometry package perform the changes; % must come after loading the base class to prevent overwriting \ifthenelse{\equal{\sidebarplacement}{right}}{% \geometry{ top=\topbottommargin, bottom=\topbottommargin, right=\sidebarwidth + \leftrightmargin, left=\leftrightmargin, } }{% else \geometry{ top=\topbottommargin, bottom=\topbottommargin, left=\sidebarwidth + \leftrightmargin, right=\leftrightmargin, } } %------------------------------------------------------------------------------- % REQUIRED PACKAGES %------------------------------------------------------------------------------- % use as workaround for spacing problem when TikZ picture is not in paragraph; % details: https://tex.stackexchange.com/a/435790 \RequirePackage[texcoord]{eso-pic} % for easy section style definitions \RequirePackage{titlesec} % loads graphicx, provides align=c option for vertical alignment w.r.t. text \RequirePackage{graphbox} % provides X column type for automatic length calculations \RequirePackage{tabularx} \RequirePackage{longtable, tabu} % take care of compiler-specific packages \RequirePackage{ifluatex} \RequirePackage{ifxetex} \newif\ifxetexorluatex \ifxetex \xetexorluatextrue \else \ifluatex \xetexorluatextrue \else \xetexorluatexfalse \fi \fi % pictures, icons and drawings \ifxetexorluatex \RequirePackage{academicons} \fi \RequirePackage{fontawesome5} \RequirePackage{devicons} \RequirePackage{tikz} \usetikzlibrary{arrows, backgrounds} % provides \xrfill for horizontal rules \RequirePackage{xhfill} % enable multiple optional arguments in macros \RequirePackage{xparse} % enable links \RequirePackage[hidelinks]{hyperref} %------------------------------------------------------------------------------- % DERIVED COLOR DEFINITIONS %------------------------------------------------------------------------------- % profile section color (sidebar/left column) \colorlet{pseccolor}{maincolor!90} % color used for all icon arguments \colorlet{iconcolor}{maincolor!90} % color definitions for TikZ drawings \colorlet{wheelchartlabelcolor}{black} \colorlet{wheeltextcolor}{black!80!white} % color of unfilled skill points / bar / chart label \colorlet{skillbg}{black!25} %------------------------------------------------------------------------------- % GLOBAL LAYOUT AND HEADINGS STYLE %------------------------------------------------------------------------------- % remove headers and footers \pagestyle{empty} % globally disable paragraph indentation \setlength{\parindent}{0pt} % set space between paragraphs % \setlength{\parskip}{1ex} % creates a rule after some text using remaining line width % usage: \xrfill[]{} \newcommand*{\sectionline}[1]{#1~\xrfill[.5ex]{1pt}[pseccolor]} % section style for cv table headings in right column % \titleformat{}[]{}{