## Overview & Features

SnuggleTeX is a free and open-source Java library for converting fragments
of LaTeX to XML (usually XHTML + MathML).

- SnuggleTeX converts simple math mode LaTeX to MathML, generating Presentation
MathML by default.
- SnuggleTeX converts simple LaTeX input consisting of a mixture of text
and math mode LaTeX into XHTML with embedded MathML.
- SnuggleTeX can generate either a DOM fragment, an XML string fragment, or create
a full standalone web page of various types.
- Web page outputs can be configured in various ways and SnuggleTeX provides a
number of useful web page templates that can be used to target certain “known
good” browser and deployment options.
- Outputs can be fully standalone (e.g. with all CSS styling done inline) to enable
XML fragments to be imported into other XML applications and/or systems
which support XHTML+MathML.
- SnuggleTeX has optional features for converting the resulting MathML to images
(using the JEuclid library) and can additionally attempt to convert very
simple MathML expressions into a mixture of XHTML and CSS.
- SnuggleTeX can optionally attempt to
“semantically enrich” or
“up-convert” the Presentation MathML it creates, additionally generating
Content MathML and/or Maxima input
formats if it can make enough sense of the LaTeX input.
(This is currently experimental work
aimed primarily at secondary/early tertiary UK Education contexts!)
- SnuggleTeX also includes some experimental utility code to convert the raw MathML
generated by ASCIIMathML
to Content MathML and Maxima notation by hooking into the semantic enrichment process.
- Error reporting is configurable and error messages are internationalisable and
provide detailed contextual information.
- SnuggleTeX supports
`\newcommand` and `\newenvironment` and
friends, making it easy to create custom commands and environments within LaTeX.
(It is also possible to define new commands and environments via Java.)