How to cite multiple papers in RMarkdown
Asked Answered
M

2

24

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
    
Mourant answered 26/6, 2017 at 19:32 Comment(4)
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()).Dextro
@Yihui, I now provide example files.Mourant
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.Dextro
@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.Leukocyte
D
41

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].

Dextro answered 27/6, 2017 at 17:6 Comment(1)
This is not enough highlighted here ...Ruddy
N
0

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

Nosh answered 29/10, 2022 at 9:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.