This example shows how to use the
MathJax.typesetPromise()
function to process user input
that is HTML containing delimited TeX expressions and/or MathML tags,
allowing for the possibility that they use \require
to
load extensions dynamically, or one is loaded automatically by the
autoload
extension, or the font needs to load additional
data for the characters used in the expression.
When the user presses the Render TeX
button or
switches the display
checkbox or one of the other
controls, the Interactive.convert()
function runs. The
comments in the code explain how the conversion process is
handled. Note that the user interface is disabled during the
typesetting process, since the conversion is done asynchronously in
this example. This prevents the user from starting a new typeset
operation while one is already in progress.