[Tex/LaTex] harvard style referencing

harvard-stylenatbib

I am new to LaTeX and I need to change the style of an article.
Setting in tex file is:

\documentclass[12pt,a4paper]{article}
\usepackage{natbib}
\usepackage{hyperref}
\numberwithin{equation}{section}
\usepackage{natbib}
\bibliographystyle{dcu}
\begin{document}
\bibliography{final} 
\end{document}

An example in the bib file:

@article{Clement1999,
author = {Clement, A. and Cane, M. A. and Seager, R},
title = {{Orbital controls on the Tropical climate}},
journal = {Paleoceanography},
year = {1999},
volume = {14},
pages = {441--456}
}

It shows the referencing style in text and the list of references:

(Simmons 1980)

Simmons, N.M. (1980). Behaviour. In The Desert Bighorn, ed. G. Monson and L. Summer. Tucson, AZ: University of Arizona Press: 124-44.

I need to change the style to:

(Simmons, 1980)

Simmons, N.M. (1980). Behaviour. In The Desert Bighorn, ed. G. Monson and L. Summer. Tucson, AZ: University of Arizona Press, pp. 124-44.

I have tried the following ways to change the style:

\bibliographystyle{dcu} was changed to \bibliographystyle{agsm} the style remains the same in the pdf file after rerunning tex file. Rerunning of bib file showed this message:

! Missing $ inserted.

            $

               \mskip 

\,->\mskip

       \thinmuskip 

l.440 … of Florida Current transport at 27{\$}\,

                                              ^\circ{\$}N}},

\usepackage{natbib} was changed to \usepackage[comma]{natbib}. Console output showed the message: [comma] clash with natbib.

\cite{key} was changed to \citep{key}. After running the tex file, the style still remains the same (author year).

What should I do to show a comma between name and year in citation and to have 'pp.' instead of colon in references?

Thank you for your help in advance.

Best Answer

What should I do to show a comma between name and year in citation?

A: Load the natbib package with the option comma -- \usepackage[comma]{natbib} -- and use the command \citep to cite the piece in question.

The second question, which bibliography style to use to get the formatting the way you say you want it, is quite a bit harder to answer. As shown below, none of the style files that are belong to the harvard citation management package (two of which are dcu and agsm) deliver precisely what you say you want. Listed alphabetically by style file (and skipping over the somewhat specialized nederlands style), the formatting produced by the package's style files is as follows:

agsm

enter image description here

apsr

enter image description here

dcu

enter image description here

jmr

enter image description here

jphysicsB

enter image description here

kluwer

enter image description here

I'd say the apsr bibliography style comes closest to delivering the formatting you say you want -- although you'll probably have to enter by hand the comma that appears to be missing between the name of the publisher and the pp string...

Interestingly, all of these styles happen to prefix the string "pp. " before the contents of the pages field -- at least for entries of type @incollection.

Of course, there are many, many bibliography style files out there that can produce authoryear-style citations. You should certainly not feel constrained to choose from the just the half dozen of style files provided by "harvard" package.


Addendum to address some of the OP's follow-up comments:

  • If the instruction \usepackage[comma]{natbib} gives you an error message along the lines you report, it's probably because the package has already been loaded (maybe by the document class you're using). In fact, your MWE loads the natbib package twice. If you add the option comma to the second \usepackage{natbib} instruction you're guaranteed to get the error message you report getting.

    If you can't get rid of the first, incompatible \usepackage{natbib} statement, executing the instruction

    \setcitestyle{aysep={,}}
    

    should work. See p. 12 of the natbib package's user guide for more on the \setcitestyle macro.

  • Because your MWE doesn't feature a \cite or \nocite command, the instruction \bibliography{final} will not produce any output. Your MWE is also missing the instruction \usepackage{amsmath}; without it the preamble instruction \numberwithin{equation}{section} will cause an error. Separately, if you want to use hyperref, you should load hyperref after natbib; and, if you want the citation callouts to be made into hyperlinks to the corresponding bibliographic entries,

  • It looks like you have a typo in the sentence on the Florida Current. I would try

    Florida Current transport at 27\,${}^{\circ}$N
    

    At any rate, this matter does not look to be related directly to citations and bibliography generation, right? It looks like an "ordinary" LaTeX syntax error to me...

A fully modified/corrected version of your MWE produces the following output. (Be sure to run LaTeX, BibTeX, and LaTeX twice more on the file.) Note the comma between the author string and the year string in the citation callout.

enter image description here

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}  % this was missing in your code
\numberwithin{equation}{section}
\usepackage{natbib}   % no point in loading a package more than once...
\setcitestyle{aysep={,}} 
\bibliographystyle{dcu}
\usepackage[colorlinks=true,citecolor=blue]% %% added these two options
   {hyperref} % hyperref should be loaded _after_ natbib
\usepackage{filecontents}
\begin{filecontents*}{final.bib}
@article{Clement1999,
   author  = {Clement, A. and Cane, M. A. and Seager, R.},
   title   = {{Orbital controls on the Tropical climate}},
   journal = {Paleoceanography},
   year    = {1999},
   volume  = {14},
   pages   = {441--456}
}
\end{filecontents*}
\begin{document}
\citep{Clement1999}  %% need at least one \cite, \citet, or \citep command...
\bibliography{final} 
\end{document}

Here's the MWE that was used to create the first set of screen shots shown above.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[comma]{natbib}
\usepackage{har2nat}
\bibliographystyle{agsm}
  %% or: apsr, dcu, jmr, jphysicsB, kluwer
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@incollection{simmons:1980,
   author    = "N. M. Simmons",
   title     = "Behaviour",
   pages     = "124-44",
   year      = 1980,
   booktitle = "The Desert Bighorn",
   editor    = "Gale Monson and Lowell Summer",
   publisher = "University of Arizona Press",
   address   = "Tucson, AZ",
}
\end{filecontents*}
\begin{document}\pagestyle{empty}
\citep{simmons:1980}
\bibliography{\jobname}
\end{document}