My name is Sponge Bob Squarepants. I want to find my name from the list of bibliographic entries and mark it in bold.
Minimum working example:
\documentclass{article}
\usepackage[style=numeric,citecounter=true,citetracker=true]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{myreferences.bib}
@article{sponge1,
author = {Sponge Bob Squrepants},
year = {2000},
title = {No Title},
}
@article{sponge2,
author = {Sponge Bob Squrepants and
Patrick Star},
year = {2001},
title = {No Title Again},
}
\end{filecontents*}
\addbibresource{myreferences.bib}
\begin{document}
\cite{sponge1}
\cite{sponge2}
\printbibliography
\end{document}
So, my names in both the cases (see the image) should be in bold.
For compatibility with other type of styles, it would be appreciated if the I can detect initial (i.e., S. B. Squarepants).
My attempt:
I could find \citename{sponge2}{author} to extract the author names. But I could not find how to search for the string.
Update: Found this solution due to user moewe.
%https://tex.stackexchange.com/a/334333/38244
\def\makenamesetup{%
\def\bibnamedelima{~}%
\def\bibnamedelimb{ }%
\def\bibnamedelimc{ }%
\def\bibnamedelimd{ }%
\def\bibnamedelimi{ }%
\def\bibinitperiod{.}%
\def\bibinitdelim{~}%
\def\bibinithyphendelim{.-}}
\newcommand*{\makename}[2]{\begingroup\makenamesetup\xdef#1{#2}\endgroup}
\newcommand*{\boldname}[3]{%
\def\lastname{#1}%
\def\firstname{#2}%
\def\firstinit{#3}}
\boldname{}{}{}
% Patch new definitions
\renewcommand{\mkbibnamegiven}[1]{%
\makename{\currname}{#1}%
\makename{\findname}{\firstname}%
\makename{\findinit}{\firstinit}%
\ifboolexpr{ test {\ifdefequal{\currname}{\findname}}%
or test {\ifdefequal{\currname}{\findinit}} }%
{\mkbibbold{#1}}{#1}%
}
\renewcommand{\mkbibnamefamily}[1]{%
\makename{\currname}{#1}%
\makename{\findname}{\lastname}%
\ifboolexpr{ test {\ifdefequal{\currname}{\findname}} }%
{\mkbibbold{#1}}{#1}%
}
\boldname{Squarepants}{Bob}{Sponge}
Now I want basically the same thing, but with underline. I tried looking for the underline equivalent of \mkbibbold, but no luck yet.

