The following is a minimum working example on Overleaf. The below code works as expected, and gives the correct output:
\documentclass[8pt]{article}
%\documentclass[final,5p,times,twocolumn,number,sort&compress]{elsarticle}
\usepackage[utf8]{inputenc}
\usepackage[labeled,resetlabels]{multibib}
\newcites{G}{Good references}
\newcites{B}{Bad references}
\begin{document}
These are normal references \cite{johnjane}.
The special references are \citeG{goodbook} and \citeB{badbook}.
\bibliographystyle{plain}
\bibliography{normalref.bib}
\bibliographystyleG{plain}
\bibliographyG{goodref.bib}
\bibliographystyleB{plain}
\bibliographyB{badref.bib}
\begin{filecontents}{normalref.bib}
@inproceedings{
johnjane,
title={Cinderella},
author={Doe, John and Doe, Jane},
booktitle={Bedtime stories},
pages={200},
year={2020}
}
\end{filecontents}
\begin{filecontents}{goodref.bib}
@inproceedings{
goodbook,
title={How to hack?},
author = {Monkey Luffy},
booktitle={Ethical hacking},
pages={36--40},
year={2015}
}
\end{filecontents}
\begin{filecontents}{badref.bib}
@inproceedings{
badbook,
title={How to hack?},
author={Blackbeard},
booktitle={Unethical hacking},
pages={36--40},
year={2015}
}
\end{filecontents}
\end{document}
Correct output with the usage of multibib:
When I use the elsarticle class instead of the article class, i.e., when I comment out the first line and uncomment the second line in the above code, the output is not as expected.
Wrong output when using elsarticle class file (which is apparently provided by Overleaf):
Can someone help me get the correct output when using the elsarticle class file? As mentioned, my code is on Overleaf.


elsarticleusesnatbib. See https://tex.stackexchange.com/a/471427/226 but you'll have to replace\citeO, \oldCiteO with\citeG,\citeB,\oldciteG,\oldciteBto suit your own purposes. – imnothere Oct 03 '20 at 02:26