/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/extensions/TeX/noErrors.js * * Prevents the TeX error messages from being displayed and shows the * original TeX code instead. You can configure whether the dollar signs * are shown or not for in-line math, and whether to put all the TeX on * one line or use multiple-lines. * * To configure this extension, use * * MathJax.Hub.Config({ * TeX: { * noErrors: { * inlineDelimiters: ["",""], // or ["$","$"] or ["\\(","\\)"] * multiLine: true, // false for TeX on all one line * style: { * "font-size": "90%", * "text-align": "left", * "color": "black", * "padding": "1px 3px", * "border": "1px solid" * // add any additional CSS styles that you want * // (be sure there is no extra comma at the end of the last item) * } * } * } * }); * * Display-style math is always shown in multi-line format, and without * delimiters, as it will already be set off in its own centered * paragraph, like standard display mathematics. * * The default settings place the invalid TeX in a multi-line box with a * black border. If you want it to look as though the TeX is just part of * the paragraph, use * * MathJax.Hub.Config({ * TeX: { * noErrors: { * inlineDelimiters: ["$","$"], // or ["",""] or ["\\(","\\)"] * multiLine: false, * style: { * "font-size": "normal", * "border": "" * } * } * } * }); * * You may also wish to set the font family, as the default is "serif" * * --------------------------------------------------------------------- * * Copyright (c) 2009-2013 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */(function(c,h){var g=c.CombineConfig("TeX.noErrors",{disabled:!1,multiLine:!0,inlineDelimiters:["",""],style:{"font-size":"90%","text-align":"left",color:"black",padding:"1px 3px",border:"1px solid"}});MathJax.Extension["TeX/noErrors"]={version:"2.2",config:g};c.Register.StartupHook("TeX Jax Ready",function(){var a=MathJax.InputJax.TeX.formatError;MathJax.InputJax.TeX.Augment({formatError:function(l,f,k,b){if(g.disabled)return a.apply(this,arguments);var d=l.message.replace(/\n.*/,"");c.signal.Post(["TeX Jax - parse error",d,f,k,b]);var d=g.inlineDelimiters,e=k||g.multiLine;k||(f=d[0]+f+d[1]);f=e?f.replace(/ /g,"\u00a0"):f.replace(/\n/g," ");return MathJax.ElementJax.mml.merror(f).With({isError:!0,multiLine:e})}})});c.Register.StartupHook("HTML-CSS Jax Config",function(){c.Config({"HTML-CSS":{styles:{".MathJax .noError":c.Insert({"vertical-align":c.Browser.isMSIE&&g.multiLine?"-2px":""},g.style)}}})});c.Register.StartupHook("HTML-CSS Jax Ready",function(){var a=MathJax.ElementJax.mml,c=MathJax.OutputJax["HTML-CSS"],f=a.math.prototype.toHTML,k=a.merror.prototype.toHTML;a.math.Augment({toHTML:function(b,d){var e=this.data[0];e&&e.data[0]&&e.data[0].isError?(b.style.fontSize="",b=this.HTMLcreateSpan(b),b.bbox=e.data[0].toHTML(b).bbox):b=f.call(this,b,d);return b}});a.merror.Augment({toHTML:function(b){if(!this.isError)return k.call(this,b);b=this.HTMLcreateSpan(b);b.className="noError";this.multiLine&&(b.style.display="inline-block");for(var d=this.data[0].data[0].data.join("").split(/\n/),e=0,a=d.length;e