The texmath package

[Tags: gpl, library]

The texmathml library provides functions to convert LaTeX math formulas to presentation MathML (which can be used in HTML) or OMML (Office Math Markup Language, used in Microsoft Office). It supports basic LaTeX and AMS extensions, and it can parse and apply LaTeX macros.

Use the executable flag to install a standalone executable, texmath, that reads a LaTeX formula from stdin and writes MathML to stdout.

Use the cgi flag to install a cgi script, texmath-cgi.

[Skip to ReadMe]


Versions0.1,,,,, 0.1.1, 0.2,,,,, 0.3,,,,,,, 0.4, 0.5,,,,, 0.6,,,,,,, 0.6.1,,,,,, 0.6.3, 0.6.4, 0.6.5,,, 0.6.6,,,, 0.6.7, 0.7,,, 0.8,,, 0.8.1, 0.8.2,,, 0.8.3, 0.8.4,,, 0.8.5,, 0.8.6,, (info)
Change logchangelog
Dependenciesbase (==3.* || >=4.5 && <5), cgi, containers, json, mtl, pandoc-types (>=, parsec (>=3), syb, texmath, utf8-string, xml [details]
AuthorJohn MacFarlane
Home page
Source repositoryhead: git clone git://
Executablestexmath-cgi, texmath
UploadedSun Jul 20 19:46:22 UTC 2014 by JohnMacFarlane
DistributionsArch:, Debian:, Fedora:, FreeBSD:0.8.3, LTSHaskell:, NixOS:, Stackage:
Downloads69886 total (136 in last 30 days)
0 []
StatusDocs available [build log]
Successful builds reported [all 1 reports]




cgiCompile cgi executable.DisabledAutomatic
executableCompile test executable.DisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Maintainers' corner

For package maintainers and hackage trustees

Readme for texmath-0.6.7


texmath is a Haskell library for converting LaTeX math to MathML and OMML (the math format used in Microsoft Office). It is used by pandoc and gitit.

You can try it out online here. (Note that the math it produces will be rendered correctly only if your browser supports MathML. Firefox does; Safari and Chrome do not.)

By default, only the Haskell library is installed. To install a test program, texmath, use the executable Cabal flag:

cabal install -fexecutable

To run the test suite, compile with --enable-tests and do cabal test.

texmath reads a LaTeX formula from stdin and writes a standalone xhtml file to stdout. You can run the test suite thus:

cd tests

Macro definitions may be included before the formula.

The cgi Cabal flag will cause a CGI binary, texmath-cgi, to be produced:

cabal install -fcgi

The file cgi/texmath.html contains an example of how it can be used.

Thanks to John Lenz for many contributions.