The HaTeX package

[Tags:bsd3, library, test]

The LaTeX project site states: "LaTeX is a high-quality typesetting system". This library provides a bridge between LaTeX and Haskell, implementing the LaTeX syntax in Haskell.

Some of the things you can do are:

Write LaTeX documents with all the advantages you already have in Haskell (recursion, type system, high order functions, ...), create a LaTeX backend for your own program, make analysis of LaTeX code through its Abstract Syntax Tree (AST), pretty-print Haskell values in LaTeX, generate TikZ scripts easily, ...

See the examples directory in the source distribution to look some simple examples. It would be good to get you started. The HaTeX User's Guide is available at

[Skip to Readme]


Versions 1.0.0, 1.0.1, 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 3.0.0, 3.1.0, 3.2,, 3.3, 3.4, 3.5, 3.6,,,,,,,,,,,,,,,,,,,,,,,
Dependencies attoparsec (>=0.10.2 && <0.11), base (==4.*), bytestring (>= && <0.11), containers (>= && <0.6), matrix, text (>= && <0.12), transformers (>=0.2.2 && <0.4) [details]
License BSD3
Author Daniel Díaz
Maintainer Daniel Díaz (dhelta `dot` diaz `at` gmail `dot` com)
Category Text, LaTeX
Bug tracker
Source repository head: git clone
Uploaded Fri Jul 5 14:15:57 UTC 2013 by DanielDiaz
Distributions LTSHaskell:, NixOS:, Stackage:, Tumbleweed:
Downloads 11289 total (132 in the last 30 days)
1 []
Status Docs uploaded by user
Build status unknown [no reports yet]




Maintainer's Corner

For package maintainers and hackage trustees

Readme for HaTeX

Readme for HaTeX-

HaTeX ReadMe

HaTeX is a Haskell library that implements the LaTeX syntax. Check a list of examples of usage in the examples directory. A good starting point may be simple.hs. Run the script using the main function.

Installation notes

To install HaTeX, use cabal-install. $ cabal update $ cabal install HaTeX This will install the latest official release (recommended). If you want to try a newer version, use git to clone the code contained in this repository. $ git clone $ cd HaTeX $ cabal install However, note that the API may be unstable and is subject to any kind of change. In the other hand, this package follows the Package Versioning Policy, so it is unlikely to suffer from API breakages if you follow it too when importing the library.

HaTeX User's Guide

The HaTeX User's Guide lives here... and is also done in Haskell! It is free source and anybody can contribute to it. Doing so, you will help current and future users! A downloadable version (not necessarily the last version, but most likely) can be found here. To be sure that you are reading the last version, go to the github repository of the guide and follow instructions to build it. It is fairly easy.


To contribute to HaTeX, please, visit our code repository in GitHub:

TODO list

  • Add more examples.
  • More testing on the parser (See #15).
  • Add more documentation.
  • BibTeX support.

Packages to be implemented

  • fancyhdr
  • geometry

Related projects

  • TeX-my-math: Experimental library to ease the production of mathematical expressions using HaTeX.