From cd048cbae24c51668cd4bfbea9206692454659d0 Mon Sep 17 00:00:00 2001 From: chapeau Date: Sat, 11 Nov 2023 18:16:21 +0100 Subject: [PATCH] update altacv --- .woodpecker.yml | 2 +- altacv.cls | 92 +++++++++++++++++++++++++++++++++++++----------- main.tex | 5 +-- page2sidebar.tex | 0 4 files changed, 75 insertions(+), 24 deletions(-) create mode 100644 page2sidebar.tex diff --git a/.woodpecker.yml b/.woodpecker.yml index 3f78cff..a4ed0dc 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -6,4 +6,4 @@ steps: - name: compile image: git.faercol.me/faercol/latex:latest commands: - - pdflatex index.tex + - pdflatex main.tex diff --git a/altacv.cls b/altacv.cls index 0b856d8..995dec4 100644 --- a/altacv.cls +++ b/altacv.cls @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%% -% This is altacv.cls (v1.6.4, 13 Nov 2021) written by +% This is altacv.cls (v1.7.1, 25 Aug 2023) written by % LianTze Lim (liantze@gmail.com). % %% It may be distributed and/or modified under the @@ -19,7 +19,7 @@ %%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesClass{altacv}[2021/10/04 AltaCV v1.6.4, yet another alternative class for a resume/curriculum vitae.] +\ProvidesClass{altacv}[2023/08/25 AltaCV v1.7.1, yet another alternative class for a resume/curriculum vitae.] %% v1.1: Optionally load academicons %% v1.4: Nope, academicons is unnecessary; fontawesome5 has \faOrcid. @@ -96,21 +96,27 @@ \colorlet{body}{black!80!white} \colorlet{name}{heading} \colorlet{tagline}{accent} -\newcommand{\itemmarker}{{\small\textbullet}} -\newcommand{\ratingmarker}{\faCircle} +% Renamed or added v1.7 +\newcommand{\cvItemMarker}{{\small\textbullet}} +\newcommand{\cvRatingMarker}{\faCircle} +\let\itemmarker\cvItemMarker % for backward compatibility +\let\ratingmarker\cvRatingMarker % for backward compatibility +\newcommand{\cvDateMarker}{\faCalendar[regular]} +\newcommand{\cvLocationMarker}{\faMapMarker} +\newcommand{\locationname}{Location} +\newcommand{\datename}{Date} \RequirePackage{tikz} \usetikzlibrary{arrows} \RequirePackage[skins]{tcolorbox} \RequirePackage[inline]{enumitem} \setlist{leftmargin=*,labelsep=0.5em,nosep,itemsep=0.25\baselineskip,after=\vspace{0.25\baselineskip}} -\setlist[itemize]{label=\itemmarker} +\setlist[itemize]{label=\cvItemMarker} \RequirePackage{graphicx} \RequirePackage{trimclip} \RequirePackage{dashrule} \RequirePackage{multirow,tabularx} \RequirePackage{changepage} -% \RequirePackage{marginfix} \setlength{\parindent}{0pt} \newcommand{\divider}{\textcolor{body!30}{\hdashrule{\linewidth}{0.6pt}{0.5ex}}\medskip} @@ -139,21 +145,26 @@ %% 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 +%% v1.7: Some tweaks/corrections so that accsupp is for icons only +%% v1.7.1: Bugfix to support some symbol commands e.g. academicons commands \ExplSyntaxOn \NewDocumentCommand{\printinfo}{m m o}{% - \BeginAccSupp{method=escape,ActualText={#1:~#2}} \IfNoValueTF{#3}{% - \mbox{\textcolor{accent}{\normalfont #1}~\utffriendlydetokenize{#2}\hspace{2em}}% + \mbox{\textcolor{accent}% + {\BeginAccSupp{method=escape,ActualText={\detokenize{#1}:}}\normalfont #1\EndAccSupp{}}% + ~\utffriendlydetokenize{#2}\hspace{2em}}% }{% \if@withhyper% - \mbox{\textcolor{accent}{\normalfont #1}~ - \href{#3}{\utffriendlydetokenize{#2}}\hspace{2em}} + \mbox{\textcolor{accent}% + {\BeginAccSupp{method=escape,ActualText={\detokenize{#1}:}}\normalfont #1\EndAccSupp{}}% + ~\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}}% + \mbox{\textcolor{accent} + {\BeginAccSupp{method=escape,ActualText={\detokenize{#1}:}}\normalfont #1\EndAccSupp{}}% + ~{\utffriendlydetokenize{#3#2}}\hspace{2em}}% \fi% }% - \EndAccSupp{} }% @@ -200,8 +211,7 @@ \NewInfoField{github}{\faGithub}[https://github.com/] % v1.?? Use fontawesome5 for Orcid symbol \NewInfoField{orcid}{\faOrcid}[https://orcid.org/] -%\NewInfoField{location}{\faMapMarker} -\NewInfoField{version}{\faCodeBranch} +\NewInfoField{location}{\cvLocationMarker} % v1.2: Support for multiple photos \newlength{\altacv@photos@width} @@ -280,20 +290,30 @@ } % v1.1.4: fixes inconsistent font size +% v1.7: adds accsupp ActualText for location and date markers \newcommand{\cvevent}[4]{% {\large\color{emphasis}#1\par} \smallskip\normalsize \ifstrequal{#2}{}{}{ \textbf{\color{accent}#2}\par \smallskip} - \ifstrequal{#3}{}{}{{\small\makebox[0.5\linewidth][l]{\faCalendar~#3}}}% - \ifstrequal{#4}{}{}{{\small\makebox[0.5\linewidth][l]{\faMapMarker~#4}}}\par + \ifstrequal{#3}{}{}{% + {\small\makebox[0.5\linewidth][l]% + {\BeginAccSupp{method=pdfstringdef,ActualText={\datename:}}\cvDateMarker\EndAccSupp{}% + ~#3}% + }}% + \ifstrequal{#4}{}{}{% + {\small\makebox[0.5\linewidth][l]% + {\BeginAccSupp{method=pdfstringdef,ActualText={\locationname:}}\cvLocationMarker\EndAccSupp{}% + ~#4}% + }}\par \medskip\normalsize } +% v1.7: adds accsupp for the icon as well \newcommand{\cvachievement}[3]{% \begin{tabularx}{\linewidth}{@{}p{2em} @{\hspace{1ex}} >{\raggedright\arraybackslash}X@{}} - \multirow{2}{*}{\Large\color{accent}#1} & \bfseries\textcolor{emphasis}{#2}\\ + \multirow{2}{*}{\Large\color{accent}\BeginAccSupp{method=escape,ActualText={#1: }}#1\EndAccSupp{}} & \bfseries\textcolor{emphasis}{#2}\\ & #3 \end{tabularx}% \smallskip @@ -310,9 +330,9 @@ \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}% + {\clipbox*{0pt -0.25ex {.5\width} {\totalheight}}{\color{accent}\cvRatingMarker}% + \clipbox*{{.5\width} -0.25ex {\width} {\totalheight}}{\color{body!30}\cvRatingMarker}} + {\ifdimgreater{\x bp}{#2 bp}{\color{body!30}}{\color{accent}}\cvRatingMarker}% }\EndAccSupp{}\par% } @@ -396,8 +416,38 @@ } \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 } + diff --git a/main.tex b/main.tex index 710ecf3..abd56de 100644 --- a/main.tex +++ b/main.tex @@ -1,5 +1,5 @@ \PassOptionsToPackage{dvipsnames}{xcolor} -\documentclass[10pt,a4paper]{altacv} +\documentclass[10pt,a4paper,withhyper]{altacv} %Layout \geometry{left=1cm,right=8cm,marginparwidth=6cm,marginparsep=1cm,top=1.25cm,bottom=1.25cm,footskip=2\baselineskip} @@ -24,6 +24,7 @@ \renewcommand{\itemmarker}{{\small\textbullet}} \renewcommand{\ratingmarker}{\faCircle} +\NewInfoField{git}{\faCodeBranch}[https://git.chapoline.me/chapeau/cv/src/tag/] \begin{document} \name{Caroline Canebier} @@ -32,7 +33,7 @@ \email{caroline@canebier.fr} \phone{+33 6 85 90 68 16} \linkedin{www.linkedin.com/in/caroline-canebier} - \version{\textit{CV v2.1.4}} + \git{v2.1.4} } % diff --git a/page2sidebar.tex b/page2sidebar.tex new file mode 100644 index 0000000..e69de29