Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/static/MathJax/extensions/TeX/mathchoice.js
blob: fff8adf9b76ffb8299e907d571ae9644221a9d56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 *  /MathJax/extensions/TeX/mathchoice.js
 *  
 *  Copyright (c) 2010 Design Science, Inc.
 *
 *  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.Hub.Register.StartupHook("TeX Jax Ready",function(){var c="1.1";var a=MathJax.ElementJax.mml;var d=MathJax.InputJax.TeX;var b=d.Definitions;b.macros.mathchoice="MathChoice";d.Parse.Augment({MathChoice:function(f){var i=this.ParseArg(f),e=this.ParseArg(f),g=this.ParseArg(f),h=this.ParseArg(f);this.Push(a.TeXmathchoice(i,e,g,h))}});a.TeXmathchoice=a.mbase.Subclass({type:"TeXmathchoice",choice:function(){var e=this.getValues("displaystyle","scriptlevel");if(e.scriptlevel>0){return Math.min(3,e.scriptlevel+1)}return(e.displaystyle?0:1)},setTeXclass:function(e){return this.Core().setTeXclass(e)},isSpacelike:function(){return this.Core().isSpacelike()},isEmbellished:function(){return this.Core().isEmbellished()},Core:function(){return this.data[this.choice()]},toHTML:function(e){e=this.HTMLcreateSpan(e);e.bbox=this.Core().toHTML(e).bbox;return e}});MathJax.Hub.Startup.signal.Post("TeX mathchoice Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/mathchoice.js");