MathJax.Extension.jsMath2jax={version:"2.7.9",config:{preview:"TeX"},PreProcess:function(i){this.configured||(this.config=MathJax.Hub.CombineConfig("jsMath2jax",this.config),this.config.Augment&&MathJax.Hub.Insert(this,this.config.Augment),typeof this.config.previewTeX!="undefined"&&!this.config.previewTeX&&(this.config.preview="none"),this.previewClass=MathJax.Hub.config.preRemoveClass,this.configured=!0),typeof i=="string"&&(i=document.getElementById(i)),i||(i=document.body);var t=i.getElementsByTagName("span"),e;for(e=t.length-1;e>=0;e--)String(t[e].className).match(/(^| )math( |$)/)&&this.ConvertMath(t[e],"");var a=i.getElementsByTagName("div");for(e=a.length-1;e>=0;e--)String(a[e].className).match(/(^| )math( |$)/)&&this.ConvertMath(a[e],"; mode=display")},ConvertMath:function(i,t){if(i.getElementsByTagName("script").length===0){var e=i.parentNode,a=this.createMathTag(t,i.innerHTML);i.nextSibling?e.insertBefore(a,i.nextSibling):e.appendChild(a),this.config.preview!=="none"&&this.createPreview(i),e.removeChild(i)}},createPreview:function(i){var t=MathJax.Hub.config.preRemoveClass,e=this.config.preview;e!=="none"&&(i.previousSibling||{}).className!==t&&(e==="TeX"&&(e=[this.filterPreview(i.innerHTML)]),e&&(e=MathJax.HTML.Element("span",{className:t},e),i.parentNode.insertBefore(e,i)))},createMathTag:function(i,t){t=t.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&");var e=document.createElement("script");return e.type="math/tex"+i,MathJax.HTML.setScript(e,t),e},filterPreview:function(i){return i}},MathJax.Hub.Register.PreProcessor(["PreProcess",MathJax.Extension.jsMath2jax],8),MathJax.Ajax.loadComplete("[MathJax]/extensions/jsMath2jax.js");
