# biblatex: purge author and display “with” co-authors

I am a newbie with biblatex, and would like to accomplish the following:

For a reference that is typically displayed as:

Blastname N., Alastname N. and Clastname N., Title of article, Journal of Something, p.5-15, 2012

I would like to redefine the display as follows:

Title of article, with Alastname N. and Blastname N., Journal of Something, p.5-15, 2012

(i.e., always purge author Clastname N.)

-
Interesting question! I'm assuming that there shouldn't be changes to the sequence "Alastname N., Blastname N." -- please edit your question if I'm correct. – lockstep Jan 29 '12 at 22:41
In fact the authors are rearranged in alphabetical order after the "with"! – user11275 Jan 30 '12 at 14:09

With biber as the backend, you can map a co-author list obtained from author to the custom field namea. This is done with the source map feature available in the document preamble via \DeclareSourcemap (and biblatex 2+) or through the biber.conf file. Here's a simple example of the former approach that makes use of commands from the xpatch package to modify the bibliography style.

\documentclass{article}
\usepackage[backend=biber,style=authortitle,firstinits,uniquename=init]{biblatex}
\usepackage{xpatch}

\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite]{
\step[fieldsource=author, match={Doe, John}, final]
\step[fieldset=namea, origfieldval]
\step[fieldsource=namea, match={and Doe, John}, replace={}]
\step[fieldsource=namea, match={Doe, John and}, replace={}]
}
}
}

\xpretobibmacro{author}{\ifnameundef{namea}{}{\clearname{author}}}{}{}

\xapptobibmacro{title}
{\ifboolexpr{
not test {\ifnameundef{namea}}
and
test {\ifnumgreater{\value{labelname}}{1}}
}
\printnames[last-first]{namea}}
{}}{}{}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Article{first,
author = {Doe, John and Brown, Anne and Smith, Jane},
title = {First author title},
journaltitle = {Journal title},
date = {2006}}
@Book{second,
author = {Brown, Anne and Doe, John and Smith, Jane},
editor = {Doe, Ed},
title = {Second author title},
date = {2009}}
@Book{last,
author = {Brown, Anne and Smith, Jane and Doe, John},
title = {Last author title},
date = {2010}}
@Article{only,
author = {Doe, John},
title = {Sole author title},
journaltitle = {Journal title},
date = {2006}}
@Book{none,
author = {Brown, Anne and Doe, Jane},
title = {No authorship title},
date = {2010}}
\end{filecontents}

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


Note that the original author list order is retained. To impose another order you can discard the source map and create namea lists manually.

-
Thank you, looks nice! I will try this after I install biber etc. – user11275 Jan 30 '12 at 14:10
@user11275 No problem. I should've mentioned that the matching done in sourcemap supports regular expressions. See this answer from PLK for an example. The biber manual gives the details. – Audrey Jan 30 '12 at 14:17

It is better to use the byauthor macro instead of patching title. For simple use in a CV (when all bibliography items include John Doe as a coauthor) the following code without xpatch suffices:

\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite]{
\step[fieldsource=author, fieldset=namea, origfieldval]
\step[fieldsource=namea, match={and Doe, John}, replace={}]
\step[fieldsource=namea, match={Doe, John and}, replace={}]
\step[fieldsource=namea, match={Doe, John}, replace={}]
}}}

\renewbibmacro{author}{}
\renewbibmacro{translator+others}{}
\renewbibmacro{byauthor}{%
\ifnameundef{namea}{}

A more comprehensive solution for CVs is provided by the package biblatex-publist