1

I'd like to refer to an article which has apparently been accepted for publication by a journal but yet to be published (other than unofficially on the arXiv). To do so, I'm using the pubstate field. Unfortunately, there's no official date scheduled for publication. This means my bibliography entries end up with a pair of brackets surrounding an empty string. (Note that I'm using authortitle style.)

In this situation, is it possible to have biblatex say print "(forthcoming)" in place of a missing date?

Attempted solution

I tried to solve this problem as follows. Here's a MWE:

\begin{filecontents}{\jobname.bib}
@article{example1,
    title = "My first article",
    author = "A. N. Author",
    journal = "Journal of Stuff",
    pubstate = "inpreparation",
}

@article{example2,
    title = "My second article",
    crossref = "example1",
    pubstate = "submitted",
}

@article{example3,
    title = "My third article",
    crossref = "example1",
    pubstate = "forthcoming"
}

@article{example4,
    title = "My fourth article",
    crossref = "example1",
    pubstate = "inpress"
}

@article{example5,
    title = "My fifth article",
    crossref = "example1",
    pubstate = "prepublished"
}
\end{filecontents}

\documentclass{article}
\usepackage[style=authortitle,backend=biber]{biblatex}
\addbibresource{\jobname}
\addbibresource{biblatex-examples.bib}

\begin{document}
Here's my long-winded citation: \cites{example1}{example2}{example3}{example4}{example5}.
Here's one from the \texttt{biblatex} example: \cite{springer}.
\printbibliography
\end{document}

First attempt: pubstate, journal, no date

I did some searching and came across an answer of Andrew Swann. Unfortunately I'm trying to use this with the authortitle style rather than authordate. After some more searching and reading the biblatex manual, I attempted to use the pubstate as a `fake date' if no date was provided. I added the following to the preamble.

\renewbibmacro*{date}{%
    \ifboolexpr{ test {\iffieldundef{date}} and not test {\iffieldundef{pubstate}} }%
    {\printfield{pubstate}}%
    {\printfield{date}}%
}

\renewbibmacro*{addendum+pubstate}{%
    \printfield{addendum}%
}

The result was mixed.

Second attempt: vanishing dates in Springer

This makes the undated references behave as I had intended. Unfortunately I managed to wipe out the date for the Springer reference. Is there a better (correct?) way to deal with this using biblatex?

1 Answer 1

1

For biblatex date is only a 'virtual' field, within biblatex you can only access its parts year, month, day, .... Of course in the .bib file date is very much real.

If you want to check if there is no date, check for year (this is what Andrew does in his answer, but he has to check for a special year field)

\renewbibmacro*{date}{%
  \ifboolexpr{ test {\iffieldundef{year}} and not test {\iffieldundef{pubstate}} }%
    {\printfield{pubstate}}%
    {\printdate}}

\renewbibmacro*{addendum+pubstate}{%
  \printfield{addendum}%
  \newunit\newblock
  \iffieldundef{year}
    {}
    {\printfield{pubstate}}}
2
  • Thanks, that's perfect. So is date mainly meant for entering dates in one field in the .bbl file, rather than spread out across three fields?
    – David R
    Jul 31, 2017 at 17:59
  • @DavidRobertson Exactly, date is the correct field to input the data in the .bib, but for internal reasons it is easier to handle the split-up parts of the date in biblatex macros.
    – moewe
    Jul 31, 2017 at 18:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .