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.
I've tried to install these on both Elementary OS, and Manjaro with much success. I've tried to describe how to install everything in detail. If you don't have command-line experience, don't get discouraged! It is very tricky (it gets easier, with time). Seek the help of someone you know who can sit with you to help you install these, I find it easier to learn with someone in person, especially someone who knows you well (knows your level, how you learn best etc). Otherwise, ask me and I will try my best to assist you (rek at kokorobot dot ca). If I don't answer right away, it may be because I am sailing and away from a cell tower. I will return your email as soon as I can!
- Installing Pandoc
- Installing XeLaTeX, LaTeX
- Installing Calibre
- Installing ImageMagick
- Installing Pdfunite
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:
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.
If you are on Manjaro, you can get the package using Pacman:
sudo pacman -S pandoc
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
sudo pacman -S textlive-most
Texlive-most contains every package you may need. You'll be asked to choose a repository, I opted for 7 (texlive-latex-extra).
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.
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.
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.