[Tex/LaTex] apalike bibliography changes to numbers suddenly

apa-stylebibliographiesbibtexnatbib

I am using natbib package in my project, which has \documentclass{report}, and I am using apalike style for my bibliography. I am currently using v2.overleaf to write my document. Everything was working so far, but now when I add any more references in my document's .bib file, the citations in my document change from author, date (I mostly used \citep(something), they change to numbers. It looks like there is a limit on the number of references.

I cannot seem to find what the problem is, but here is some info:

  • I have used 48 references so far, and adding the 49th lead to this problem (I have no idea if this is related or not)

  • my .bib file now has 541 lines.

I wonder if anyone has faced this problem before.

I appreciate any help guys 🙂

\documentclass[letterpaper,12pt]{report}
\usepackage[round]{natbib}

\begin{document}
some text here \citep{citation48}
some other text \citep{citation49} 
\bibliographystyle{apalike}
{\footnotesize
\bibliography{library.bib}}
\end{document}

Before
enter image description here

After
enter image description here

Best Answer

The natbib documentation states:

The natbib package will automatically switch to numerical mode if any one of the \bibitem entries fails to conform to the possible author–year formats. There is no way to override this, since such an entry would cause trouble in the author–year mode.

It does this only after generating an error:

! Package natbib Error: Bibliography not compatible with author-year citations.

(natbib)                Press <return> to continue in numerical citation style.

Unfortunately, online LaTeX systems like ShareLaTeX and Overleaf do everything they can to produce some output and try to push through errors wherever they can. This problem is compounded by the fact that there is no simple way to view the error log without downloading it (last time I checked). For example, if you have the following .bib file entry, namely an item with an author but no year, and you push through the error, the bibliography will be generated using the numeric system. From your comment it seems that something of this sort is what happened.

@misc{Foo2018,
    Author = {Foo},
    Howpublished = {Unpublished manuscript},
    Title = {A title}}