[Tex/LaTex] Citations with no date, e.g. (Aristotle n.d.)

bibliographiesbibtexcitingnatbib

I need to cite a work from antiquity that has no known date, using natbib and author-year citations. The best suggestion I've found is to write the citation using "n.d." (no date) for the year of publication, but putting that into by bibtex file renders an ugly citation without periods:

(Author nd)

when what I'd like is:

(Author n.d.)

Wrapping it in curly braces ("{n.d.}") doesn't seem to help with the in-line citation (though it works in the bibliography).

How can I force BibTex to render the date in an in-line citation with punctuation?


Example .bib

@book{aristotle,
    Author = {Aristotle},
    Booktitle = {Works of Aristotle},
    Title = {Categoriae},
    Year = {{n.d.}}}

Example LaTeX

\documentclass{article}

\usepackage[authoryear]{natbib}
\bibliographystyle{apalike}

\begin{document}
Lorem ipsum dolor sit amet \citep{aristotle}, consectetur adipiscing elit.

\bibliography{file.bib}
\end{document}

(Ugly, incorrect) output

Lorem ipsum dolor (Aristotle, nd) sit amet.

REFERENCES
Aristotle (n.d.). Categoriae.

Best Answer

The function calc.label in apalike.bst is responsible of this: it strips away all non alphanumeric characters and keeps the last up to four characters remaining.

If you copy apalike.bst to myapalike.bst and change the function defined in lines 896-912 to become

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 #-1 #4 substring$          % uses all four digits
  *
  'label :=
}

then \bibliographystyle{myapalike} will accept year={n.d.} as you wish: it consists of four characters, after all!

The change consists simply in removing the string purify$. I can't say if this may have adverse effects on other entries; but, as long as you have only years or n.d., all should go well.

Related Question