LaTeXML A LaTeX to XML Converter

Get LaTeXML

Current Release:

The current release is 0.7.0 (also see the Change Log).

LaTeXML itself is written in ‘pure’ Perl, but requires TeX, and several perl modules, some of which depend on C libraries — the Prerequisites. It should always be possible to install LaTeXML on any platform with a sufficiently recent Perl, by following the instructions at General Installation Procedures.

Normally, it would be preferable to install a platform-specific, prebuilt release. But frankly, the released version is rather old; so out-of-date, in fact, that we are inclined to wait until we have a really dramatic replacement before we make a new formal release. Until then, you will probably be best served by Installing from SVN.

In any case, it is usually preferable to use a platform-specific procedure for installing the prerequisites, and there may be platform-specific instructions regarding SVN. Thus, please consult Operating System Specific Notes, first, for platform-specific releases and instructions.

As a rule of thumb, any ‘recent’ version of any prerequisite software will work with LaTeXML, something released within the last few years; Perl should be at least version 5.8. Of course for security reasons, you should update all software on your system regularly to install patches and fix any bugs. When maintaining your system using a platform specific software updating tool, such as yum, apt or port, you should regularly use the appropriate ‘update’ command.

General Installation Procedures

The following sections outline the general procedures for installing LaTeXML and the supporting libraries and modules that it needs.

Installing Prerequisites

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

  • If the Perl modules Parse::RecDesent, File::Which, XML::LibXML and XML::LibXSLT are not already installed:
    Use CPAN to install the required perl modules (typically as root):

       perl -MCPAN -e shell
       cpan> install DB_File, Parse::RecDescent, File::Which
       cpan> install XML::LibXML, XML::LibXSLT
       cpan> quit
  • If ImageMagick and its Perl binding are not already installed:
    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.

Installing from 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
       perl Makefile.PL
       make
       make test
  • Install, as root:

       make install

(See perl perlmodinstall for more details, if needed.)

You can specify nonstandard place to install files (and 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.

Installing from SVN

The most current code can be obtained from the svn repository. It is browsable at https://svn.mathweb.org/repos/LaTeXML/. Anonymous checkout is available using the command:

  svn co https://svn.mathweb.org/repos/LaTeXML/trunk/ LaTeXML

After checkout, the installation is similar to Installing from Source:

   cd LaTeXML
   perl Makefile.PL
   make
   make test
   make install

where the last command would typically be execuded as root.

Note that if you have already checked out a copy of LaTeXML, you can update and rebuild your copy by using the following

   cd LaTeXML
   svn update
   make
   make test
   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. Use one of the following procedures depending on which version of LaTeXML you wish to install:

Installing prebuilt


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

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

Installing from Source or SVN

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

yum install perl-Parse-RecDescent perl-File-Which \
    perl-XML-LibXML perl-XML-LibXSLT \
    ImageMagick ImageMagick-perl

Afterwards, you may use the general procedure for Installing from Source or Installing from SVN. Note that if the command to make the Makefile fails with “Can’t locate ExtUtils/MakeMaker.pm…” or warns that Test::Simple is missing, you will need to install them as follows:

yum install perl-ExtUtils-MakeMaker perl-Test-Simple

Older Enterprise-style RPM-based systems (RedHat, Centos)

For older Red Hat Enterprise Linux 5 and derivatives (Centos, Scientific Linux), we provide two additional packages which are needed.

Installing prebuilt


Debian-based systems

For Debian-based systems (including Ubuntu), the deb repositories are generally used for software installation. Use one of the following procedures depending on which version of LaTeXML you wish to install:

Installing prebuilt

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

  sudo apt-get install latexml

This will automatically include any needed dependencies.

Installing from Source or SVN

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

   sudo apt-get install   \
      libparse-recdescent-perl libfile-which-perl \
      libxml2 libxml-libxml-perl \
      libxslt1.1 libxml-libxslt-perl  \
      imagemagick perlmagick

Afterwards, you may use the general procedure for Installing from Source or Installing from SVN.

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

Installing from Source or SVN

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

  sudo port install    \
      p5-xml-libxml p5-xml-libxslt  \
      p5-parse-recdescent p5-file-which p5-perlmagick

Afterwards, you may use the general procedure for Installing from Source or Installing from SVN.

Note there have been issues reported regarding DB_File not being installed; Apparently you must install the the db ‘variant’ of perl, rather than the gdbm variant; that is, you must run sudo port install perl +db (possibly after uninstalling perl first?).

Windows

There is currently no prebuilt LaTeXML for Windows, but it does run under Strawberry Perl which comes with some of our prerequisites pre-installed, and provides other needed commands (perl, cpan, dmake). You may install LaTeXML either by Installing from Source or Installing from SVN after Installing prerequisites.

Installing prerequisites


  • 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

  • If you don’t have Ghostscript already installed:
    Follow the instructions at Ghostscript to download and install the latest version of Ghostscript program (needed by Image::Magick)

  • If you don’t have Imagemagick already installed:
    Follow the instructions at Image Magick to download and install the latest ImageMagick binary.

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

      cpan -i Parse::RecDescent
      cpan -i File::Which
  • Install the Image::Magick Perl module using the command

      cpan -i Image::Magick

    If the install fails with a single error on the write.t test, don’t worry, it is a well known error on Win32 systems that is irrelevant. In that case, run cpan and then in its interactive shell, proceed to force the install

      cpan
      cpan> force install Image::Magick

Installing from Source


After Installing prerequisites, you my install the released source of LaTeXML, by following the general procedure but using Strawberry Perl’s dmake command:

  • Download 0.7.0 (tar.gz)

  • Unpack and build LaTeXML:

     tar zxvf LaTeXML-0.7.0.tar.gz\
     cd LaTeXML-0.7.0
     perl Makefile.PL
     dmake
     dmake test
     dmake install

Installing from SVN


Alternatively, after Installing prerequisites, you may install a very current version of LaTeXML from SVN:

  • If you don’t already have an SVN client, follow the instructions at TortoiseSVN to download and install the most recent version.

  • Fetch LaTeXML from the repository and build:

     svn co https://svn.mathweb.org/repos/LaTeXML
     cd LaTeXML
     perl Makefile.PL
     dmake
     dmake test
     dmake install

Note that if you have already checked out a copy of LaTeXML, you can update and rebuild your copy by using the following

   cd LaTeXML
   svn update
   dmake
   dmake test
   dmake install

Prerequisites

The following list gives an overview of the Perl modules required by LaTeXML; As a general rule, LaTeXML will run with any version released within the last several years.

Parse::RecDescent

a useful grammar based parser module.

File::Which

a handy, portable which command for finding executables.

Image::Magick

provides bindings to the ImageMagick library.

XML::LibXML

provides bindings to the C library libxml2 (available from xmlsoft). Versions before 1.61 will require the additional XML::LibXML::XPathContext module.

XML::LibXSLT

provides bindings to the C library libxslt (from xmlsoft,

DB_File

usually part of a standard Perl installation, provided BerkeleyDB is installed.

Test::Simple

usually part of a standard Perl installation.

License

As this software was developed as part of work done by the United States Government, it is not subject to copyright, and is in the public domain. Note that according to Gnu.org public domain is compatible with GPL.