LaTeXML A LaTeX to XML/HTML/MathML Converter

Get LaTeXML

Current Release:

The current release is 0.8.0. (see the Change Log).

There are several ways to install LaTeXML, depending on your OS platform, whether you want a bleeding-edge version from GitHub. Since LaTeXML depends on, or can use if available, several other Perl Modules and external programs, consult Prerequisites before deciding.

  • Normally, it is preferable to install a platform-specific, prebuilt release, if available, which will install all prerequisites, usually including the optional ones.

  • You may install from CPAN which will install most prerequisites, although you may prefer to pre-install prerequisites using the platform-specific approach and should pre-install any optional prerequisites that you want.

  • You may download and install the tarball, but you will need to pre-install prerequisites (including any optional ones) using CPAN or a platform-specific approach.

  • If you want to use the development version with the latest patches and improvements, you may fetch the source from GitHub. Again you will need to pre-install prerequisites (including optional ones) using CPAN or a platform-specific approach.

Platform To install prebuilt To install prerequisites
RPM-based Linux see RPM prebuit see RPM prerequisites
Debian-based Linux see Debian prebuilt see Debian prerequisites
Macintosh OS w/MacPorts see MacPorts prebuilt see MacPorts prerequisites
Windows w/Strawberry Perl see Windows CPAN see Windows prerequisites
Other see CPAN or GitHub see CPAN prerequisites

Note that there is no implied endorsement of any of these systems.

Prerequisites

LaTeXML requires several Perl modules to do it’s job. Most are automatically installed by the platform-specific installation or CPAN. However, CPAN will not install the required C libraries needed for XML::LibXML, and XML::LibXSLT. If libxml2 and libxslt are are not already installed, follow the instructions at XMLSoft to download and install the most recent versions of libxml2 and libxslt. Note that Strawberry Perl, on Windows, already includes these libraries.

Optional Prerequisites

The following packages are optional because they are sometimes difficult to find or install, or in order to allow for minimal installs in unusual circumstances. Most users should consider them as required and install them if at all possible.

TeX

Virtually all users of LaTeXML will want to install TeX. LaTeXML should find whatever TeX-installation you have, and will use TeX’s style files directly in some cases, providing broader coverage, particularly for the more complex styles like babel and tikz. Moreover, if TeX is present when LaTeXML is being installed, LaTeXML will install a couple of its own style files that can be used with regular TeX, or LaTeX runs; So if you are going to install TeX, install it first!

Image::Magick

provides a handy library of image manipulation routines. When they are present LaTeXML is able to carry out more image processing, such as transformations by the graphicx package, and conversion of math to images; otherwise, some such operations will not be supported.

Please do not try to install Image::Magick from CPAN, however: the module there seldom matches the underlying ImageMagick library. It is recommended to install the Perl binding for Image::Magick from the same source as the library was obtained, either from your system’s repository, or from the ImageMagick site, itself. In the latter case, follow the instructions at ImageMagick to download and install the latest version of ImageMagick being sure to enable and build the Perl binding along with it.

Graphics::Magick

is an alternative to Image::Magick that LaTeXML will use if is found on the system; it may (or may not ) be easier to install, although it is less widely available.

UUID::Tiny

generates unique identifiers that can be used to make better ePub documents (it can be installed using CPAN).

Note to packagers: If you are preparing a compiled installation package (such as rpm or deb) for LaTeXML, and the above packages are easily installable in your distribution, you probably should include them as dependencies of LaTeXML.

RPM-based systems

For Fedora and RedHat Enterprise based distributions (Redhat Enterprise Linux 6, Centos 6,…) and similar, most software is obtained and installed via the yum repository.

Installing prebuilt


The following commands will install LaTeXML, including its required and optional prerequisites:

  • Download 0.8.0 (Fedora 20) or 0.8.0 (RedHat 6) (but enable the elp repository), as appropriate.

  • Install LaTeXML, and its prerequisites, using the command:

    yum --nogpgcheck localinstall LaTeXML-0.8.0-*.noarch.rpm

Installing prerequisites

The prerequisites (including the optional ones) can be installed by running this command as root:

yum install \
  perl-Archive-Zip perl-DB_File perl-File-Which \
  perl-Getopt-Long perl-Image-Size perl-IO-String perl-JSON-XS \
  perl-libwww-perl perl-Parse-RecDescent perl-Pod-Parser \
  perl-Time-HiRes perl-URI perl-XML-LibXML perl-XML-LibXSLT \
  perl-UUID-Tiny texlive ImageMagick ImageMagick-perl

Continue by installing LaTeXML from tarball, CPAN or GitHub, as desired.

Debian-based systems

For Debian-based systems (including Ubuntu), the deb repositories are generally used for software installation. Thanks to Atsuhito Kohda, LaTeXML is available from Debian’s unstable repositories.

Installing prebuilt

The following command will install LaTeXML, including its required and optional prerequisites:

sudo apt-get install latexml

Installing prerequisites

The prerequisites (including optional ones) can be installed by running this command:

sudo apt-get install   \
  libarchive-zip-perl libfile-which-perl libimage-size-perl  \
  libio-string-perl libjson-xs-perl libparse-recdescent-perl \
  liburi-perl libuuid-tiny-perl libwww-perl                  \
  libxml2 libxml-libxml-perl libxslt1.1 libxml-libxslt-perl  \
  texlive-latex-base imagemagick  perlmagick

[NOTE Recheck this dependency list when the port is done!]

