Skip to content

Instantly share code, notes, and snippets.

@chrisdaaz
Last active March 19, 2021 17:56
Show Gist options
  • Save chrisdaaz/85e85fc32d2277d2bd53eeec44f19c86 to your computer and use it in GitHub Desktop.
Save chrisdaaz/85e85fc32d2277d2bd53eeec44f19c86 to your computer and use it in GitHub Desktop.
LaTeXML install

The tool we are using for creating the web version of the textbook is LaTeXML. Before installing LaTeXML, your machine will need a few prerequisite software packages. These instructions assume that you are using either macOS or Linux-based operating system.

Installing Perquisites

Install Homebrew: Homebrew is a software package manager that makes it very easy to install and setup software from the terminal. The installation instructions are on the website, reposted here:

Copy and paste this command in your Terminal to install Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

This script will install Homebrew, which you will be able to use to install software with the brew install command.

Install LibXML2 and LibXSLT: These are C libraries required for parsing and processing XML files. LaTeXML first converts TeX into XML formats before converting to HTML, so we'll need to make sure you're machine can understand XML. It's possible these might already be installed, but we can use Homebrew to check or install them if missing:

brew install libxml2
brew install libxslt

Install ImageMagick with Perl support: ImageMagick is a command-line image processing software. LateXML using ImageMagick to convert figure images into formats suitable for the web (i.e. .eps to .png). You can install it with Homebrew:

brew tap davea/perlmagick
brew install perlmagick
echo "export PERL5LIB="/home/linuxbrew/.linuxbrew/lib/perl5/site_perl":$PERL5LIB" >> ~/.zshrc

Install LaTeX (Skip if you already have LaTeX): LaTeXML relies on your local TeX distribution in order to read TeX commands, macros, and use packages. Any TeX distribution will suffice, provided you have also installed all of the necessary packages your TeX project requires. I recommend the TeX Live that can be installed on the project website or via Homebrew.

Install LaTeXML

You can install LaTeXML with Homebrew from your terminal with this command:

brew install latexml

That's it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment