delay rendering math until buttton click

119 views
Skip to first unread message

vernon...@gmail.com

unread,
Jun 15, 2012, 10:13:52 AM6/15/12
to mathja...@googlegroups.com
Is it possible to use the ignoreClass and processClass configuration directives to delay processing ?

For instance consider the div below: 

<div class='ignore_tex' >$$ math jax stuff $$</div>



Is it possible to have mathjax process the div below at a button click. 





 

Davide P. Cervone

unread,
Jun 19, 2012, 3:55:42 PM6/19/12
to mathja...@googlegroups.com
You would have to remove the "ignore_tex" class (assuming you have set
ignoreClass to be ignore_tex rather than the default tex2jax_ignore)
before MathJax would process the DIV. If you are trying to prevent
the initial typesetting, then

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
skipStartupTypeset: true
});
</script>

should do that for you. In this case, nothing will be typeset until
you call Typeset() yourself. Your button click could then use

MathJax.Hub.Queue(["Typeset",MathJax.Hub]);

as part of its onclick handler.

If you want other stuff on the page to be typeset but not this one
div, then you could either use the elements array in your
configuration to specify the sections that you DO want to be typeset,
or you can use the "ignore_tex" class to prevent sections from being
typeset, and then remove that class after the initial typeset is
complete.

Davide


On Jun 15, 2012, at 10:13 AM, <vernon...@gmail.com> <vernon...@gmail.com
Reply all
Reply to author
Forward
0 new messages