Continue by installing LaTeXML from tarball, CPAN or GitHub, as desired.

MacOS

For Apple Macintosh systems, the MacPorts repository is the most convenient way to install LaTeXML; thanks to Sean and Andrew Fernandes. Download and install MacPorts from that site.

Installing prebuilt

Since some users prefer MacTeX or another TeX system over MacPort’s texlive, and since texlive is quite large, the default LaTeXML installation does not include a dependency on a TeX-installation nor does it install LaTeXML’s own style files! However, we provide two ‘variants’ that do include or assume such a dependency:

MacPort’s TeXLive:

To install LaTeXML, including MacPort’s texlive along with LaTeXML’s other prerequisites and style files, use the command:

sudo port install LaTeXML +texlive

MacTeX:

To install LaTeXML, along with its prerequisites and style files, using your (preinstalled) MacTeX, use the command:

sudo port install LaTeXML +mactex

Other:

To install LaTeXML without assuming any installed TeX, use the command:

sudo port install LaTeXML

Note that the latter will not install LaTeXML’s style files into any texmf directory, although LaTeXML will still use any TeX system it finds at runtime.

Installing prerequisites

The prerequisites (including optional ones except TeX) can be installed by running this command as root:

sudo port install \
  p5-archive-zip p5-file-which p5-getopt-long p5-image-size \
  p5-io-string p5-json-xs p5-libwww-perl p5-parse-recdescent \
  p5-time-hires p5-uri p5-xml-libxml p5-xml-libxslt \
  p5-perlmagick

Additionally, either add texlive to the above list, or install MacTeX. Continue by installing LaTeXML from tarball, CPAN or GitHub, as desired.

Windows

These installation instructions assume you will use Strawberry Perl, which comes with many of our prerequisites pre-installed, and provides other needed commands (perl, cpan, dmake).

Installing prebuilt

There is currently no prebuilt LaTeXML for Windows, but it should install cleanly under Strawberry Perl’s CPAN. Install the TeX-system of your choice (if desired), ImageMagick (see Installing ImageMagick under Windows) and then install LaTeXML using:

cpan LaTeXML

Installing the optional package Image::Magick on Windows seems to be problematic, so we have omitted it from these instructions. You may want to try , but you’re on your own, there! You may have better luck with Graphics::Magick.

Installing prerequisites


Install Strawberry Perl, and the TeX-system of your choice (if desired), ImageMagick (if you want to try; see Installing ImageMagick under Windows), and then install the additional prerequisites as

cpan Image::Size Parse::RecDescent UUID::Tiny

Continue by installing LaTeXML from tarball, CPAN or GitHub, as desired, but note that the dmake command should be used in place of make.

Installing ImageMagick under Windows

In principle, you should be able to install the binary from ImageMagick and then install the Perl binding using CPAN; unfortunately, it seems that the CPAN version seldom matches the binary or fails for other reasons. What should work the following:

Download and install the main ImageMagick binary appropriate for your Windows system from ImageMagick. Then fetch the PerlMagick tarball with the same version from ImageMagick/perl. Use the following commands to compile and install the PerlMagick, with X.XX being the version you downloaded:

tar -zxvf PerlMagick-X.XX.tar.gz
cd PerlMagick-X.XX
perl Makefile.PL
dmake
dmake test
dmake install

CPAN installation

The following command will install LaTeXML and its Perl prerequisites, but you may need to pre-install libxml2 and libxslt (See Prerequisites). Pre-install TeX and any optional Perl modules, if desired.

cpan LaTeXML

Installing prerequisites

The following command will install the Perl prerequisites (including optional) for LaTeXML, but you may need to pre-install libxml2 and libxslt (See Prerequisites).

cpan Archive::Zip DB_File File::Which Image::Size \
  IO::String JSON::XS LWP Parse::RecDescent \
  URI XML::LibXML XML::LibXSLT UUID::Tiny

You may still want to install TeX and Image::Magick using other means.

Installing tarball

Source tarball

To download the tar file containing the source:

Building

Whether you’ve downloaded using the tar file or from git, you build the system using the standard Perl procedure (On Windows systems, use dmake instead of make):

cd LaTeXML  [or  LaTeXML-0.8.0 or  LaTeXML-master]
perl Makefile.PL
make
make test

The last step runs the system through some basic tests, which should complete without error (although some tests may be ‘skipped’ under certain circumstances).

Note: You can specify nonstandard place to install files — possibly avoiding the need to install as root! — by modifying the Makefile creating command above to

perl Makefile.PL PREFIX=perldir TEXMF=texdir

where perldir is where you want the perl related files to go and texdir is where you want the TeX style files to go. (See perl perlmodinstall for more details and options.)

Installing

After building, you will finally want to install LaTeXML where the OS can find the files. You’ll typically need to be root:

su
make install

or perhaps

sudo make install

(On Windows, use dmake).

Installing from GitHub

The development version of LaTeXML is available on GitHub. This will include the latest patches and enhancements between official releases, but may of course introduce new bugs or incompatibilities with little notice (you may wish to subscribe to the LaTeXML mailing list). You can also browse the current code at GitHub, as well as file bug reports and enhancement requests.

Fetch the development version using the following command:

git clone https://github.com/brucemiller/LaTeXML.git

Continue with building and installing as described in Building.

Keep up-to-date by occasionally running the command:

git pull

in the source directory, and then repeating the building and install commands.

You can avoid directly using git, but still get the development sources by downloading LaTeXML-master.zip and running

unzip LaTeXML-master.zip

Archived Releases: