I would like to cite something so that it comes up as
Something important has been shown (author, 2000; 2006).
Although, I do not care about the separator between 2000 and 2006 (the semicolon was just used as an example).
When I compile my document, I get
Something important has been shown (author, 2000, 0).
Citation1 is an article (published in 2000) and citation2 is a book (published in 2006).
The code I currently use looks approximately like this:
\RequirePackage{filecontents}
\begin{filecontents}{bibliography.bib}
@book{doyle2006making,
title={Making war and building peace: United Nations peace operations},
author={Doyle, Michael W and Sambanis, Nicholas},
year={2006},
publisher={Princeton University Press}
}
@article{doyle2000international,
title={International peacebuilding: A theoretical and quantitative analysis},
author={Doyle, Michael W and Sambanis, Nicholas},
journal={American political science review},
volume={94},
number={4},
pages={779--801},
year={2000},
publisher={Cambridge University Press}
}
\end{filecontents}
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[natbibapa]{apacite}
\usepackage[super]{nth}
\usepackage{graphicx, floatpag, caption}
\newcommand\textlcsc[1]{\textsc{\MakeLowercase{#1}}}
\usepackage{bibentry}
\nobibliography*
\usepackage[hyphens]{url}
\usepackage{float}
\usepackage{rotating}
\usepackage{pdflscape}
\begin{document}
Something important has been shown \citep{citation1, citation2}.
\newpage
\bibliographystyle{apalike}
\bibliography{bibliography.bib}
\end{document}
.bib
entries with us and extend the code in the question here such that it loads the.bib
file and a bibliography style. The following naive extension of your code show the expected output "(Smith, 2000, 2006)" for me gist.github.com/moewew/3387d93db36e34327173d41e87aa6c7d, so there must be something else going on at your end.apalike
bibliography style withapacite
. You must use theapacite
bibliography style with it.\bibliography
takes the file name without extension, so\bibliography{bibliography.bib}
should be\bibliography{bibliography}
. Strictly speaking\bibliography{bibliography.bib}
is a syntax error, but some TeX systems are more lenient and still accept it (my MikTeX isn't and throws an error:I couldn't open database file bibliography.bib.bib
). Note also that the.bib
files in the MWE don't match (\begin{filecontents}{mybib.bib}
but\bibliography{bibliography.bib}
).