[Tex/LaTex] Year not showing up after publisher and location in bibliography

biblatexbibliographiesciting

A paper I'm writing requires me to use a custom citation style. The style's similar to the standard Harvard style, so I've decided to tweak the biblatex-bath style to my needs.

Among other things, when citing books, the publisher and location must be given as

Publisher; Location; Year.

I've found the standard publisher+location+date bibmacro, defined by biblatex in bbx/standard.bbx and decided to overwrite this, as follows:

\renewbibmacro*{publisher+location+date}{%
  \printlist{publisher}%
  \setunit*{\addsemicolon\space}%
  \printlist{location}%
  \setunit*{\addsemicolon\space}%
  \printfield{year}%
  \newunit%
}

Publisher and location come out fine with this, but the year is missing. Here is a complete MWE:

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8
\begin{filecontents*}{biblatextest2.bib}
@Book{Gali2015,
  author    = {Gal{\'\i}, Jordi},
  title     = {Monetary policy, inflation, and the business cycle: an introduction to the new Keynesian framework and its applications},
  year      = {2015},
  edition   = {2},
  publisher = {Princeton University Press},
  location  = {Princeton and Oxford},
}
\end{filecontents*}
\documentclass{article}
\usepackage[style=bath,sorting=ynt]{biblatex}
\assignrefcontextentries[]{*}
\renewbibmacro*{publisher+location+date}{%
  \printlist{publisher}%
  \setunit*{\addsemicolon\space}%
  \printlist{location}%
  \setunit*{\addsemicolon\space}%
  \printfield{year}%
  \newunit%
}
\addbibresource{biblatextest2.bib}
\begin{document}
    \noindent Here is a citation. Compare \cite[p.~123]{Gali2015}.
    \appendix
    \newrefcontext[sorting=nyt]%
    \printbibliography
\end{document}

This yields:

Example of missing year

As you can see, the year after the publisher and location is missing. Printing another field there, e.g. \printfield{title} rather than \printfield{year}, works; the issue is specific to \printfield{year}. (Actually, this isn't entirely true: \printfield{name} doesn't work either.)

As usual I'd appreciate any help. (Feel free to suggest a completely different solution as well; I'm not hung up on modifying this particular biblatex style, or modifying any specific style at all. If there is a better way of cooking up a custom biblatex style, I'm all ears.)

Best Answer

You can add the option mergedate=false to your biblatex options.

I'd probably be inclined to use \usebibmacro{date} instead of \printfield{year} to be more consistent with the default macro and allow for more flexibility.

\RequirePackage{filecontents}
\begin{filecontents*}{biblatextest2.bib}
@Book{Gali2015,
  author    = {GalĂ­, Jordi},
  title     = {Monetary policy, inflation, and the business cycle: an introduction to the new Keynesian framework and its applications},
  year      = {2015},
  edition   = {2},
  publisher = {Princeton University Press},
  location  = {Princeton and Oxford},
}
\end{filecontents*}
\documentclass{article}
\usepackage[style=bath,mergedate=false,sorting=ynt]{biblatex}
\assignrefcontextentries[]{*}
\renewbibmacro*{publisher+location+date}{%
  \printlist{publisher}%
  \setunit*{\addsemicolon\space}%
  \printlist{location}%
  \setunit*{\addsemicolon\space}%
  \usebibmacro{date}%
  \newunit%
}
\addbibresource{biblatextest2.bib}
\begin{document}
    \noindent Here is a citation. Compare \cite[p.~123]{Gali2015}.
    \appendix
    \newrefcontext[sorting=nyt]%
    \printbibliography
\end{document}

MWE output