[Tex/LaTex] Question mark shown instead of citation using harvard

cite-packageharvard-stylenatbib

I am getting [?] when citing using harvard. If I use \citeasnoun I get the citation. How do I solve this problem. I am using TeXnicCenter with MikTeX 2.9 and installed the harvard package.

\documentclass[a4paper,12pt]{article}
\usepackage{float,epsfig}
\usepackage{pifont,epsfig}
\usepackage[dvips]{color}
\usepackage{graphicx,color}
%\usepackage{harvard}
\usepackage{natbib}
\usepackage[sort]{cite}
%\usepackage{ifpdf}
\usepackage{cleveref}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{example}[theorem]{Example}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\usepackage{amsfonts}
\renewcommand{\baselinestretch}{1.0}
\parindent=0pt                  % Do not indent paragraphs
\setlength{\hoffset}{-0.5cm}
\setlength{\voffset}{-2.0cm}
\setlength{\textheight}{9.3in}
\setlength{\textwidth}{5.8in}
\begin{document}
------
 \bibliographystyle{agsm}
 \bibliography{ref}
%\input{bio_2}
\end{document}

When I use natbib I get it correct. I also wish to replace & with and when I use \citet in natbib.

Best Answer

It seems you want sorted citations and therefore load both the harvard and cite packages, but apparently the latter is not compatible with the former. I suggest that you load just natbib with its sort option, which emulates the sort option of cite .

\documentclass[a4paper,12pt]{article}

% Variant A: Doesn't work
% \usepackage{harvard}
% \usepackage[sort]{cite}

% Variant B: Works
\usepackage[sort]{natbib}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{B02,
  author = {Buthor, B.},
  year = {2002},
  title = {Bravo},
}
\end{filecontents}

\begin{document}

\citep{B02,A01}

\bibliographystyle{agsm}
\bibliography{\jobname}

\end{document}

enter image description here