Installing LaTeXML for Metanorma (and tex2mn)

Author’s picture Alex Bobrikovich Author’s picture Ronald Tse on 11 May 2020


Metanorma’s processor for the StandardDocument model (aka metanorma-standoc) depends on the excellent LaTeXML package from NIST to process MathML fragments.

Typically, you will only need the latest stable version of LaTeXML to use Metanorma: version 0.8.4 as of today.

However, if you are using or plan on using TeX syntax input for Metanorma (i.e. tex2mn, see our previous post, Metanorma now supports LaTeX input), you will need the currently unreleased version of LaTeXML 0.8.5 for its additional features.

This post explains how to install the “edge” version of LaTeXML.

Special thanks to Bruce Miller and Deyan Ginev for their unwavering support!

Installing the latest stable LaTeXML


The LaTeXML package is available on Chocolatey package manager and can be easily installed via the Chocolatey command-line interface.

choco install -y latexml


The LaTeXML snap is available on the Snap store and can be installed on Ubuntu and Linux platforms that are Snap-enabled.

sudo snap install latexml


The LaTeXML formula is available from the Homebrew package manager.

brew install latexml


If the latest stable LaTeXML version isn’t available from the package manager of your choice, you can always install it with cpanm:

# Download and install cpanminus
curl -L | perl - App::cpanminus

cpanm LaTeXML

Installing pre-release LaTeXML

In order to utilize unreleased features, you may follow the instructions below to install pre-release versions of LaTeXML.


The following command installs the latest beta release of LaTeXML via Chocolatey.

choco install -y latexml.beta


The following command installs the latest “edge channel” release of LaTeXML via the Snap store.

sudo snap install latexml --edge


There is currently no easy to install a pre-release version via Homebrew — use the CPANM method instead.


If you have to use the specific dev version of LaTeXML it can be installed with cpanm.

Notice that CPAN is a prerequisite, and its installation methods differ per platform:


brew install cpanminus


choco install -y strawberryperl imagemagick.tool


curl -L | perl - App::cpanminus

Once CPAN is installed, the remaining command is to install LaTeXML via cpanm:

cpanm git://


In most cases, problems occur with installation dependencies that depend on native libraries, such as:

  • XML::LibXSLT

  • XML::LibXML

The fix is to install the specific version of the dependency that correlates with the version of the native library installed on your machine.

This command on macOS, for example, ensures that XML::LibXSLT matches the version of libxml2 installed:

brew install libxml2 cpanminus
env PATH=$(brew --prefix libxml2)/bin:$PATH \
  cpanm --notest XML::LibXSLT@1.96 \