Skip to content
Frédéric Wang edited this page Jun 1, 2014 · 13 revisions

TeXZilla.toMathMLString

  TeXZilla.toMathMLString = function(aTeX, aDisplay, aRTL, aThrowExceptionOnError)

converts the TeX string aTeX into a MathML source. The optional boolean aDisplay and aRTL indicates whether the MathML output should be in display mode and in RTL direction respectively. An optional boolean aThrowExceptionOnError was introduced in TeXZilla 0.9.3 and indicates whether TeXZilla should throw an exception when parsing fails.

TeXZilla.toMathML

  TeXZilla.toMathML = function(aTeX, aDisplay, aRTL, aThrowExceptionOnError)

is the same as TeXZilla.toMathMLString, but returns a MathML DOM element. This requires to have a DOMParser API available (see TeXZilla.setDOMParser below).

TeXZilla.toImage

 TeXZilla.toImage = function(aTeX, aRTL, aRoundToPowerOfTwo, aSize, aDocument)

This requires TeXZilla >= 0.9.7.

TeXZilla.filterString = function(aString, aThrowExceptionOnError)

This requires TeXZilla >= 0.9.7.

TeXZilla.filterElement = function(aElement, aThrowExceptionOnError)

This requires TeXZilla >= 0.9.7.

TeXZilla.getTeXSource

  TeXZilla.getTeXSource = function(aMathMLElement)

returns the TeX source attached to aMathMLElement via a semantics annotation or null if none is found. aMathMLElement is either a string or a MathML DOM element. This requires to have a DOMParser API available (see TeXZilla.setDOMParser below).

TeXZilla.setDOMParser

  TeXZilla.setDOMParser = function(aDOMParser)

sets TeXZilla's DOMParser to the DOMParser instance aDOMParser. Note that TeXZilla tries to automatically initialized its DOMParser to new DOMParser() and otherwise leave it null.

TeXZilla.setSafeMode

  TeXZilla.setSafeMode = function(aEnable)

enables or disables TeXZilla's safe mode as indicated by the boolean aEnable. By default safe mode is disabled but if you enable it, MathML features like href or maction that are known to be usable for XSS injections will be ignored. This requires TeXZilla >= 0.9.7.

TeXZilla.setItexIdentifierMode

  TeXZilla.setItexIdentifierMode = function(aEnable)

enables or disables itex identifier mode as indicated by the boolean aEnable. By this is disabled but if you enable it, a sequence of basic latin letters (a, b, ... z, A, B, C, ..., Z) such as $pin$ will generate a single MathML token <mi>pin</mi>. Other letters e.g. Greek or Arabic will still be treated as individual tokens. This requires TeXZilla >= 0.9.7.

Clone this wiki locally