I am writing my CV in LaTeX. I am using biblatex and want my name (and only my name) to be bold for every reference. Is there a magic way to do this?
A similar question
Make one author's name bold every time it shows up in the bibliography
[1] was asked, but that answer used BibTeX. While I use the BibTeX backend, I use biblatex.
Any suggestions?
Since biblatex 3.4/biber 2.5, there is a general "annotation" functionality to do things like this, for example:
\documentclass{article}
\usepackage{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@MISC{test,
AUTHOR = {Last1, First1 and Last2, First2 and Last3, First3},
AUTHOR+an = {2=highlight},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\renewcommand*{\mkbibnamegiven}[1]{%
\ifitemannotation{highlight}
{\textbf{#1}}
{#1}}
\renewcommand*{\mkbibnamefamily}[1]{%
\ifitemannotation{highlight}
{\textbf{#1}}
{#1}}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
You can also annotate at the name part level and the top-level field level. See the biblatex PDF manual for details.
biber performance and while biber is never going to be as fast as bibtex (partly because it does a lot more than bibtex in the biblatex use case), it currently shows, in version 2.5, 400% speed improvement in the large test cases I used for tuning compared with any previous versions. - PLK
\renewcommand macros in \AtEveryBibitem so that they only apply to bibliography items. - PLK
AUTHOR+an = {1=highlight;2=highlight}, - Tom
\textcite? I only want the name bold in the bibliography or when doing \fullcite. - FWDekker
ACCEPTED]
You can patch the name:last, name:first-last and name:last-first macros defined in biblatex.def. These are used by all of the default name formatting directives and take four arguments:
{<last name>}{<first name>}{<name prefix>}{<name affix>}
or
{<last name>}{<first name (initials)>}{<name prefix>}{<name affix>}
In the following we match only on the first and last name parts.
\documentclass{article}
\usepackage{biblatex}
\usepackage{xpatch}% or use http://tex.stackexchange.com/a/40705
\makeatletter
\newbibmacro*{name:bold}[2]{%
\edef\blx@tmp@name{\expandonce#1, \expandonce#2}%
\def\do##1{\ifdefstring{\blx@tmp@name}{##1}{\bfseries\listbreak}{}}%
\dolistloop{\boldnames}}
\newcommand*{\boldnames}{}
\makeatother
\xpretobibmacro{name:family}{\begingroup\usebibmacro{name:bold}{#1}{#2}}{}{}
\xpretobibmacro{name:given-family}{\begingroup\usebibmacro{name:bold}{#1}{#2}}{}{}
\xpretobibmacro{name:family-given}{\begingroup\usebibmacro{name:bold}{#1}{#2}}{}{}
\xpretobibmacro{name:delim}{\begingroup\normalfont}{}{}
\xapptobibmacro{name:family}{\endgroup}{}{}
\xapptobibmacro{name:given-family}{\endgroup}{}{}
\xapptobibmacro{name:family-given}{\endgroup}{}{}
\xapptobibmacro{name:delim}{\endgroup}{}{}
% just for demonstration
\ExecuteBibliographyOptions{maxnames=99,giveninits}
\DeclareNameAlias{default}{family-given/given-family}
\addbibresource{biblatex-examples.bib}
\forcsvlist{\listadd\boldnames}
{{Herrmann, Wolfgang~A.}, {Herrmann, W.~A.}, {Herrmann, Wolfgang\bibnamedelima A.},
{Herrmann, W\bibinitperiod\bibinitdelim A\bibinitperiod}}
\setlength{\parindent}{0pt}
\setlength{\parskip}{\baselineskip}
\begin{document}
\fullcite{herrmann}
\forcsvlist{\listadd\boldnames}
{{{\"{O}}fele, Karl}, {{\"{O}}fele, K.}, {{\"{O}}fele, K\bibinitperiod}}
\fullcite{herrmann}
\renewcommand*{\boldnames}{}
\forcsvlist{\listadd\boldnames}
{{Hoffmann, Stephan~D.}, {Hoffmann, S.~D.}, {Hoffmann, Stephan\bibnamedelima D.},
{Hoffmann, S\bibinitperiod\bibinitdelim D\bibinitperiod}}
\fullcite{herrmann}
\end{document}

Note that the name parts in the \boldnames etoolbox internal list should follow the format of the bbl file, which is backend-dependent. The example here covers both biber and BibTeX. With biber you can also perform matching using the hash field:
\iffieldequalstr{hash}{<hash string>}
where <hash string> can also be found in the bbl file.
If your name is consistently formatted in the bib file an alternative approach is to normalize name punctuation before matching. This example allows you to specify your name in BibTeX's format regardless of the backend.
\documentclass{article}
\usepackage{biblatex}
\usepackage{xpatch}% or use http://tex.stackexchange.com/a/40705
\def\makenamesetup{%
\def\bibnamedelima{~}%
\def\bibnamedelimb{ }%
\def\bibnamedelimc{ }%
\def\bibnamedelimd{ }%
\def\bibnamedelimi{ }%
\def\bibinitperiod{.}%
\def\bibinitdelim{~}%
\def\bibinithyphendelim{.-}}
\newcommand*{\makename}[3]{\begingroup\makenamesetup\xdef#1{#2, #3}\endgroup}
\newbibmacro*{name:bold}[2]{%
\makename{\currname}{#1}{#2}%
\makename{\findname}{\lastname}{\firstname}%
\makename{\findinit}{\lastname}{\firstinit}%
\ifboolexpr{ test {\ifdefequal{\currname}{\findname}}
or test {\ifdefequal{\currname}{\findinit}} }{\bfseries}{}}
\newcommand*{\boldname}[3]{%
\def\lastname{#1}%
\def\firstname{#2}%
\def\firstinit{#3}}
\boldname{}{}{}
\xpretobibmacro{name:family}{\begingroup\usebibmacro{name:bold}{#1}{#2}}{}{}
\xpretobibmacro{name:given-family}{\begingroup\usebibmacro{name:bold}{#1}{#2}}{}{}
\xpretobibmacro{name:family-given}{\begingroup\usebibmacro{name:bold}{#1}{#2}}{}{}
\xpretobibmacro{name:delim}{\begingroup\normalfont}{}{}
\xapptobibmacro{name:family}{\endgroup}{}{}
\xapptobibmacro{name:given-family}{\endgroup}{}{}
\xapptobibmacro{name:family-given}{\endgroup}{}{}
\xapptobibmacro{name:delim}{\endgroup}{}{}
% just for demonstration
\ExecuteBibliographyOptions{maxnames=99,giveninits}
\DeclareNameAlias{default}{family-given/given-family}
\addbibresource{biblatex-examples.bib}
\boldname{Herrmann}{Wolfgang~A.}{W.~A.}
\setlength{\parindent}{0pt}
\setlength{\parskip}{\baselineskip}
\begin{document}
\fullcite{herrmann}
\boldname{{\"O}fele}{Karl}{K.}
\fullcite{herrmann}
\boldname{Hoffmann}{Stephan~D.}{S.~D.}
\fullcite{herrmann}
\end{document}

This answer was updated to work with versions >= 3.3 of
biblatex. See the edit history for older versions ofbiblatex. -- moewe
biber backend. Will this make it easier? - jlconlin
\DeclareSourceMap, but it's the processed data that really matters - initials, location in the name list, etc. Biber also creates a hash string to identify each name, but its value isn't very meaningful. - Audrey
\newbibmacro*{name:bold}[2]{\iffieldequalstr{hash}{aa1a2c66bf52b23789b077a79ac34863}{\bfseries}{}} would bold the first author's name. I pulled this hash string from the bbl file. - Audrey
bbl file, but isn't the loop over the boldnames csvlist obsolete in that case? - K.-Michael Aye
name:* macros with \begingroup\iffieldequalstr{hash}{aa1a2c66bf52b23789b077a79ac34863}{\bfseries}{} and append with \endgroup. - Audrey
first and last were deprecated in favor of given and family, respectively? Making the relevant changes fixes the second MWE in your answer, but even after making those changes, the first MWE no longer works for me. - Adam Liter
style=apa and it stopped working. To test it, replace \usepackage{biblatex} in the MWE above by \usepackage[american]{babel} \usepackage{csquotes} \usepackage[style=apa]{biblatex} \DeclareLanguageMapping{american}{american-apa}. Any suggestions how this can be fixed? Thank you! - tmalsburg
As I couldn't use https://tex.stackexchange.com/a/73246/7561 as well, and in case others stumble into this looking for a solution, I'm updating the answers. As pointed by Adam Liter, in the comments of that answer, the options used in the previous answer are deprecated and doesn't work (at least for me).
Instead, I redefined the \mkbibnamegiven and \mkbibnamefamily, and used the same ideas as before.
Basically, you use the \boldname to the define the name you want to mark as bold, like: \boldname{Lastname}{Givenname}{G.}.
\newcommand*{\boldname}[3]{%
\def\lastname{#1}%
\def\firstname{#2}%
\def\firstinit{#3}}
\boldname{}{}{}
Then, we redefine the macros that generate the given and family names. The main idea is to search for the named defined above, and if it is found (including the given and family name) it makes it bold (using \mkbibbold), if not it leaves it as is.
% Patch new definitions
\renewcommand{\mkbibnamegiven}[1]{%
\ifboolexpr{ ( test {\ifdefequal{\firstname}{\namepartgiven}} or test {\ifdefequal{\firstinit}{\namepartgiven}} ) and test {\ifdefequal{\lastname}{\namepartfamily}} }
{\mkbibbold{#1}}{#1}%
}
\renewcommand{\mkbibnamefamily}[1]{%
\ifboolexpr{ ( test {\ifdefequal{\firstname}{\namepartgiven}} or test {\ifdefequal{\firstinit}{\namepartgiven}} ) and test {\ifdefequal{\lastname}{\namepartfamily}} }
{\mkbibbold{#1}}{#1}%
}
A full example:
% !BIB program = biber
\documentclass{article}
\usepackage[backend=biber,maxbibnames=99,defernumbers=true,sorting=ydnt,giveninits=true]{biblatex}
\begin{filecontents}{\jobname.bib}
@InProceedings{identifier1,
Title = {Some Awesome Title},
Author = {Some Author and Another Author},
Booktitle = {Some Book about the Future},
Year = {2042},
Pages = {1--42}
}
@InProceedings{identifier2,
Title = {Some So-So Title},
Author = {First Author and Second Author},
Booktitle = {An okay Booktitle},
Year = {2000},
Pages = {1--100}
}
@Book{test1,
author = {Goossens, Michel and Mittelbach, Frank
and Samarin, Alexander},
title = {The LaTeX Companion},
publisher = {Addison-Wesley},
location = {Reading, Mass.},
year = {1994},
}
@Book{test2,
author = {Mittelbach, F. and Goossens, Michel
and Samarin, Alexander},
title = {The LaTeX Companion},
publisher = {Addison-Wesley},
location = {Reading, Mass.},
year = {1994},
}
@Book{test3,
author = {Mittelbach, Frank and Samarin, Alexander
and Goossens, Michel},
title = {The LaTeX Companion},
publisher = {Addison-Wesley},
location = {Reading, Mass.},
year = {1994},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\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]{%
\ifboolexpr{ ( test {\ifdefequal{\firstname}{\namepartgiven}} or test {\ifdefequal{\firstinit}{\namepartgiven}} ) and test {\ifdefequal{\lastname}{\namepartfamily}} }
{\mkbibbold{#1}}{#1}%
}
\renewcommand{\mkbibnamefamily}[1]{%
\ifboolexpr{ ( test {\ifdefequal{\firstname}{\namepartgiven}} or test {\ifdefequal{\firstinit}{\namepartgiven}} ) and test {\ifdefequal{\lastname}{\namepartfamily}} }
{\mkbibbold{#1}}{#1}%
}
\boldname{Author}{Some}{S.}
\begin{document}
\nocite{*}
\printbibliography
\boldname{Goossens}{Michel}{M.}
\printbibliography
\boldname{Mittelbach}{Frank}{F.}
\printbibliography
\end{document}
Added support for checking given and family names before bolding the name.
\boldname{van Gut Goossens}{Michel}{M.} or when the name comes in multiple forms as in the short version of your example and this long version. One solution I tried, and could would work for some purposes would be to highlight just at last word in the name, \boldname{Goossens}{}{}, but that doesn't highlight anything at all. Any ideas for a workaround? Cheers. - fridaymeetssunday
This is more or less a copy of my answer to Highlight an author in bibliography using biblatex allowing bibliography style to format it [1].
The following implements
Audrey's solution
[2] for name hashes. The advantage of using hashes is that you only have to give one version of the name, all normalisation will be performed by Biber. The great disadvantage of hashes is that they are not easy to handle for humans. biblatex can't create the hashes on the fly, so that they need to be looked up in the .bbl file. The following solution automates hash lookup from the .bbl, so that you can use it more easily.
The solution works by writing all names you want in bold to dummy entries in a separate .bib file called \jobname -boldnames.bib (Warning That file will be overwritten without warning. In the unlikely event you already have a file of that name, you can rename the file by changing the command \hlblx@bibfile@name.). Biber then calculates the name hashes for us. These hashes can then be extracted using a dummy cite command (\nhblx@getmethehash) and are added to a list of names, which we can test against. All of this is hidden in higher-level macros and happens automatically, so you don't have to worry about the details.
Usage is very simple. Use \addboldnames to add a list of names to be highlighted. \addboldnames accepts a comma-separated list of names in the same format as you would write them to the .bib file. If a name contains a comma, the entire name must be wrapped in curly braces.
\addboldnames{{Silva, Carlos F. M.},{Silva, Jr., José Mairton B.}}
or
\addboldnames{Emma Sigfridsson}
\addboldnames can be used in the preamble and the document body.
To reset the list of names to be highlighted, use \resetboldnames.
In the name formatting directives we can now use \mkboldifhashinlist to check if the current name is in the list of names for bolding.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[backend=biber,style=numeric]{biblatex}
\makeatletter
\def\nhblx@bibfile@name{\jobname -nhblx.bib}
\newwrite\nhblx@bibfile
\immediate\openout\nhblx@bibfile=\nhblx@bibfile@name
\immediate\write\nhblx@bibfile{%
@comment{Auto-generated file}\blx@nl}
\newcounter{nhblx@name}
\setcounter{nhblx@name}{0}
\newcommand*{\nhblx@writenametobib}[1]{%
\stepcounter{nhblx@name}%
\edef\nhblx@tmp@nocite{%
\noexpand\AfterPreamble{%
\noexpand\setbox0\noexpand\vbox{%
\noexpand\nhblx@getmethehash{nhblx@name@\the\value{nhblx@name}}}}%
}%
\nhblx@tmp@nocite
\immediate\write\nhblx@bibfile{%
@misc{nhblx@name@\the\value{nhblx@name}, author = {\unexpanded{#1}}, %
options = {dataonly=true},}%
}%
}
\AtEndDocument{%
\closeout\nhblx@bibfile}
\addbibresource{\nhblx@bibfile@name}
\newcommand*{\nhblx@boldhashes}{}
\DeclareNameFormat{nhblx@hashextract}{%
\xifinlist{\thefield{hash}}{\nhblx@boldhashes}
{}
{\listxadd{\nhblx@boldhashes}{\thefield{hash}}}}
\DeclareCiteCommand{\nhblx@getmethehash}
{}
{\printnames[nhblx@hashextract][1-999]{author}}
{}
{}
\newcommand*{\addboldnames}{\forcsvlist\nhblx@writenametobib}
\newcommand*{\resetboldnames}{\def\nhblx@boldhashes{}}
\newcommand*{\ifhashinboldlist}{%
\xifinlist{\thefield{hash}}{\nhblx@boldhashes}}
\makeatother
\newcommand*{\mkboldifhashinlist}[1]{%
\ifhashinboldlist
{\mkbibbold{#1}}
{#1}}
\DeclareNameWrapperFormat{boldifhashinlist}{%
\renewcommand*{\mkbibcompletename}{\mkboldifhashinlist}%
#1}
\DeclareNameWrapperAlias{sortname}{default}
\DeclareNameWrapperAlias{default}{boldifhashinlist}
\addboldnames{{Sigfridsson, Emma},{Vizedom, Monika B.}}
\addbibresource{biblatex-examples.bib}
\begin{document}
\fullcite{sigfridsson}
\fullcite{knuth:ct:a}
\fullcite{vizedom:related}
\resetboldnames\addboldnames{Donald E. Knuth}
\fullcite{knuth:ct:a}
\resetboldnames\addboldnames{Philipp Jaff{\'e}}
\fullcite{jaffe}
\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.
biblatex are concerned these two are different people. How would they know differently? - moewe
There is still an issue with the last answer by adn: The sub macros that use the Strings in \boldname{Goossens}{Michel}{M.} only search for these strings (i.e., "Goossens", "Michel", and "M.") independently of each other. That is: any occurrence of "M." will be bold, no matter whether it belongs to a different author (like "M." for "Martin"). Improving the search scripts to only make the respective names bold if they are detected in a sequence would solve this behavior. In its current form, its usefulness is quite limited given there are more than just a couple of references.
Here a MWE that shows the problem:
\documentclass{article}
\usepackage[backend=biber,maxbibnames=99,defernumbers=true,sorting=ydnt,giveninits=true]{biblatex}
\begin{filecontents}{\jobname.bib}
@InProceedings{identifier1,
Title = {Some Awesome Title},
Author = {Some Author and Another Author},
Booktitle = {Some Book about the Future},
Year = {2042},
Pages = {1--42}
}
@InProceedings{identifier2,
Title = {Some So-So Title},
Author = {First Author and Second Author},
Booktitle = {An okay Booktitle},
Year = {2000},
Pages = {1--100}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\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{Author}{Some}{S.}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
It produces the following PDF, in which:
(a) all occurrences of "S." are bold, although one stands for "Second", which does not belong to the name "Some Author" and
(b) all occurrences of "Author" are bold (i.e., all four authors!), although just one matches the desired author "Some Author"
I hence propose another solution, which does solve this problem (however, there are other problems with it - and I would be glad if someone would present a solution for it). The solution was mentioned in
Make one author's name bold every time it shows up in the bibliography
[1] (this link is also given in the very first post here one that page). However, (a) it does work with biblatex, although jlconlin says that it only works with bibtex and (b) I have extended it a bit to provide some further functionalities that you would not get without it (but that are provided by the previous answer, given by adn).
That solution simply uses a macro in the bibtex files instead of the actual authors' names. Then, the \textbf{} macro does work, while the document would not compile if \textbf{} would be inserted directly in the .bib file.
\documentclass{article}
\usepackage[backend=biber,maxbibnames=99,defernumbers=true,sorting=ydnt,giveninits=true]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@InProceedings{identifier1,
Title = {Some Awesome Title},
Author = {\MyName[someKey]{S. Author} and Another Author},
Booktitle = {Some Book about the Future},
Year = {2042},
Pages = {1--42}
}
@InProceedings{identifier2,
Title = {Some So-So Title},
Author = {First Author and Second Author},
Booktitle = {An okay Booktitle},
Year = {2000},
Pages = {1--100}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\newcommand{\MyName}[2][\empty]{ % \empty is default for the opt. argument
\ifthenelse{\equal{#1}{\empty}} % test the opt. argument
{\hspace*{-.75mm}#2} % it's empty! just show mand. argument
{\hspace*{-.75mm}\textbf{#2}} % it's not empty! make mand. argument (the name) bold
}
\nocite{*}
\printbibliography
\end{document}
It produces the following PDF:

As can be seen: the problem is solved, as exactly those authors are shown bold that use the macro. To be more precise: the is now an optional argument, which can be instantiated by any String of the user's choice. This "key" can be used in the definition of \MyName to define more specific behavior. For instance, I use biblatex to use keywords (given in an extra keywords fields - not given here) in order to give several reference sections, divided by the keywords. If making an author's name bold should depend on that keyword (which is the case for me), that logic can be put into the if-then statement. (In my example, the name in the \MyName macro is shown bold if there is any keyword given and non-bold, otherwise. This can be extended -- obviously -- to match any specific key.
It is important to know that this solution does not support to abbreviate the authors' names given in the macro. You will see that I passed "S. Author" to \MyName instead of "Some Author", because latex/bibtex cannot produce "S. Author" from it. However, this does not make this solution any less practical, I think.
Its problem: All names which are put into the \MyName macro appear more to the right than without using the macro. That is, there is a space of approx. 2mm on the left of any such name. This occurs independently of the matching if case, i.e., no matter whether it is bold or not. This is the reason why I have added a negative \hspace in front of it. However,
(a) this quiet dirty. Isn't there a (la)tex macro that eliminates the additional space? and
(b) it is impossible to find the correct space that needs to be subtracted, because it is different for different bibtex entries (sometimes this automatically inserted space is larger, sometimes it is smaller)
Combining solution by adn, and suggestion by Audrey to use the "hash" field generated by biber, this works (texlive 2017.20170818-1):
\documentclass{article}
\usepackage[backend=biber,maxbibnames=99,defernumbers=true,sorting=ydnt,giveninits=true]{biblatex}
\addbibresource{biblatex-examples.bib}
% Run biber once, find the hash you want in the generated .bbl file
% (here, M. Goossens) and paste here:
\edef\authorhash{\detokenize{0743efb276e9219ee664a9b3dbd60619}}
\renewcommand{\mkbibnamegiven}[1]{%
\iffieldequals{hash}{\authorhash}{\mkbibbold{#1}}{#1}}
\renewcommand{\mkbibnamefamily}[1]{%
\iffieldequals{hash}{\authorhash}{\mkbibbold{#1}}{#1}}
\renewcommand{\mkbibnameprefix}[1]{%
\iffieldequals{hash}{\authorhash}{\mkbibbold{#1}}{#1}}
\renewcommand{\mkbibnamesuffix}[1]{%
\iffieldequals{hash}{\authorhash}{\mkbibbold{#1}}{#1}}
\begin{document}
\nocite{companion}
\printbibliography
\end{document}
Edit: Following moewe's good advices, fixes and verifications (thanks !) :
Patching name: as suggested by Audrey would indeed be more efficient but apparently it does not work anymore for some reason (see comment
Make specific author bold using biblatex
[1]).
biblatex-examples, a file that is automatically available if biblatex is installed, instead of mybiblio.bib, which we don't have. You can avoid having to paste the hash twice if you save it in a macro. Note also that if the name has a suffix or prefix that will not be printed in bold with your solution. - moewe
\edef\boldname{\detokenize{0743efb276e9219ee664a9b3dbd60619}} \renewcommand{\mkbibnamegiven}[1]{% \iffieldequals{hash}{\boldname}{\mkbibbold{#1}}{#1}% } \renewcommand{\mkbibnamefamily}[1]{% \iffieldequals{hash}{\boldname}{\mkbibbold{#1}}{#1}% } (modulo line breaks) works for me. The hashes are detokenized so we need to do the same. \mkbibnamesuffix and \mkbibnameprefix should work, not sure how you added the fields by hand. The great advantage of Audrey's patching the name: macros instead of \mkbibname... is that the entire name is processed in one go ... - moewe
name: does still work, but you have to replace last by family and first by given. There were some change in name handling in version 3.3, see tex.stackexchange.com/q/299036/35864 - moewe
hashes that works. - moewe
As of biblatex 3.13 (released 2019-08-17), there is the \mkbibcompletename command.
In the preamble:
\renewcommand*{\mkbibcompletename}[1]{%
\ifitemannotation{highlight}
{\textbf{#1}}% e.g., 𝐘𝐨𝐝𝐚, 𝐌𝐚𝐬𝐭𝐞𝐫 (if highlight)
{#1}% e.g., Yoda, Master (otherwise)
}
Now to annotate authors "2" and "4" as highlight authors:
@inproceedings{skywalker4096history,
author = {Skywalker, Anakin and Yoda, Master and Kenobi, Obi-Wan and Windu, Mace},
author+an = {2=highlight;4=highlight},
title = {The History of Jedi Knights},
date = {4096},
booktitle = {Proceedings of the Jedi Council},
}
Output:
Another easy solution is to use the publist package [1]
It doesn't require to modify the bib file (like in PLK answer [2]) especially useful if the file is generated automatically. It also works correctly with more complex family name (with two words for example) as opposed to Audrey's answer [3]. The package adds also some other nice features for generating publication list.
Syntax it pretty straightforward and concise:
\documentclass{article}
\usepackage[%
bibstyle=publist,
backend=biber,
defernumbers=true,
sorting=ydnt,
natbib=true,
maxbibnames=99,
giveninits=true,
isbn=false,doi=false,url=false,eprint=false, %
plauthorhandling=highlight,boldyear=false %
]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@InProceedings{identifier1,
Title = {Some Awesome Title},
Author = {My Family Name, MyForname and Author, Another},
Booktitle = {Some Book about the Future},
Year = {2042},
Pages = {1--43}
}
@InProceedings{identifier2,
Title = {Some So-So Title},
Author = {Author, Another and My Family Name, M.},
Booktitle = {An okay Booktitle},
Year = {2000},
Pages = {1--100}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\plauthorname[MyForname][]{My Family Name}
\plauthorname[M.][]{My Family Name}
\nocite{*}
\printbibliography
\end{document}
[1] https://www.ctan.org/pkg/biblatex-publist\bibnamedelima added by the backend. - moewe
\bibnamedelima, so they should work as well provided you find the right input for the macros. - moewe
I had the most annoying variation on this problem:
I eventually figured out how to satisfy all of these and end up with pretty compact code. I loop over a list of authors to highlight and match on both the family name and the first initial of the given name, also checking the biblatex data for the year.
\documentclass{article}
\usepackage{biblatex}
\usepackage{xstring} % Used for string matching
\newcommand{\mkmatchformat}{}%
\newcommand{\matchbold}{%
\renewcommand{\mkmatchformat}{}%
\renewcommand\do[1]{%
\StrCut{##1}{.}\csinit\cstmp
\StrCut{\cstmp}{,}\csfam\csyear
\ifboolexpr{%
test {\IfBeginWith{\namepartgiven}{\csinit}}%
and test {\IfSubStr{\namepartfamily}{\csfam}}%
and test {\ifnumcomp{\thefield{year} + 1}{>}{\csyear}}%
}{%
\renewcommand{\mkmatchformat}{\mkbibbold}%
\listbreak%
}{}%
}%
\dolistloop{\mylab}%
\mkmatchformat{\printname}%
}
\newcommand{\printname}{}
\renewcommand{\mkbibnamefamily}[1]{%
\renewcommand\printname{#1}%
\matchbold{}%
}
\renewcommand{\mkbibnamegiven}[1]{%
\renewcommand\printname{#1}%
\matchbold{}
}
% Test data.
\addbibresource{biblatex-examples.bib}
% List names to match using the first initial of given name, family name,
% and earliest year pubilcation for which name should be highlighted.
% Format {I.Familyname,year}.
\newcommand*{\mylab}{}
\listadd{\mylab}{D.Knuth,1986}
\listadd{\mylab}{S.Kullback,1990}
\listadd{\mylab}{W.Herrmann,2000}
\listadd{\mylab}{S.Hoffmann,2000}
\listadd{\mylab}{S.Schneider,2008}
% Bibformat so we can see all the names.
\ExecuteBibliographyOptions{maxnames=99,giveninits}
\begin{document}
\fullcite{knuth:ct:b}
\fullcite{knuth:ct:c}
\fullcite{knuth:ct:a}
\fullcite{kullback}
\fullcite{kullback:related}
\fullcite{herrmann}
\end{document}
DeclareSourcemap-- see for example here: tex.stackexchange.com/questions/62779/… - Marco Daniel\mkbibbold. So the author field looks like this:author={A. Lastname, \mkbibbold{Your name}, A. Lastname}You should use biber though. - rowmanbiblatex. The other question doesn't specifically mentionbiblatex, so not all answers use it and those that do usebiblatexare by far not as sophisticated as the six answers presented here. If you insist that the should be only one such question, please raise this on meta and ask the mods to merge the answers as well. Just making this a duplicate has the potential to bury lots of good answers behind the duplicate banner. - moewe