[Tex/LaTex] Biblatex: How to get “Author (forthcoming)” when pubstate=forthcoming is set, instead of “Author (n.d.)”

biblatex

I am using biblatex with these options :

\usepackage[backend=biber,natbib=true,style=authoryear,language=english]{biblatex}

I have an entry whose field pubstate is set to "forthcoming".

When I cite this reference in the text, I get "Author (n.d.)", and I would like to have "Author (forthcoming)", instead.

Pretty much the same thing in the bibliography. I get : Author (n.d.) … blablabla … Forthcoming. And I would prefer : Author (Forthcoming): blablabla …

I could set the "year" field to "Forthcoming". However, this is not a good solution because I am writing articles in three languages very often. And I would need to change my bibliography database evry time I start a new article in a different language.

Any ideas of how I can have this issue solved ?

Thank you very much in advance,
Pierric

Best Answer

The usual way to do this would be to extend the list of fields considered for dates by using \DeclareLabeldate. This will you give the desired behaviour in the text, but prints the "forthcoming" at the end of the bibliography entry. Perhaps that is acceptable to you. If not then you will need the extra code below renewing the biblatex macro addendum+pubstate. This is an improved version with changes suggested by Moewe.

Sample output

\documentclass{article}

\usepackage[backend=biber,natbib=true,style=authoryear,language=english]{biblatex}
\addbibresource{mybib.bib}

\DeclareLabeldate{%
  \field{date}
  \field{eventdate}
  \field{origdate}
  \field{urldate}
  \field{pubstate}
  \literal{nodate}
}

\renewbibmacro*{addendum+pubstate}{%
  \printfield{addendum}%
  \iffieldequalstr{labeldatesource}{pubstate}{}
  {\newunit\newblock\printfield{pubstate}}}

\begin{document}

\citet{myart} and \citet{Xx}.

\printbibliography

\end{document}

with mybib.bib containing

@Article{Xx,
  author =       {Xy, X.},
  title =        {A title},
  journaltitle = {Y. Journal},
  date =         2000
}

@Article{myart,
  author =       {Author, A. N.},
  title =        {On things},
  journaltitle = {J. Jour.},
  pubstate =     {forthcoming}
}

Old code

If your biblatex version is old there are two macros that need updating andn you can code as follows (this was my original code):

\documentclass{article}

\usepackage[backend=biber,natbib=true,style=authoryear,language=english]{biblatex}
\addbibresource{mybib.bib}

\DeclareLabeldate{%
  \field{date}
  \field{eventdate}
  \field{origdate}
  \field{urldate}
  \field{pubstate}
  \literal{nodate}
}

\renewbibmacro*{date+extrayear}{%
  \iffieldundef{\thefield{datelabelsource}year}
    {\printtext[parens]{\printfield{labelyear}}}
    {\printtext[parens]{%
       \iffieldsequal{year}{\thefield{datelabelsource}year}
         {\printlabeldateextra}%
         {\printfield{labelyear}%
          \printfield{extrayear}}}}}%

\renewbibmacro*{addendum+pubstate}{%
  \printfield{addendum}%
  \iffieldundef{\thefield{datelabesource}year}{}
  {\newunit\newblock\printfield{pubstate}}}

\begin{document}

\citet{myart} and \citet{Xx}.

\printbibliography

\end{document}