1

What should I do when citing two references together in text from the same author and year? At present, the citation year of the second piece changes into 0.

Example: \cite{Brown2018a, Brown2018b} turns into Brown(2018a,0)

No error code shows up, and both Brown2018a and Brown2018b work fine separately. Also no issue with the formatted references, it's just when those are together. The same problem occurs with my other same author and year citations. I'm using overleaf with pdfLatex with natbib and \bibliographystyle{apalike}.

mybib.bib
    @misc{Brown2018a,
    author= {Brown, A.}, 
    year= {2018}, 
    title= {Example 1} 
    }

    @misc{Brown2018b, 
    author= {Brown, A.}, 
    year= {2018}, 
    title= {Example 2} 
    }

\documentclass{article}
\usepackage{natbib}
\bibliographystyle{apalike}

\begin{document}
Blaa blaa \cite{Brown2018a, Brown2018b} blaaaa blaa blaaa.
\bibliography{mybib}
\end{document

This turns out like this in references and in text:

in references

enter image description here

  • Welcome to TeX.SE. – Mico Jan 20 at 0:01
  • Also I've tried citing with \cite, \citet and \citep and everytime I get "0" in place of the "2018b" – Willa Jan 20 at 2:19
  • Without having access to the version of apalike.bst that's in your TeX distribution, it's not possible to diagnose what's wrong. My hunch is that the file apalike.bst was modified (or got corrupted?) at some point in the past. All I can suggest for now is that you copy the file apalike.bst from https://www.ctan.org/tex-archive/biblio/bibtex/base into the directory where your main tex file is located. Rename this file, say, to apalike-clean.bst. Then, change \bibliographystyle{apalike} to \bibliographystyle{apalike-clean} and rerun LaTeX, BibTeX, and LaTeX twice more. – Mico Jan 20 at 2:34
1

(too long for a comment, hence posted as an answer)

I'm afraid I'm unable to replicate the citation call-out issue you say you're encountering, using only the information you've provided so far. Hence, please edit your posting to clarify in which sense either your LateX code or your BibTeX code differs from the minimal working example shown below. Please also state which TeX distribution, which version of LaTeX -- pdfLaTeX, XeLaTeX, LuaLaTeX, something else? -- you use and which versions of the natbib citation management package and of the apalike bibliography style you employ.

To compile the following code, I used the pdflatex program provided by the current version of MacTeX2018, LaTeX2e <2018-12-01>, natbib 2010/09/13 8.31b, and apalike 2010/12/08 0.99a.

enter image description here

\RequirePackage{filecontents}
\begin{filecontents}{mybib.bib}
@misc{Brown2018a,
  author = "Anthony Brown",
  title  = "First",
  year   = 2018,
}
@misc{Brown2018b,
  author = "Anthony Brown",
  title  = "Second",
  year   = 2018,
}
\end{filecontents}

\documentclass{article}
\usepackage{natbib}
\bibliographystyle{apalike}

\begin{document}
\noindent
\citet{Brown2018a,Brown2018b}; \citep{Brown2018a, Brown2018b}
\bibliography{mybib}
\end{document}
  • I'm not sure how to find out the natbib and apalike versions but I've edited some of my code in – Willa Jan 20 at 2:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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