|
| 1 | +/************************************************************* |
| 2 | + * |
| 3 | + * MathJax/config/readium.js |
| 4 | + * |
| 5 | + * Configuration file for Readium project |
| 6 | + * |
| 7 | + * --------------------------------------------------------------------- |
| 8 | + * |
| 9 | + * Copyright (c) 2012 Design Science, Inc. |
| 10 | + * |
| 11 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 12 | + * you may not use this file except in compliance with the License. |
| 13 | + * You may obtain a copy of the License at |
| 14 | + * |
| 15 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 16 | + * |
| 17 | + * Unless required by applicable law or agreed to in writing, software |
| 18 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 19 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 20 | + * See the License for the specific language governing permissions and |
| 21 | + * limitations under the License. |
| 22 | + */ |
| 23 | + |
| 24 | +MathJax.Hub.Config({ |
| 25 | + jax: ["input/TeX","input/MathML","output/SVG"], |
| 26 | + extensions: ["tex2jax.js","mml2jax.js","MathEvents.js"], |
| 27 | + TeX: { |
| 28 | + extensions: ["noErrors.js","noUndefined.js","autoload-all.js"] |
| 29 | + }, |
| 30 | + SVG: { |
| 31 | + linebreaks: { automatic: true } |
| 32 | + }, |
| 33 | + MathMenu: { |
| 34 | + showRenderer: false |
| 35 | + }, |
| 36 | + menuSettings: { |
| 37 | + zoom: "Click" |
| 38 | + }, |
| 39 | + messageStyle: "none" |
| 40 | +}); |
| 41 | + |
| 42 | +MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () { |
| 43 | + var SVG = MathJax.OutputJax.SVG, GLYPH = SVG.BBOX.GLYPH; |
| 44 | + GLYPH.Augment({ |
| 45 | + Init: function (scale,id,h,d,w,l,r,p) { |
| 46 | + var t = SVG.config.blacker, |
| 47 | + def = {"stroke-width":t}; |
| 48 | + if (p !== "") {def.d = "M"+p+"Z"} |
| 49 | + if (scale !== 1) {def.transform = "scale("+scale+")"} |
| 50 | + this.SUPER(arguments).Init.call(this,def); |
| 51 | + this.h = (h+t) * scale; this.d = (d+t) * scale; this.w = (w+t/2) *scale; |
| 52 | + this.l = (l+t/2) * scale; this.r = (r+t/2) * scale; |
| 53 | + this.H = Math.max(0,this.h); this.D = Math.max(0,this.d); |
| 54 | + this.x = this.y = 0; this.scale = scale; |
| 55 | + } |
| 56 | + }); |
| 57 | +}); |
| 58 | + |
| 59 | +MathJax.Ajax.loadComplete("[MathJax]/config/readium-iframe.js"); |
0 commit comments