TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

Example LaTeX



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


(Ugly, incorrect) output

Lorem ipsum dolor (Aristotle, nd) sit amet.

Aristotle (n.d.). Categoriae.
share|improve this question
It seems that apalike.bst strips everything from the contents of the year field except for the last up to four letters or digits. The culprit is the function calc.label; if the call to purify$ is removed, then n.d. is accepted (as it consists of four characters). – egreg Jul 19 '12 at 15:18
up vote 9 down vote accepted

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" =
    { type$ "proceedings" =
        'editor.key.label                       % apalike ignores organization
        'author.key.label                       % for labeling and sorting
  ", "                                                  % 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.

share|improve this answer
Ah, excellent. That feels like a bit of a hack, but it definitely gets the job done. Thanks! – Doches Jul 19 '12 at 19:30
@Doches You should consider switching to biblatex. – egreg Jul 19 '12 at 19:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.