2011-01-28 02:12:00 +01:00
/ *
* / M a t h J a x / c o n f i g / M M L _ H T M L o r M M L . j s
*
* Copyright ( c ) 2010 - 11 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 . Config ( { delayJaxRegistration : true } ) ;
MathJax . Ajax . Preloading (
"[MathJax]/jax/input/MathML/config.js" ,
"[MathJax]/jax/output/HTML-CSS/config.js" ,
"[MathJax]/jax/output/NativeMML/config.js" ,
"[MathJax]/config/MMLorHTML.js" ,
"[MathJax]/extensions/mml2jax.js" ,
"[MathJax]/extensions/MathZoom.js" ,
"[MathJax]/extensions/MathMenu.js" ,
"[MathJax]/jax/element/mml/jax.js" ,
2011-06-01 21:35:18 +02:00
"[MathJax]/extensions/toMathML.js" ,
2011-01-28 02:12:00 +01:00
"[MathJax]/jax/input/MathML/jax.js"
) ;
2011-06-01 21:35:18 +02:00
MathJax . Hub . Config ( { "v1.0-compatible" : false } ) ;
2011-01-28 02:12:00 +01:00
2011-06-03 09:03:06 +02:00
MathJax . InputJax . MathML = MathJax . InputJax ( { id : "MathML" , version : "1.1.4" , directory : MathJax . InputJax . directory + "/MathML" , extensionDir : MathJax . InputJax . extensionDir + "/MathML" , entityDir : MathJax . InputJax . directory + "/MathML/entities" , config : { useMathMLspacing : false } } ) ; MathJax . InputJax . MathML . Register ( "math/mml" ) ; MathJax . InputJax . MathML . loadComplete ( "config.js" ) ;
2011-01-28 02:12:00 +01:00
2011-06-03 09:03:06 +02:00
MathJax . OutputJax [ "HTML-CSS" ] = MathJax . OutputJax ( { id : "HTML-CSS" , version : "1.1.5" , directory : MathJax . OutputJax . directory + "/HTML-CSS" , extensionDir : MathJax . OutputJax . extensionDir + "/HTML-CSS" , autoloadDir : MathJax . OutputJax . directory + "/HTML-CSS/autoload" , fontDir : MathJax . OutputJax . directory + "/HTML-CSS/fonts" , webfontDir : MathJax . OutputJax . fontDir + "/HTML-CSS" , config : { scale : 100 , minScaleAdjust : 50 , availableFonts : [ "STIX" , "TeX" ] , preferredFont : "TeX" , webFont : "TeX" , imageFont : "TeX" , undefinedFamily : "STIXGeneral,'Arial Unicode MS',serif" , showMathMenu : true , styles : { ".MathJax_Display" : { "text-align" : "center" , margin : "1em 0em" } , ".MathJax .merror" : { "background-color" : "#FFFF88" , color : "#CC0000" , border : "1px solid #CC0000" , padding : "1px 3px" , "font-family" : "serif" , "font-style" : "normal" , "font-size" : "90%" } , ".MathJax_Preview" : { color : "#888888" } , "#MathJax_Tooltip" : { "background-color" : "InfoBackground" , color : "InfoText" , border : "1px solid black" , "box-shadow" : "2px 2px 5px #AAAAAA" , "-webkit-box-shadow" : "2px 2px 5px #AAAAAA" , "-moz-box-shadow" : "2px 2px 5px #AAAAAA" , "-khtml-box-shadow" : "2px 2px 5px #AAAAAA" , filter : "progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')" , padding : "3px 4px" } } } } ) ; if ( MathJax . Hub . Browser . isMSIE && document . documentMode >= 9 ) { delete MathJax . OutputJax [ "HTML-CSS" ] . config . styles [ "#MathJax_Tooltip" ] . filter } if ( ! MathJax . Hub . config . delayJaxRegistration ) { MathJax . OutputJax [ "HTML-CSS" ] . Register ( "jax/mml" ) } MathJax . Hub . Register . StartupHook ( "End Config" , [ function ( b , c ) { var a = b . Insert ( { minBrowserVersion : { Firefox : 3 , Opera : 9.52 , MSIE : 6 , Chrome : 0.3 , Safari : 2 , Konqueror : 4 } , inlineMathDelimiters : [ "$" , "$" ] , displayMathDelimiters : [ "$$" , "$$" ] , multilineDisplay : true , minBrowserTranslate : function ( f ) { var e = b . getJaxFor ( f ) , k = [ "[Math]" ] , j ; var h = document . createElement ( "span" , { className : "MathJax_Preview" } ) ; if ( e . inputJax . id === "TeX" ) { if ( e . root . Get ( "displaystyle" ) ) { j = a . displayMathDelimiters ; k = [ j [ 0 ] + e . originalText + j [ 1 ] ] ; if ( a . multilineDisplay ) { k = k [ 0 ] . split ( /\n/ ) } } else { j = a . inlineMathDelimiters ; k = [ j [ 0 ] + e . originalText . replace ( /^\s+/ , "" ) . replace ( /\s+$/ , "" ) + j [ 1 ] ] } } for ( var g = 0 , d = k . length ; g < d ; g ++ ) { h . appendChild ( document . createTextNode ( k [ g ] ) ) ; if ( g < d - 1 ) { h . appendChild ( document . createElement ( "br" ) ) } } f . parentNode . insertBefore ( h , f ) } } , ( b . config [ "HTML-CSS" ] || { } ) ) ; if ( b . Browser . version !== "0.0" && ! b . Browser . versionAtLeast ( a . minBrowserVersion [ b . Browser ] || 0 ) ) { c . Translate = a . minBrowserTranslate ; b . Config ( { showProcessingMessages : false } ) ; MathJax . Message . Set ( "Your browser does not support MathJax" , null , 4000 ) ; b . Startup . signal . Post ( "MathJax not supported" ) } } , MathJax . Hub , MathJax . OutputJax [ "HTML-CSS" ] ] ) ; MathJax . OutputJax [ "HTML-CSS" ] . loadComplete ( "config.js" ) ;
2011-01-28 02:12:00 +01:00
2011-06-03 09:03:06 +02:00
MathJax . OutputJax . NativeMML = MathJax . OutputJax ( { id : "NativeMML" , version : "1.1.4" , directory : MathJax . OutputJax . directory + "/NativeMML" , extensionDir : MathJax . OutputJax . extensionDir + "/NativeMML" , config : { scale : 100 , showMathMenu : true , showMathMenuMSIE : true , styles : { "DIV.MathJax_MathML" : { "text-align" : "center" , margin : ".75em 0px" } } } } ) ; if ( ! MathJax . Hub . config . delayJaxRegistration ) { MathJax . OutputJax . NativeMML . Register ( "jax/mml" ) } MathJax . OutputJax . NativeMML . loadComplete ( "config.js" ) ;
2011-01-28 02:12:00 +01:00
2011-06-03 09:03:06 +02:00
( function ( c ) { var h = "1.1.1" ; var a = MathJax . Hub . CombineConfig ( "MMLorHTML" , { prefer : { MSIE : "MML" , Firefox : "MML" , Opera : "HTML" , other : "HTML" } } ) ; var e = { Firefox : 3 , Opera : 9.52 , MSIE : 6 , Chrome : 0.3 , Safari : 2 , Konqueror : 4 } ; var b = ( c . Browser . version === "0.0" || c . Browser . versionAtLeast ( e [ c . Browser ] || 0 ) ) ; var g = false ; if ( ! c . Browser . isIE9 ) { try { new ActiveXObject ( "MathPlayer.Factory.1" ) ; g = true } catch ( f ) { } } var d = ( c . Browser . isFirefox && c . Browser . versionAtLeast ( "1.5" ) ) || ( c . Browser . isMSIE && g ) || ( c . Browser . isOpera && c . Browser . versionAtLeast ( "9.52" ) ) ; c . Register . StartupHook ( "End Config" , function ( ) { var i = ( a . prefer && typeof ( a . prefer ) === "object" ? a . prefer [ MathJax . Hub . Browser ] || a . prefer . other || "HTML" : a . prefer ) ; if ( b || d ) { if ( d && ( i === "MML" || ! b ) ) { if ( MathJax . OutputJax . NativeMML ) { MathJax . OutputJax . NativeMML . Register ( "jax/mml" ) } else { c . config . jax . unshift ( "output/NativeMML" ) } c . Startup . signal . Post ( "NativeMML output selected" ) } else { if ( MathJax . OutputJax [ "HTML-CSS" ] ) { MathJax . OutputJax [ "HTML-CSS" ] . Register ( "jax/mml" ) } else { c . config . jax . unshift ( "output/HTML-CSS" ) } c . Startup . signal . Post ( "HTML-CSS output selected" ) } } else { c . PreProcess . disabled = true ; c . prepareScripts . disabled = true ; MathJax . Message . Set ( "Your browser does not support MathJax" , null , 4000 ) ; c . Startup . signal . Post ( "MathJax not supported" ) } } ) } ) ( MathJax . Hub ) ; MathJax . Ajax . loadComplete ( "[MathJax]/config/MMLorHTML.js" ) ;
2011-01-28 02:12:00 +01:00
2011-06-12 19:57:10 +02:00
MathJax . Extension . mml2jax = { version : "1.1.2" , config : { preview : "alttext" } , MMLnamespace : "http://www.w3.org/1998/Math/MathML" , PreProcess : function ( e ) { if ( ! this . configured ) { this . config = MathJax . Hub . CombineConfig ( "mml2jax" , this . config ) ; if ( this . config . Augment ) { MathJax . Hub . Insert ( this , this . config . Augment ) } this . InitBrowser ( ) ; this . configured = true } if ( typeof ( e ) === "string" ) { e = document . getElementById ( e ) } if ( ! e ) { e = document . body } this . ProcessMathArray ( e . getElementsByTagName ( "math" ) ) ; if ( e . getElementsByTagNameNS ) { this . ProcessMathArray ( e . getElementsByTagNameNS ( this . MMLnamespace , "math" ) ) } var d = document . getElementsByTagName ( "html" ) [ 0 ] ; if ( d ) { for ( var c = 0 , b = d . attributes . length ; c < b ; c ++ ) { var a = d . attributes [ c ] ; if ( a . nodeName . substr ( 0 , 6 ) === "xmlns:" && a . nodeValue === this . MMLnamespace ) { this . ProcessMathArray ( e . getElementsByTagName ( a . nodeName . substr ( 6 ) + ":math" ) ) } } } } , ProcessMathArray : function ( b ) { var a ; if ( b . length ) { if ( this . MathTagBug ) { for ( a = b . length - 1 ; a >= 0 ; a -- ) { if ( b [ a ] . nodeName === "MATH" ) { this . ProcessMathFlattened ( b [ a ] ) } else { this . ProcessMath ( b [ a ] ) } } } else { for ( a = b . length - 1 ; a >= 0 ; a -- ) { this . ProcessMath ( b [ a ] ) } } } } , ProcessMath : function ( e ) { var d = e . parentNode ; var a = document . createElement ( "script" ) ; a . type = "math/mml" ; d . insertBefore ( a , e ) ; if ( this . AttributeBug ) { var b = this . OuterHTML ( e ) ; if ( this . CleanupHTML ) { b = b . replace ( /<\?import .*?>/i , "" ) . replace ( /<\?xml:namespace .*?\/>/i , "" ) ; b = b . replace ( / /g , " " ) } MathJax . HTML . setScript ( a , b ) ; d . removeChild ( e ) } else { var c = MathJax . HTML . Element ( "span" ) ; c . appendChild ( e ) ; MathJax . HTML . setScript ( a , c . innerHTML ) } if ( this . config . preview !== "none" ) { this . createPreview ( e , a ) } } , ProcessMathFlattened : function ( f ) { var d = f . parentNode ; var b = document . createElement ( "script" ) ; b . type = "math/mml" ; d . insertBefore ( b , f ) ; var c = "" , e , a = f ; while ( f && f . nodeName !== "/MATH" ) { e = f ; f = f . nextSibling ; c += this . NodeHTML ( e ) ; e . parentNode . removeChild ( e ) } if ( f && f . nodeName === "/MATH" ) { f . parentNode . removeChild ( f ) } b . text = c + "</math>" ; if ( this . config . preview !== "none" ) { this . createPreview ( a , b ) } } , NodeHTML : function ( e ) { var c , b , a ; if ( e . nodeName === "#text" ) { c = this . quoteHTML ( e . nodeValue ) } else { if ( e . nodeName === "#comment" ) { c = "<!--" + e . nodeValue + "-->" } else { c = "<" + e . nodeName . toLowerCase ( ) ; for ( b = 0 , a = e . attributes . length ; b < a ; b ++ ) { var d = e . attributes [ b ] ; if ( d . specified ) { c += " " + d . nodeName . toLowerCase ( ) . replace ( /xmlns:xmlns/ , "xmlns" ) + "=" ; var f = d . nodeValue ; if ( f == null && d . nodeName === "style" && e . style ) { f = e . style . cssText } c += '"' + this . quoteHTML ( f ) + '"' } } c += ">" ; if ( e . outerHTML != null && e . outerHTML . match ( /(.<\/[A-Z]+>|\/>)$/ ) ) { for ( b = 0 , a = e . childNodes . length ; b < a ; b ++ ) { c += this . OuterHTML ( e . childNodes [ b ] ) } c += "</" + e . nodeName . toLowerCase ( ) + ">" } } } return c } , OuterHTML : function ( d ) { if ( d . nodeName . charAt ( 0 ) === "#" ) { return this . NodeHTML ( d ) } if ( ! this . AttributeBug ) { return d . outerHTML } var c = this . NodeHTML ( d ) ; for ( var b = 0 , a = d . childNodes . length ; b < a ; b ++ ) { c += this . OuterHTML ( d . childNodes [ b ] ) } c += "</" + d . nodeName . toLowerCase ( ) + ">" ; return c } , quoteHTML : function ( a ) { if ( a == null ) { a = "" } return a . replace ( /&/g , "&" ) . replace ( /</g , "<" ) . replace ( />/g , ">" ) . replace ( /"/g , """ ) } , createPreview : function ( b , a ) { var c ; if ( this . config . preview === "alttext" ) { var d = b . getAttribute ( "alttext" ) ; if ( d != null ) { c = [ this . filterText ( d ) ] } } else { if ( this . config . preview instanceof Array ) { c = this . config . preview } } if ( c ) { c = MathJax . HTML . Element ( "span" , { className : MathJax . Hub . config . preRemoveClass } , c ) ; a . parentNode . insertBefore ( c , a ) } } , filterText : function ( a ) { return a } , InitBrowser : function ( ) { var b = MathJax . HTML . Element ( "span" , { id : "<" , className : "mathjax" , innerHTML : "<math><mi>x</mi><mspace /></math>" } ) ; var a = b . outerHTML || "" ; this . AttributeBug = a !== "" && ! ( a . match ( /id="<"/ ) && a . match ( /class="mathjax"/ ) && a . match ( /<\/math>/ ) ) ; this . MathTagBug = b . childNodes . length > 1 ; this . CleanupHTML = MathJax . Hub . Browser . isMSIE } } ; MathJax . Hub . Register . PreProcessor ( [ "PreProcess" , MathJax . Extension . mml2jax ] ) ; MathJax . Ajax . loadComplete ( "[MathJax]/extensions/mml2jax.js" ) ;
2011-01-28 02:12:00 +01:00
2011-06-01 21:35:18 +02:00
( function ( a , c , e , b , h ) { var i = "1.1" ; var g = a . CombineConfig ( "MathZoom" , { delay : 400 , styles : { "#MathJax_Zoom" : { position : "absolute" , "background-color" : "#F0F0F0" , overflow : "auto" , display : "block" , "z-index" : 301 , padding : ".5em" , border : "1px solid black" , margin : 0 , "font-family" : "serif" , "font-size" : "85%" , "font-weight" : "normal" , "font-style" : "normal" , "text-align" : "left" , "text-indent" : 0 , "text-transform" : "none" , "line-height" : "normal" , "letter-spacing" : "normal" , "word-spacing" : "normal" , "word-wrap" : "normal" , "white-space" : "nowrap" , "float" : "none" , "box-shadow" : "5px 5px 15px #AAAAAA" , "-webkit-box-shadow" : "5px 5px 15px #AAAAAA" , "-moz-box-shadow" : "5px 5px 15px #AAAAAA" , "-khtml-box-shadow" : "5px 5px 15px #AAAAAA" , filter : "progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')" } , "#MathJax_ZoomOverlay" : { position : "absolute" , left : 0 , top : 0 , "z-index" : 300 , display : "inline-block" , width : "100%" , height : "100%" , border : 0 , padding : 0 , margin : 0 , "background-color" : "white" , opacity : 0 , filter : "alpha(opacity=0)" } } } ) ; var d = function ( j ) { if ( ! j ) { j = window . event } if ( j ) { if ( j . preventDefault ) { j . preventDefault ( ) } if ( j . stopPropagation ) { j . stopPropagation ( ) } j . cancelBubble = true ; j . returnValue = false } return false } ; var f = MathJax . Extension . MathZoom = { version : i , settings : a . config . menuSettings , HandleEvent : function ( l , j , k ) { if ( ! l ) { l = window . event } if ( f . settings . CTRL && ! l . ctrlKey ) { return true } if ( f . settings . ALT && ! l . altKey ) { return true } if ( f . settings . CMD && ! l . metaKey ) { return true } if ( f . settings . Shift && ! l . shiftKey ) { return true } return f [ j ] ( l , k ) } , Click : function ( k , j ) { if ( this . settings . zoom === "Click" ) { return this . Zoom ( j , k ) } } , DblClick : function ( k , j ) { if ( this . settings . zoom === "Double-Click" ) { return this . Zoom ( j , k ) } } , Mouseover : function ( k , j ) { if ( this . settings . zoom === "Hover" ) { f . oldMouseOver = j . onmouseover ; j . onmouseover = null ; j . onmousemove = this . Mousemove ; j . onmouseout = this . Mouseout ; return f . Timer ( k , j ) } } , Mouseout : function ( j ) { this . onmouseover = f . oldMouseOver ; delete f . oldMouseOver ; this . onmousemove = this . onmouseout = null ; f . ClearTimer ( ) ; return d ( j ) } , Mousemove : function ( j ) { return f . Timer ( j || window . event , this ) } , Timer : function ( k , j ) { this . ClearTimer ( ) ; this . timer = setTimeout ( MathJax . Callback ( [ "Zoom" , this , j , { } ] ) , g . delay ) ; return d ( k ) } , ClearTimer : function ( ) { if ( this . timer ) { clearTimeout ( this . timer ) ; delete this . timer } } , Zoom : function ( s , l ) { this . ClearTimer ( ) ; this . Remove ( ) ; var v = s . parentNode ; if ( v . className === "MathJax_MathContainer" ) { v = v . parentNode } if ( v . parentNode . className === "MathJax_MathContainer" ) { v = v . parentNode . parentNode } var q = ( String ( v . className ) . match ( /^MathJax_(MathML|Display)$/ ) ? v : s ) . nextSibling ; var m = a . getJaxFor ( q ) , r = m . root ; var o = ( b && m . outputJax . isa ( b . constructor ) ? "HTMLCSS" : ( h && m . outputJax . isa ( h . constructor ) ? "MathML" : null ) ) ; if ( ! o ) { return } var j = Math . floor ( 0.85 * document . body . clientWidth ) , p = Math . floor ( 0.85 * document . body . clientHeight ) ; var k = c . Element ( "span" , { style : { position : "relative" , display : "inline-block" , height : 0 , width : 0 } , id : "MathJax_ZoomFrame" } , [ [ "span" , { id : "MathJax_ZoomOverlay" , onmousedown : this . Remove } ] , [ "span" , { id : "MathJax_Zoom" , onclick : this . Remove , style : { visibility : "hidden" , fontSize : this . settings . zscale , "max-width" : j + "px" , "max-height" : p + "px" } } , [ [ "span" ] ] ] ] ) ; var x = k . lastChild , u = x . firstChild , n = k . firstChild ; s . parentNode . insertBefore ( k , s ) ; if ( this . msieZIndexBug ) { var t = c . Element ( "img" , { src : "about:blank" , id : "MathJax_ZoomTracker" , style : { width : 0 , height : 0 , position : "relative" } } ) ; document . body . appendChild ( k ) ; k . style . position = "absolute" ; k . style . zIndex = g . styles [ "#MathJax_ZoomOverlay" ] [ "z-index" ] ; k = t } var w = ( this [ "Zoom" + o ] ) ( r , u , s ) ; if ( this . msiePositionBug ) { if ( this . msieIE8Bug ) { u . style . position = "absolute" ; x . style . height = u . offsetHeight ; u . style . position = "" ; if ( x . offsetHeight <= p && x . offsetWidth <= j ) { x . style . overflow = "visible" } } if ( this . msieWidthBug ) { x . style . width = Math . min ( j , w . w ) } else { if ( w . w > j ) { x . style . width = j } } if ( x . offsetHeight > p ) { x . style . Height = p + "px" } if ( s . nextSibling ) { s . parentNode . insertBefore ( k , s . nextSibling ) } else { v . appendChild ( k ) } } else { if ( this . operaPositionBug ) { x . style . width = Math . min ( j , u . offsetWidth ) + "px" } } this . Position ( x , w , ( o === "MathML" && v . nodeName . toLowerCase ( ) === "div" ) ) ; x . style . visibility = "" ; if ( this . settings . zoom === "Hover" ) { n . onmouseov
2011-01-28 02:12:00 +01:00
2011-06-03 09:03:06 +02:00
( function ( b , c , f ) { var k = "1.1.4" ; MathJax . Extension . MathMenu = { version : k } ; var i = b . Browser . isPC , g = b . Browser . isMSIE ; var e = ( i ? null : "5px" ) ; var j = b . CombineConfig ( "MathMenu" , { delay : 150 , helpURL : "http://www.mathjax.org/help/user/" , showRenderer : true , showFontMenu : false , showContext : false , windowSettings : { status : "no" , toolbar : "no" , locationbar : "no" , menubar : "no" , directories : "no" , personalbar : "no" , resizable : "yes" , scrollbars : "yes" , width : 100 , height : 50 } , styles : { "#MathJax_About" : { position : "fixed" , left : "50%" , width : "auto" , "text-align" : "center" , border : "3px outset" , padding : "1em 2em" , "background-color" : "#DDDDDD" , color : "black" , cursor : "default" , "font-family" : "message-box" , "font-size" : "120%" , "font-style" : "normal" , "text-indent" : 0 , "text-transform" : "none" , "line-height" : "normal" , "letter-spacing" : "normal" , "word-spacing" : "normal" , "word-wrap" : "normal" , "white-space" : "nowrap" , "float" : "none" , "z-index" : 201 , "border-radius" : "15px" , "-webkit-border-radius" : "15px" , "-moz-border-radius" : "15px" , "-khtml-border-radius" : "15px" , "box-shadow" : "0px 10px 20px #808080" , "-webkit-box-shadow" : "0px 10px 20px #808080" , "-moz-box-shadow" : "0px 10px 20px #808080" , "-khtml-box-shadow" : "0px 10px 20px #808080" , filter : "progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')" } , ".MathJax_Menu" : { position : "absolute" , "background-color" : "white" , color : "black" , width : "auto" , padding : ( i ? "2px" : "5px 0px" ) , border : "1px solid #CCCCCC" , margin : 0 , cursor : "default" , font : "menu" , "text-align" : "left" , "text-indent" : 0 , "text-transform" : "none" , "line-height" : "normal" , "letter-spacing" : "normal" , "word-spacing" : "normal" , "word-wrap" : "normal" , "white-space" : "nowrap" , "float" : "none" , "z-index" : 201 , "border-radius" : e , "-webkit-border-radius" : e , "-moz-border-radius" : e , "-khtml-border-radius" : e , "box-shadow" : "0px 10px 20px #808080" , "-webkit-box-shadow" : "0px 10px 20px #808080" , "-moz-box-shadow" : "0px 10px 20px #808080" , "-khtml-box-shadow" : "0px 10px 20px #808080" , filter : "progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')" } , ".MathJax_MenuItem" : { padding : ( i ? "2px 2em" : "1px 2em" ) , background : "transparent" } , ".MathJax_MenuTitle" : { "background-color" : "#CCCCCC" , margin : ( i ? "-1px -1px 1px -1px" : "-5px 0 0 0" ) , "text-align" : "center" , "font-style" : "italic" , "font-size" : "80%" , color : "#444444" , padding : "2px 0" , overflow : "hidden" } , ".MathJax_MenuArrow" : { position : "absolute" , right : ".5em" , color : "#666666" , "font-family" : ( g ? "'Arial unicode MS'" : null ) } , ".MathJax_MenuActive .MathJax_MenuArrow" : { color : "white" } , ".MathJax_MenuCheck" : { position : "absolute" , left : ".7em" , "font-family" : ( g ? "'Arial unicode MS'" : null ) } , ".MathJax_MenuRadioCheck" : { position : "absolute" , left : ( i ? "1em" : ".7em" ) } , ".MathJax_MenuLabel" : { padding : ( i ? "2px 2em 4px 1.33em" : "1px 2em 3px 1.33em" ) , "font-style" : "italic" } , ".MathJax_MenuRule" : { "border-top" : ( i ? "1px solid #CCCCCC" : "1px solid #DDDDDD" ) , margin : ( i ? "4px 1px 0px" : "4px 3px" ) } , ".MathJax_MenuDisabled" : { color : "GrayText" } , ".MathJax_MenuActive" : { "background-color" : ( i ? "Highlight" : "#606872" ) , color : ( i ? "HighlightText" : "white" ) } } } ) ; var d = function ( l ) { if ( ! l ) { l = window . event } if ( l ) { if ( l . preventDefault ) { l . preventDefault ( ) } if ( l . stopPropagation ) { l . stopPropagation ( ) } l . cancelBubble = true ; l . returnValue = false } return false } ; var a = MathJax . Menu = MathJax . Object . Subclass ( { version : k , items : [ ] , posted : false , title : null , margin : 5 , Init : function ( l ) { this . items = [ ] . slice . call ( arguments , 0 ) } , With : function ( l ) { if ( l ) { b . Insert ( this , l ) } return this } , Post : function ( n , v ) { if ( ! n ) { n = window . event } var t = ( ! this . title ? null : [ [ "div" , { className : "MathJax_MenuTitle" } , [ this . title ] ] ] ) ; var l = document . getElementById ( "MathJax_MenuFrame" ) ; if ( ! l ) { l = a . Background ( this ) } var o = c . addElement ( l , "div" , { onmouseup : a . Mouseup , ondblclick : this . False , ondragstart : this . False , onselectstart : this . False , oncontextmenu : this . False , menuItem : this , className : "MathJax_Menu" } , t ) ; for ( var q = 0 , p = this . items . length ; q < p ; q ++ ) { this . items [ q ] . Create ( o ) } this . posted = true ; o . style . width = ( o . offsetWidth + 2 ) + "px" ; var u = n . pageX , s = n . pageY ; if ( ! u && ! s ) { u = n . clientX + document . body . scrollLeft + document . documentElement . scrollLeft ; s = n . clientY + document . body . scrollTop + document . documentElement . scrollTop } if ( ! v ) { if ( u + o . offsetWid
2011-01-28 02:12:00 +01:00
2011-06-12 19:57:10 +02:00
MathJax . ElementJax . mml = MathJax . ElementJax ( { mimeType : "jax/mml" } , { id : "mml" , version : "1.1.1" , directory : MathJax . ElementJax . directory + "/mml" , extensionDir : MathJax . ElementJax . extensionDir + "/mml" , optableDir : MathJax . ElementJax . directory + "/mml/optable" } ) ; MathJax . ElementJax . mml . Augment ( { Init : function ( ) { if ( arguments . length === 1 && arguments [ 0 ] . type === "math" ) { this . root = arguments [ 0 ] } else { this . root = MathJax . ElementJax . mml . math . apply ( this , arguments ) } if ( this . root . mode ) { if ( ! this . root . display && this . root . mode === "display" ) { this . root . display = "block" } delete this . root . mode } } } , { INHERIT : "_inherit_" , AUTO : "_auto_" , SIZE : { INFINITY : "infinity" , SMALL : "small" , NORMAL : "normal" , BIG : "big" } , COLOR : { TRANSPARENT : "transparent" } , VARIANT : { NORMAL : "normal" , BOLD : "bold" , ITALIC : "italic" , BOLDITALIC : "bold-italic" , DOUBLESTRUCK : "double-struck" , FRAKTUR : "fraktur" , BOLDFRAKTUR : "bold-fraktur" , SCRIPT : "script" , BOLDSCRIPT : "bold-script" , SANSSERIF : "sans-serif" , BOLDSANSSERIF : "bold-sans-serif" , SANSSERIFITALIC : "sans-serif-italic" , SANSSERIFBOLDITALIC : "sans-serif-bold-italic" , MONOSPACE : "monospace" , INITIAL : "inital" , TAILED : "tailed" , LOOPED : "looped" , STRETCHED : "stretched" , CALIGRAPHIC : "-tex-caligraphic" , OLDSTYLE : "-tex-oldstyle" } , FORM : { PREFIX : "prefix" , INFIX : "infix" , POSTFIX : "postfix" } , LINEBREAK : { AUTO : "auto" , NEWLINE : "newline" , NOBREAK : "nobreak" , GOODBREAK : "goodbreak" , BADBREAK : "badbreak" } , LINEBREAKSTYLE : { BEFORE : "before" , AFTER : "after" , DUPLICATE : "duplicate" , INFIXLINBREAKSTYLE : "infixlinebreakstyle" } , INDENTALIGN : { LEFT : "left" , CENTER : "center" , RIGHT : "right" , AUTO : "auto" , ID : "id" , INDENTALIGN : "indentalign" } , INDENTSHIFT : { INDENTSHIFT : "indentshift" } , LINETHICKNESS : { THIN : "thin" , MEDIUM : "medium" , THICK : "thick" } , NOTATION : { LONGDIV : "longdiv" , ACTUARIAL : "actuarial" , RADICAL : "radical" , BOX : "box" , ROUNDEDBOX : "roundedbox" , CIRCLE : "circle" , LEFT : "left" , RIGHT : "right" , TOP : "top" , BOTTOM : "bottom" , UPDIAGONALSTRIKE : "updiagonalstrike" , DOWNDIAGONALSTRIKE : "downdiagonalstrike" , VERTICALSTRIKE : "verticalstrike" , HORIZONTALSTRIKE : "horizontalstrike" , MADRUWB : "madruwb" } , ALIGN : { TOP : "top" , BOTTOM : "bottom" , CENTER : "center" , BASELINE : "baseline" , AXIS : "axis" , LEFT : "left" , RIGHT : "right" } , LINES : { NONE : "none" , SOLID : "solid" , DASHED : "dashed" } , SIDE : { LEFT : "left" , RIGHT : "right" , LEFTOVERLAP : "leftoverlap" , RIGHTOVERLAP : "rightoverlap" } , WIDTH : { AUTO : "auto" , FIT : "fit" } , ACTIONTYPE : { TOGGLE : "toggle" , STATUSLINE : "statusline" , TOOLTIP : "tooltip" , INPUT : "input" } , LENGTH : { VERYVERYTHINMATHSPACE : "veryverythinmathspace" , VERYTHINMATHSPACE : "verythinmathspace" , THINMATHSPACE : "thinmathspace" , MEDIUMMATHSPACE : "mediummathspace" , THICKMATHSPACE : "thickmathspace" , VERYTHICKMATHSPACE : "verythickmathspace" , VERYVERYTHICKMATHSPACE : "veryverythickmathspace" , NEGATIVEVERYVERYTHINMATHSPACE : "negativeveryverythinmathspace" , NEGATIVEVERYTHINMATHSPACE : "negativeverythinmathspace" , NEGATIVETHINMATHSPACE : "negativethinmathspace" , NEGATIVEMEDIUMMATHSPACE : "negativemediummathspace" , NEGATIVETHICKMATHSPACE : "negativethickmathspace" , NEGATIVEVERYTHICKMATHSPACE : "negativeverythickmathspace" , NEGATIVEVERYVERYTHICKMATHSPACE : "negativeveryverythickmathspace" } , OVERFLOW : { LINBREAK : "linebreak" , SCROLL : "scroll" , ELIDE : "elide" , TRUNCATE : "truncate" , SCALE : "scale" } , UNIT : { EM : "em" , EX : "ex" , PX : "px" , IN : "in" , CM : "cm" , MM : "mm" , PT : "pt" , PC : "pc" } , TEXCLASS : { ORD : 0 , OP : 1 , BIN : 2 , REL : 3 , OPEN : 4 , CLOSE : 5 , PUNCT : 6 , INNER : 7 , VCENTER : 8 , NONE : - 1 } , PLANE1 : String . fromCharCode ( 55349 ) } ) ; ( function ( a ) { var d = false ; var b = true ; a . mbase = MathJax . Object . Subclass ( { type : "base" , isToken : d , defaults : { mathbackground : a . INHERIT , mathcolor : a . INHERIT } , noInherit : { } , Init : function ( ) { this . data = [ ] ; if ( this . inferRow && ! ( arguments . length === 1 && arguments [ 0 ] . inferred ) ) { this . Append ( a . mrow ( ) . With ( { inferred : b } ) ) } this . Append . apply ( this , arguments ) } , With : function ( f ) { for ( var g in f ) { if ( f . hasOwnProperty ( g ) ) { this [ g ] = f [ g ] } } return this } , Append : function ( ) { if ( this . inferRow && this . data . length ) { this . data [ 0 ] . Append . apply ( this . data [ 0 ] , arguments ) } else { for ( var g = 0 , f = arguments . length ; g < f ; g ++ ) { this . SetData ( this . data . length , arguments [ g ] ) } } } , SetData : function ( f , g ) { if ( g != null ) { if ( ! ( g instanceof a . mbase ) ) { g = ( this . isToken ? a . chars ( g ) : a . mtext ( g ) ) } g . parent = this ; g . setInherit ( this . inheritFromMe ? this : this . inherit ) } this . data [ f ] = g } , Parent : function ( ) { var f = this . p
2011-06-01 21:35:18 +02:00
2011-06-03 09:03:06 +02:00
MathJax . Hub . Register . LoadHook ( "[MathJax]/jax/element/mml/jax.js" , function ( ) { var b = "1.1.1" ; var a = MathJax . ElementJax . mml ; a . mbase . Augment ( { toMathML : function ( k ) { var g = ( this . inferred && this . parent . inferRow ) ; if ( k == null ) { k = "" } var e = this . type , d = this . MathMLattributes ( ) ; if ( e === "mspace" ) { return k + "<" + e + d + " />" } var j = [ ] ; var h = ( this . isToken ? "" : k + ( g ? "" : " " ) ) ; for ( var f = 0 , c = this . data . length ; f < c ; f ++ ) { if ( this . data [ f ] ) { j . push ( this . data [ f ] . toMathML ( h ) ) } else { if ( ! this . isToken ) { j . push ( h + "<mrow />" ) } } } if ( this . isToken ) { return k + "<" + e + d + ">" + j . join ( "" ) + "</" + e + ">" } if ( g ) { return j . join ( "\n" ) } if ( j . length === 0 || ( j . length === 1 && j [ 0 ] === "" ) ) { return k + "<" + e + d + " />" } return k + "<" + e + d + ">\n" + j . join ( "\n" ) + "\n" + k + "</" + e + ">" } , MathMLattributes : function ( ) { var j = [ ] , g = this . defaults ; var c = this . copyAttributes , l = this . skipAttributes ; if ( this . type === "math" ) { j . push ( 'xmlns="http://www.w3.org/1998/Math/MathML"' ) } if ( this . type === "mstyle" ) { g = a . math . prototype . defaults } for ( var d in g ) { if ( ! l [ d ] && g . hasOwnProperty ( d ) ) { var e = ( d === "open" || d === "close" ) ; if ( this [ d ] != null && ( e || this [ d ] !== g [ d ] ) ) { var k = this [ d ] ; delete this [ d ] ; if ( e || this . Get ( d ) !== k ) { j . push ( d + '="' + this . quoteHTML ( k ) + '"' ) } this [ d ] = k } } } for ( var h = 0 , f = c . length ; h < f ; h ++ ) { if ( this [ c [ h ] ] != null ) { j . push ( c [ h ] + '="' + this . quoteHTML ( this [ c [ h ] ] ) + '"' ) } } if ( j . length ) { return " " + j . join ( " " ) } else { return "" } } , copyAttributes : [ "fontfamily" , "fontsize" , "fontweight" , "fontstyle" , "color" , "background" , "id" , "class" , "href" , "style" ] , skipAttributes : { texClass : 1 , useHeight : 1 , texprimestyle : 1 } , quoteHTML : function ( e ) { e = String ( e ) . split ( "" ) ; for ( var f = 0 , d = e . length ; f < d ; f ++ ) { var h = e [ f ] . charCodeAt ( 0 ) ; if ( h < 32 || h > 126 ) { e [ f ] = "&#x" + h . toString ( 16 ) . toUpperCase ( ) + ";" } else { var g = { "&" : "&" , "<" : "<" , ">" : ">" , '"' : """ } [ e [ f ] ] ; if ( g ) { e [ f ] = g } } } return e . join ( "" ) } } ) ; a . msubsup . Augment ( { toMathML : function ( h ) { var e = this . type ; if ( this . data [ this . sup ] == null ) { e = "msub" } if ( this . data [ this . sub ] == null ) { e = "msup" } var d = this . MathMLattributes ( ) ; delete this . data [ 0 ] . inferred ; var g = [ ] ; for ( var f = 0 , c = this . data . length ; f < c ; f ++ ) { if ( this . data [ f ] ) { g . push ( this . data [ f ] . toMathML ( h + " " ) ) } } return h + "<" + e + d + ">\n" + g . join ( "\n" ) + "\n" + h + "</" + e + ">" } } ) ; a . munderover . Augment ( { toMathML : function ( h ) { var e = this . type ; if ( this . data [ this . under ] == null ) { e = "mover" } if ( this . data [ this . over ] == null ) { e = "munder" } var d = this . MathMLattributes ( ) ; delete this . data [ 0 ] . inferred ; var g = [ ] ; for ( var f = 0 , c = this . data . length ; f < c ; f ++ ) { if ( this . data [ f ] ) { g . push ( this . data [ f ] . toMathML ( h + " " ) ) } } return h + "<" + e + d + ">\n" + g . join ( "\n" ) + "\n" + h + "</" + e + ">" } } ) ; a . TeXAtom . Augment ( { toMathML : function ( c ) { return c + "<mrow>\n" + this . data [ 0 ] . toMathML ( c + " " ) + "\n" + c + "</mrow>" } } ) ; a . chars . Augment ( { toMathML : function ( c ) { return ( c || "" ) + this . quoteHTML ( this . toString ( ) ) } } ) ; a . entity . Augment ( { toMathML : function ( c ) { return ( c || "" ) + "&" + this . data [ 0 ] + ";<!-- " + this . toString ( ) + " -->" } } ) ; a . xml . Augment ( { toMathML : function ( c ) { return ( c || "" ) + this . toString ( ) } } ) ; MathJax . Hub . Register . StartupHook ( "TeX mathchoice Ready" , function ( ) { a . TeXmathchoice . Augment ( { toMathML : function ( c ) { return this . Core ( ) . toMathML ( c ) } } ) } ) ; MathJax . Hub . Startup . signal . Post ( "toMathML Ready" ) } ) ; MathJax . Ajax . loadComplete ( "[MathJax]/extensions/toMathML.js" ) ;
2011-06-01 21:35:18 +02:00
2011-06-03 09:03:06 +02:00
( function ( b , c ) { var a ; b . Parse = MathJax . Object . Subclass ( { Init : function ( d ) { this . Parse ( d ) } , Parse : function ( f ) { var g ; if ( typeof f !== "string" ) { g = f . parentNode } else { if ( f . match ( /^<[a-z]+:/i ) && ! f . match ( /^<[^<>]* xmlns:/ ) ) { f = f . replace ( /^<([a-z]+)(:math)/i , '<$1$2 xmlns:$1="http://www.w3.org/1998/Math/MathML"' ) } f = f . replace ( /^\s*(?:\/\/)?<!(--)?\[CDATA\[((.|\n)*)(\/\/)?\]\]\1>\s*$/ , "$2" ) ; f = f . replace ( /&([a-z][a-z0-9]*);/ig , this . replaceEntity ) ; g = b . ParseXML ( f ) ; if ( g == null ) { b . Error ( "Error parsing MathML" ) } } var e = g . getElementsByTagName ( "parsererror" ) [ 0 ] ; if ( e ) { b . Error ( "Error parsing MathML: " + e . textContent . replace ( /This page.*?errors:|XML Parsing Error: |Below is a rendering of the page.*/g , "" ) ) } if ( g . childNodes . length !== 1 ) { b . Error ( "MathML must be formed by a single element" ) } if ( g . firstChild . nodeName . toLowerCase ( ) === "html" ) { var d = g . getElementsByTagName ( "h1" ) [ 0 ] ; if ( d && d . textContent === "XML parsing error" && d . nextSibling ) { b . Error ( "Error parsing MathML: " + String ( d . nextSibling . nodeValue ) . replace ( /fatal parsing error: / , "" ) ) } } if ( g . firstChild . nodeName . toLowerCase ( ) . replace ( /^[a-z]+:/ , "" ) !== "math" ) { b . Error ( "MathML must be formed by a <math> element, not <" + g . firstChild . nodeName + ">" ) } this . mml = this . MakeMML ( g . firstChild ) } , MakeMML : function ( h ) { var l = h . nodeName . toLowerCase ( ) . replace ( /^[a-z]+:/ , "" ) ; if ( ! ( a [ l ] && a [ l ] . isa && a [ l ] . isa ( a . mbase ) ) ) { return a . merror ( "Unknown node type: " + l ) } var d = a [ l ] ( ) , k , j , e , n ; for ( k = 0 , j = h . attributes . length ; k < j ; k ++ ) { e = h . attributes [ k ] . name ; if ( e == "xlink:href" ) { e = "href" } if ( e . match ( /:/ ) ) { continue } n = h . attributes [ k ] . value ; if ( n . toLowerCase ( ) === "true" ) { n = true } else { if ( n . toLowerCase ( ) === "false" ) { n = false } } d [ e ] = n } for ( k = 0 , j = h . childNodes . length ; k < j ; k ++ ) { var f = h . childNodes [ k ] ; if ( f . nodeName === "#comment" ) { continue } if ( f . nodeName === "#text" ) { if ( d . isToken && ! d . mmlSelfClosing ) { var o = this . trimSpace ( f . nodeValue ) ; if ( d . isa ( a . mo ) && o . length === 1 && this . Remap [ o . charAt ( 0 ) ] ) { o = this . Remap [ o . charAt ( 0 ) ] } o = o . replace ( /&([a-z][a-z0-9]*);/ig , this . replaceEntity ) ; d . Append ( a . chars ( o ) ) } else { if ( f . nodeValue . match ( /\S/ ) ) { b . Error ( "Unexpected text node: '" + f . nodeValue + "'" ) } } } else { if ( d . type === "annotation-xml" ) { d . Append ( a . xml ( f ) ) } else { var g = this . MakeMML ( f ) ; d . Append ( g ) ; if ( g . mmlSelfClosing && g . data . length ) { d . Append . apply ( d , g . data ) ; g . data = [ ] } } } } if ( b . config . useMathMLspacing ) { d . useMMLspacing = 8 } return d } , trimSpace : function ( d ) { return d . replace ( /^[ \t\n\r]+/ , "" ) . replace ( /[ \t\n\r]+$/ , "" ) . replace ( /[ \t\n\r][ \t\n\r]+/g , " " ) } , replaceEntity : function ( f , e ) { if ( e . match ( /^(lt|amp|quot)$/ ) ) { return f } if ( b . Parse . Entity [ e ] ) { return b . Parse . Entity [ e ] } var g = e . charAt ( 0 ) . toLowerCase ( ) ; var d = e . match ( /^[a-zA-Z](fr|scr|opf)$/ ) ; if ( d ) { g = d [ 1 ] } if ( ! b . Parse . loaded [ g ] ) { b . Parse . loaded [ g ] = true ; MathJax . Hub . RestartAfter ( MathJax . Ajax . Require ( b . entityDir + "/" + g + ".js" ) ) } return f } , Remap : { "\u0027" : "\u2032" , "\u002A" : "\u2217" , "\u002D" : "\u2212" } } , { loaded : [ ] } ) ; b . Augment ( { Translate : function ( d ) { if ( ! this . ParseXML ) { this . ParseXML = this . createParser ( ) } var e , g ; if ( d . firstChild && d . firstChild . nodeName . toLowerCase ( ) . replace ( /^[a-z]+:/ , "" ) === "math" ) { g = this . prefilterMathML ( d . firstChild ) } else { g = d . innerHTML . replace ( /^\s+/ , "" ) . replace ( /\s+$/ , "" ) ; if ( c . isMSIE ) { g = g . replace ( /( )+$/ , "" ) } else { if ( c . isKonqueror ) { g = g . replace ( /</g , "<" ) . replace ( />/g , ">" ) . replace ( /&/g , "&" ) } } g = this . prefilterMath ( g , d ) } try { e = b . Parse ( g ) . mml } catch ( f ) { if ( ! f . mathmlError ) { throw f } e = this . formatError ( f , g , d ) } return a ( e ) } , prefilterMath : function ( e , d ) { return e } , prefilterMathML : function ( d ) { return d } , formatError : function ( f , e , d ) { return a . merror ( f . message . replace ( /\n.*/ , "" ) ) } , Error : function ( d ) { throw MathJax . Hub . Insert ( Error ( d ) , { mathmlError : true } ) } , parseDOM : function ( d ) { return this . parser . parseFromString ( d , "text/xml" ) } , parseMS : function ( d ) { return ( this . parser . loadXML ( d ) ? this . parser : null ) } , parseDIV : function ( d ) { this . div . innerHTML = d . replace ( /<([a-z]+)([^>]*)\/>/g , "<$1$2></$1>" ) ; return this . div } , parseError : function ( d ) { return null } , createParser : function ( ) { if ( window . DOMParser ) { this . parser = new DOMParser ( ) ; return ( this . parseDOM ) } else { if ( window . ActiveXObject ) { var e = [ "MSXML2.DOMDocument.6.0" , "MSXML2.DOMDocument.5.0" , "MSXML2.DOMDocument.4.0" , "MSXML2.DOMDocument.3.0" , "MSXML2.DOMDocument.2.0" , " Microsoft .
2011-01-28 02:12:00 +01:00
MathJax . Ajax . loadComplete ( "[MathJax]/config/MML_HTMLorMML.js" ) ;