BibLaTeX – How to Move the Field Note to the End of the Reference

apa-stylebiblatexbibliographies

I am using the notefield to add the original publication date and I would like to print it at the end of the reference instead of before the publisher information.

I had a look here and tried to come out with a similar solution. Still my macro doesn't work: the notefield doesn't change position.

\RequirePackage{filecontents}

\begin{filecontents*}{mybib.bib}
@book{habermas_structural_1989,
    address = {Cambridge, {MA}},
    title = {The structural transformation of the public sphere: {An} inquiry into a category of bourgeois society},
    publisher = {MIT {Press}},
    author = {Habermas, Jürgen},
    translator = {Burger, Thomas and Lawrence, Frederick},
    year = {1989},
    note = {({Original} work published 1962)}
}
\end{filecontents*}

\documentclass{article}


% Set the values for the bibliography
\usepackage[
    style=apa,
    backend=biber,
    isbn=false,
    url=false,
    doi=false,
    eprint=false,
    hyperref=true,
    backref=false,
    firstinits=false,
]{biblatex}

\renewbibmacro*{publisher+note}{%
  \printlist{publisher}%
  \setunit*{\addperiod\space}%
  \usebibmacro{note}%
  \newunit}

% Recommended by biblatex
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage{xpatch}

% Set language
\usepackage[british]{babel}
\DeclareLanguageMapping{british}{british-apa}

\addbibresource{mybib.bib}

\begin{document}

\cite{habermas_structural_1989}

\printbibliography
\end{document}

Best Answer

The biblatex documentation states on page 14: "This [the addendum field] is similar to the note field except that it is printed at the end of the bibliography entry."

So instead of note it is better to use addendum. biblatex-apa automatically wraps addendum into parentheses, so there is no need to do that manually.

NB: It is always better to let biblatex handle such cases: It is quite tiresome to always remember to put the parentheses around the words, and what if you want to get rid of them?

So the entry in the .bib file should look like this.

@book{habermas_structural_1989_addendum,
    address = {Cambridge, {MA}},
    title = {The structural transformation of the public sphere: {An} inquiry into a category of bourgeois society},
    publisher = {MIT {Press}},
    author = {Habermas, Jürgen},
    translator = {Burger, Thomas and Lawrence, Frederick},
    year = {1989},
    addendum = {{Original} work published 1962}
}

If you can not be bothered to use addendum manually, you can make biblatex/biber do the mapping for you.

Just add this to the preamble.

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldsource=note, final]
      \step[fieldset=addendum, origfieldval, final]
      \step[fieldset=note, null]
    }
  }
}

It will copy the note field into the addendum field (only if the latter one is empty), the note field will be removed afterwards.

You can then use note as usual.


The least convenient way is to modify all the drivers defined in apa.bbx. Unfortunately apa.bbx does not use any macros to print note and addendum, but the bare \printfield{note} and \printfield{addendum}.

In \DeclareBibliographyDriver{book} we find:

...
\printfield{series}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{location+publisher}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\setunit*{\addspace}\newblock
\usebibmacro{origyear}%
\newunit\newblock
\printfield{addendum}%
\newunit\newblock
...

You could manually move all the \printfield{note} near \printfield{addendum} like so

...
\printfield{series}%
\newunit\newblock
\usebibmacro{location+publisher}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\setunit*{\addspace}\newblock
\usebibmacro{origyear}%
\newunit\newblock
\printfield{addendum}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
...

or you could xpatch all the drivers via

\xpatchbibdriver{book}
  {\newunit\newblock
   \printfield{note}%
  }
  {}%
  {\typeout{successfully temporarily removed note}}
  {\typeout{failed to temporarily remove note}}

\xpatchbibdriver{book}
  {\printfield{addendum}%
  }
  {\printfield{addendum}%
   \newunit\newblock
   \printfield{note}}%
  {\typeout{successfully re-added note after addendum}}
  {\typeout{failed re-add note after addendum}}

You will have to do this for all drivers though. So you might want to wrap this into a command

\newcommand{\movenote}[1]{%
  \xpatchbibdriver{#1}
    {\newunit\newblock
     \printfield{note}}
    {}%
    {\typeout{successfully temporarily removed note (in driver #1)}}
    {\typeout{failed to temporarily remove note  (in driver #1)}}%
  \xpatchbibdriver{#1}
    {\printfield{addendum}}
    {\printfield{addendum}%
     \newunit\newblock
     \printfield{note}}%
    {\typeout{successfully re-added note after addendum  (in driver #1)}}
    {\typeout{failed re-add note after addendum  (in driver #1)}}%
}

To patch a driver, use \movenote{article}, you can call this command for all drivers like this:

\makeatletter
\forlistloop{\movenote}{\blx@datamodel@entrytypes}
\makeatother

or

\makeatletter
\def\do#1{\movenote{#1}}
\abx@doentrytypes
\makeatother