15

Issue

I would like to be able to cite works that are in preparation but still incomplete, using "in prep." instead of a date. (This is mainly for citing my own work in progress in job applications, my CV, etc.) The reason is because (at least in my field) "Bar (2016)" implies that the work is at least somewhat complete and available in some form or other (published, or posted on an archive or the author's website), whereas "Bar (in prep.)" does not imply either one.

Specifically, I would like to be able to do something like the following with Biblatex:

\cite{bar}         -> Bar [in prep.]
\textcite{bar}     -> Bar (in prep.)
\parencite{bar}    -> (Bar [in prep.])
\printbibliography -> Bar, Foo (in prep.). Title. ...

I don't think the square brackets are conventional, but they make sense to me because "Bar in prep." and "(Bar in prep.)" look odd, especially with more than one author, e.g. "Bar and Baz in prep.", and "Bar (in prep.)" is already taken and has a different semantics.

Biblatex has a field called pubstate that accepts the possible value inpreparation, which gets expanded to the (localized) string "in preparation". By default, however, if I also specify a date, then the date gets printed instead of "in preparation".

@unpublished{bar,
  author = {Foo Bar},
  date = {2016},
  pubstate = {inpreparation},
  title = {Title},
}

\cite{bar}         -> Bar 2016
\textcite{bar}     -> Bar (2016)
\parencite{bar}    -> (Bar 2016)
\printbibliography -> Bar, Foo (2016). Title. ... In preparation.

MWE:

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@unpublished{bar,
  author = {Foo Bar},
  date = {2016},
  pubstate = {inpreparation},
  title = {Title},
}
\end{filecontents}
\usepackage[backend=biber,style=authoryear-comp]{biblatex}
\addbibresource{\jobname.bib}

\begin{document}
In \cite{bar}, \textcite{bar} argues \ldots \parencite{bar}.
\printbibliography
\end{document}

Here are two solutions I know of.

Solution #1

Replace date = {2016} with year = {in prep.}. (NB: Using date = {in prep.} throws an error.) This kind of works, but is not exactly what I'm looking for (no square brackets). Moreover, it's an abuse of the year field, and I would prefer a semantically better solution in the spirit of Biblatex.

@unpublished{bar,
  author = {Foo Bar},
  year = {in prep.},
  title = {Title},
}

\cite{bar}         -> Bar in prep.
\textcite{bar}     -> Bar (in prep.)
\parencite{bar}    -> (Bar in prep.)
\printbibliography -> Bar, Foo (in prep.). Title. ...

MWE:

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@unpublished{bar,
  author = {Foo Bar},
  year = {in prep.},
  title = {Title},
}
\end{filecontents}
\usepackage[backend=biber,style=authoryear-comp]{biblatex}
\addbibresource{\jobname.bib}

\begin{document}
In \cite{bar}, \textcite{bar} argues \ldots \parencite{bar}.
\printbibliography
\end{document}

Solution #2

Remove the date field altogether, keep pubstate = {inpreparation}, and add

\DeclareLabeldate{%
  \field{date}
  \field{pubstate}
}

which basically means "use date, if there is a value for it; otherwise, use pubstate, if there is a value for it".

@unpublished{bar,
  author = {Foo Bar},
  pubstate = {inpreparation},
  title = {Title},
}

\cite{bar}         -> Bar in preparation
\textcite{bar}     -> Bar (in preparation)
\parencite{bar}    -> (Bar in preparation)
\printbibliography -> Bar, Foo. Title. ... In preparation.

MWE:

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@unpublished{bar,
  author = {Foo Bar},
  pubstate = {inpreparation},
  title = {Title},
}
\end{filecontents}
\usepackage[backend=biber,style=authoryear-comp]{biblatex}
\addbibresource{\jobname.bib}
\DeclareLabeldate{%
  \field{date}
  \field{pubstate}
}

\begin{document}
In \cite{bar}, \textcite{bar} argues \ldots \parencite{bar}.
\printbibliography
\end{document}

This solution is more in line with Biblatex principles, but it's still a bit off:

  • "in preparation" instead of the shorter (and more conventional) "in prep."
  • no square brackets in \cite and \parencite cases
  • no "(in prep.)" immediately after the author in the reference list

My question

Is there any easy way to adapt solution #2 (or similar) so that inpreparation expands to "in prep.", to add square brackets but only for \cite and \parencite, and to add "(in prep.)" (or "in prep." or whatever, in accordance with the specified bibstyle) after the author name in the reference list?

Or is there a better way of going about all of this that I've overlooked? Thanks.

9
  • 2
    +1 for "Bar and Baz in prep." :) Seriously, your question interests me very much, I had the same problem yesterday, answering a question, and I opt for Solution #1, but I'm looking forward to finding a smartiest solution!
    – CarLaTeX
    Commented Nov 2, 2016 at 8:51
  • You're using biblatex so suppressing one field (date) when another is populated(inpreparation) is quite easy (an example with DOIs and URLs). More generally, it will be possible to do this nicely (but I lack the expertise to help you without spending time I haven't got).
    – Chris H
    Commented Nov 2, 2016 at 8:54
  • @CarLaTeX: There are some other problems with solution #1, which I didn't mention. For example, Biblatex eats up punctuation following "in prep.", which is good when it's a period because you don't want two periods in a row, but bad when it's a comma, semicolon, etc. Try In \cite{bar}, blah. Another problem is that, because of this, Biblatex essentially treats the period in "in prep." as a sentence-final period, thus sometimes adding too much space afterwards. Compare: \noindent xxx \cite{bar} xxx\\ xxx Bar in prep.~xxx The first has more space than the second. Commented Nov 2, 2016 at 9:09
  • @BrianBuccola Probably with \adddot and some other tricks thay can be solved, let's wait for some expert's answer!
    – CarLaTeX
    Commented Nov 2, 2016 at 9:25
  • 1
    If you are worried by the error in solution #1: with an additional sortyear = 2016 the error should be removed in upcoming versions of biblatex Commented Nov 3, 2016 at 2:27

