7

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

Andrew Swann
  • 95,762
Pierric
  • 93

1 Answers1

12

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}
Andrew Swann
  • 95,762
  • With the new backward incompatible changes to Biblatex, \printdateextralabel should be\printlabeldateextra. See: https://github.com/plk/biblatex/wiki – Adam Liter Oct 17 '16 at 00:26
  • @AdamLiter Many thanks - code updated and I have added the bib file. – Andrew Swann Oct 17 '16 at 09:53
  • With current versions of biblatex you don't need to redefine date+extrayear I think (if I'm not missing anything). With the new date regime it is probably safer to test \iffieldequalstr{labeldatesource}{pubstate} instead of \iffieldundef{\thefield{datelabesource}year}{} in addendum+pubstate. See https://tex.stackexchange.com/q/386400/35864 – moewe Aug 14 '17 at 17:19
  • Thank you. Unfortunately, I can't upvote again. So you will have to accept my thanks without that. I think you are missing an empty pair of braces after the \iffieldequalstr{labeldatesource}{pubstate}, currently you only have the 'false' branch. I notice that is because I copied the {} into my comment, it should have not been there, sorry for the confusion. We need to replace \iffieldundef{\thefield{datelabesource}year} by \iffieldequalstr{labeldatesource}{pubstate}. – moewe Aug 15 '17 at 14:54
  • @moewe Indeed - it fell off my copy+paste - many thanks – Andrew Swann Aug 16 '17 at 08:34
  • 1
    In the definition of \DeclareLabeldate it might be worth adding \field{year} after \field{date}. – banbh Apr 18 '19 at 18:38
  • @banbh One can use that if one wishes, but year is deprecated in biblatex – Andrew Swann Apr 23 '19 at 15:10
  • I seem to get the desired behavior with just \DeclareLabeldate{% \field{date} \literal{forthcoming} } (So without all the renew macro stuff.) What am I missing? – E... Aug 18 '20 at 21:05
  • Without the renewing, you get "Forthcoming" additionally printed later in the entry. – Andrew Swann Aug 19 '20 at 09:17