Harvard Referencing in R Markdown + getting in-text references to be seperated by a comma

I am using R markdown for a pdf document, however I just have to do some minor tweaks to my citations.

Firstly, is there a package which will put my BibTeX references in Harvard format?

And secondly, how can I get the author's surname and the year to be seperated by a comma within my in-text citations?

Here is one of the references in my BibTex file

@article{schwarz1978estimating,
  title={Estimating the dimension of a model},
  author={Schwarz, Gideon and others},
  journal={The annals of statistics},
  volume={6},
  number={2},
  pages={461--464},
  year={1978},
  publisher={Institute of Mathematical Statistics}
}

When I in-text reference this, it generates (Schwarz 1978). I would like a comma to seperate the surname and the year.

1 Like

Take a look at the harvard \LaTeX package.

I tried installing this package in my R Markdown file, however it appears that this package in unavailable in R.

I'm wondering if there is a pure R-Markdown solution to this?

For reference, the issue has also been posted on SO

It also look like you got an answer there.

@tanga94 please look at the cross referencing policy for next times. It is not advise to post, at the same time, on multiple forums, and when you do, always link to your cross post. If the answer there is ok, please put it here also and mark it as solution to help everyone.
thanks!

Rmarkdown passes the bibtex intoformation to ['pandoc-citeproc](https://github.com/jgm/pandoc-citeproc/blob/master/man/pandoc-citeproc.1.md), which has four options: 1) a the default $\LaTeX$ template, 2) the chicago-author-date.csl, 3) a custom cls or 4) an include statement invoking another \$LaTeX$ (not R) package such as 'harvard.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.