Building on my answer to Make specific author bold using biblatex, which has a slightly more convenient user interface for the bold names, we can define the new command \printpublication
.
The exact working of the code for bold names is explained in the linked answer: The gist is that we write the names to an external .bib
and can then extract the hash automatically from the .bbl
file. With the hashes we can then go on to highlight the names, the hashes of interest are stored in a list.
The command \mkboldifhashinlist
highlights exactly those names for which the hashes are in the list of interest. With the definition in \DeclareNameWrapperFormat{given-family:hash:bold}
this macro can be applied to the complete name if so desired.
\printpublication
is a copy of \fullcite
with the \defcounter
s as well as the new bold name format thrown directly into the precode of \usedriver
.
\documentclass{article}
\usepackage[backend=biber, natbib=true, style=ieee, sorting=none,
doi=false, isbn=false, url=true]{biblatex}
\makeatletter
% auxiliary bibfile
\def\hlblx@bibfile@name{\jobname -boldnames.bib}
\newwrite\hlblx@bibfile
\immediate\openout\hlblx@bibfile=\hlblx@bibfile@name
\newcounter{hlblx@name}
\setcounter{hlblx@name}{0}
\newcommand*{\hlblx@writenametobib}[1]{%
\stepcounter{hlblx@name}%
\edef\hlblx@tmp@nocite{%
\noexpand\AfterPreamble{%
\noexpand\setbox0\noexpand\vbox{%
\noexpand\hlblx@getmethehash{hlblx@name@\the\value{hlblx@name}}}}%
}%
\hlblx@tmp@nocite
\immediate\write\hlblx@bibfile{%
@misc{hlblx@name@\the\value{hlblx@name}, author = {\unexpanded{#1}}, %
options = {dataonly=true},}%
}%
}
\AtEndDocument{%
\closeout\hlblx@bibfile}
\addbibresource{\hlblx@bibfile@name}
\newcommand*{\hlbxl@boldhashes}{}
\DeclareNameFormat{hlblx@hashextract}{%
\xifinlist{\thefield{hash}}{\hlbxl@boldhashes}
{}
{\listxadd{\hlbxl@boldhashes}{\thefield{fullhash}}}}
\DeclareCiteCommand{\hlblx@getmethehash}
{}
{\printnames[hlblx@hashextract][1-999]{author}}
{}
{}
% user-level macros
\newcommand*{\addboldnames}{\forcsvlist\hlblx@writenametobib}
\newcommand*{\resetboldnames}{\def\hlbxl@boldhashes{}}
\newcommand*{\mkboldifhashinlist}[1]{%
\xifinlist{\thefield{hash}}{\hlbxl@boldhashes}
{\mkbibbold{#1}}
{#1}}
\makeatother
\DeclareNameWrapperFormat{given-family:hash:bold}{%
\renewcommand*{\mkbibcompletename}{\mkboldifhashinlist}%
#1}
\DeclareCiteCommand{\printpublication}
{\usebibmacro{prenote}}
{\usedriver
{\DeclareNameAlias{sortname}{default}%
\DeclareNameWrapperAlias{default}{given-family:hash:bold}%
\defcounter{maxnames}{3}%
\defcounter{minnames}{1}}
{\thefield{entrytype}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\addboldnames{{Author, Arik}}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, Arik and Author, Jaz and Author, Ricky},
year = {2100},
title = {An unnecessary long title},
}
@book{A02,
author = {Author, Jaz and Author, Arik and Author, Ricky},
year = {2100},
title = {An unnecessary long title},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\printpublication{A01}
\printpublication{A02}
\printbibliography
\end{document}

edited to use a more elegant version to format complete names. \DeclareNameWrapperFormat
and \mkbibcompletename
are only available in biblatex
v3.12 (2018-10-30) and v3.13 (2019-08-17), respectively. Please refer to the edit history if you are using an older version of biblatex
.