[Tex/LaTex] Twin reference in wrong order

bibtexciting

I have references for two papers written by the same authors in the same year. When I cite them, I see something like this [Landgren et al., 2016a] and [Landgren et al., 2016b]. The problem is that the paper with 2016a was published some months after the one with 2016b, in fact 2016a is a follow up of 2016b. How can I make latex swap the order of both papers, so the older paper is labeled with 2016a? I have specified the month in my .bib file but that doesn't change anything.

Edit

Minimal bibtex:

@inproceedings{landgren2016distributed,
  title={On distributed cooperative decision-making in multiarmed bandits},
  author={Landgren, Peter and Srivastava, Vaibhav and Leonard, Naomi Ehrich},
  booktitle={Control Conference (ECC), 2016 European},
  pages={243--248},
  year={2016},
  month={may},
  organization={IEEE}
}

@inproceedings{landgren2016bdistributed,
  title={Distributed cooperative decision-making in multiarmed bandits: Frequentist and Bayesian algorithms},
  author={Landgren, Peter and Srivastava, Vaibhav and Leonard, Naomi Ehrich},
  booktitle={Decision and Control (CDC), 2016 IEEE 55th Conference on},
  pages={167--172},
  year={2016},
  month={sep},
  organization={IEEE}
}

Main tex

\documentclass{article}

\begin{document}


\nocite{*}
\bibliographystyle{apalike}
\bibliography{refs.bib}

\end{document}

Best Answer

You can fix the issue without changing the bst file (and making the copy editors happy, if you're submitting the paper and apalike is the required bib style). The sorting order, when the same list of author is shared by two entries, is determined by the title.

\begin{filecontents*}{\jobname.bib}
@inproceedings{landgren2016distributed,
  title={{\noopsort{A}{On}} distributed cooperative decision-making in multiarmed bandits},
  author={Landgren, Peter and Srivastava, Vaibhav and Leonard, Naomi Ehrich},
  booktitle={Control Conference (ECC), 2016 European},
  pages={243--248},
  year={2016},
  month=may,
  organization={IEEE}
}

@inproceedings{landgren2016bdistributed,
  title={{\noopsort{B}{Distributed}} cooperative decision-making in multiarmed bandits: Frequentist and Bayesian algorithms},
  author={Landgren, Peter and Srivastava, Vaibhav and Leonard, Naomi Ehrich},
  booktitle={Decision and Control (CDC), 2016 IEEE 55th Conference on},
  pages={167--172},
  year={2016},
  month=sep,
  organization={IEEE}
}
\end{filecontents*}

\documentclass{article}

\newcommand{\noopsort}[2]{#2}

\begin{document}

\nocite{*}
\bibliographystyle{apalike}
\bibliography{\jobname}

\end{document}

This way BibTeX sorts according to A and B, rather than according to On and Distributed.

I used filecontents* just for making the example self-contained.

enter image description here

Related Question