Search code examples
rlatexknitrr-markdownbibtex

How can I specify the default bibliography LaTeX/BibTeX citation styles "plain" or "unsrt" in an R Markdown document?


I'm writing a journal paper using R Markdown, and I want to use the default bibliographic citation style "unsrt". Or "plain". Either will do. We still use these in my field.

This page provides information on citations and citation styles in R Markdown: http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html#citations_for_pdf_output But the links there do not give any clues as to how to get the "plain" or "unsrt" styles. They don't seem to be available! How do I specify these default styles?

Alternatively, how do I convert a .bst file to a .csl file, or what style in the Zotero style archive is closest to plain or unsrt?


Solution

  • First, you need to turn on natbib with pandoc option --natbib so it doesn't use pandoc-citeproc. Then, you can use biblio-style to set your prefered style. Here is a minimal YAML header that does the trick:

    ---
    output:
      pdf_document:
        pandoc_args: ["--natbib"]
    biblio-style: plain
    bibliography: mybibfile.bib
    ---