3

I'm writing my package's vignette and I'm trying include a paper containing multiple authors as reference, using something like this in the beginning of the code:

---
references:
- id: doe2009
  title: A Method for Something
  author:
  - family: Doe
    given: John
  - family: Shepard
    given: Jane
  container-title: Some Journal
  volume: 11
  issue: 45
  page: 33-39
  type: article-journal
  issued:
    year: 2009
---

Problem is, my citation goes on the end like this:

Doe, John, and Jane Shepard. 2009. “A Method for Something.” Some Journal 11 (45): 33–39.

There is one pattern for the first author and another for the second author.

How can I change this to a more consistent form? Also, I'm trying to avoid external files to my package... is there a way for doing this without using an external csl?

I'm sorry that the problem may sound trivial. I don't know nothing about CSL and this is my first attempt to publish a package.

jbrettas
  • 323
  • 1
  • 7

1 Answers1

8

Sorry, but I don't think this can be done without an external file.

The RStudio help page on bibliographies says

By default, pandoc will use a Chicago author-date format for citations and references. To use another style, you will need to specify a CSL 1.0 style file in the csl metadata field.

Going to the Zotero style repository page for Chicago format (and mousing over the first style entry) shows that the Chicago style does indeed set the last author name as "Firstname Lastname" (all others as "Lastname, Firstname").

Going haphazardly to a different style, e.g. the APA style, can give you a style with consistent author formats independent of order (click to download one of the CSL files).

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • Thank you for the help. I'll consider using another style then, even if this implies on calling external data to build the vignette. – jbrettas Jan 01 '16 at 23:33
  • 1
    Actually, the only options in CSL are: a) always use "Firstname Lastname", b) use "Lastname, Firstname" for the first name and "Firstname Lastname" for all following names, and c) always use "Lastname, Firstname". See the description of the "name-as-sort-order" attribute at http://docs.citationstyles.org/en/stable/specification.html#name. Option b, as used by Chicago author-date, is common for styles that sort bibliographic entries alphabetically. – Rintze Zelle Feb 19 '16 at 16:23