4

This is a question related to an answer given by @PLK in Make specific author bold using biblatex (I am unable to comment in the original post). I want to highlight specific authors in the bibliography. Modifying @PLK's MWE below I want to highlight multiple authors, but this method only highlights one.

\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,3=highlight},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\nocite{*}

\renewcommand*{\mkbibnamegiven}[1]{%
  \ifitemannotation{highlight}
    {\textbf{#1}}
    {#1}}

\renewcommand*{\mkbibnamefamily}[1]{%
  \ifitemannotation{highlight}
    {\textbf{#1}}
    {#1}}

\begin{document}
\nocite{*}
\printbibliography

\end{document}

1 Answer 1

3

According to the biblatex documentation, pp. 74-75 you need to separate the annotation for different list items (names) with a semicolon

@misc{test,
  author    = {Last1, First1 and Last2, First2 and Last3, First3},
  authot+an = {2=highlight;3=highlight},
}

works

The syntax is explained as follows

<annotationspecs> ::= <annotationspec> [ ";" <annotationspec> ]
<annotationspec>  ::= [ <itemcount> [ ":" <part> ] ] "=" <annotations>
<annotations>     ::= <annotation> [ "," <annotation> ]
<annotation>      ::= (string)

You want to give different specifications (namely one for item no 2 and one for item no 3). If you separate the two entries with a comma as you did, biblatex interprets 3=highlight as another annotation for the second name.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .