Rek Bellum

Here is how to install the various tools required to make PDFs, EPUBs and MOBIs with Pandoc. If you only have plans to make PDFs, only install Pandoc and LateX.

Contents

Installing Pandoc on Linux

To install Pandoc on Linux, you can generally use your package manager, or download the latest version from the website directly. You'll want to get pandoc-2.11.2-linux-amd64.tar.gz. When you've downloaded it, unzip the file, and move the folder (named pandoc-x.xx.x) to your Applications folder.

You've got Pandoc, but it's not usable yet, you've got to use the terminal to unpack the files. Write the path to the Pandoc package, followed by the sudo command:

cd ~/Applications
sudo dpkg -i ./pandoc-2.11.1

You'll be asked for your password. Enter your password, and press enter to install Pandoc. You should have the latest version of Pandoc installed, to verify the version, type the following in the command line:

pandoc --version

You'll see the name of the version on top, which in this case, is version 2.11.1.

pandoc 2.11.2
Compiled with pandoc-types 1.22, texmath 0.12.0.3, skylighting 0.10.0.3,
citeproc 0.2, ipynb 0.1.0.1
User data directory: /home/user/.local/share/pandoc or /home/user/.pandoc
Copyright (C) 2006-2020 John MacFarlane. Web:  https://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.

You now have the latest version of Pandoc installed on your computer.

Installing Tex Live

For converting text files (written in Pandoc Markdown) to PDF, Pandoc makes use of LaTeX and XeTeX as the text rendering engine. This is what makes your documents beautiful. Tex Live is a package specific to Linux, enter the following command to install it:

sudo apt-get install texlive-xetex texlive-fonts-recommended texlive-generic-recommended

Calibre

Calibre is an e-book manager. It allows users to manage e-book collections as well as to create, edit, and read e-books. It's not a light tool. In fact, it requires a LOT of dependencies to work, but hey... it's open source, and free, and it works well.

You can install it using apt-get, but beware that the distribution provided calibre package are often buggy and outdated. It is better to use the binary install:

sudo -v && wget -nv -O- https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()"

Since I use fish, I have to use the bash command with the -c switch to read from a string. Ignore if you're not using fish:

bash -c 'sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin'

Voila, you have Calibre.

ImageMagick

If you don't have ImageMagick, I highly recommend it. It's great to create, edit, compose, or convert digital images in tons of formats. If you install Calibre first, you might not have to install ImageMagick

Install the app using the following command:

sudo apt-get install imagemagick

I recommend keeping the recipes you discover for ImageMagick on file somewhere, so you don't always have to look up how to do them. See my recipes.

PDF unite

Pdfunite does what its name suggests it does: merge pdfs. It is part of the poppler-utils package, install it using the following command:

sudo apt-get install poppler-utils

Now, you'll be able to use it.