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
A: Load the
natbib
package with the optioncomma
--\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
andagsm
) deliver precisely what you say you want. Listed alphabetically by style file (and skipping over the somewhat specializednederlands
style), the formatting produced by the package's style files is as follows:agsm
apsr
dcu
jmr
jphysicsB
kluwer
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 thepp
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 thenatbib
package twice. If you add the optioncomma
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 instructionshould 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 usehyperref
, you should loadhyperref
afternatbib
; 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
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.
Here's the MWE that was used to create the first set of screen shots shown above.