diff --git a/main_cv.tex b/main_cv.tex index 2e255fb..cb27241 100644 --- a/main_cv.tex +++ b/main_cv.tex @@ -15,21 +15,26 @@ \addbibresource[]{biblio.bib} % bold the name of specific author -\newcommand{\makeauthorbold}[1]{% +\usepackage{xstring} +\usepackage{etoolbox} +\newboolean{bold} +\newcommand{\makeauthorsbold}[1]{% \DeclareNameFormat{author}{% + \setboolean{bold}{false}% + \renewcommand{\do}[1]{\expandafter\ifstrequal\expandafter{\namepartfamily}{####1}{\setboolean{bold}{true}}{}}% + \docsvlist{#1}% \ifthenelse{\value{listcount}=1} {% - {\expandafter\ifstrequal\expandafter{\namepartfamily}{#1}{\mkbibbold{\namepartfamily\addcomma\addspace \namepartgiveni}}{\namepartfamily\addcomma\addspace \namepartgiveni}} - % + {\expandafter\ifthenelse{\boolean{bold}}{\mkbibbold{\namepartfamily\addcomma\addspace \namepartgiveni}}{\namepartfamily\addcomma\addspace \namepartgiveni}}% }{\ifnumless{\value{listcount}}{\value{liststop}} - {\expandafter\ifstrequal\expandafter{\namepartfamily}{#1}{\mkbibbold{\addcomma\addspace \namepartfamily\addcomma\addspace \namepartgiveni}}{\addcomma\addspace \namepartfamily\addcomma\addspace \namepartgiveni}} - {\expandafter\ifstrequal\expandafter{\namepartfamily}{#1}{\mkbibbold{\addcomma\addspace \namepartfamily\addcomma\addspace \namepartgiveni\addcomma\isdot}}{\addcomma\addspace \namepartfamily\addcomma\addspace \namepartgiveni\addcomma\isdot}}% + {\expandafter\ifthenelse{\boolean{bold}}{\mkbibbold{\addcomma\addspace \namepartfamily\addcomma\addspace \namepartgiveni}}{\addcomma\addspace \namepartfamily\addcomma\addspace \namepartgiveni}}% + {\expandafter\ifthenelse{\boolean{bold}}{\mkbibbold{\addcomma\addspace \namepartfamily\addcomma\addspace \namepartgiveni\addcomma\isdot}}{\addcomma\addspace \namepartfamily\addcomma\addspace \namepartgiveni\addcomma\isdot}}% } \ifthenelse{\value{listcount}<\value{liststop}} {\addcomma\space}{} } } -\makeauthorsbold{Zhirui,Luo} +\makeauthorsbold{Luo, Zhirui} % what is your name? \newcommand{\myname}{Zhirui Luo}