Update AltaCV version

This commit is contained in:
Yorick Barbanneau 2023-07-15 00:49:43 +02:00
parent 4f899df7a5
commit fffb14b3ec
3 changed files with 372 additions and 193 deletions

View file

@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%
% This is altacv.cls (v1.1.5, 1 December 2018) written by
% This is altacv.cls (v1.6.5, 3 Nov 2022) written by
% LianTze Lim (liantze@gmail.com).
%
%% It may be distributed and/or modified under the
@ -15,30 +15,37 @@
% - https://github.com/akreuzer Added ragged2e option (5 Nov 2018)
% - https://github.com/stefanogermano Fixed bad boxes and undefined font shape (July 2018)
% - https://github.com/foohyfooh Fixed blank spaces in \cvevent and bad link in README.md (June 2018)
% - https://github.com/logological Remove redundant hyperref and typos (Apr 2021)
%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
%% v1.4: Detect TL2018 to handle accented characters in class information
\@ifl@t@r\fmtversion{2018/04/01}{\UseRawInputEncoding}{}
\ProvidesClass{altacv}[2018/12/01 AltaCV v1.1.5, yet another alternative class for a résumé/curriculum vitae.]
\ProvidesClass{altacv}[2022/11/03 AltaCV v1.6.5, yet another alternative class for a resume/curriculum vitae.]
%% v1.1: Optionally load academicons
\newif\if@academicons
\DeclareOption{academicons}{\@academiconstrue}
%% v1.4: Nope, academicons is unnecessary; fontawesome5 has \faOrcid.
\DeclareOption{academicons}{\ClassWarning{altacv}{academicons option is now obsolete and unnecessary.}}
%% v1.1.3: Choice of round/square photo
\newif\if@normalphoto
\DeclareOption{normalphoto}{\@normalphototrue}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{extarticle}}
\newif\if@raggedtwoe
\DeclareOption{ragged2e}{\@raggedtwoetrue}
%% v1.3: load hyperref for clickable hyperlinks
\newif\if@withhyper
\DeclareOption{withhyper}{\@withhypertrue}
\ProcessOptions\relax
\LoadClass{extarticle}
%% v1.3.2 Hopefully this helps make the PDF
%% file more 'friendly' with copy-paste etc
\RequirePackage{etoolbox}
\RequirePackage[a-1b]{pdfx}
\RequirePackage{accsupp}
\RequirePackage[margin=2cm]{geometry}
\RequirePackage{fontawesome}
\RequirePackage[fixed]{fontawesome5}
\RequirePackage{ifxetex,ifluatex}
\RequirePackage{scrlfile}
\RequirePackage{xparse}
%% v1.1.5: added for convenience
\newif\ifxetexorluatex
@ -52,65 +59,54 @@
\fi
\fi
%% v1.1: Optionally load academicons
%% v1.1.5: Handle different versions of academicons
\if@academicons
\ifxetexorluatex
\RequirePackage{fontspec}
%% academicons in TL2018 doesn't require
%% Academicons to be installed in OS fonts
%% so can be loaded directly
\@ifl@t@r\fmtversion{2018/04/01}{%
\RequirePackage{academicons}
}{%
% TL2017
\@ifl@t@r\fmtversion{2017/04/01}{%
\@ifpackagelater{academicons}{2018/03/01}{%
\RequirePackage{academicons}
}{%
\let\ori@newfontfamily\newfontfamily%
\renewcommand{\newfontfamily}[2]{}
\RequirePackage{academicons}
\let\newfontfamily\ori@newfontfamily
\newfontfamily{\AI}{academicons.ttf}
}
}{% TL2016 requires the package to be loaded before
% the version can be checked. Only added because
% Overleaf v1 still runs TL2016; will be removed
% when v1 is completely retired.
\let\ori@newfontfamily\newfontfamily%
\renewcommand{\newfontfamily}[2]{}
\RequirePackage{academicons}
\let\newfontfamily\ori@newfontfamily
\newfontfamily{\AI}{academicons.ttf}
}
}
\else
\ClassError{AltaCV}{academicons unsupported by latex or pdflatex. Please compile with xelatex or lualatex}{Please compile with xelatex or lualatex to use the academicons option}
\fi
\ifxetexorluatex
\RequirePackage{fontspec}
\else
%% v1.3.2 attempts to make ligatures
%% copy-paste as normal characters
\RequirePackage{cmap}
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\input{glyphtounicode}
\pdfglyphtounicode{f_f}{FB00}
\pdfglyphtounicode{f_f_i}{FB03}
\pdfglyphtounicode{f_f_l}{FB04}
\pdfglyphtounicode{f_i}{FB01}
\pdfgentounicode=1
\fi
\if@raggedtwoe
\RequirePackage[newcommands]{ragged2e}
\fi
\if@withhyper
\AtBeginDocument{%
\hypersetup{hidelinks}
\urlstyle{same}
}
\fi
\RequirePackage{xcolor}
\colorlet{accent}{blue!70!black}
\colorlet{heading}{black}
\colorlet{emphasis}{black}
\colorlet{heading}{black}
\colorlet{headingrule}{black}
\colorlet{subheading}{emphasis}
\colorlet{body}{black!80!white}
\colorlet{name}{heading}
\colorlet{tagline}{accent}
\newcommand{\itemmarker}{{\small\textbullet}}
\newcommand{\ratingmarker}{\faCircle}
\RequirePackage{tikz}
\usetikzlibrary{arrows}
\RequirePackage[skins]{tcolorbox}
\RequirePackage{enumitem}
\setlist{leftmargin=*,labelsep=0.5em,nosep,itemsep=0.25\baselineskip,after=\vskip0.25\baselineskip}
\RequirePackage[inline]{enumitem}
\setlist{leftmargin=*,labelsep=0.5em,nosep,itemsep=0.25\baselineskip,after=\vspace{0.25\baselineskip}}
\setlist[itemize]{label=\itemmarker}
\RequirePackage{graphicx}
\RequirePackage{etoolbox}
\RequirePackage{trimclip}
\RequirePackage{dashrule}
\RequirePackage{multirow,tabularx}
\RequirePackage{changepage}
@ -123,66 +119,164 @@
\begin{adjustwidth}{}{\dimexpr-\marginparwidth-\marginparsep\relax}}
{\end{adjustwidth}}
\newcommand{\emailsymbol}{\faAt}
\newcommand{\phonesymbol}{\faPhone}
\newcommand{\homepagesymbol}{\faChain}
\newcommand{\locationsymbol}{\faMapMarker}
\newcommand{\linkedinsymbol}{\faLinkedin}
\newcommand{\twittersymbol}{\faTwitter}
\newcommand{\githubsymbol}{\faGithub}
\newcommand{\orcidsymbol}{\aiOrcid}
\newcommand{\mailsymbol}{\faEnvelope}
%% v1.3.1 \detokenize will break UTF-8 in pdflatex
%% Using alternative from https://tex.stackexchange.com/a/530911/226
\newcommand{\utffriendlydetokenize}[1]{%
\scantokens{%
\catcode`\_=12%
% \catcode`\^=12%
% \catcode`\{=12%
% \catcode`\}=12%
\catcode`\&=12%
\catcode`\$=12%
\catcode`\#=12%
\catcode`\~=12%
% \catcode`\\=12%
{#1}%
}%
}
%% v1.3: Incorporating hyperlinks
%% v1.3.1: using \unfriendlydetokenize to avoid breaking unicode
%% v1.6: Use accsupp so that when copying/pasting the icon from PDF to a text
%% file, the icon name is pasted
\ExplSyntaxOn
\NewDocumentCommand{\printinfo}{m m o}{%
\BeginAccSupp{method=escape,ActualText={#1:~#2}}
\IfNoValueTF{#3}{%
\mbox{\textcolor{accent}{\normalfont #1}~\utffriendlydetokenize{#2}\hspace{2em}}%
}{%
\if@withhyper%
\mbox{\textcolor{accent}{\normalfont #1}~
\href{#3}{\utffriendlydetokenize{#2}}\hspace{2em}}
\else%
\ClassWarning{Please specify [withhyper] option to enable hyperlinks. Printing out full hyperlink prefix #1 for now.}%
\mbox{\textcolor{accent}{\normalfont #1}~{\utffriendlydetokenize{#3#2}}\hspace{2em}}%
\fi%
}%
\EndAccSupp{}
}%
\newcommand{\printinfo}[2]{\mbox{\textcolor{accent}{\normalfont #1}\hspace{0.5em}#2\hspace{2em}}}
%% v1.3: Exploring convenient creation of fields
%% v1.6: Add starred mode to create \printinfo with full URL
\NewDocumentCommand{\NewInfoField}{s m m o}{%
\IfBooleanF{#1}{
\IfNoValueF{#4}{\csdef{#2 hyperprefix}{#4}}%
}
\csdef{#2 symbol}{#3}%
\IfBooleanTF{#1}
{ \csdef{#2}##1##2{%
\if@withhyper
\IfNoValueTF {##2}
{\printinfo{\csuse{#2 symbol}}{##1}}%
{\printinfo{\csuse{#2 symbol}}{##1}[##2]}%
\else
\printinfo{\csuse{#2 symbol}}{##1}%
\fi%
}%
}
{ \csdef{#2}##1{%
\if@withhyper
\IfNoValueTF {#4}
{\printinfo{\csuse{#2 symbol}}{##1}}%
{\printinfo{\csuse{#2 symbol}}{##1}[\csuse{#2 hyperprefix}##1]}%
\else
\printinfo{\csuse{#2 symbol}}{##1}%
\fi%
}%
}
}
\ExplSyntaxOff
\newcommand{\name}[1]{\def\@name{#1}}
\newcommand{\tagline}[1]{\def\@tagline{#1}}
\newcommand{\photo}[2]{\def\@photo{#2}\def\@photodiameter{#1}}
\newcommand{\email}[1]{\printinfo{\emailsymbol}{#1}}
\newcommand{\mailaddress}[1]{\printinfo{\mailsymbol}{#1}}
\newcommand{\phone}[1]{\printinfo{\phonesymbol}{#1}}
\newcommand{\homepage}[1]{\printinfo{\homepagesymbol}{#1}}
\newcommand{\twitter}[1]{\printinfo{\twittersymbol}{#1}}
\newcommand{\linkedin}[1]{\printinfo{\linkedinsymbol}{#1}}
\newcommand{\github}[1]{\printinfo{\githubsymbol}{#1}}
\newcommand{\orcid}[1]{\printinfo{\orcidsymbol}{#1}}
\newcommand{\location}[1]{\printinfo{\locationsymbol}{#1}}
\newcommand{\personalinfo}[1]{\def\@personalinfo{#1}}
\NewInfoField{email}{\faAt}[mailto:]
\NewInfoField{mailaddress}{\faEnvelope}
\NewInfoField{phone}{\faPhone}[tel:]
\NewInfoField{homepage}{\faGlobe}[https://]
\NewInfoField{twitter}{\faTwitter}[https://twitter.com/]
\NewInfoField{linkedin}{\faLinkedin}[https://linkedin.com/in/]
\NewInfoField{github}{\faGithub}[https://github.com/]
% v1.?? Use fontawesome5 for Orcid symbol
\NewInfoField{orcid}{\faOrcid}[https://orcid.org/]
\NewInfoField{location}{\faMapMarker}
% v1.2: Support for multiple photos
\newlength{\altacv@photos@width}
\newlength{\altacv@photo@diam@left}
\newlength{\altacv@photo@diam@right}
\def\altacv@left@photos{}
\def\altacv@right@photos{}
\newcommand{\@makeaphoto}[2]{%
\begin{minipage}{#1}%
\if@normalphoto
\includegraphics[width=\linewidth]{#2}
\else
\tikz\path[fill overzoom image={#2}]circle[radius=0.5\linewidth];
\fi%
\end{minipage}%
}
\newcommand{\altacv@add@photo@left}[1]{%
\appto{\altacv@left@photos}{%
\@makeaphoto{\altacv@photo@diam@left}{#1}\hspace{1ex}%
}%
\addtolength{\altacv@photos@width}{\altacv@photo@diam@left}%
\addtolength{\altacv@photos@width}{1ex}%
}
\newcommand{\altacv@add@photo@right}[1]{%
\appto{\altacv@right@photos}{%
\@makeaphoto{\altacv@photo@diam@right}{#1}\hspace{1ex}%
}%
\addtolength{\altacv@photos@width}{\altacv@photo@diam@right}%
\addtolength{\altacv@photos@width}{1ex}%
}
\newcommand{\photoL}[2]{%
\setlength{\altacv@photo@diam@left}{#1}%
\forcsvlist{\altacv@add@photo@left}{#2}%
}
\newcommand{\photoR}[2]{%
\setlength{\altacv@photo@diam@right}{#1}%
\forcsvlist{\altacv@add@photo@right}{#2}%
}
\let\photo\photoR
\newcommand{\namefont}{\Huge\bfseries}
\newcommand{\taglinefont}{\large\bfseries}
\newcommand{\personalinfofont}{\footnotesize\bfseries}
\newcommand{\cvsectionfont}{\LARGE\bfseries}
\newcommand{\cvsubsectionfont}{\large\bfseries}
\newcommand{\cvsectionline}{\rule{\linewidth}{2pt}}
\newcommand{\makecvheader}{%
\begingroup
\ifdef{\@photodiameter}{\begin{minipage}{\dimexpr\linewidth-\@photodiameter-2em}}{}%
\raggedright\color{emphasis}%
{\Huge\bfseries\MakeUppercase{\@name}\par}
\altacv@left@photos\hfill%
\begin{minipage}{\dimexpr\linewidth-\altacv@photos@width}%
\raggedright%
{\namefont\color{name}\MakeUppercase{\@name}\par}
\medskip
{\large\bfseries\color{accent}\@tagline\par}
{\taglinefont\color{tagline}\@tagline\par}
\medskip
{\footnotesize\bfseries\@personalinfo\par}
\ifdef{\@photodiameter}{%
{\personalinfofont\@personalinfo\par}
\end{minipage}\hfill%
\begin{minipage}{\@photodiameter}
\if@normalphoto
\includegraphics[width=\linewidth]{\@photo}
\else
\tikz\path[fill overzoom image={\@photo}]circle[radius=0.5\linewidth];
\fi%
\end{minipage}\par}{}%
\altacv@right@photos\par%
\endgroup\medskip
}
\renewenvironment{quote}{\color{accent}\itshape\large}{\par}
\newcommand{\cvsection}[2][]{%
\bigskip%
\nointerlineskip\bigskip% %% bugfix in v1.6.2
\ifstrequal{#1}{}{}{\marginpar{\vspace*{\dimexpr1pt-\baselineskip}\raggedright\input{#1}}}%
{\color{heading}\LARGE\bfseries\MakeUppercase{#2}}\\[-1ex]%
{\color{heading}\rule{\linewidth}{2pt}\par}\medskip
{\color{heading}\cvsectionfont\MakeUppercase{#2}}\\[-1ex]%
{\color{headingrule}\cvsectionline\par}\medskip
}
\newcommand{\cvsubsection}[1]{%
\smallskip%
{\color{emphasis}\large\bfseries{#1}\par}\medskip
{\color{subheading}\cvsubsectionfont{#1}\par}\medskip
}
% v1.1.4: fixes inconsistent font size
@ -192,8 +286,8 @@
\ifstrequal{#2}{}{}{
\textbf{\color{accent}#2}\par
\smallskip}
\ifstrequal{#3}{}{}{{\small\makebox[0.5\linewidth][l]{\faCalendar\hspace{0.5em}#3}}}%
\ifstrequal{#4}{}{}{{\small\makebox[0.5\linewidth][l]{\faMapMarker\hspace{0.5em}#4}}}\par
\ifstrequal{#3}{}{}{{\small\makebox[0.5\linewidth][l]{\faCalendar~#3}}}%
\ifstrequal{#4}{}{}{{\small\makebox[0.5\linewidth][l]{\faMapMarker~#4}}}\par
\medskip\normalsize
}
@ -209,10 +303,17 @@
\tikz[baseline]\node[anchor=base,draw=body!30,rounded corners,inner xsep=1ex,inner ysep =0.75ex,text height=1.5ex,text depth=.25ex]{#1};
}
% v1.6: Use accsupp so that the actual numeric value is copied/pasted
% and also support 0.5, 1.5, 2.5, 3.5, 4.5
\newcommand{\cvskill}[2]{%
\textcolor{emphasis}{\textbf{#1}}\hfill
\foreach \x in {1,...,5}{%
\space{\ifnumgreater{\x}{#2}{\color{body!30}}{\color{accent}}\ratingmarker}}\par%
\textcolor{emphasis}{\textbf{#1}}\hfill
\BeginAccSupp{method=plain,ActualText={#2}}
\foreach \x in {1,...,5}{%
\ifdimequal{\x pt - #2 pt}{0.5pt}%
{\clipbox*{0pt -0.25ex {.5\width} {\totalheight}}{\color{accent}\ratingmarker}%
\clipbox*{{.5\width} -0.25ex {\width} {\totalheight}}{\color{body!30}\ratingmarker}}
{\ifdimgreater{\x bp}{#2 bp}{\color{body!30}}{\color{accent}}\ratingmarker}%
}\EndAccSupp{}\par%
}
% Adapted from @Jake's answer at http://tex.stackexchange.com/a/82729/226
@ -260,7 +361,8 @@
(-\newcumnum:\innerradius) arc (-\newcumnum:-(\cumnum):\innerradius) -- cycle;
% Draw the data labels
\draw [*-,thin,emphasis] node [append after command={(\midangle:\midradius pt) -- (\midangle:\outerradius + 1ex) -- (\tikzlastnode)}] at (\midangle:\outerradius + 1ex) [xshift=\labelshiftdir*0.5cm,inner sep=1ex, outer sep=0pt, text width=\width,anchor=\textanchor,align=\textalign,font=\small,text=body]{\name};
% v1.6: Use accsupp so that the numeric number is copied/pasted too
\draw [*-,thin,emphasis] node [append after command={(\midangle:\midradius pt) -- (\midangle:\outerradius + 1ex) -- (\tikzlastnode)}] at (\midangle:\outerradius + 1ex) [xshift=\labelshiftdir*0.5cm,inner sep=1ex, outer sep=0pt, text width=\width,anchor=\textanchor,align=\textalign,font=\small,text=body]{\BeginAccSupp{method=pdfstringdef,ActualText={\name: \value}}\name\EndAccSupp{}};
% Set the old cumulated angle to the new value
\global\let\cumnum=\newcumnum
}
@ -273,24 +375,18 @@
\newcommand{\cvref}[3]{%
\smallskip
\textcolor{emphasis}{\textbf{#1}}\par
\begin{description}[font=\color{accent},style=multiline,leftmargin=1.35em]
\item[\normalfont\emailsymbol] #2
\item[\small\normalfont\mailsymbol] #3
\begin{description}[font=\color{accent},style=multiline,leftmargin=1.35em,align=left]
\item[\small\normalfont\emailsymbol] #2
\item[\small\normalfont\mailaddresssymbol] #3
\end{description}
% \medskip
}
\newenvironment{cvcolumn}[1]{\begin{minipage}[t]{#1}\raggedright}{\end{minipage}}
\RequirePackage[backend=biber,style=authoryear,sorting=ydnt]{biblatex}
%% For removing numbering entirely when using a numeric style
% \setlength{\bibhang}{1em}
% \DeclareFieldFormat{labelnumberwidth}{\makebox[\bibhang][l]{\itemmarker}}
% \setlength{\biblabelsep}{0pt}
\defbibheading{pubtype}{\cvsubsection{#1}}
\renewcommand{\bibsetup}{\vspace*{-\baselineskip}}
\AtEveryBibitem{\makebox[\bibhang][l]{\itemmarker}}
\setlength{\bibitemsep}{0.25\baselineskip}
% v1.5 Move biblatex-related code to separate .cfg file
% so that it's easier to change and customise the style for
% publication lists
% v1.1.2: make it easier to add a sidebar aligned with top of next page
\RequirePackage{afterpage}
@ -300,7 +396,36 @@
}
\newcommand{\addnextpagesidebar}[2][]{\afterpage{\addsidebar[#1]{#2}}}
\AtBeginDocument{%
% v1.6.5 But provide for ability to highlight names in publication list
\RequirePackage{pgffor}
\def\my@namelist{}
\newcommand{\mynames}[1]{\def\my@namelist{#1}}
\newtoggle{boldname}
\AddToHook{package/biblatex/after}{
\renewcommand*{\mkbibnamefamily}[1]{%
\global\togglefalse{boldname}%
\foreach \my@fname / \my@gname in \my@namelist {%
\ifboolexpr{ test {\ifdefstrequal{\namepartfamily}{\my@fname}}
and
test {\ifdefstrequal{\namepartgiven}{\my@gname}}}
{\global\toggletrue{boldname}}{}%
}%
\iftoggle{boldname}{\textbf{#1}}{#1}%
}
\renewcommand*{\mkbibnamegiven}[1]{%
\global\togglefalse{boldname}%
\foreach \my@fname / \my@gname in \my@namelist{%
\ifboolexpr{ test {\ifdefstrequal{\namepartfamily}{\my@fname}}
and
test {\ifdefstrequal{\namepartgiven}{\my@gname}}}
{\global\toggletrue{boldname}\breakforeach}{}%
}%
\iftoggle{boldname}{\textbf{#1}}{#1}%
}
}
\AddToHook{begindocument/before}{%
\pagestyle{empty}
\color{body}
\raggedright