Skip to content

Installation Guides

Deyan Ginev edited this page Feb 24, 2018 · 8 revisions

This page provides user supplied guides and workarounds to installation issues. It supplements the 'Official' Get LaTeXML page.

1. HomeBrew on MacOS

Coming Soon

2. cpanm (development and build systems)

Using cpanminus is a simple and quick method for installing latexml for development. The method is platform-independent, but this guide is written from an Ubuntu usage perspective - please feel free to correct any inaccuracies for your specific platform.

Benefits

  • requires no system privileges
  • makes it straightforward to work with multiple forks of latexml.
    • Switching the active installation requires a single cpanm . in the chosen repository working directory.
  • possible to test multiple perl versions when combined with perlbrew
  • automatically installs CPAN perl dependencies, as long as the underlying system packages are already available (e.g. libxml2-dev)
  • offers the most recent versions of dependent packages, including the dev linting tools

Local installation

  1. You can look for App::cpanminus in your OS package manager, or install it directly via:

    curl -L https://cpanmin.us | perl - App::cpanminus
    
  2. Setup the local paths in your .bashrc or equivalent initialization script

    export PATH=$HOME/perl5/bin:$PATH
    export PERL5LIB=$HOME/perl5/lib/perl5:$PERL5LIB
    
  3. Install LaTeXML and pre-commit hook

    git clone https://github.com/brucemiller/LaTeXML
    cd LaTeXML
    ln -s tools/pre-commit .git/hooks
    cpanm .
    

    Additionally, for certain quick fixes you may want to reinstall without running tests at all (e.g. fixing a typo while prototyping), which you can do neatly via cpanm . --notest.

  4. Install linting tools

    cpanm Perl::Critic Perl::Tidy
    

A caveat to keep in mind with this approach is that you may see some weird classes of errors if you install LaTeXML both globally (say via a package manager or classic sudo make install), and locally via cpanminus. It is usually recommended to only install latexml using a single pipeline, to keep things simple.

Tip I. Speeding up test runs on multi core CPUs

The default execution of perl's Test::Harness test runs happens in a single process and thread, and is needlessly slow on modern systems. Setting the HARNESS_OPTIONS environment variable allows to leverage the full compute power of modern systems, e.g. by adding to your .bashrc or equivalent:

    export HARNESS_OPTIONS=j$(grep -c ^processor /proc/cpuinfo):c

On my X230 Thinkpad, an Intel i5-3210M CPU @ 2.50GHz processor speeds up from 4.5 to 2.2 minutes in running make test, as one example. A gain that compounds while developing.

6v.0.0.0 IV ice

Clone this wiki locally