Skip to content

Generating PDFs

Jake Renzella edited this page Dec 13, 2016 · 4 revisions

Table of Contents

PDF Generation Prerequisites

PDF generation requires LaTeX to be installed. If you do not install LaTeX and execute the submission:generate_pdfs task, you will encounter errors.

Install LaTeX on your platform before running this task. We suggest using TeXLive to install LaTeX. Please ensure you download and install a TeXLive distribution from 2016 onwards.

Installing LaTeX

For macOS with Homebrew Cask

$ brew cask install mactex

For macOS without Homebrew, download and install the MacTeX distribution.

A note especially for macOS users who have installed LaTeX under El Capitan, your installation will be under /Library/TeX/texbin. This needs to be added to the PATH:

$ echo "export PATH=$PATH:/Library/TeX/texbin" >> ~/.bashrc

or, if using zsh:

$ echo "export PATH=$PATH:/Library/TeX/texbin" >> ~/.zshrc

Refer to this artcile for more about MacTeX installs on El Capitan.

For Linux with apt-get

$ apt-get install texlive-full

Check your PATH for Linux and macOS

After installing LaTeX, you must ensure the following are listed on the PATH:

$ which convert
/usr/local/bin/convert
$ which pygmentize
/usr/local/bin/pygmentize
$ which pdflatex
/Library/TeX/texbin/pdflatex

If any of the following are not found, then you will need to double check your installation and ensure the binaries are on the PATH. If they are not installed correctly, refer to the install native tools section for macOS and Linux and ensure the native tools are installing properly.

For Docker

By default, LaTeX is not installed within the Doubtfire API container to save time and space.

Should you need to install LaTeX within the container run:

$ docker-compose -p doubtfire run api "bash -c 'apt-get update && apt-get install texlive-full'"