/* * /MathJax/extensions/TeX/unicode.js * * Copyright (c) 2009-2013 The MathJax Consortium * * Part of the MathJax library. * See http://www.mathjax.org for details. * * Licensed under the Apache License, Version 2.0; * you may not use this file except in compliance with the License. * * http://www.apache.org/licenses/LICENSE-2.0 */MathJax.Extension["TeX/unicode"]={version:"2.2",unicode:{},config:MathJax.Hub.CombineConfig("TeX.unicode",{fonts:"STIXGeneral,'Arial Unicode MS'"})};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var c=MathJax.InputJax.TeX,e=MathJax.ElementJax.mml,d=MathJax.Extension["TeX/unicode"].unicode;c.Definitions.Add({macros:{unicode:"Unicode"}},null,!0);c.Parse.Augment({Unicode:function(a){var b=this.GetBrackets(a),c;b&&(b.replace(/ /g,"").match(/^(\d+(\.\d*)?|\.\d+),(\d+(\.\d*)?|\.\d+)$/)?(b=b.replace(/ /g,"").split(/,/),c=this.GetBrackets(a)):(c=b,b=null));a=this.trimSpaces(this.GetArgument(a));var f=parseInt(a.match(/^x/)?"0"+a:a);d[f]?c||(c=d[f][2]):d[f]=[800,200,c,f];b&&(d[f][0]=Math.floor(1E3*b[0]),d[f][1]=Math.floor(1E3*b[1]));var b=this.stack.env.font,g={};c?(d[f][2]=g.fontfamily=c.replace(/"/g,"'"),b&&(b.match(/bold/)&&(g.fontweight="bold"),b.match(/italic|-mathit/)&&(g.fontstyle="italic"))):b&&(g.mathvariant=b);g.unicode=[].concat(d[f]);this.Push(e.mtext(e.entity("#"+a)).With(g))}});MathJax.Hub.Startup.signal.Post("TeX unicode Ready")});MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function(){var c=MathJax.ElementJax.mml,e=MathJax.Extension["TeX/unicode"].config.fonts,d=c.mbase.prototype.HTMLgetVariant;c.mbase.Augment({HTMLgetVariant:function(){var a=d.call(this);a.unicode&&(delete a.unicode,delete a.FONTS);if(!this.unicode)return a;a.unicode=!0;a.defaultFont||(a=MathJax.Hub.Insert({},a),a.defaultFont={family:e});var b=this.unicode[2],b=b?b+(","+e):e;a.defaultFont[this.unicode[3]]=[this.unicode[0],this.unicode[1],500,0,500,{isUnknown:!0,isUnicode:!0,font:b}];return a}})});MathJax.Hub.Register.StartupHook("SVG Jax Ready",function(){var c=MathJax.ElementJax.mml,e=MathJax.Extension["TeX/unicode"].config.fonts,d=c.mbase.prototype.SVGgetVariant;c.mbase.Augment({SVGgetVariant:function(){var a=d.call(this);a.unicode&&(delete a.unicode,delete a.FONTS);if(!this.unicode)return a;a.unicode=!0;a.forceFamily||(a=MathJax.Hub.Insert({},a));a.defaultFamily=e;a.noRemap=!0;a.h=this.unicode[0];a.d=this.unicode[1];return a}})});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/unicode.js");