autoload-all.js (3118B)
1 /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ 2 /* vim: set ts=2 et sw=2 tw=80: */ 3 4 /************************************************************* 5 * 6 * MathJax/extensions/TeX/autoload-all.js 7 * 8 * Provides pre-defined macros to autoload all the extensions 9 * so that all macros that MathJax knows about are available. 10 * 11 * --------------------------------------------------------------------- 12 * 13 * Copyright (c) 2013-2015 The MathJax Consortium 14 * 15 * Licensed under the Apache License, Version 2.0 (the "License"); 16 * you may not use this file except in compliance with the License. 17 * You may obtain a copy of the License at 18 * 19 * http://www.apache.org/licenses/LICENSE-2.0 20 * 21 * Unless required by applicable law or agreed to in writing, software 22 * distributed under the License is distributed on an "AS IS" BASIS, 23 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 * See the License for the specific language governing permissions and 25 * limitations under the License. 26 */ 27 28 MathJax.Extension["TeX/autoload-all"] = { 29 version: "2.6.0" 30 }; 31 32 MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { 33 34 var EXTENSIONS = { 35 action: ["mathtip","texttip","toggle"], 36 AMSmath: ["mathring","nobreakspace","negmedspace","negthickspace","intI", 37 "iiiint","idotsint","dddot","ddddot","sideset","boxed", 38 "substack","injlim","projlim","varliminf","varlimsup", 39 "varinjlim","varprojlim","DeclareMathOperator","operatorname", 40 "genfrac","tfrac","dfrac","binom","tbinom","dbinom","cfrac", 41 "shoveleft","shoveright","xrightarrow","xleftarrow"], 42 begingroup: ["begingroup","endgroup","gdef","global"], 43 cancel: ["cancel","bcancel","xcancel","cancelto"], 44 color: ["color","textcolor","colorbox","fcolorbox","definecolor"], 45 enclose: ["enclose"], 46 extpfeil: ["Newextarrow","xlongequal","xmapsto","xtofrom", 47 "xtwoheadleftarrow","xtwoheadrightarrow"], 48 mhchem: ["ce","cee","cf"] 49 }; 50 51 var ENVIRONMENTS = { 52 AMSmath: ["subarray","smallmatrix","equation","equation*"], 53 AMScd: ["CD"] 54 }; 55 56 var name, i, m, defs = {macros:{}, environment:{}}; 57 58 for (name in EXTENSIONS) {if (EXTENSIONS.hasOwnProperty(name)) { 59 if (!MathJax.Extension["TeX/"+name]) { 60 var macros = EXTENSIONS[name]; 61 for (i = 0, m = macros.length; i < m; i++) 62 {defs.macros[macros[i]] = ["Extension",name]} 63 } 64 }} 65 66 for (name in ENVIRONMENTS) {if (ENVIRONMENTS.hasOwnProperty(name)) { 67 if (!MathJax.Extension["TeX/"+name]) { 68 var envs = ENVIRONMENTS[name]; 69 for (i = 0, m = envs.length; i < m; i++) 70 {defs.environment[envs[i]] = ["ExtensionEnv",null,name]} 71 } 72 }} 73 74 MathJax.InputJax.TeX.Definitions.Add(defs); 75 76 MathJax.Hub.Startup.signal.Post("TeX autoload-all Ready"); 77 78 }); 79 80 MathJax.Callback.Queue( 81 ["Require",MathJax.Ajax,"[MathJax]/extensions/TeX/AMSsymbols.js"], 82 ["loadComplete",MathJax.Ajax,"[MathJax]/extensions/TeX/autoload-all.js"] 83 );