rmarkdown: how to use multiple bibliographies for a document

Viewed 2765

[My environment: Win 7 Pro / R 3.2.1 / knitr_1.12.3 / R Studio Version 0.99.892]

I am trying to write an article in .Rmd format using R Studio, Knit -> PDF, and I've been following http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html for details of how to get pandoc and pandoc-citeproc to produce a References section and citations in the text.

My BibTeX references are in several different .bib files, which, when using LaTeX in .Rnw files, are all found in my local texmf tree via

\bibliography{statistics, graphics}

I can't seem to make this work with pandoc-citeproc. My YAML header has the following, that works for one .bib file, as long as it is in the same directory as the source .Rmd file:

    ---
    title: "Notes on Testing Equality of Covariance Matrices"
    author: "Michael Friendly"
    date: '`r format(Sys.time(), "%B %d, %Y")`'
    output:
      pdf_document:
        fig_caption: yes
        keep_tex: yes
        number_sections: yes
    csl: apa.csl
    bibliography: statistics.bib
    ---

Following advice in the link given above, I tried:

bibliography: [statistics.bib,graphics.bib]

this gives:

pandoc-citeproc.exe: "stdin" (line 50, column 12):
unexpected ":"
expecting letter, digit, white space or "="
pandoc.exe: Error running filter pandoc-citeproc
Filter returned error status 1

[Edit: For completeness, I show the generated pandoc command, where it looks like both .bib files are passed correctly]:

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS EqCov.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output EqCov.pdf --template "C:\R\R-3.2.1\library\rmarkdown\rmd\latex\default-1.15.2.tex" --number-sections --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in" --bibliography statistics.bib --bibliography graphics.bib --filter pandoc-citeproc 
output file: EqCov.knit.md

So do all the following forms:

    bibliography: ["statistics.bib","graphics.bib"]

    bibliography: 
      - "statistics.bib"
      - "graphics.bib"

    bibliography: 
      - statistics.bib
      - graphics.bib

Ideally, I'd like to be able to use one of the following forms, and not have to copy the .bib files to the document directory.

bibliography: ["C:/Dropbox/localtexmf/bibtex/bib/statistics.bib","C:/Dropbox/localtexmf/bibtex/bib/graphics.bib"]

bibliography: 
 - "C:/Dropbox/localtexmf/bibtex/bib/statistics.bib"
 - "C:/Dropbox/localtexmf/bibtex/bib/graphics.bib"
1 Answers
Related