i need the command for citing my reference with author and year e.g magda(1980) [duplicate]

I used the following commands to do so but could not able to produce name of author with year. I only produced author name.

\usepackage[round]{natbib}
\begin{thebibliography}
\bibitem[Magda(1980)]{ref1}Magda C.G.(1980).Circular balanced repeated measurements designs, \textit{Comm. Statist.Theory   Methods} \textbf{9}, 1901-1918.
\bibliographystyle{plainnat}
\end{thebibliography}

• Did you use any \cite commands? Try with \citet{ref1}. – Troy Sep 1 '17 at 13:53
• yes i used it but its not giving me required result – muhammad daniyal Sep 1 '17 at 13:56
• its giving me Magda[1] – muhammad daniyal Sep 1 '17 at 13:57
• Can you provide a minimal compilable example so that we can reproduce your problem? Includes the documentclass, the \begin{document} and \end{document} commands etc. – Troy Sep 1 '17 at 13:58
• You can edit your code into the question with the edit button below your question. – Troy Sep 1 '17 at 14:02

You're mixing two different bibliography systems here. If you want to write the bibliography manually in a thebibliography environment, there are a couple of things to change:

• Remove \bibliographystyle{plainnat}
• Add the mandatory argument to the thebibliography environment, i.e. \begin{thebibliography}{9}. (If you have 10 or more citations, use e.g. 99 instead of 9.)

\documentclass[round,authoryear]{elsarticle}
\begin{document}
\citep{ref1} \citet{ref1}
\section*{\refname}
\begin{thebibliography}{9}
\bibitem[Magda(1980)]{ref1} Magda C.G.(1980). Circular balanced repeated measurements designs, \textit{Comm. Statist.Theory   Methods} \textbf{9}, 1901--1918.
\end{thebibliography}
\end{document}

• i think there is clash of package between elsarticle and using natbib – muhammad daniyal Sep 1 '17 at 14:45
• @muhammaddaniyal Oh, right, you were using that class, sorry. Use \documentclass[round,authoryear]{elsarticle} and remove natbib. – Torbjørn T. Sep 1 '17 at 14:48
• thanks a lot.. you made it quite easy for me to understand.. thanks once again – muhammad daniyal Sep 1 '17 at 14:50