TeX4ht is a system for converting documents written in TeX/LaTeX/ConTeXt/etc. to HTML, various XML flavors, braille, etc., optionally using MathML.

- it supports most LaTeX packages and custom commands, including: BibLaTeX, TikZ, Fontspec
- it supports various input formats, apart from LaTeX: PythonTeX, RMarkdown and other formats supported by Knitr and Pandoc
- extensive support for modification of the output
- output formats include HTML 5, ODT and Docbook
- math can be exported to MathML, MathJax or pictures
- publishing webpages from Overleaf

- ChangeLog.
- Project page at Puszcza: source repository, bug db.
- General mailing list (archives), and archive of repository commits.
- Chat on Matrix and Gitter.

- Work-in-progress documentation.
- The original documentation.
- TeX4ht: HTML production, a tutorial/introductory article on using and customizing TeX4ht.
- TeX4ht: LaTeX to Web publishing, more recent tutorial on customizing TeX4ht.
- helpers4ht, Michal Hoftich's wiki to document and simplify tex4ht usage.
- CVR on TeX4ht, blog posts on practical aspects of working with tex4ht.
- tex4ht setup and cheat sheet from Nasser Abbasi.
- Questions about TeX4ht on tex.stackexchange.com.

TeX4ht can be invoked in several ways. The original way is to use the
`htlatex`

command. To convert a LaTeX source file.tex to
HTML5 that uses UTF-8, with MathML:

$htlatex file.tex "xhtml,html5,mathml,charset=utf-8" " -cunihtf -utf8"

N.B. That command line has three arguments, the second two given inside shell quotes; the last argument starts with a space. More details on calling conventions.

An easier way is to use make4ht (see its documentation for more). The following command produces the same output as the previous one, HTML5 in UTF-8 encoding with MathML:

$make4ht file.tex "mathml"

If you want to have MathJax (rather than the browser) rasterize the MathML:

$make4ht file.tex "mathml,mathjax"

But perhaps the best method of all is to insert LaTeX into the HTML output, and have MathJax rasterize the LaTeX:

$make4ht file.tex "mathjax"

This has the additional advantage (thanks to MathJax) that right-clicking on any equation in the HTML brings up a menu offering to provide the source for the equation.

Bug reports are welcome by email or by submission to the bug database. Please include a complete source document and the exact program invocation, as well as what goes wrong. To fix the problem we need to be able to reproduce it. If the problem remains unresolved, please submit it to the bug db, so it won't be forgotten.

We continue to install updates in the tex4ht development source and propagate them to TeX, although we have not made a full release in tex4ht. Some development changes remain solely in the source repository.

TeX4ht was created by Eitan Gurari at Ohio State University. Eitan died unexpectedly in June 2009; we extend our sympathies to his family, and dedicate future work on the project to his memory.

With the encouragement and support of Eitan's family, Michal Hoftich, Karl Berry, and others have continued to work on TeX4ht. Involvement by other volunteers, from bug reports to major new development, is welcome and needed.

No full post-Eitan release has been made to date. This continues to be a work in progress.

Latest changes (full ChangeLog):

2024-09-11 |
tex4ht-mathjax.tex (mathjax-latex-4ht.4ht): prevent insertion of spaces after \begin and \end in \VerbMath. |

2024-09-10 |
tex4ht-mathjax.tex (mathjax-latex-4ht.4ht): use \detokenize again, the alternative method could lead to commands joined with the following text (\int A to \intA). |