7

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.)

lockstep
  • 250,273
  • 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

2 Answers2

9

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}}
  }
    {\setunit{\addcomma\space with\addcolon\addspace}%
     \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}
\addbibresource{\jobname.bib}

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

enter image description here

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

Audrey
  • 28,881
0

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}{}
{\setunit{\addcomma\space with\addspace}%
\printnames{namea}}}

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

pavel
  • 861