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 (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)
DeclareSourcemap
-- see for example here: tex.stackexchange.com/questions/62779/… – Marco Daniel Sep 19 '12 at 5:09\mkbibbold
. So the author field looks like this:author={A. Lastname, \mkbibbold{Your name}, A. Lastname}
You should use biber though. – rowman Sep 19 '12 at 19:10