How to install LaTeXML

This is a short guide how to install the non graphical version of LaTeXML on debian as a web service that you can use as server for converting LaTeX to MathML. If you need a user interface see this outdated guide. here a part of my history where I insalled everything from my LaTeXML home '/home/LaTeXML' replace that with whatever you think suitable for you.
  1. sudo apt-get install \
  2. libarchive-zip-perl libfile-which-perl libimage-size-perl \
  3. libio-string-perl libjson-xs-perl libwww-perl libparse-recdescent-perl \
  4. liburi-perl libxml2 libxml-libxml-perl libxslt1.1 libxml-libxslt-perl \
  5. texlive imagemagick perlmagick make
  6. mkdir /home/LaTeXML
  7. cd /home/LaTeXML
  8. git clone https://github.com/brucemiller/LaTeXML.git
  9. cd LaTeXML/
  10. perl Makefile.PL
  11. make
  12. sudo make install
  13. cd /home/LaTeXML
  14. sudo apt-get install libplack-perl libapache2-mod-perl2 apache2
  15. git clone https://github.com/dginev/LaTeXML-Plugin-ltxpsgi.git
  16. cd LaTeXML-Plugin-ltxpsgi
  17. perl Makefile.PL
  18. make
  19. sudo make install
  20. cd /etc/apache2/sites-available/
  21. vi latexml.conf
and paste the contents of my latexml config file which I have given below:
  1. Listen 8888
  2. <VirtualHost *:8888>
  3. ServerName localhost
  4.  
  5. PerlOptions +Parent
  6.  
  7. <Perl>
  8. $ENV{PLACK_ENV} = 'production';
  9. </Perl>
  10.  
  11. <Location />
  12. SetHandler perl-script
  13. PerlHandler Plack::Handler::Apache2
  14. PerlSetVar psgi_app /usr/local/bin/ltxpsgi
  15. </Location>
  16.  
  17. ErrorLog /var/log/apache2/latexml.error.log
  18. LogLevel warn
  19. CustomLog /var/log/apache2/latexml.access.log combined
  20. </VirtualHost>
  1. a2ensite latexml
  2. apache2ctl restart
To test you can use the following request generated by mediawiki while \sin x^2 is converted:
  1. curl -d 'format=xhtml&whatsin=math&whatsout=math&pmml&cmml&nodefaultresources&preload=LaTeX.pool&preload=article.cls&preload=amsmath.sty&preload=amsthm.sty&preload=amstext.sty&preload=amssymb.sty&preload=eucal.sty&preload=%5Bdvipsnames%5Dxcolor.sty&preload=url.sty&preload=hyperref.sty&preload=%5Bids%5Dlatexml.sty&preload=texvc&tex=literal:%5Csin+x%5E2' localhost:8888
The result should contain a very log file an the XML output in the end.

Tags: