1

I got a problem using R-markdown to write my master's work. I am using the papaja package. Everything's fine except that when I knit my document to produce a pdf the first name of the author in my bibliography are BEFORE the last name. Here is a little reproducible example of my problem. Here is the r-makrdown content:

 ---
title: "The title"
shorttitle: "Title"
author: 
  - name: First Author
    affiliation: 1
    corresponding: yes    # Define only one corresponding author
    address: Postal address
    email: my@email.com
  - name: Ernst-August Doelle
    affiliation: "1,2"
affiliation:
  - id: 1
    institution: Wilhelm-Wundt-University
  - id: 2
    institution: Konstanz Business School

abstract: |
  Enter abstract here (note the indentation, if you start a new paragraph).

note: |  
  Complete departmental affiliations for each author (note the indentation, if you start a new paragraph).

  Enter author note here.

keywords: "keywords"

wordcount: X

class: man
lang: american
figsintext: yes
lineno: yes
bibliography:
  - r-references.bib

output: papaja::apa6_pdf
---

```{r message = FALSE, warning = FALSE}
library("papaja")
apa_prepare_doc() # Prepare document for rendering
```

[@R-papaja]

# References
```{r create_r-references}
r_refs(file = "test-references.bib")
```

\setlength{\parindent}{-0.5in}
\setlength{\leftskip}{0.5in}
\setlength{\parskip}{8pt}

And here are my references which are in the "test-references.bib" file:

 %% This BibTeX bibliography file was created using BibDesk.
 %% http://bibdesk.sourceforge.net/


 %% Created for Lucien at 2015-12-09 13:45:03 +0100 


 %% Saved with string encoding Unicode (UTF-8) 



 @Manual{R-base,
   title = {R: A Language and Environment for Statistical Computing},
   author = {{R Core Team}},
   organization = {R Foundation for Statistical Computing},
   address = {Vienna, Austria},
   year = {2015},
   url = {https://www.R-project.org/},
 }
 @Manual{R-papaja,
   author = {Frederik Aust and Marius Barth},
   title = {papaja: Create APA manuscripts with RMarkdown},
   year = {2015},
   note = {R package version 0.1.0.9054},
   url = {https://github.com/crsh/papaja},
 }

The output in the pdf for the reference is:

Frederik Aust and Marius Barth.papaja: Create APA manuscripts with RMarkdown, 2015.20URL https://github.com/crsh/papaja. R package version 0.1.0.9054.

And I expect:

Aust Frederik and Barth Marius .papaja: Create APA manuscripts with RMarkdown, 2015.20URL https://github.com/crsh/papaja. R package version 0.1.0.9054.

neilfws
  • 32,751
  • 5
  • 50
  • 63
GyrLu
  • 33
  • 4
  • 1
    The format of a citation will be given by the csl file. You can view the csl file for papaja [here](https://github.com/crsh/papaja/blob/1f28fafa1cbb16efb8f6b97d59e7f937be47131c/inst/rmarkdown/templates/apa6/resources/apa6.csl). You will need to edit the local copy. Unfortunately, I don't know what to change to get the formatting you desire. – r.bot Dec 09 '15 at 13:47
  • Indeed, something seems to be at odds with the CSL file. Neither the erroneous nor the expected references are in APA style. Try reinstalling papaja and see if that fixes the problem. – crsh May 17 '17 at 07:18

1 Answers1

2

Your paper was probably already due... Anyway. You should have the authors in the format Lastname, Firstname [and Lastname, Firstname]*.

In your case:

@Manual{R-papaja,
  author = {Aust, Frederik and Barth, Marius},
  title = {papaja: Create APA manuscripts with RMarkdown},
  year = {2015},
  note = {R package version 0.1.0.9054},
  url = {https://github.com/crsh/papaja},
}
Toaditoad
  • 254
  • 2
  • 12