⚠️There's a newer version (0.1.0.9997) of this package. Take me there.

papaja: Create APA manuscripts with RMarkdown

papaja is a R-package in the making including a RMarkdown template that can be used with RStudio (or without) to produce complete manuscripts (PDF and Word documents), which conform to the American Psychological Association (APA) manuscript guidelines (6th Edition). To do so, papaja uses the LaTeX document class apa6 and a .docx-reference file. The supplied R-functions are ment to facilitate the reporting of statistics in accordance with APA guidelines.

Note, at this point papaja is in active development and should be considered alpha. If you experience any problems, please open an issue.

If you are looking for other journal article templates, take a look at the list below. Finally, in case you prefer to work with Python, have a look at the Academic Markdown-module.

Examples

Take a look at the .rmd of the example manuscript in the folder example and the resulting .pdf. More examples to come.

The example document also contains some basic instructions.

Setup

Requirements

Before using papaja to create an APA-manuscript, make sure the following software is installed on your computer:

  • R (2.11.1 or later)
  • RStudio (0.98.932 or later) is optional; if you don't use RStudio, you need to install pandoc using the instructions for your operating system
  • A TeX distribution (2013 or later; e.g., MikTeX for Windows, MacTeX for Mac, obviously, or TeX Live for Linux)
    • If you are running Windows, use MikTex if possible. Currently, pandoc and the Windows version of Tex Live don't seem to like each other. Make sure you install the complete---not the basic---version.
    • If you are running Ubuntu 14.04 you need a couple of TeX packages in addition to the already installed ones for the document class apa6 to work:
sudo apt-get install texlive texlive-latex-extra texlive-bibtex-extra texlive-publishers texlive-fonts-recommended texlive-fonts-extra texlive-humanities

Install papaja

Finally install papaja from this GitHub repository:

devtools::install_github("crsh/papaja")

Create a manuscript

Once you have installed the papaja package you can select the APA template when creating a new Markdown file through the menus in RStudio.

If you want to add citations specify your .bib-file in the document header and under the bibliography parameter and you can start citing.

The supplied functions apa_print() and apa_table() facilitate reporting of results.

Using papaja without RStudio

In addition to the above, you need to do the following to use papaja without RStudio:

  • Install the rmarkdown package:
install.packages("rmarkdown")
  • Use the rmarkdown::render function to create articles:
rmarkdown::render("mymanuscript.Rmd")

Known issues

  • The references violates the APA guidelines in that there is no hanging indentation (i.e. indentation of all lines but the first one). See the related issue for a fix.
  • If building the example manuscript throws the error ! Incomplete \iffalse; all text was ignored after line 20. make sure you have saved the .Rmd and are not working from a temporary directory or restart RStudio. If this doesn't work try updating your TeX-packages.
  • Citations may mess with RStudios syntax highlighting in the current line. Incorrect highlighting following a citation does not necessarily indicate incorrect syntax.
  • Printing PDF from RStudio's PDF viewer can produce weird results. If you want to print your manuscript I suggest you use any other PDF viewer of your choice.
  • When creating a word document on Windows, special characters in title, abstract, and note are not rendered correctly. This is a bug in r-yaml and has been for a while, but it will soon be addressed by a workaround in knitr.

Other journal templates

Obiously, not all journals require manuscripts and articles to be prepared according to APA guidelines. If you are looking for other journal article templates, the following list of other rmarkdown/pandoc packages and templates may be helpful:

  • rticles: The rticles package includes a set of R Markdown templates that enable authoring of R related journal and conference submissions.
  • Michael Sachs' pandoc journal templates: Pandoc templates for the major statistics and biostatistics journals

If you know of other packages and templates, drop us a note, so we can add them here.

Copy Link

Version

Down Chevron

Version

0.1.0.9054

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

January 1st, 1970

Functions in papaja (0.1.0.9054)