Skip to content

Mixing HTML and SVG output

pkra edited this page May 18, 2013 · 2 revisions

From Rendering some formulas in HTML and others in SVG on same page with Mathjax


Is it possible with MathJax to render some formulas in HTML/CSS and others in SVG on same page with Mathjax?


If you can put the ones that should use HTML-CSS in one (or several)
container elements and the SVG ones in another container element, and
the containers have ID's, then you could use

    skipStartupTypeset: true 

in your configuration to prevent the initial typeset, load both output
renders by including them in the jax array, and then use

    MathJax.Hub.Queue( 
       ["setRenderer",MathJax.Hub,"HTML-CSS"], 
      ["Typeset",MathJax.Hub,"id-for-html-css"], 
       ["setRenderer",MathJax.Hub,"SVG"], 
      ["Typeset",MathJax.Hub,"id-for-SVG"] 
    ); 

to typeset the two sections with different renderers. You can pass an
array of ID's if you need more than one container.

Davide

Clone this wiki locally