15

I have trouble getting the form of citations I need. Once I cite I want to see authors' names and not numbers. The unconventional thing is that I have to use the documentclass elsarticle (This is editor's request), which always produce numbers. Here is it what I have

\documentclass{elsarticle}
\usepackage{natbib}
\usepackage[colorlinks=true,linkcolor=black, citecolor=blue, urlcolor=blue]{hyperref}

\begin{document}

\bibliographystyle{plainnat}
\bibliography{references}

\end{document}

Can someone help me on this?

Here's an expanded MWE.

\documentclass{elsarticle}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{amsmath, mathtools}
\usepackage{natbib}
\usepackage[colorlinks=true,linkcolor=black, citecolor=blue, urlcolor=blue]{hyperref}
\usepackage{changes}
\usepackage{appendix}
\usepackage{filecontents}
\usepackage{multirow}
\usepackage{booktabs}



\begin{document}

\section{The Model}

The main environment modifies that of \cite{Diamond1965}, into two main dimensions

\newpage

\bibliographystyle{elsarticle-harv}
\bibliography{references}



\end{document}
egreg
  • 1,121,712
user17880
  • 623

3 Answers3

24

You should specify authoryear in the class options.

\begin{filecontents*}{\jobname.bib}
@article{Diamond1965,
 author={J. A. L. Diamond},
 title={Some Like It Hot},
 journal={J. High Level Cinema},
 year={1965},
}
\end{filecontents*}

\documentclass[authoryear]{elsarticle}

\usepackage[colorlinks=true,linkcolor=black, citecolor=blue, urlcolor=blue]{hyperref}

\begin{document}

\section{The Model}

The main environment modifies that of \cite{Diamond1965}, into two main dimensions

\bibliographystyle{plainnat}
\bibliography{\jobname}

\end{document}

The filecontents* environment is just to make the example selfcontained, you don't need it; change the \bibliography line to have the name of your .bib file.

Yes, I know that “Some Like It Hot” wasn't shot in 1965. ;-)

enter image description here

Adding the authoryear to natbib is not a solution, because the elsarticle class already loads it, so having

\usepackage[authoryear]{natbib}

in the preamble will only cause an error about conflicting options.

egreg
  • 1,121,712
10

Since you're using the elsarticle document class, you may want to use the elsarticle-harv instead of the plainnat bibliography style. As its name suggests, elsarticle-harv.bst gives you authoryear-style citations -- aka harvard-style citations -- and references that are formatted according to the guidelines of most Elsevier-run journals that require authoryear-style citations.

Moreover, in order to activate full authoryear style (with years rather than numbers), authoryear should be specified as a documentclass option:

\documentclass[authoryear]{elsarticle}

(This information added after the OP posted an MWE.)

Mico
  • 506,678
  • 3
    Thank you for the answer. I changed to elsarticle-harv, but for some mysterious reason to me I still get the number style citation. – user17880 Mar 25 '14 at 11:20
  • @user17880 - After changing the argument of the \bibliographystyle instruction, did you run LaTeX, BibTeX, and LaTeX twice more? Also, do try adding the option authoryear when loading the natbib package, i.e., typing \usepackage[authoryear]{natbib} (and, of course, rerun LaTeX, BibTeX, and LaTeX twice more). – Mico Mar 25 '14 at 11:28
  • I did it now, but it does nothing. I also, delete the whole files that latex is producing after compiling but again nothing happens. I only get authors names if I changed the document class to, for example, article. – user17880 Mar 25 '14 at 11:34
8

if you are using the elsevier reference style (which contains all the packages itself) you can pose bibliography options like this:

\bibliographystyle{elsarticle-harv}\biboptions{authoryear}