123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- MathJax.Extension["TeX/HTML"] = {
- version: "2.7.2"
- };
- MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
- var TEX = MathJax.InputJax.TeX;
- var TEXDEF = TEX.Definitions;
-
- TEXDEF.Add({
- macros: {
- href: 'HREF_attribute',
- "class": 'CLASS_attribute',
- style: 'STYLE_attribute',
- cssId: 'ID_attribute'
- }
- },null,true);
- TEX.Parse.Augment({
-
-
-
- HREF_attribute: function (name) {
- var url = this.GetArgument(name),
- arg = this.GetArgumentMML(name);
- this.Push(arg.With({href:url}));
- },
-
-
-
-
- CLASS_attribute: function (name) {
- var CLASS = this.GetArgument(name),
- arg = this.GetArgumentMML(name);
- if (arg["class"] != null) {CLASS = arg["class"] + " " + CLASS}
- this.Push(arg.With({"class":CLASS}));
- },
-
-
-
- STYLE_attribute: function (name) {
- var style = this.GetArgument(name),
- arg = this.GetArgumentMML(name);
-
- if (arg.style != null) {
- if (style.charAt(style.length-1) !== ";") {style += ";"}
- style = arg.style + " " + style;
- }
- this.Push(arg.With({style: style}));
- },
-
-
-
- ID_attribute: function (name) {
- var ID = this.GetArgument(name),
- arg = this.GetArgumentMML(name);
- this.Push(arg.With({id:ID}));
- },
-
-
-
-
- GetArgumentMML: function (name) {
- var arg = this.ParseArg(name);
- if (arg.inferred && arg.data.length == 1)
- {arg = arg.data[0]} else {delete arg.inferred}
- return arg;
- }
- });
-
- MathJax.Hub.Startup.signal.Post("TeX HTML Ready");
-
- });
- MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/HTML.js");
|