LaTeXML A LaTeX to XML Converter

Get LaTeXML

Current Release:

The current release is 0.7.0, but it is terribly out of date! Release 0.8.0 is on it’s way!

Normally, it is preferable to install a platform-specific, prebuilt release. By using the appropriate, system-specific, magiccommand both LaTeXML and any prerequisites (additional perl modules that it needs, some of which themselves depend on C libraries) will be installed automatically.

magiccommand LaTeXML

See instructions for specific systems, below.

But as the currrent release is so out-of-date, please consider alpha versions 0.7.9 (see git checkout), in which case you’ll need to pre-install the prerequisites by following the instructions at General Installation Procedures.

Also see the Change Log.

General Installation Procedures

Installing Prerequisites

If you cannot install a prebuilt package, or want to use the current pre-release version from the repository, you will need to pre-install some or all of the prerequisites.

The easiest route is using the appropriate, system-specific, magiccommand to install the prerequisites

magiccommand prerequisite ...

See instructions for specific systems, below.

To install the prerequisites by hand, the following instructions may help:

  • 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.

  • Use CPAN to install the required perl modules (typically as root), something like this

perl -MCPAN -e shell
  cpan> install Archive::Zip, File::Which, Image::Size, IO::String
  cpan> install libwww, JSON::XS, LWP, Parse::RecDescent, URI
  cpan> install XML::LibXML, XML::LibXSLT
  cpan> quit

Installing Optional Prerequisites

The following packages are usually desirable, but aren’t required to run LaTeXML.

TeX

Most users of LaTeXML will want to install TeX, as well. LaTeXML will use TeX’s style files directly in some cases, providing broader coverage.

Moreover, if TeX is present when LaTeXML is being installed, it will install a couple of its own for use 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 processessing, such as transformations by the graphicx package, and conversion of math to images. When the package is not present, some such operations will not be supported.

Unfortunately, it is sometimes a difficult package to install. 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 widespread.

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.

Getting the source

Source tarball

You can either download a tar file containing the source:

  • Download 0.7.0 (tar.gz)

  • Unpack and Build LaTeXML, following the usual Perl module incantations:

    tar zxvf LaTeXML-0.7.0.tar.gz
    cd LaTeXML-0.7.0

git checkout

Or you can fetch the most current code from github by using the git command:

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

You can also browser the current code at https://github.com/brucemiller/LaTeXML/.

[Once you’ve fetched the code from you github, you can easily keep up-to-date by ocassionally running the command:

git pull

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

Building

Whether you’ve downloaded using a tar file, or from git, you build the system using the standard Perl procedure:

cd LaTeXML  [or  LaTeXML-0.7.0]
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). [On windows systems, use dmake instead of make.]

Note: You can specify nonstandard place to install files — and possibly avoid 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

Operating System Specific Notes

With no implied endorsement of any of these systems.

RPM-based systems

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

Installing prebuilt


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

    yum --nogpgcheck localinstall LaTeXML-0.7.0-*.ltxml.noarch.rpm

Adding ImageMagick ImageMagick-perl will include the optional ImageMagick.

Installing only prerequisites

The prerequisites can be installed (or updated) by running this command as root:

yum install \
  perl-Archive-Zip perl-File-Which perl-Image-Size \
  perl-IO-string perl-JSON-XS perl-libwww-perl perl-Parse-RecDescent \
  perl-URI perl-XML-LibXML perl-XML-LibXSLT

Install the optional packages with:

yum install texlive ImageMagick ImageMagick-perl

Then continue by using the general procedure from Building.

Debian-based systems

For Debian-based systems (including Ubuntu), the deb repositories are generally used for software installation.

Installing prebuilt

LaTeXML has been included in the Debian repositories (thanks Atsuhito Kohda); it, along with dependencies, should be installable using

sudo apt-get install latexml

Adding imagemagick perlmagick will include the optional ImageMagick.

Installing only prerequisites

The prerequisites can be installed (or updated) by running this command as root:

sudo apt-get install   \
  libarchive-zip-perl libfile-which-perl libimage-size-perl \
  libio-string-perl libjson-xs-perl libwww-perl libparse-recdescent-perl \
  liburi-perl libxml2 libxml-libxml-perl libxslt1.1 libxml-libxslt-perl

Install the optional packages with:

sudo apt-get install texlive imagemagick perlmagick

Then continue by using the general procedure from Building.

MacOS

The MacPorts tool provides a handy repository for software installation on Mac computers; download and install macports from that site. Then, use one of the following procedures depending on which version of LaTeXML you wish to install:

Installing prebuilt

LaTeXML has been included in the MacPorts repository (thanks Andrew Fernandes); it should be installable, along with its prerequisites, using the command

sudo port install LaTeXML

Adding p5-perlmagick will include the optional ImageMagick.

Installing only prerequisites

The prerequisites can be installed by running this command as root:

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

Install the optional packages with:

sudo port install p5-perlmagick texlive

although you may prefer other TeX systems on the Mac. Then continue by using the general procedure from Building.

Note: There have been issues reported with recent installations of Perl with MacPorts: it will install LaTeXML’s executables in a directory specific to the current version of Perl (eg. /opt/local/libexec/perl5.12/sitebin, instead of /opt/local/bin which would be in your PATH environment variable). Apparently this is a feature, not a bug; it only happens when installing from source or git; not when installing the MacPorts port. There are three workarounds, each with disadvantages:

  • Watch for where the scripts get installed and that directory to your PATH environment variable;

  • Set up symbolic links from a directory in your path, such as /opt/local/bin, to the actual installed locations;

  • Use the makefile options to choose an installation directory (see LABEL:install.options):

    perl Makefile.PL INSTALLSITEBIN=/opt/local/bin INSTALLSITESCRIPT=/opt/local/bin

Windows

There is currently no prebuilt LaTeXML for Windows, but it does run under Strawberry Perl, which comes with many of our prerequisites pre-installed, and provides other needed commands (perl, cpan, dmake).

Installing prerequisites


  • If you want to install a TeX system, do so first.

  • If you don’t have Strawberry Perl already installed:
    Follow the instructions at Strawberry Perl to download and install the latest version of Strawberry Perl

  • Install other prerequisite modules by typing the following in the command prompt

    cpan -i Image::Size
    cpan -i Parse::RecDescent

Installing the optional package Image::Magick on Windows seems to be problematic; you’re on your own, there! Or you may have better luck with Graphics::Magick.

Then continue by using the general procedure from Building, but note that the dmake command should be used in place of make.

Archived Releases: