# Highlight an author in bibliography using biblatex-gost package

When trying to use the solution for author highlighting from Highlight an author in bibliography using biblatex allowing bibliography style to format it it turned out that it perfectly works with default styles but stops working with biblatex-gost ones (well, at least with gost-numeric style I need, others were not tested). What should be changed to make it working?

\documentclass{article}
\usepackage[backend=biber,style=gost-numeric]{biblatex}% If one deletes "gost-" all becomes OK

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}

@incollection{Silva:2014a,
title={Radio Resource Management for Device-to-Device Communications in Long Term Evolution Networks},
author={Carlos F. M. Silva and Silva, Jr., Jos\'{e} Mairton B. and Tarcisio F. Maciel},
booktitle={Resource Allocation and {MIMO} for {4G} and Beyond},
year=2014,
editor={Francisco Rodrigo Porto Cavalcanti},
pages={105-156},
doi={10.1007/978-1-4614-8057-0_3},
isbn={978-1-4614-8056-3},
}
\end{filecontents}

\usepackage{xpatch}% or use https://tex.stackexchange.com/a/40705

\newbibmacro*{name:bold}[2]{%
\def\do##1{\iffieldequalstr{hash}{##1}{\bfseries\listbreak}{}}%
\dolistloop{\boldnames}%
}

\newcommand*{\boldnames}{}

\xpretobibmacro{name:last}{\begingroup\usebibmacro{name:bold}{#1}{#2}}{}{}
\xpretobibmacro{name:first-last}{\begingroup\usebibmacro{name:bold}{#1}{#2}}{}{}
\xpretobibmacro{name:last-first}{\begingroup\usebibmacro{name:bold}{#1}{#2}}{}{}
\xpretobibmacro{name:delim}{\begingroup\normalfont}{}{}

\xapptobibmacro{name:last}{\endgroup}{}{}
\xapptobibmacro{name:first-last}{\endgroup}{}{}
\xapptobibmacro{name:last-first}{\endgroup}{}{}
\xapptobibmacro{name:delim}{\endgroup}{}{}

\renewcommand*{\boldnames}{}
{{5e1df516fe8816ee66169b8616522816}}

\begin{document}
\fullcite{Silva:2014a}

\printbibliography
\end{document}


This answer was updated to work with newer versions of biblatex-gost. See the edit history for older versions.

biblatex-gost defines its own name formats for authors called headingname:family-given, so you need to patch this macro instead.

MWE

\documentclass{article}
\usepackage[backend=biber,style=gost-numeric]{biblatex}
\usepackage{xpatch}

\newcommand*{\boldnames}{}

\newcommand*{\doboldhashes}[1]{%
\iffieldequalstr{hash}{#1}
{\bfseries\listbreak}
{}}%

\newbibmacro*{name:bold}{%
\forlistloop{\doboldhashes}{\boldnames}%
}

\xpretobibmacro{name:delim}{\begingroup\normalfont}{}{}
\xapptobibmacro{name:delim}{\endgroup}{}{}

\renewcommand*{\boldnames}{}
{{5e1df516fe8816ee66169b8616522816}}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@incollection{Silva:2014a,
title={Radio Resource Management for Device-to-Device Communications in Long Term Evolution Networks},
author={Carlos F. M. Silva and Silva, Jr., Jos\'{e} Mairton B. and Tarcisio F. Maciel},
booktitle={Resource Allocation and {MIMO} for {4G} and Beyond},
year=2014,
editor={Francisco Rodrigo Porto Cavalcanti},
pages={105-156},
doi={10.1007/978-1-4614-8057-0_3},
isbn={978-1-4614-8056-3},
}
\end{filecontents}

For completing the answer above: name:delim affects the delimiter before the name, so depending on the desired effect, it may be necessary to patch it.
If not patched, the delimiter before boldcased names will be bold; if patched with \normalfont, it will be regular.