1

I am trying to get Harvard citation style, but this keeps using numbering.

\documentclass{elsarticle}

\usepackage{natbib}


\bibliographystyle{dcu}

\begin{document}

\cite{xx}

\bibliography{a}


\end{document}

Also, how do I ensure the order in the bib follows last name order?

1
  • 1
    Fixed by using \documentclass[authoryear]{elsarticle} - I thought it was enough to do it in natbib, but that's not the case when using elsarticle.
    – kloop
    Commented Mar 6, 2020 at 14:11

1 Answer 1

1

elsarticle already loads natbib, unless instructed otherwise with the nonatbib option. What's more, elsarticle loads natbib with the number option by default – again unless instructed otherwise with the document class option authoryear.

So

\documentclass[authoyryear]{elsarticle}

\bibliographystyle{dcu}

\begin{document}
\cite{incollection-full}

\bibliography{xampl}
\end{document}

would tell elsarticle to prepare author-year citations. When I run that MWE, however, I get two error messages

! Undefined control sequence.
l.1 \harvardpreambledefs
                        {%
? 
! Undefined control sequence.
l.4 \harvardpreambletext
                        {%
? 

That is because te dcu bibliography style is part of the harvard bundle and should be used together with \usepackage{harvard}. But the harvard package can't be loaded with with natbib, so we need

\documentclass[nonatbib]{elsarticle}

\usepackage{harvard}
\bibliographystyle{dcu}

\begin{document}
\cite{incollection-full}

\bibliography{xampl}
\end{document}

Interestingly har2nat instead of harvard is not enough here.


But if you are using elsarticle you should probably use one of their bibliography styles and not some random other style, so

\documentclass[authoryear]{elsarticle}

\bibliographystyle{elsarticle-harv}

\begin{document}
\cite{incollection-full}

\bibliography{xampl}
\end{document}

would be a much better idea.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .