SnuggleTeX (1.2.0-beta1)

Skip Navigation

Overview & Features

SnuggleTeX is a free and open-source Java library for converting fragments of LaTeX to XML (usually XHTML + MathML).
  • SnuggleTeX can convert simple LaTeX documents consisting of a mixture of text and math mode LaTeX into XHTML with embedded MathML.
  • More simply, SnuggleTeX can convert math mode LaTeX to MathML, generating Presentation MathML by default.
  • As of SnuggleTeX 1.1.0, SnuggleTeX can also attempt to “semantically enrich” or “up-conver” 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 can output 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 browser and deployment options.
  • 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.
  • 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.
  • 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.)
  • SnuggleTeX (1.1.0 and above) 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.