In this document, we’ll go over how to create APA style documents with Markdown and papaja. papaja (short for Preparing APA Journal Articles) is an R package that, combined with R Markdown, takes care of all the terribly tedious aspects of APA style, from layout to citations, and allows you to focus on your writing and analysis.

Get the latest versions of RStudio and R

RStudio and R are constantly being updated with bug fixes and additional features. As of now, RStudio is at v1.0.44 and R is at version v3.3.2. If you have a version much older than these, I recommend you update them.

Install TeX

In order to create PDF documents from papaja, you need to have a TeX distribution installed on your computer. Go to one of the following links and install the latest version to your computer.

Note: Be sure to restart RStudio after installing TeX to make sure RStudio knows it’s there (now).

Install papaja

Next, install the papaja R package from GitHub:

# Install the papaja R package from GitHub
# install.packages("devtools")   # In case you don't have devtools installed
devtools::install_github("crsh/papaja")
library(papaja)

Learn the basics of Markdown

papaja is based on R Markdown. R Markdown is a simple markup language that allows you to easily construct all kinds of documents, from reports, to web pages, to APA style documents. For a full overview of R Markdown, go through the lessons at http://rmarkdown.rstudio.com/lesson-1.html and check out the my guide at http://rpubs.com/YaRrr/markdownbasics

Open an APA-template markdown file

Now it’s time to write your APA style document using papaja! It’s best to start by opening a template. Here are two templates I’ve created:

  1. A short APA style report: https://dl.dropboxusercontent.com/u/7618380/phillips2017apa.Rmd. Here is the bibliography file phillips2017apa_references.bib: https://dl.dropboxusercontent.com/u/7618380/phillips2017apa_references.bib

  2. An APA style tutorial on papaja: https://dl.dropboxusercontent.com/u/7618380/apa_example.Rmd. Here is the bibliography file r-references.bib: https://dl.dropboxusercontent.com/u/7618380/r-references.bib

You can also open the default APA template in Markdown by clicking the following in RStudio: File – New File – R Markdown… – From Template – APA Article (6th Edition)