[Tex/LaTex] Referencing (not Bibliography) in Harvard Style using Write Latex

bibliographiesbibtexharvard-style

I am relatively new to Latex and I am trying to write my first project thesis. I am using WriteLatex, which is an online Latex environment. I was successful in obtaining the references from many sites, imported them into a .bib file in Bibtex and cite them in Author Year title format. My problem arises when I cannot see the References at the bottom in Harvard style. What I want to see is this

[Alpaydin,2004] Ethem Alpaydin, Introduction to Machine Learning, MIT Press, 2004.

What I get is just this under the name Bibliography

Ethem Alpaydin, Introduction to Machine Learning, MIT Press, 2004.

I am using the following packages

\documentclass[a4paper]{report}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{graphicx}
\usepackage{natbib}

\begin{document}

\addcontentsline{toc}{subsection}{Bibliography}
\bibliography{Ref} %My .bib file
\bibliographystyle{plainnat}
\end{document}

Edit: The Bibliography files are of the format:

@book{alpaydin2004introduction,
  title={Introduction to machine learning},
  author={Alpaydin, Ethem},
  year={2004},
  publisher={MIT press}
}

Can someone please help me get the Harvard style referencing even at the end of the document in the style I mentioned above. Thanks in advance

Best Answer

To get the appearance of the entries in the references, keep using the plainnat bibliography style but do not load the natbib package. You'll get:

enter image description here

\documentclass[a4paper]{article} % to keep output all on one page
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb,amsthm,graphicx}
%\usepackage{natbib} %% deliberately commented out
\bibliographystyle{plainnat}
\usepackage{filecontents}
\begin{filecontents*}{Ref.bib}
@book{alp:04,
  author   = "Ethem Alpaydin", 
  title    = "Introduction to Machine Learning",
  publisher= "MIT Press",
  year     = 2004,
}
\end{filecontents*}
\begin{document}
\cite{alp:04}
\bibliography{Ref}
\end{document}

If you do not want square brackets surrounding the citation callout, i.e., if you want it to look like Alpaydin(2004), you should also provide the following instructions in the preamble:

\usepackage[noadjust]{cite}
\renewcommand\citeleft{}
\renewcommand\citeright{}

If you did load natbib -- and, of course, didn't load the cite package as well -- you'd get the following look, which is, I gather, not what you want:

enter image description here

Related Question