[Tex/LaTex] Truncation of “year” field in author-year citations using “apalike” bibliography style

bibtexnatbib

I use the natbib package (with the default authoryear option) and the apalike bibliography style for bibliographies.

I would like to cite a forthcoming paper in such a way that "forthcoming" or "to appear" is used in place of a year of publication — both in inline citations and in the bibliography.

If I use the following bibtex entry…

@Unpublished{ key,
   title="Title", 
   author="F. Lastname", 
   year="to appear", 
   note="Manuscript under submision" }

…then \citep{key} expands to (Lastname pear) rather than the desired (Lastname to appear). Similarly, if I use "forthcoming" in the year field, \citep{key} expands to (Lastname ming). It appears that the year field is being truncated to its last four characters.

Is there a workaround for this?

Best Answer

I should note that although this sort of citation is common, it's not very good practice: the article you are citing does have a year, namely the year of the draft you read, and should be cited with that year, and a note saying that it is to appear. See Which publication type for forthcoming papers in BibTeX? for some ideas on how best to implement this.

That being said, it's not that difficult to modify the bibliography style to allow this kind of year.

This truncation is a property of how the apalike.bst style is set up. Make a copy of apalike.bst and make the following modification to it. Save it as myapalike.bst in your local texmf folder. It should go in <path/to/local>/texmf/bibtex/bst (where the path is dependent on your OS). Then use \bibliographystyle{myapaplike} in your document.

Find the FUNCTION calc.label: it should look like the following:

FUNCTION {calc.label}
{ type$ "book" =
  type$ "inbook" =
  or
    'author.editor.key.label
    { type$ "proceedings" =
        'editor.key.label                       % apalike ignores organization
        'author.key.label                       % for labeling and sorting
      if$
    }
  if$
  ", "                                                  % these three lines are
  *                                                     % for apalike, which
  year field.or.null purify$ #-1 #4 substring$          % uses all four digits
  *
  'label :=
}

Change the line

year field.or.null purify$ #-1 #4 substring$          % uses all four digits

to be:

year field.or.null purify$ #-1 #64 substring$          % allow many characters