0

I use the below given code for getting Harvard style of citation. I have used the package natbib and used \bibliographystyle{agsm}. I get Harvard style in reference section. However, in the body of the document, it cites as "1" instead of the required author year format. I am not able to fix it. Please share your thoughts regarding the possible error.

\documentclass[review]{elsarticle}
\usepackage{natbib}
%\journal{Journal of \LaTeX\ Templates}
\begin{document}
This is a test doc \cite{testref}.
\section*{References}
\bibliographystyle{agsm}
\bibliography{ref}
\end{document}

Please see the results enter image description here

And with the following change I get name in text but with extra bracket 1 and no year as shown below

\documentclass[review]{elsarticle}
\usepackage{natbib}
%\journal{Journal of \LaTeX\ Templates}
\begin{document}
This is a test doc \citet{testref}.
\section*{References}
\bibliographystyle{plainnat}
%\bibliographystyle{agsm}
\bibliography{ref}
\end{document}

enter image description here

2

The elsarticle class already loads natbib. By default natbib is loaded with the numbers option and thus produces numeric citations. For author-year citations you can load elsarticle with the authoryear option.

The elsarticle documentation explains in §11 Bibliography (p. 13)

natbib package is loaded by elsarticle with numbers as default option. You can change this to author-year or harvard scheme by adding option authoryear in the class loading command. If you want to use more options of the natbib package, you can do so with the \biboptions command, which is described in the section 4, Usage.

\documentclass[review,authoryear]{elsarticle}
\begin{document}
This is a test doc \citep{sarfraz}.

As \citet{sarfraz} found.

\bibliographystyle{agsm}
\bibliography{biblatex-examples}
\end{document}

This is a test doc (Sarfraz and Razzak, 2002).//As Sarfraz and Razzak (2002) found.


Note that elsarticle comes with its own set of .bst files. If you are planning to submit to an Elsevier journal (IMHO that is the only good reason for using the elsarticle class), I suggest you have a look at elsarticle-harv instead of asgm for author-year citations.

\documentclass[review,authoryear]{elsarticle}
\begin{document}
This is a test doc \citep{sarfraz}.

As \citet{sarfraz} found.

\bibliographystyle{elsarticle-harv}
\bibliography{biblatex-examples}
\end{document}

This is a test doc (Sarfraz and Razzak, 2002).//As Sarfraz and Razzak (2002) found.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.