John Bokma

Installing the latest version of Pandoc on Ubuntu 17.04

May 17, 2017

This tutorial describes how I installed the latest version of Pandoc on Ubuntu 17.04 and installed additional packages in order to convert my resume written in Markdown to a PDF file.

Installing the latest version of Pandoc

I downloaded and installed the deb of the latest Pandoc release as follows:

wget https://github.com/jgm/pandoc/releases/download/\
1.19.2.1/pandoc-1.19.2.1-1-amd64.deb
sudo dpkg -i pandoc-1.19.2.1-1-amd64.deb
rm pandoc-1.19.2.1-1-amd64.deb

I verified that Pandoc got installed correctly and that the version reported matched the version installed using pandoc -v. This gave the following output:

pandoc 1.19.2.1
Compiled with pandoc-types 1.17.0.4, texmath 0.9, skylighting 0.1.1.4
Default user data directory: /home/john/.pandoc
Copyright (C) 2006-2016 John MacFarlane
Web:  http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.

Installing pdflatex

In order to get the pdflatex program, required to convert the LaTeX created by pandoc to PDF, I installed texlive-latex-recommended as follows.

sudo apt-get install -y texlive-latex-recommended

This used nearly 800 MB of additional disk space. When I tested generating my PDF resume via Pandoc I ended up with the following LaTeX error:

! LaTeX Error: File `enumitem.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 
         
l.14 \usepackage

pandoc: Error producing PDF

Using apt-cache search gave the following two results:

$ apt-cache search enumitem
texlive-lang-german - TeX Live: German
texlive-latex-extra - TeX Live: LaTeX additional packages

In my case the latter was the obvious choice, which I installed using apt-get as follows:

sudo apt-get install -y texlive-latex-extra

This is most likely not a minimal install, as this used over 600 MB of additional disk space. However, I preferred this over manually installing LaTeX packages, especially as I was not sure how many were missing nor which ones I would need in the future.

Testing

If you want to test this installation the same way as I did, git is required. Install it as follows:

sudo apt-get install -y git

Next, clone my resume repository as follows:

git clone https://github.com/john-bokma/resume-pandoc.git

Change into the resume-pandoc directory:

cd resume-pandoc/

And generate the PDF version of my resume as follows:

pandoc perl-programmer-john-bokma-resume.md -f markdown+yaml_metadata_block \
  --template templates/jb2resume.latex \
  -o perl-programmer-john-bokma-resume.pdf

For more information on the template and its settings, see resume-pandoc.

home - blog - email

I am a freelance Perl programmer for hire, download my up-to-date resume (PDF).