0

I have been trying to modify existing biblatex styles to match the PNAS citation guidelines and I have an issue with the title delimiter.

PNAS expects book and collection citations to be of this format:

Doe J (<year>) \emph{<booktitle>} (<publisher>: <address>).

And journal articles of this format:

Doe J (<year>) <title>. \emph{<journaltitle>} <volume>(<number>):<pagerange>.

I have managed to achieve most of this with the help Barbara Beeton, percusse and other gurus.

But I haven't figured out how to have journal titles followed by period+space and book/collection titles only by space.

This is what I have so far:

Output

Apologetically, I am offering a rather long (M)WE containing all the changes I have made so far to achieve this outcome. I do this to avoid a conflict between what I already changed and the solution you suggest.

Also, since I am a n00b, please do let me know if I have any silly mistakes in the modifications I have made.


MWE:

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents}{bibliography.bib}
@Article{a:agrawal:2001:01,
  title           = {Phenotypic Plasticity in the Interactions and Evolution of Species},
  author          = {Agrawal, Anurag A.},
  journal         = {Science},
  year            = {2001},
  month           = oct,
  volume          = {294},
  number          = {5541},
  pages           = {321--326},
}

@Book{b:darwin:1859:01,
  title           = {On the Origin of Species by Means of Natural Selection or the Preservation of Favoured Species in the Struggle for Life},
  author          = {Darwin, Charles},
  publisher       = {John Murray},
  address         = {London},
  year            = {1859},
}
\end{filecontents}

\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[%
  backend=biber,
  useprefix,
  citestyle=numeric,
  bibstyle=authoryear,
  sorting=none,
  firstinits=true,
  uniquename=init,
  terseinits=true,
  dashed=false,
]{biblatex}

\addbibresource{bibliography.bib}

%% =============================================================================
%% PNAS Style
%% =============================================================================
  \AtEveryBibitem{\clearfield{month}} % Do not show month in bibliography.
  \AtEveryCitekey{\clearfield{month}} % Do not show month in citations.

  % Comma-separated authors, last then first name.
  \renewcommand*{\labelnamepunct}{\addspace}
  \renewcommand*{\finalnamedelim}{%
    \ifbibliography{\addcomma\space}{\addspace\&\space}}
  \renewcommand*{\revsdnamepunct}{}
  \DeclareNameAlias{sortname}{last-first}

  % No quotes or italics in titles, except books and collections in italics.
  \DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,
                      thesis,unpublished]{title}{#1}
  \DeclareFieldFormat[book,collection]{title}{\emph{#1}}

  % Journal titles in italics.
  \DeclareFieldFormat{journaltitle}{\emph{#1}}
  \DeclareFieldFormat{issuetitle}{\emph{#1}}
  \DeclareFieldFormat{maintitle}{\emph{#1}}

  % Print publisher, then location, separated by comma in parentheses.
  \renewbibmacro*{publisher+location+date}{%
    \printtext[parens]{%
      \printlist{publisher}%
      \iflistundef{location}
        {\setunit*{\addcomma\space}}
        {\setunit*{\addcolon\space}}%
      \printlist{location}%
      \setunit*{\addcomma\space}%
      \usebibmacro{date}%
    }\newunit%
  }

  % Remove "in:" for article entries.
  \renewbibmacro*{in:}{%
    \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}

  % Remove page prefixes.
  \DeclareFieldFormat{pages}{#1}

  % Print volume, followed by number in parentheses.
  \DeclareFieldFormat[article]{number}{\mkbibparens{#1}}
  \renewbibmacro*{volume+number+eid}{%
    \printfield{volume}%
    \printfield{number}}

  % Colon for volume(number):pages delimiter.
  \renewcommand*{\bibpagespunct}{%
    \ifentrytype{article}{\addcolon}{\addcomma\space}}

  % Add labelnumbers to bibliography.
  \DeclareFieldFormat{labelnumberwidth}{#1\adddot}
  \defbibenvironment{bibliography}
    {\list
       {\printtext[labelnumberwidth]{%
        \printfield{prefixnumber}%
        \printfield{labelnumber}}}
       {\setlength{\labelwidth}{\labelnumberwidth}%
        \setlength{\leftmargin}{\labelwidth}%
        \setlength{\labelsep}{\biblabelsep}%
        \addtolength{\leftmargin}{\labelsep}%
        \setlength{\itemsep}{\bibitemsep}%
        \setlength{\parsep}{\bibparsep}}%
        \renewcommand*{\makelabel}[1]{\hss##1}}
    {\endlist}
    {\item}

  % Omit authoryear disambiguation.
  \AtEveryBibitem{\clearfield{extrayear}}

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

therefor you have to modify the bibdriver for the entrytype book in standard.bbx. You can easily exchange parts from macros, especially biblatex-macros, with the package xpatch.

Add the following lines to your preamble, it will exchange the first string with the second - which will replace the default unit at this time for one time with a space character.

\usepackage{xpatch}
\xpatchbibdriver{book}{\newunit\newblock\usebibmacro{publisher+location+date}}{%
\setunit{\addspace}\newblock%
\usebibmacro{publisher+location+date}%
}{}{}
2
  • btw. it's easier if you write the wanted format like: Doe J (year) booktitle (publisher: address). - much easier to read.
    – musicman
    May 29 '14 at 5:46
  • @sudosensei, would you mind sharing you the biblatex PNAS style, if you have it working?
    – vancleve
    Feb 20 '15 at 19:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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