1 Answer 1

6

I have a reasonable, but somewhat limited, solution for the question.

In order to have the shorter form "in prep." instead of the full one, you can:

\DefineBibliographyStrings{english}{%
    inpreparation      = {in prep\adddot},
}

As you suggested yourself, to add pubstate to the labeldate:

\DeclareLabeldate{%
    \field{date}
    \field{year}
    \field{eventdate}
    \field{origdate}
    \field{urldate}
    \field{pubstate}   % <-- NEW
    \literal{nodate}
}

To get the square brackets in \cite and \parencite I believe the simplest way is to adjust the respective cite commands:

\DeclareCiteCommand{\parencite}[\mkbibparens]
  {\iffieldequalstr{pubstate}{inpreparation}{\DeclareFieldFormat{labelyear}{\mkbibbrackets{\bibstring{\thefield{labelyear}}}}}{}%   <-- NEW
   \usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\cite}
  {\iffieldequalstr{pubstate}{inpreparation}{\DeclareFieldFormat{labelyear}{\mkbibbrackets{\bibstring{\thefield{labelyear}}}}}{}%   <-- NEW
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

(@CarLaTeX, I don't see why this shouldn't work with "in press" too).

To get "(in prep.)" in the place of the year in the bibliography:

\renewbibmacro*{date+extrayear}{%
    \iffieldundef{\thefield{datelabelsource}year}
      {\iffieldequalstr{pubstate}{inpreparation}{\printtext[parens]{\bibstring{\thefield{pubstate}}}}{}}   % <-- NEW
      {\printtext[parens]{%
         \iffieldsequal{year}{\thefield{datelabelsource}year}
           {\printdateextralabel}%
           {\printfield{labelyear}%
            \printfield{extrayear}}}}}%

Given this, if you wish to omit the redundant "In preparation" at the end of the reference in the bibliography:

\renewbibmacro*{addendum+pubstate}{%
  \printfield{addendum}%
  \newunit\newblock
  \iffieldequalstr{pubstate}{inpreparation}{}{\printfield{pubstate}}}   % <-- NEW

Putting it all together in a MWE:

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@unpublished{bar,
  author = {Foo Bar},
  pubstate = {inpreparation},
  title = {Title},
}
\end{filecontents}

\usepackage[backend=biber,style=authoryear-comp]{biblatex}

\DefineBibliographyStrings{english}{%
    inpreparation      = {in prep\adddot},
}

\DeclareLabeldate{%
    \field{date}
    \field{year}
    \field{eventdate}
    \field{origdate}
    \field{urldate}
    \field{pubstate}  % <-- NEW
    \literal{nodate}
}

\DeclareCiteCommand{\parencite}[\mkbibparens]
  {\iffieldequalstr{pubstate}{inpreparation}{\DeclareFieldFormat{labelyear}{\mkbibbrackets{\bibstring{\thefield{labelyear}}}}}{}%  <-- NEW
   \usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\cite}
  {\iffieldequalstr{pubstate}{inpreparation}{\DeclareFieldFormat{labelyear}{\mkbibbrackets{\bibstring{\thefield{labelyear}}}}}{}%  <-- NEW
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\renewbibmacro*{addendum+pubstate}{%
  \printfield{addendum}%
  \newunit\newblock
  \iffieldequalstr{pubstate}{inpreparation}{}{\printfield{pubstate}}}   % <-- NEW

\renewbibmacro*{date+extrayear}{%
    \iffieldundef{\thefield{datelabelsource}year}
      {\iffieldequalstr{pubstate}{inpreparation}{\printtext[parens]{\bibstring{\thefield{pubstate}}}}{}}  % <-- NEW
      {\printtext[parens]{%
         \iffieldsequal{year}{\thefield{datelabelsource}year}
           {\printdateextralabel}%
           {\printfield{labelyear}%
            \printfield{extrayear}}}}}%

\addbibresource{\jobname.bib}

\begin{document}
In \cite{bar}, \textcite{bar} argues \ldots\ \parencite{bar}.
\printbibliography
\end{document}

Which renders:

enter image description here

But, alas, the limitation is quite restrictive. If you have two or more "in preps." from the same author, you will get strange results in the dealing of the extrayear part. But this would also be the case in both of the 2 solutions of the OP (least bad with solution #1).

You must log in to answer this question.

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