I have a basic tex file and a bibliography which is exported from Mendeley
However, when I want to cite in the author-year style, I get the error:
Package natbib Error: Bibliography not compatible with author-year citations.
(natbib) Press <return> to continue in numerical citation style.
Any clue what's wrong?
Minimum working example:
\documentclass[letterpaper, 10pt]{article}
\usepackage[authoryear]{natbib}
\usepackage{lipsum}
\begin{document}
\lipsum[1-4]
\nocite{*}
\bibliographystyle{apalike}
\bibliography{articles}
\end{document}
A snippet of my .bib library:
@article{shortcode,
author = {Lastname, Firstname},
file = {:/path/to/file.pdf:pdf},
journal = {Journal name},
number = {xx},
pages = {x--xx},
title = {Title},
volume = {xx},
year = {xxxx}
}
\cite
commands to\citet
or\citep
.