papaja is template for R Markdown, which is used to create APA 6th conform journal articles. papaja is most easily used in integration with the RStudio IDE to convert formatted text and R code and to .html, .pdf, etc. This is a good thing: RStudio is free, open source and offers useful features; it is the prefered IDE for many R enthusiasts that I know. However, RStudio is not everyone’s coding environment of choice. If you wish to use RMarkdown and papaja to create your APA articles, you probably want to use your most comfortable R environment (other choices might be emacs ESS or rkward).

papaja (and R Markdown) make use of a bunch of open source software in order to convert a simple .Rmd file to pdf manuscripts. In RStudio, most of these dependencies do not need to be installed manually as they come with the installation package. This repository contains guidelines on how to install R Markdown and papaja on an Ubuntu system without the requirement of an RStudio installation, which is somewhat less convenient (but maybe worthy). There is no warranty that it will work the same way on your system, it is just an explanation of how I did it. I wanted to share this because I found it somewhat tricky to make papaja run outside of RStudio.

Note: To install the required dependencies for papaja, terminal commands are given that will install these dependencies. Commands starting with $ must be typed in your normal terminal. Commands starting with > must be executed in your R console.

1) Install the required TeX packages

– as described in the papaja GitHub repository:

$ sudo apt install texlive texlive-latex-extra texlive-bibtex-extra texlive-publishers texlive-fonts-recommended texlive-fonts-extra texlive-humanities

2) Install some required GNU libraries

If these libraries are not available on your system, install them. They are required to install the devtools package that we need to install papaja:

$ sudo apt install libcurl4-openssl-dev libxml2-dev libgsl0-dev libssl-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev

3) Install the required R packages

> devtools::install_github("crsh/papaja")

4) Install pandoc

$ sudo apt install pandoc pandoc-citeproc
$ sudo apt install haskell-platform
$ cabal update
$ cabal install pandoc pandoc-citeproc
PATH=/home/yourName/.cabal/bin:"$PATH" 
> rmarkdown::pandoc_available()

5) ImageMagick

$ sudo apt install imagemagick imagemagick-doc

6) Create a manuscript and enjoy

> rmarkdown::render("manuscript.Rmd")

7) Further reading

These are some sources on writing in R Markdown and / or papaja that might be useful:


Last updated: 2023-02-08

Back to the front page