Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
    
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

1 Answer 1

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.

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.