itsqualtime
itsqualtime

Reputation: 83

Selectively render equations with MathJax

I am trying to have MathJax typeset equations on my entire document, except for specific divs. Right now, my HTML document has the following set up:

 <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>

and a bunch of other configs specified in

<script type="text/x-mathjax-config" > //options </script>

Let's say the body contains:

<div id="one"> $A^x$ </div>
<div class="two"> $B_x$ </div>

When the page loads, both A^x and B_x are typeset. However, I would like to tell MathJax not to render the equations in div.two on page load (only later). Is there a simple way to do this?

Note that I am not trying to do something like

MathJax.Hub.Queue(["Typeset",MathJax.Hub,document.getElementsById('one')[0]])();

but rather "render everything, minus the divs which class 'two' ".

Thanks.

Upvotes: 2

Views: 591

Answers (1)

Peter Krautzberger
Peter Krautzberger

Reputation: 5305

Since it looks like you are using TeX-input, you can specify classes in the configuration of the tex2jax pre-processor, e.g.,

<script type="text/x-mathjax-config">
  // ...
  tex2jax: {ignoreClass: "class2"}
</script>

See the MathJax documentation for more details.

Upvotes: 1

Related Questions