[Tex/LaTex] how to use harvard (authoryear) style to format citation call-outs

citingharvard-stylenatbib

The paper is required to format citation call-outs with the harvard style (aka authoryear style) like:

format requirements

The content of my *.tex file is like this:

 ...
 \usepackage{natbib,stfloats}
 \begin{document}%

 \citet{ananthanarayanan2011scarlett} create more replicas for hot files
 to simplify the scheduling decision-making. EC (erasure
 coding) to alleviate the low storage efficiency of multi-replicas in
 HDFS~\citep{sathiamoorthy2013xoring, subedi2015finger, xia2015tale}. The
 benefits of data prefetching have been widely
 discussed~\citep{prajapati2014locality,chen2012data}.

 \bibliographystyle{agsm}
 % \bibliographystyle{abbrvnat}
 % \setcitestyle{authoryear,open={(},close={)}}
 \bibliography{refs}
 \end{document}

The final result is not as I want. The problems are:

  1. for two authors the format is not (A and B, year) but (A & B year)

  2. for three or more authors is not (A et al., year) but ( A et al. year)

  3. groups of call-outs should be listed first alphabetically and then chronologically, but the formatted result is (Zaharia et al. 2008, Magalhães et al. 2015), not first alphabetically, and call-outs are not separated by ';'.

An example shows the formatted result:

agsm formatted result

I then turned to set the bibliography style to abbrvnat:

  \bibliographystyle{abbrvnat}
  \setcitestyle{authoryear,open={(},close={)}}

The formatted result changes to:

abbrvnat bst format

But it still has the first alphabetically problem, and it induces another problem that the call-outs are not surrounded by "()" but by "[]".

Can someone help me out of this problem? Is the problem of the cite command or the configuration of bst, so can anyone can give an short cite and config example to format paper as required. thank you!

Best Answer

For the approach with the abbrvnat bibliography style, try issuing the instruction

\setcitestyle{authoryear,round,semicolon} 

after loading natbib. Thus, omit the open={(},close={)} part. By the way, whenever one makes changes to the argument of \setcitestyle, one should recompile the document fully -- LaTeX, BibTeX, and LaTeX twice more -- to propagate all changes.

As far as I can tell, both the natbib and the harvard citation management packages order the formatted citation call-outs in the ordering provided in the input (\citep and \citet). Thus, I'm afraid it's up to you to list the arguments of \citep in the desired ordering.