/*
* /MathJax/extensions/MatchWebFonts.js * * Copyright (c) 2009-2018 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
(function(c,b){var d=“2.7.5”;var a=MathJax.Hub.CombineConfig(“MatchWebFonts”,{matchFor:{“HTML-CSS”:true,NativeMML:true,SVG:true},fontCheckDelay:500,fontCheckTimeout:15*1000,});MathJax.Extension.MatchWebFonts={version:d,config:a};c.Register.StartupHook(“HTML-CSS Jax Ready”,function(){var e=MathJax.OutputJax;var f=e.postTranslate;e.Augment({postTranslate:function(h,g){if(!g&&a.matchFor&&this.config.matchFontHeight){b.timer.start(b,[“checkFonts”,this,h.jax],a.fontCheckDelay,a.fontCheckTimeout)}return f.apply(this,arguments)},checkFonts:function(k,o){if(k.time(function(){})){return}var s=[],p,l,g=false;for(p=0,l=o.length;p;if(B.parentNode&&B.MathJax.elementJax){B.parentNode.insertBefore(this.EmExSpan.cloneNode(true),B)}}for(w=0,s=l.length;w<s;w++){B=l;if(!B.parentNode){continue}var g=B.MathJax.elementJax;if(!g){continue}var v=document.getElementById(g.inputID+“-Frame”);var k=v.getElementsByTagName(“math”);if(!k){continue}g=g.NativeMML;var y=B.previousSibling;var z=y.firstChild.offsetWidth/60;var h=y.lastChild.offsetWidth/60;if(z===0||z===“NaN”){z=this.defaultEx;h=this.defaultMEx}var r=(z!==g.ex);if(r||h!=g.mex){var C=(this.config.matchFontHeight&&h>1?z/h:1);C=Math.floor(Math.max(this.config.minScaleAdjust/100,C)*this.config.scale);if(C/100!==g.scale){o.push()}g.scale=C/100;g.fontScale=C+“%”;g.ex=z;g.mex=h}if(“scrollWidth” in g&&(r||g.scrollWidth!==k.firstChild.scrollWidth)){g.scrollWidth=k.firstChild.scrollWidth;t.push()}if(k.MathJaxMtds){for(var u=0,p=k.MathJaxMtds.length;u<p;u++){if(!k.MathJaxMtds.parentNode){continue}if(r||k.MathJaxMtds.firstChild.scrollWidth!==g.mtds){g.mtds=k.MathJaxMtds.firstChild.scrollWidth;q.push([k.MathJaxMtds,g.mtds/g.ex])}}}}for(w=0,s=l.length;w<s;w++){B=l;if(B.parentNode&&B.MathJax.elementJax){B.parentNode.removeChild(B.previousSibling)}}for(w=0,s=o.length;w<s;w++){o[0].fontSize=o[1]+“%”}for(w=0,s=t.length;w<s;w++){t[0].width=t[1].toFixed(3)+“ex”}for(w=0,s=q.length;w<s;w++){var x=q[0].getAttribute(“style”);x=x.replace(/(($|;)s*min-width:).*?ex/,“$1 ”+q[1].toFixed(3)+“ex”);q[0].setAttribute(“style”,x)}setTimeout(A,A.delay)}})});c.Startup.signal.Post(“MatchWebFonts Extension Ready”);b.loadComplete(“/extensions/MatchWebFonts.js”)})(MathJax.Hub,MathJax.Ajax);