23

How do I cite multiple papers in RMarkdown as I would do in LaTex with

\cite{Bartel2004, Bartel2009a}

I tried

[@Bartel2004, @Bartel2009a]

which renders to

(D. P. Bartel 2004, David P. Bartel (2009))

which is not too bad, but the second brackets should not be there.

EDIT:

  • minimal working example at github gist.
  • pandoc version

    pandoc 1.19.2.1
    Compiled with pandoc-types 1.17.0.4, texmath 0.9, skylighting 0.1.1.4
    
Gregor Sturm
  • 2,792
  • 1
  • 25
  • 34
  • I think this is a valid question (@Will I wonder how much experience you have with R Markdown and Pandoc). I vaguely remember I ran into this issue before but I didn't investigate it. @GregorSturm It will be nice if you could provide a minimal reproducible example as well as your pandoc version (`rmarkdown::pandoc_version()`). – Yihui Xie Jun 26 '17 at 20:06
  • @Yihui, I now provide example files. – Gregor Sturm Jun 26 '17 at 20:29
  • 1
    Excellent! I can reproduce your issue. I'll see what I can do when I have got more time, unless someone else can provide an answer. – Yihui Xie Jun 26 '17 at 20:30
  • @Yihui None, actually. This question (and similar ones!) would *greatly* benefit if someone familiar with RMarkdown created a tag for it and detailed, in the tag synopsis, how it is related to programming. Would prevent confusion in the future and increase the visibility of questions like this to folks with domain knowledge. Good luck. –  Jun 26 '17 at 20:40

2 Answers2

40

According to this Github issue:

Multiple citations in the same bracket should be separated by a semicolon ; instead of a comma.

So you need to use [@Bartel2004; @Bartel2009a] instead of [@Bartel2004, @Bartel2009a].

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
  • This is not enough highlighted [here](https://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html) ... – Fran Oct 04 '19 at 10:01
0

Instead of a comma, you should use a semi-colon between the keys: [@Bartel2004; @Bartel2009a]