BSD-3-Clause licensed by Daniel Díaz
Maintained by Daniel Díaz (dhelta `dot` diaz `at` gmail `dot` com)
This version can be pinned in stack with:HaTeX-,4809

Module documentation for

  • Text
    • Text.LaTeX
      • Text.LaTeX.Base
        • Text.LaTeX.Base.Class
        • Text.LaTeX.Base.Commands
        • Text.LaTeX.Base.Parser
        • Text.LaTeX.Base.Pretty
        • Text.LaTeX.Base.Render
        • Text.LaTeX.Base.Syntax
        • Text.LaTeX.Base.Texy
        • Text.LaTeX.Base.Types
        • Text.LaTeX.Base.Warnings
        • Text.LaTeX.Base.Writer
      • Text.LaTeX.Packages
        • Text.LaTeX.Packages.AMSFonts
        • Text.LaTeX.Packages.AMSMath
        • Text.LaTeX.Packages.AMSSymb
        • Text.LaTeX.Packages.AMSThm
        • Text.LaTeX.Packages.Babel
        • Text.LaTeX.Packages.Beamer
        • Text.LaTeX.Packages.Color
        • Text.LaTeX.Packages.Fancyhdr
        • Text.LaTeX.Packages.Fontenc
        • Text.LaTeX.Packages.Geometry
        • Text.LaTeX.Packages.Graphicx
        • Text.LaTeX.Packages.Hyperref
        • Text.LaTeX.Packages.Inputenc
        • Text.LaTeX.Packages.TikZ
          • Text.LaTeX.Packages.TikZ.PathBuilder
          • Text.LaTeX.Packages.TikZ.Simple
          • Text.LaTeX.Packages.TikZ.Syntax
        • Text.LaTeX.Packages.Trees
          • Text.LaTeX.Packages.Trees.Qtree

The HaTeX library

HaTeX is a Haskell library that implements the LaTeX syntax, plus some abstractions over it.

Check a list of usage examples in the Examples directory of the repository in GitHub. A good starting point may be simple.hs. Run any example script executing the main function.

Installation notes

To install HaTeX, use cabal-install.

$ cabal update
$ cabal install HaTeX

This will download and 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 (assuming you are using the version in Hackage).

See the Hackage page of HaTeX to browse older versions.

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.

Please note that the user’s guide needs to be updated (contributions are more than welcome!).

Community and Contributions

There are many ways to get involved in the HaTeX project. Use the most comfortable way for you.

TODO list

  • Add more examples.
  • Add more documentation.
  • BibTeX support.

Related projects

  • TeX-my-math: Experimental library to ease the production of mathematical expressions using HaTeX (no longer maintained?).
  • haskintex: Tool to use Haskell (and, additionaly, the HaTeX library) within a LaTeX file.

Travis automatic build

Every time code changes in the GitHub repository, an automatic build checks that the library compiles with several versions of GHC (7.4, 7.6, and 7.8) and that all tests pass. This label indicates the result of the last automatic build.

Build Status

Currently, automatic builds are only running under Linux. We hope Travis will support other systems in the future.


HaTeX Changelog

This is the logchange of HaTeX. It might not be exhaustive. For a full list of changes, see the commit history of the git repository:

Changelog by versions

From to

  • New package implemented: AMSSymb.
  • Package beamer further developed.
  • Bug fix: #35.
  • Added common numeric sets to AMSSymb.
  • Breaking change: AMSMath functions ‘pm’ and ‘mp’ changed their type from LaTeXC l => l -> l -> l to LaTeXC l => l.
  • Additions to the AMSMath module.

From to

  • Fixed link in cabal file.
  • Added support for arguments delimited by parenthesis (experimental).
  • More tests on parsing.
  • Parser now backtracks when failing in argument parsing.

From to

  • New function matrixTabular to create tables from matrices.
  • Modified LaTeX Monoid instance to make monoid laws hold.
  • Some documentation improvements.
  • Added this CHANGELOG!