Skip to content
Frédéric Wang edited this page Feb 23, 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.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.

Clone this wiki locally