Say I use BibLaTeX with standard style authoryear
or authoryear-comp
.
Then given a citation command such as \parencite{A, B, C} (or any other standard Biblatex citation command), I'd like the resulting citations to be typeset differently depending on whether a given field (e.g. the author field) in the corresponding bibliography entry contains a given string (e.g. someone's lastname).
MWE:
\documentclass{article}
\usepackage{filecontents}
\usepackage[backend=biber,style = authoryear-comp]{biblatex}
\usepackage[colorlinks=true, breaklinks, allcolors = blue]{hyperref}
\DeclareSourcemap{%
\maps[datatype=bibtex]{%
\map{%
\step[fieldsource=author, match=Doe, final]%
\step[fieldset=keywords, fieldvalue=doe]%
}%
}%
}
\begin{filecontents}{\jobname.bib}
@Book{p1,
author = "A. U. Thor and John Doe",
title = "A Scientific Article 1",
year = "1975"
}
@Book{p2,
author = "John Doe",
title = "A Scientific Article 2",
year = "1985"
}
@Book{p3,
author = "Joe Bar",
title = "A Scientific Article 3",
year = "1995"
}
@Book{p4,
author = "Jane Baz",
title = "A Scientific Article 4",
year = "2005"
}
@Book{p5,
author = "A. U. Thor and John Doe",
title = "A Scientific Article 5",
year = "2010"
}
@Book{p6,
author = "Jane Baz",
title = "A Scientific Article 6",
year = "2015"
}
\end{filecontents}
\addbibresource{\jobname.bib}
\nocite{*}
\begin{document}
In: \parencite{p4, p1, p2, p3, p5, p6}, ``Thor and Doe 1975, 2010'' and ``Doe
1985'' should be \emph{emphasized} (but the corresponding entries in the
References section should remain typeset as the others).
\printbibliography
\end{document}
Note: I asked a similar question here but the proposed solution does not work with standard styles authoryear
or authoryear-comp
.