gollum 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of gollum might be problematic. Click here for more details.
- data/HISTORY.md +3 -0
- data/LICENSE +21 -0
- data/README.md +435 -0
- data/Rakefile +146 -0
- data/bin/gollum +41 -0
- data/docs/sanitization.md +32 -0
- data/gollum.gemspec +506 -0
- data/lib/gollum.rb +58 -0
- data/lib/gollum/albino.rb +17 -0
- data/lib/gollum/file.rb +60 -0
- data/lib/gollum/frontend/app.rb +154 -0
- data/lib/gollum/frontend/public/css/editbar.css +194 -0
- data/lib/gollum/frontend/public/css/gollum.css +55 -0
- data/lib/gollum/frontend/public/css/screen.css +726 -0
- data/lib/gollum/frontend/public/css/syntax.css +61 -0
- data/lib/gollum/frontend/public/images/buttons.png +0 -0
- data/lib/gollum/frontend/public/images/editbar-buttons.png +0 -0
- data/lib/gollum/frontend/public/images/example.png +0 -0
- data/lib/gollum/frontend/public/images/twiddle-down.png +0 -0
- data/lib/gollum/frontend/public/images/twiddle-right.png +0 -0
- data/lib/gollum/frontend/public/images/txt.png +0 -0
- data/lib/gollum/frontend/public/javascript/MathJax/COPYING.txt +202 -0
- data/lib/gollum/frontend/public/javascript/MathJax/MathJax.js +1704 -0
- data/lib/gollum/frontend/public/javascript/MathJax/README.txt +480 -0
- data/lib/gollum/frontend/public/javascript/MathJax/config/MMLorHTML.js +63 -0
- data/lib/gollum/frontend/public/javascript/MathJax/config/MathJax.js +351 -0
- data/lib/gollum/frontend/public/javascript/MathJax/config/local/local.js +37 -0
- data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/AMSmath.js +376 -0
- data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/AMSsymbols.js +385 -0
- data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/autobold.js +43 -0
- data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/boldsymbol.js +109 -0
- data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/mathchoice.js +65 -0
- data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/newcommand.js +185 -0
- data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/noErrors.js +169 -0
- data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/unicode.js +131 -0
- data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/verb.js +53 -0
- data/lib/gollum/frontend/public/javascript/MathJax/extensions/jsMath2jax.js +77 -0
- data/lib/gollum/frontend/public/javascript/MathJax/extensions/mml2jax.js +101 -0
- data/lib/gollum/frontend/public/javascript/MathJax/extensions/tex2jax.js +242 -0
- data/lib/gollum/frontend/public/javascript/MathJax/extensions/toMathML.js +140 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/jax.js +1474 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/Arrows.js +122 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/BasicLatin.js +58 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/CombDiacritMarks.js +35 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/CombDiactForSymbols.js +35 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/Dingbats.js +35 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/GeneralPunctuation.js +40 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/GeometricShapes.js +66 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/GreekAndCoptic.js +35 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/Latin1Supplement.js +37 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/LetterlikeSymbols.js +39 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/MathOperators.js +228 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/MiscMathSymbolsA.js +38 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/MiscMathSymbolsB.js +167 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/MiscTechnical.js +38 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/SpacingModLetters.js +36 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/SuppMathOperators.js +289 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/SupplementalArrowsB.js +162 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/config.js +39 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/a.js +87 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/b.js +114 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/c.js +111 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/d.js +112 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/e.js +88 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/f.js +58 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/fr.js +79 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/g.js +82 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/h.js +52 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/i.js +85 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/j.js +36 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/k.js +36 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/l.js +175 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/m.js +61 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/n.js +219 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/o.js +88 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/opf.js +79 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/p.js +84 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/q.js +34 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/r.js +134 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/s.js +168 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/scr.js +79 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/t.js +82 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/u.js +91 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/v.js +73 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/w.js +35 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/x.js +47 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/y.js +41 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/z.js +39 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/jax.js +590 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/TeX/config.js +40 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/input/TeX/jax.js +1652 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/autoload/menclose.js +61 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/autoload/mglyph.js +98 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/autoload/ms.js +49 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/blank.gif +0 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/config.js +127 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/AlphaPresentForms.js +32 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/Arrows.js +109 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/BoldFraktur.js +79 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/BoxDrawing.js +67 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/CombDiacritMarks.js +98 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/CombDiactForSymbols.js +49 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/ControlPictures.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/CurrencySymbols.js +31 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/Cyrillic.js +129 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/EnclosedAlphanum.js +89 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/GeneralPunctuation.js +67 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/GeometricShapes.js +33 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/GreekAndCoptic.js +109 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/GreekBold.js +85 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/GreekSSBold.js +85 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/IPAExtensions.js +116 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/Latin1Supplement.js +123 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/LatinExtendedA.js +155 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/LatinExtendedAdditional.js +35 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/LatinExtendedB.js +59 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/LetterlikeSymbols.js +69 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/Main.js +172 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/MathBold.js +89 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/MathOperators.js +260 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/MathSSBold.js +89 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/MiscMathSymbolsA.js +31 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/MiscMathSymbolsB.js +37 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/MiscSymbols.js +30 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/MiscTechnical.js +42 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/NumberForms.js +39 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/PhoneticExtensions.js +30 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/SpacingModLetters.js +87 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/SuperAndSubscripts.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/SuppMathOperators.js +84 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/AlphaPresentForms.js +32 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/BasicLatin.js +122 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/BoxDrawing.js +67 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/CombDiactForSymbols.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/ControlPictures.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/CurrencySymbols.js +31 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/Cyrillic.js +129 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/EnclosedAlphanum.js +89 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/GeneralPunctuation.js +50 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/GreekAndCoptic.js +119 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/GreekBoldItalic.js +85 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/GreekSSBoldItalic.js +85 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/IPAExtensions.js +116 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/Latin1Supplement.js +123 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/LatinExtendedA.js +155 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/LatinExtendedAdditional.js +35 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/LatinExtendedB.js +59 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/LetterlikeSymbols.js +56 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/Main.js +56 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/MathBoldItalic.js +79 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/MathBoldScript.js +79 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/MathOperators.js +29 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/MathSSItalicBold.js +79 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/SpacingModLetters.js +54 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/AlphaPresentForms.js +32 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/BoxDrawing.js +67 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/CombDiactForSymbols.js +47 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/ControlPictures.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/CurrencySymbols.js +31 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/Cyrillic.js +129 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/EnclosedAlphanum.js +89 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/GeneralPunctuation.js +50 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/GreekAndCoptic.js +78 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/GreekItalic.js +85 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/IPAExtensions.js +116 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/Latin1Supplement.js +123 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/LatinExtendedA.js +154 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/LatinExtendedAdditional.js +35 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/LatinExtendedB.js +58 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/LetterlikeSymbols.js +56 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/Main.js +192 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/MathItalic.js +78 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/MathOperators.js +29 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/MathSSItalic.js +79 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/MathScript.js +68 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/SpacingModLetters.js +54 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/ij.js +29 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/AlphaPresentForms.js +32 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Arrows.js +106 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/BBBold.js +82 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/BlockElements.js +35 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/BoldFraktur.js +79 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/BoxDrawing.js +72 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/CJK.js +29 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/CombDiacritMarks.js +86 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/CombDiactForSymbols.js +50 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/ControlPictures.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/CurrencySymbols.js +31 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Cyrillic.js +129 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Dingbats.js +57 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/EnclosedAlphanum.js +89 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Fraktur.js +74 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GeneralPunctuation.js +68 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GeometricShapes.js +118 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GreekAndCoptic.js +109 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GreekBold.js +85 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GreekBoldItalic.js +85 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GreekItalic.js +85 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GreekSSBold.js +85 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GreekSSBoldItalic.js +85 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Hiragana.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/IPAExtensions.js +118 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Latin1Supplement.js +115 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/LatinExtendedA.js +154 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/LatinExtendedAdditional.js +35 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/LatinExtendedB.js +63 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/LatinExtendedD.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/LetterlikeSymbols.js +82 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Main.js +380 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathBold.js +89 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathBoldItalic.js +79 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathBoldScript.js +79 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathItalic.js +78 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathOperators.js +207 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathSS.js +89 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathSSBold.js +90 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathSSItalic.js +79 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathSSItalicBold.js +79 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathScript.js +68 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathTT.js +88 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MiscMathSymbolsA.js +66 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MiscMathSymbolsB.js +154 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MiscSymbols.js +74 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MiscSymbolsAndArrows.js +91 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MiscTechnical.js +80 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/NumberForms.js +39 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/PhoneticExtensions.js +36 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/SpacingModLetters.js +79 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Specials.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/SuperAndSubscripts.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/SuppMathOperators.js +271 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/SupplementalArrowsA.js +35 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/SupplementalArrowsB.js +155 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/ij.js +29 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsD/Bold/All.js +55 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsD/Regular/All.js +54 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsD/Regular/Main.js +36 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsSm/Bold/All.js +55 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsSm/Regular/All.js +54 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsSm/Regular/Main.js +36 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUp/Bold/All.js +55 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUp/Regular/All.js +54 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUp/Regular/Main.js +36 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUpD/Bold/All.js +55 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUpD/Regular/All.js +54 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUpD/Regular/Main.js +36 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUpSm/Bold/All.js +55 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUpSm/Regular/All.js +54 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUpSm/Regular/Main.js +36 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Bold/All.js +29 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Bold/Main.js +35 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Bold/PrivateUse.js +182 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/BoldItalic/All.js +29 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/BoldItalic/Main.js +36 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/BoldItalic/PrivateUse.js +215 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Italic/All.js +29 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Italic/Main.js +60 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Italic/PrivateUse.js +242 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Regular/All.js +29 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Regular/Main.js +57 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Regular/PrivateUse.js +387 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeFiveSym/Regular/All.js +51 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeFiveSym/Regular/Main.js +43 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeFourSym/Bold/Main.js +46 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeFourSym/Regular/All.js +63 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeFourSym/Regular/Main.js +62 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeOneSym/Bold/All.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeOneSym/Bold/Main.js +52 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeOneSym/Regular/All.js +77 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeOneSym/Regular/Main.js +105 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeThreeSym/Bold/Main.js +46 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeThreeSym/Regular/All.js +63 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeThreeSym/Regular/Main.js +62 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeTwoSym/Bold/Main.js +46 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeTwoSym/Regular/All.js +64 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeTwoSym/Regular/Main.js +63 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/Variants/Bold/All.js +60 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/Variants/Bold/Main.js +44 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/Variants/Regular/All.js +120 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/Variants/Regular/Main.js +49 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/fontdata-beta.js +373 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/fontdata.js +1403 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/Arrows.js +65 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/BBBold.js +55 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/BoxDrawing.js +33 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/CombDiacritMarks.js +29 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/Dingbats.js +29 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/EnclosedAlphanum.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/GeneralPunctuation.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/GeometricShapes.js +36 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/GreekAndCoptic.js +29 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/Latin1Supplement.js +31 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/LatinExtendedA.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/LetterlikeSymbols.js +34 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/Main.js +51 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/MathOperators.js +138 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/MiscMathSymbolsB.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/MiscSymbols.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/MiscTechnical.js +29 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/PUA.js +43 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/SpacingModLetters.js +29 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/SuppMathOperators.js +50 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Caligraphic/Bold/Main.js +96 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Caligraphic/Regular/Main.js +95 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Fraktur/Bold/BasicLatin.js +109 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Fraktur/Bold/Main.js +36 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Fraktur/Bold/Other.js +30 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Fraktur/Bold/PUA.js +34 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Fraktur/Regular/BasicLatin.js +109 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Fraktur/Regular/Main.js +35 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Fraktur/Regular/Other.js +30 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Fraktur/Regular/PUA.js +35 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Greek/Bold/Main.js +43 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Greek/BoldItalic/Main.js +110 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Greek/Italic/Main.js +109 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Greek/Regular/Main.js +42 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/Arrows.js +51 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/CombDiacritMarks.js +39 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/CombDiactForSymbols.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/GeneralPunctuation.js +44 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/GeometricShapes.js +32 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/GreekAndCoptic.js +38 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/Latin1Supplement.js +36 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/LatinExtendedA.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/LatinExtendedB.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/LetterlikeSymbols.js +33 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/Main.js +161 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/MathOperators.js +94 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/MiscMathSymbolsA.js +29 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/MiscSymbols.js +34 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/MiscTechnical.js +33 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/SpacingModLetters.js +36 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/SuppMathOperators.js +30 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/SupplementalArrowsA.js +34 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Italic/CombDiacritMarks.js +38 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Italic/GeneralPunctuation.js +33 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Italic/GreekAndCoptic.js +38 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Italic/Latin1Supplement.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Italic/LatinExtendedA.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Italic/LatinExtendedB.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Italic/LetterlikeSymbols.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Italic/Main.js +137 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/Arrows.js +51 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/CombDiacritMarks.js +39 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/CombDiactForSymbols.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/GeneralPunctuation.js +38 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/GeometricShapes.js +32 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/GreekAndCoptic.js +38 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/Latin1Supplement.js +32 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/LatinExtendedA.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/LatinExtendedB.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/LetterlikeSymbols.js +33 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/Main.js +304 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/MathOperators.js +94 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/MiscMathSymbolsA.js +31 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/MiscSymbols.js +34 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/MiscTechnical.js +35 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/SpacingModLetters.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/SuppMathOperators.js +30 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/SupplementalArrowsA.js +34 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Math/BoldItalic/Main.js +205 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Math/Italic/Main.js +204 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Bold/BasicLatin.js +115 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Bold/CombDiacritMarks.js +38 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Bold/Main.js +36 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Bold/Other.js +47 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Italic/BasicLatin.js +115 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Italic/CombDiacritMarks.js +38 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Italic/Main.js +36 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Italic/Other.js +47 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Regular/BasicLatin.js +115 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Regular/CombDiacritMarks.js +38 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Regular/Main.js +35 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Regular/Other.js +47 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Script/Regular/BasicLatin.js +54 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Script/Regular/Main.js +62 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Script/Regular/Other.js +28 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Size1/Regular/Main.js +74 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Size2/Regular/Main.js +66 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Size3/Regular/Main.js +50 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Size4/Regular/Main.js +77 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Typewriter/Regular/BasicLatin.js +123 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Typewriter/Regular/CombDiacritMarks.js +36 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Typewriter/Regular/Main.js +35 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Typewriter/Regular/Other.js +44 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/WinChrome/Regular/Main.js +43 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/WinIE6/Regular/AMS.js +56 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/WinIE6/Regular/Bold.js +82 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/WinIE6/Regular/Main.js +111 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/fontdata.js +1691 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/imageFonts.js +185 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/jax.js +1991 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/NativeMML/config.js +51 -0
- data/lib/gollum/frontend/public/javascript/MathJax/jax/output/NativeMML/jax.js +230 -0
- data/lib/gollum/frontend/public/javascript/MathJax/test/index-images.html +119 -0
- data/lib/gollum/frontend/public/javascript/MathJax/test/index.html +127 -0
- data/lib/gollum/frontend/public/javascript/MathJax/test/sample.html +99 -0
- data/lib/gollum/frontend/public/javascript/gollum.js +244 -0
- data/lib/gollum/frontend/public/javascript/jquery-1.4.2.min.js +154 -0
- data/lib/gollum/frontend/public/javascript/jquery.previewable_comment_form.js +57 -0
- data/lib/gollum/frontend/public/javascript/jquery.tabs.js +59 -0
- data/lib/gollum/frontend/public/javascript/jquery.text_selection-1.0.0.min.js +1 -0
- data/lib/gollum/frontend/templates/compare.mustache +33 -0
- data/lib/gollum/frontend/templates/create.mustache +39 -0
- data/lib/gollum/frontend/templates/edit.mustache +38 -0
- data/lib/gollum/frontend/templates/editbar.mustache +1196 -0
- data/lib/gollum/frontend/templates/history.mustache +37 -0
- data/lib/gollum/frontend/templates/layout.mustache +33 -0
- data/lib/gollum/frontend/templates/page.mustache +27 -0
- data/lib/gollum/frontend/views/compare.rb +90 -0
- data/lib/gollum/frontend/views/create.rb +21 -0
- data/lib/gollum/frontend/views/edit.rb +13 -0
- data/lib/gollum/frontend/views/editable.rb +13 -0
- data/lib/gollum/frontend/views/history.rb +44 -0
- data/lib/gollum/frontend/views/layout.rb +14 -0
- data/lib/gollum/frontend/views/page.rb +38 -0
- data/lib/gollum/markup.rb +331 -0
- data/lib/gollum/page.rb +354 -0
- data/lib/gollum/pagination.rb +61 -0
- data/lib/gollum/wiki.rb +335 -0
- data/templates/formatting.html +92 -0
- data/test/examples/lotr.git/HEAD +1 -0
- data/test/examples/lotr.git/config +5 -0
- data/test/examples/lotr.git/description +1 -0
- data/test/examples/lotr.git/hooks/applypatch-msg.sample +15 -0
- data/test/examples/lotr.git/hooks/commit-msg.sample +24 -0
- data/test/examples/lotr.git/hooks/post-commit.sample +8 -0
- data/test/examples/lotr.git/hooks/post-receive.sample +15 -0
- data/test/examples/lotr.git/hooks/post-update.sample +8 -0
- data/test/examples/lotr.git/hooks/pre-applypatch.sample +14 -0
- data/test/examples/lotr.git/hooks/pre-commit.sample +46 -0
- data/test/examples/lotr.git/hooks/pre-rebase.sample +169 -0
- data/test/examples/lotr.git/hooks/prepare-commit-msg.sample +36 -0
- data/test/examples/lotr.git/hooks/update.sample +128 -0
- data/test/examples/lotr.git/info/exclude +6 -0
- data/test/examples/lotr.git/info/refs +1 -0
- data/test/examples/lotr.git/objects/06/131480411710c92a82fe2d1e76932c70feb2e5 +0 -0
- data/test/examples/lotr.git/objects/0a/de1e2916346d4c1f2fb63b863fd3c16808fe44 +0 -0
- data/test/examples/lotr.git/objects/0e/d8cbe0a25235bd867e65193c7d837c66b328ef +3 -0
- data/test/examples/lotr.git/objects/24/49c2681badfd3c189e8ed658dacffe8ba48fe5 +0 -0
- data/test/examples/lotr.git/objects/2c/b9156ad383914561a8502fc70f5a1d887e48ad +4 -0
- data/test/examples/lotr.git/objects/5d/cac289a8603188d2c5caf481dcba2985126aaa +0 -0
- data/test/examples/lotr.git/objects/60/f12f4254f58801b9ee7db7bca5fa8aeefaa56b +0 -0
- data/test/examples/lotr.git/objects/71/4323c104239440a5c66ab12a67ed07a83c404f +0 -0
- data/test/examples/lotr.git/objects/93/6b83ee0dd8837adb82511e40d5e4ebe59bb675 +0 -0
- data/test/examples/lotr.git/objects/94/523d7ae48aeba575099dd12926420d8fd0425d +2 -0
- data/test/examples/lotr.git/objects/96/97dc65e095658bbd1b8e8678e08881e86d32f1 +0 -0
- data/test/examples/lotr.git/objects/aa/b61fe89d56f8614c0a8151da34f939dcedfa68 +0 -0
- data/test/examples/lotr.git/objects/c3/b43e9f08966b088e7a0192e436b7a884542e05 +0 -0
- data/test/examples/lotr.git/objects/dc/596d6b2dd89ab05c66f4abd7d5eb706bc17f19 +0 -0
- data/test/examples/lotr.git/objects/ec/da3205bee14520aab5a7bb307392064b938e83 +0 -0
- data/test/examples/lotr.git/objects/fa/e7ef5344202bba4129abdc13060d9297d99465 +3 -0
- data/test/examples/lotr.git/objects/info/packs +2 -0
- data/test/examples/lotr.git/objects/pack/pack-dcbeaf3f6ff6c5eb08ea2b0a2d83626e8763546b.idx +0 -0
- data/test/examples/lotr.git/objects/pack/pack-dcbeaf3f6ff6c5eb08ea2b0a2d83626e8763546b.pack +0 -0
- data/test/examples/lotr.git/packed-refs +2 -0
- data/test/examples/lotr.git/refs/heads/master +1 -0
- data/test/helper.rb +38 -0
- data/test/test_file.rb +18 -0
- data/test/test_markup.rb +348 -0
- data/test/test_page.rb +112 -0
- data/test/test_wiki.rb +201 -0
- metadata +626 -0
@@ -0,0 +1,185 @@
|
|
1
|
+
/*************************************************************
|
2
|
+
*
|
3
|
+
* MathJax/jax/output/HTML-CSS/imageFonts.js
|
4
|
+
*
|
5
|
+
* Implements the image fallback fonts for the HTML-CSS OutputJax.
|
6
|
+
*
|
7
|
+
* ---------------------------------------------------------------------
|
8
|
+
*
|
9
|
+
* Copyright (c) 2009 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
|
+
(function (HUB,HTMLCSS,AJAX) {
|
25
|
+
HUB.Register.LoadHook(HTMLCSS.fontDir + "/fontdata.js",function () {
|
26
|
+
|
27
|
+
HTMLCSS.Augment({
|
28
|
+
allowWebFonts: false,
|
29
|
+
|
30
|
+
imgDir: HTMLCSS.webfontDir+"/png",
|
31
|
+
imgSize: ['050','060','071','085',100,120,141,168,200,238,283,336,400,476],
|
32
|
+
imgBaseIndex: 4, // set by initImg()
|
33
|
+
imgSizeForEm: {}, // cache of indexes by em-size
|
34
|
+
imgSizeForScale: {}, // cache of indexes by scale for a given em-size
|
35
|
+
|
36
|
+
handleImg: function (span,font,c,n,text) {
|
37
|
+
if (text.length) {this.addText(span,text)}
|
38
|
+
var orig = c[5].orig; if (!orig) {orig = c[5].orig = [c[0],c[1],c[2],c[3],c[4]]}
|
39
|
+
var bscale = this.imgBrowserZoom(); if (!span.scale) {span.scale = 1}
|
40
|
+
var index = this.imgIndex(span.scale*bscale);
|
41
|
+
if (index == this.imgEmWidth.length-1 &&
|
42
|
+
this.em*span.scale*bscale/this.imgEmWidth[index] > 1.1)
|
43
|
+
{bscale = this.imgEmWidth[index]/(this.em*span.scale)}
|
44
|
+
var factor = this.imgEmWidth[index]/(this.em*(span.scale||1)*bscale);
|
45
|
+
c[0] = orig[0]*factor; c[1] = orig[1]*factor; c[2] = orig[2]*factor;
|
46
|
+
c[3] = orig[3]*factor; c[4] = orig[4]*factor;
|
47
|
+
var dir = this.imgDir+"/"+font.directory+"/"+this.imgSize[index];
|
48
|
+
var chr = n.toString(16).toUpperCase(); while (chr.length < 4) {chr = "0"+chr};
|
49
|
+
var file = dir+"/"+chr+".png";
|
50
|
+
var img = c[5].img[index];
|
51
|
+
var style = {width:Math.floor(img[0]/bscale+.5)+"px", height:Math.floor(img[1]/bscale+.5)+"px"};
|
52
|
+
if (img[2]) {style.verticalAlign = Math.floor(-img[2]/bscale+.5)+"px"}
|
53
|
+
if (c[3] < 0) {style.marginLeft = this.Em(c[3]/1000)}
|
54
|
+
if (c[4] != c[2]) {style.marginRight = this.Em((c[2]-c[4])/1000)}
|
55
|
+
if (this.msieIE6) {
|
56
|
+
style.filter = "progid:DXImageTransform.Microsoft." +
|
57
|
+
"AlphaImageLoader(src='"+AJAX.fileURL(file)+"', sizingMethod='scale')";
|
58
|
+
file = this.directory+"/blank.gif"
|
59
|
+
}
|
60
|
+
this.addElement(span,"img",{src:AJAX.fileURL(file), style:style});
|
61
|
+
return "";
|
62
|
+
},
|
63
|
+
|
64
|
+
defineImageData: function (def) {
|
65
|
+
for (var font in def) {if (def.hasOwnProperty(font)) {
|
66
|
+
var FONT = HTMLCSS.FONTDATA.FONTS[font];
|
67
|
+
if (FONT) {
|
68
|
+
font = def[font];
|
69
|
+
for (var n in font) {if (font.hasOwnProperty(n) && FONT[n]) {FONT[n][5] = {img: font[n]}}}
|
70
|
+
}
|
71
|
+
}}
|
72
|
+
},
|
73
|
+
|
74
|
+
initImg: function (span) {
|
75
|
+
if (this.imgSizeForEm[this.em]) {this.imgBaseIndex = this.imgSizeForEm[this.em]}
|
76
|
+
for (var i = 0, m = this.imgEmWidth.length-1; i < m; i++)
|
77
|
+
{if (this.em <= this.imgEmWidth[i]) break}
|
78
|
+
if (i && this.imgEmWidth[i] - this.em > this.em - this.imgEmWidth[i-1]) {i--}
|
79
|
+
this.imgSizeForEm[this.em] = this.imgBaseIndex = i;
|
80
|
+
},
|
81
|
+
|
82
|
+
imgIndex: function (scale) {
|
83
|
+
if (!scale) {return this.imgBaseIndex}
|
84
|
+
if (!this.imgSizeForScale[this.em]) {this.imgSizeForScale[this.em] = {}}
|
85
|
+
if (this.imgSizeForScale[this.em][scale]) {return this.imgSizeForScale[this.em][scale]}
|
86
|
+
var em = this.em * scale;
|
87
|
+
for (var i = 0, m = this.imgEmWidth.length-1; i < m; i++)
|
88
|
+
{if (em <= this.imgEmWidth[i]) break}
|
89
|
+
if (i && this.imgEmWidth[i] - em > em - this.imgEmWidth[i-1]) {i--}
|
90
|
+
this.imgSizeForScale[this.em][scale] = i;
|
91
|
+
return i;
|
92
|
+
},
|
93
|
+
|
94
|
+
imgBrowserZoom: function () {return 1}
|
95
|
+
|
96
|
+
});
|
97
|
+
|
98
|
+
HUB.Browser.Select({
|
99
|
+
|
100
|
+
Firefox: function (browser) {
|
101
|
+
var ZDIV = HTMLCSS.addElement(document.body,"div",{
|
102
|
+
style: {
|
103
|
+
display:"none", visibility:"hidden", overflow:"scroll",
|
104
|
+
position:"absolute", top:0, left: 0, width:"200px", height:"200px"
|
105
|
+
}
|
106
|
+
});
|
107
|
+
|
108
|
+
var ZFRAME = HTMLCSS.addElement(ZDIV,"div",{
|
109
|
+
style: {position:"absolute", left:0, top:0, right:0, bottom:0}
|
110
|
+
});
|
111
|
+
|
112
|
+
HTMLCSS.Augment({
|
113
|
+
imgSpaceBug: true,
|
114
|
+
imgSpace: String.fromCharCode(0xA0),
|
115
|
+
|
116
|
+
imgZoomLevel: (browser.isMac ?
|
117
|
+
{50:.3, 30:.5, 22:.67, 19:.8, 16:.9, 15:1, 13:1.1, 12:1.2,
|
118
|
+
11:1.33, 10:1.5, 9:1.7, 7:2, 6:2.4, 5:3, 0:15} :
|
119
|
+
{56:.3, 34:.5, 25:.67, 21:.8, 19:.9, 17:1, 15:1.1, 14:1.2,
|
120
|
+
13:1.33, 11:1.5, 10:1.7, 8:2, 7:2.4, 6:3, 0:17}
|
121
|
+
),
|
122
|
+
|
123
|
+
imgZoomDiv: ZDIV,
|
124
|
+
|
125
|
+
imgBrowserZoom: function () {
|
126
|
+
var size = this.imgZoomLevel;
|
127
|
+
ZDIV.style.display = "";
|
128
|
+
var ratio = (ZDIV.offsetWidth-ZFRAME.offsetWidth);
|
129
|
+
ratio = (size[ratio] ? size[ratio] : size[0]/ratio);
|
130
|
+
ZDIV.style.display = "none";
|
131
|
+
return ratio;
|
132
|
+
}
|
133
|
+
});
|
134
|
+
},
|
135
|
+
|
136
|
+
Safari: function (browser) {
|
137
|
+
// for iPhone and iTouch
|
138
|
+
// var webkit = (navigator.appVersion+"AppleWebKit/530").match(/AppleWebKit\/(\d+)/)[1];
|
139
|
+
HTMLCSS.Augment({
|
140
|
+
// imgHeightBug: (!browser.isMac || webkit > 525),
|
141
|
+
// imgDepthBug: (!browser.isMac || webkit > 525),
|
142
|
+
imgBrowserZoom: function () {return 3}
|
143
|
+
});
|
144
|
+
},
|
145
|
+
|
146
|
+
Chrome: function (browser) {
|
147
|
+
HTMLCSS.Augment({
|
148
|
+
imgHeightBug: true,
|
149
|
+
imgBrowserZoom: function () {return 3}
|
150
|
+
});
|
151
|
+
},
|
152
|
+
|
153
|
+
Opera: function (browser) {
|
154
|
+
HTMLCSS.Augment({
|
155
|
+
imgSpaceBug: true,
|
156
|
+
imgSpace: String.fromCharCode(0xA0)+String.fromCharCode(0xA0),
|
157
|
+
|
158
|
+
imgDoc: (document.compatMode == "BackCompat" ? document.body :
|
159
|
+
document.documentElement),
|
160
|
+
|
161
|
+
imgBrowserZoom: function () {
|
162
|
+
if (browser.isMac) {return 3} // Mac Opera scales very nicely
|
163
|
+
var H = this.imgDoc.clientHeight, d = Math.floor(15*H/window.innerHeight);
|
164
|
+
if (this.imgDoc.clientWidth < this.imgDoc.scrollWidth-d) {H += d}
|
165
|
+
return parseFloat((window.innerHeight/H+.05).toString().replace(/(\.\d)\d+/,"$1"));
|
166
|
+
}
|
167
|
+
});
|
168
|
+
}
|
169
|
+
});
|
170
|
+
|
171
|
+
var GETWIDTHS = function () {
|
172
|
+
var img = HTMLCSS.FONTDATA.FONTS["MathJax_Main"][0x2014][5].img; // em-dash
|
173
|
+
HTMLCSS.imgEmWidth = [];
|
174
|
+
for (var i = 0, m = img.length; i < m; i++) {HTMLCSS.imgEmWidth[i] = img[i][0]}
|
175
|
+
};
|
176
|
+
|
177
|
+
MathJax.CallBack.Queue(
|
178
|
+
["Require",AJAX,HTMLCSS.webfontDir+"/imagedata.js"],
|
179
|
+
GETWIDTHS,
|
180
|
+
["loadComplete",AJAX,HTMLCSS.directory+"/imageFonts.js"]
|
181
|
+
);
|
182
|
+
|
183
|
+
});
|
184
|
+
|
185
|
+
})(MathJax.Hub,MathJax.OutputJax["HTML-CSS"],MathJax.Ajax);
|
@@ -0,0 +1,1991 @@
|
|
1
|
+
/*************************************************************
|
2
|
+
*
|
3
|
+
* MathJax/jax/output/HTML-CSS/jax.js
|
4
|
+
*
|
5
|
+
* Implements the HTML-CSS OutputJax that displays mathematics
|
6
|
+
* using HTML and CSS to position the characters from math fonts
|
7
|
+
* in their proper locations.
|
8
|
+
*
|
9
|
+
* ---------------------------------------------------------------------
|
10
|
+
*
|
11
|
+
* Copyright (c) 2009-2010 Design Science, Inc.
|
12
|
+
*
|
13
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
14
|
+
* you may not use this file except in compliance with the License.
|
15
|
+
* You may obtain a copy of the License at
|
16
|
+
*
|
17
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
18
|
+
*
|
19
|
+
* Unless required by applicable law or agreed to in writing, software
|
20
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
21
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
22
|
+
* See the License for the specific language governing permissions and
|
23
|
+
* limitations under the License.
|
24
|
+
*/
|
25
|
+
|
26
|
+
(function (MML,AJAX,HTMLCSS) {
|
27
|
+
|
28
|
+
var FONTTEST = MathJax.Object.Subclass({
|
29
|
+
FontInfo: {
|
30
|
+
STIX: {family: "STIXSizeOneSym", testString: "() {} []"},
|
31
|
+
TeX: {family: "MathJax_Size1", testString: "() {} []"}
|
32
|
+
},
|
33
|
+
comparisonFont: ["sans-serif","monospace","script","Times","Courier","Arial","Helvetica"],
|
34
|
+
testSize: ["40px","50px","60px","30px","20px"],
|
35
|
+
|
36
|
+
Init: function () {
|
37
|
+
var div = this.div = document.body.appendChild(document.createElement("div"));
|
38
|
+
div.style.position = "absolute"; div.style.visibility = "hidden";
|
39
|
+
div.style.top = div.style.left = 0;
|
40
|
+
div.style.fontWeight = "normal";
|
41
|
+
div.style.fontStyle = "normal";
|
42
|
+
div.style.fontSize = this.testSize[0];
|
43
|
+
this.text = this.div.appendChild(document.createTextNode(""));
|
44
|
+
},
|
45
|
+
|
46
|
+
findFont: function (fonts,pref) {
|
47
|
+
if (pref && this.testCollection(pref)) {return pref}
|
48
|
+
for (var i = 0, m = fonts.length; i < m; i++) {
|
49
|
+
if (fonts[i] === pref) continue;
|
50
|
+
if (this.testCollection(fonts[i])) {return fonts[i]}
|
51
|
+
}
|
52
|
+
return null;
|
53
|
+
},
|
54
|
+
|
55
|
+
testCollection: function (name) {return this.testFont(this.FontInfo[name])},
|
56
|
+
|
57
|
+
testFont: function (font) {
|
58
|
+
if (font.isWebFont && HTMLCSS.FontFaceBug) {
|
59
|
+
this.div.style.fontWeight = this.div.style.fontStyle = "normal";
|
60
|
+
} else {
|
61
|
+
this.div.style.fontWeight = (font.weight||"normal");
|
62
|
+
this.div.style.fontStyle = (font.style||"normal");
|
63
|
+
}
|
64
|
+
var W = this.getComparisonWidths(font.testString);
|
65
|
+
if (W) {
|
66
|
+
this.div.style.fontFamily = "'"+font.family+"',"+this.comparisonFont[0];
|
67
|
+
if (this.div.offsetWidth == W[0]) {
|
68
|
+
this.div.style.fontFamily = "'"+font.family+"',"+this.comparisonFont[W[2]];
|
69
|
+
if (this.div.offsetWidth == W[1]) {return false}
|
70
|
+
}
|
71
|
+
if (this.div.offsetWidth != W[3]) {
|
72
|
+
if (!HTMLCSS.FONTDATA || !HTMLCSS.FONTDATA.hasStyleChar) {return true}
|
73
|
+
for (var i = 0, m = this.testSize.length; i < m; i++)
|
74
|
+
{if (this.testStyleChar(font,this.testSize[i])) {return true}}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
return false;
|
78
|
+
},
|
79
|
+
|
80
|
+
styleChar: String.fromCharCode(0xEFFD), // width encodes style
|
81
|
+
versionChar: String.fromCharCode(0xEFFE), // width encodes version
|
82
|
+
compChar: String.fromCharCode(0xEFFF), // "standard" width to compare to
|
83
|
+
|
84
|
+
testStyleChar: function (font,size) {
|
85
|
+
var n = 3 + (font.weight ? 2 : 0) + (font.style ? 4 : 0);
|
86
|
+
var extra = "", dw = 0;
|
87
|
+
var SIZE = this.div.style.fontSize; this.div.style.fontSize = size;
|
88
|
+
if (HTMLCSS.msieItalicWidthBug && font.style === "italic") {
|
89
|
+
this.text.nodeValue = extra = this.compChar;
|
90
|
+
dw = this.div.offsetWidth;
|
91
|
+
}
|
92
|
+
if (HTMLCSS.safariTextNodeBug) {this.div.innerHTML = this.compChar+extra}
|
93
|
+
else {this.text.nodeValue = this.compChar+extra}
|
94
|
+
var W = this.div.offsetWidth-dw;
|
95
|
+
if (HTMLCSS.safariTextNodeBug) {this.div.innerHTML = this.styleChar+extra}
|
96
|
+
else {this.text.nodeValue = this.styleChar+extra}
|
97
|
+
var N = Math.floor((this.div.offsetWidth-dw)/W+.5);
|
98
|
+
if (N === n) {
|
99
|
+
if (HTMLCSS.safariTextNodeBug) {this.div.innerHTML = this.versionChar+extra}
|
100
|
+
else {this.text.nodeValue = this.versionChar+extra}
|
101
|
+
font.version = Math.floor((this.div.offsetWidth-dw)/W+1.5)/2;
|
102
|
+
}
|
103
|
+
this.div.style.fontSize = SIZE;
|
104
|
+
return (N === n);
|
105
|
+
},
|
106
|
+
|
107
|
+
getComparisonWidths: function (string) {
|
108
|
+
if (HTMLCSS.FONTDATA && HTMLCSS.FONTDATA.hasStyleChar)
|
109
|
+
{string += this.styleChar + " " + this.compChar}
|
110
|
+
if (HTMLCSS.safariTextNodeBug) {this.div.innerHTML = string}
|
111
|
+
else {this.text.nodeValue = string}
|
112
|
+
this.div.style.fontFamily = this.comparisonFont[0];
|
113
|
+
var W = this.div.offsetWidth, sW = -1;
|
114
|
+
if (HTMLCSS.safariWebFontSerif) {
|
115
|
+
this.div.style.fontFamily = HTMLCSS.safariWebFontSerif[0];
|
116
|
+
sW = this.div.offsetWidth;
|
117
|
+
}
|
118
|
+
for (var i = 1, m = this.comparisonFont.length; i < m; i++) {
|
119
|
+
this.div.style.fontFamily = this.comparisonFont[i];
|
120
|
+
if (this.div.offsetWidth != W) {return [W,this.div.offsetWidth,i,sW]}
|
121
|
+
}
|
122
|
+
return null;
|
123
|
+
},
|
124
|
+
|
125
|
+
loadWebFont: function (font) {
|
126
|
+
var n = MathJax.Message.File("Web-Font "+HTMLCSS.fontInUse+"/"+font.directory);
|
127
|
+
var callback = MathJax.CallBack(["loadComplete",this,font,n]);
|
128
|
+
AJAX.timer.start(AJAX,[this.checkWebFont,font,callback],1);
|
129
|
+
return callback;
|
130
|
+
},
|
131
|
+
loadComplete: function (font,n) {
|
132
|
+
MathJax.Message.Clear(n);
|
133
|
+
},
|
134
|
+
|
135
|
+
checkWebFont: function (check,font,callback) {
|
136
|
+
if (check.time(callback)) return;
|
137
|
+
if (HTMLCSS.Font.testFont(font)) {callback(check.STATUS.OK)}
|
138
|
+
else {setTimeout(check,check.delay)}
|
139
|
+
},
|
140
|
+
|
141
|
+
fontFace: function (name) {
|
142
|
+
var type = HTMLCSS.allowWebFonts;
|
143
|
+
var dir = AJAX.fileURL(HTMLCSS.webfontDir+"/"+type);
|
144
|
+
var fullname = name.replace(/-b/,"-B").replace(/-i/,"-I").replace(/-Bold-/,"-Bold");
|
145
|
+
if (!fullname.match(/-/)) {fullname += "-Regular"}
|
146
|
+
if (type === "svg") {fullname += ".svg#"+fullname} else {fullname += "."+type}
|
147
|
+
var def = {
|
148
|
+
"font-family": HTMLCSS.FONTDATA.FONTS[name].family,
|
149
|
+
src: "url('"+dir+"/"+fullname+"')"
|
150
|
+
};
|
151
|
+
if (type === "svg") def.src += " format('svg')";
|
152
|
+
if (!(HTMLCSS.FontFaceBug && HTMLCSS.FONTDATA.FONTS[name].isWebFont)) {
|
153
|
+
if (name.match(/-bold/)) {def["font-weight"] = "bold"}
|
154
|
+
if (name.match(/-italic/)) {def["font-style"] = "italic"}
|
155
|
+
}
|
156
|
+
return def;
|
157
|
+
}
|
158
|
+
});
|
159
|
+
|
160
|
+
HTMLCSS.Augment({
|
161
|
+
|
162
|
+
config: {
|
163
|
+
styles: {
|
164
|
+
".MathJax": {
|
165
|
+
"font-family": "serif",
|
166
|
+
"font-style": "normal",
|
167
|
+
"font-weight": "normal",
|
168
|
+
"line-height": "normal",
|
169
|
+
"font-size": "100%",
|
170
|
+
"text-indent": 0,
|
171
|
+
"text-align": "left",
|
172
|
+
"text-transform": "none",
|
173
|
+
"letter-spacing": "normal",
|
174
|
+
"word-spacing": "normal",
|
175
|
+
"word-wrap": "none",
|
176
|
+
"white-space": "nowrap",
|
177
|
+
border: 0, padding: 0, margin: 0,
|
178
|
+
"float": "none"
|
179
|
+
},
|
180
|
+
|
181
|
+
".MathJax_Display": {
|
182
|
+
position: "relative"
|
183
|
+
},
|
184
|
+
|
185
|
+
".MathJax span, .MathJax img, .MathJax nobr, .MathJax a": {
|
186
|
+
border: 0, padding: 0, margin: 0,
|
187
|
+
"vertical-align": 0,
|
188
|
+
"line-height": "normal",
|
189
|
+
"text-decoration": "none"
|
190
|
+
}
|
191
|
+
}
|
192
|
+
},
|
193
|
+
|
194
|
+
Font: FONTTEST(),
|
195
|
+
|
196
|
+
Config: function () {
|
197
|
+
MathJax.OutputJax.prototype.Config.call(this);
|
198
|
+
var font = this.Font.findFont(this.config.availableFonts,this.config.preferredFont);
|
199
|
+
if (!font && this.allowWebFonts) {font = this.config.webFont}
|
200
|
+
if (!font && this.config.imageFont) {font = this.config.imageFont; this.imgFonts = true}
|
201
|
+
if (font) {
|
202
|
+
this.fontInUse = font; this.fontDir += "/" + font; this.webfontDir += "/" + font;
|
203
|
+
if (!this.require) {this.require = []}
|
204
|
+
this.require.push(this.fontDir+"/fontdata.js");
|
205
|
+
if (this.imgFonts) {this.require.push(this.directory+"/imageFonts.js")}
|
206
|
+
} else {
|
207
|
+
MathJax.Message.Set("Can't find a valid font using ["+this.config.availableFonts.join(", ")+"]",null,3000);
|
208
|
+
this.FONTDATA = {
|
209
|
+
TeX_factor: 1, baselineskip: 1.2, lineH: .8, lineD: .2, ffLineH: .8,
|
210
|
+
FONTS: {}, VARIANT: {normal: {fonts:[]}}, RANGES: [],
|
211
|
+
DEFAULTFAMILY: "serif", DEFAULTWEIGHT: "normal", DEFAULTSTYLE: "normal",
|
212
|
+
DELIMITERS: {}, RULECHAR: 0x2D, REMAP: {}
|
213
|
+
};
|
214
|
+
MathJax.InputJax.TeX.Definitions.macros.overline[1] = "002D";
|
215
|
+
MathJax.InputJax.TeX.Definitions.macros.underline[1] = "002D";
|
216
|
+
}
|
217
|
+
},
|
218
|
+
|
219
|
+
Startup: function () {
|
220
|
+
// Set up default fonts
|
221
|
+
var MJ = this.config.styles[".MathJax"];
|
222
|
+
var family = [], fonts = this.FONTDATA.VARIANT.normal.fonts;
|
223
|
+
if (!(fonts instanceof Array)) {fonts = [fonts]}
|
224
|
+
for (var i = 0, m = fonts.length; i < m; i++) {
|
225
|
+
family[i] = this.FONTDATA.FONTS[fonts[i]].family;
|
226
|
+
if (!family[i]) {family[i] = fonts[i]}
|
227
|
+
}
|
228
|
+
MJ["font-family"] = family.join(',');
|
229
|
+
|
230
|
+
// Make hidden div for when math is in a display:none block
|
231
|
+
this.hiddenDiv = this.Element("div",{
|
232
|
+
style:{visibility:"hidden", overflow:"hidden", height:"1px",
|
233
|
+
position:"absolute", top:0}
|
234
|
+
});
|
235
|
+
if (!document.body.firstChild) {document.body.appendChild(this.hiddenDiv)}
|
236
|
+
else {document.body.insertBefore(this.hiddenDiv,document.body.firstChild)}
|
237
|
+
this.hiddenDiv = this.addElement(this.hiddenDiv,"div",{id:"MathJax_Hidden"});
|
238
|
+
|
239
|
+
// Determine pixels per inch
|
240
|
+
var div = this.addElement(this.hiddenDiv,"div",{style:{width:"5in"}});
|
241
|
+
this.pxPerInch = div.offsetWidth/5; this.hiddenDiv.removeChild(div);
|
242
|
+
|
243
|
+
// Markers used by getW
|
244
|
+
this.startMarker = HTMLCSS.createStrut(this.Element("span"),10,true);
|
245
|
+
this.endMarker = this.addText(this.Element("span"),"x").parentNode;
|
246
|
+
|
247
|
+
// Used in getHD
|
248
|
+
this.HDspan = this.Element("span");
|
249
|
+
if (this.operaHeightBug) {this.createStrut(this.HDspan,0)}
|
250
|
+
if (this.msieInlineBlockAlignBug) {
|
251
|
+
this.HDimg = this.addElement(this.HDspan,"img",{style:{height:"0px", width:"1px"}});
|
252
|
+
try {this.HDimg.src = "about:blank"} catch(err) {}
|
253
|
+
} else {
|
254
|
+
this.HDimg = HTMLCSS.createStrut(this.HDspan,0);
|
255
|
+
}
|
256
|
+
|
257
|
+
// Used in getScales
|
258
|
+
this.HDMspan = this.Element("span",{style: {position:"absolute"}});
|
259
|
+
if (this.msieInlineBlockAlignBug) {
|
260
|
+
this.HDMimg = this.addElement(this.HDMspan,"img",{style:{height:"0px",width:"1px"}});
|
261
|
+
try {this.HDMimg.src = "about:blank"} catch(err) {}
|
262
|
+
} else {
|
263
|
+
this.HDMimg = HTMLCSS.createStrut(this.HDMspan,0); this.HDMimg.style.marginRight = "";
|
264
|
+
}
|
265
|
+
|
266
|
+
// Used for computing factor to fix margin width in MSIE
|
267
|
+
this.marginCheck = HTMLCSS.Element("span");
|
268
|
+
HTMLCSS.addElement(this.marginCheck,"span",{style: {display:"inline-block", width:"5em"}});
|
269
|
+
this.marginMove = HTMLCSS.addElement(this.marginCheck,"span",
|
270
|
+
{style: {display:"inline-block", width:"5em", marginLeft:"-5em"}});
|
271
|
+
|
272
|
+
// Set up styles and preload web fonts
|
273
|
+
return MathJax.Ajax.Styles(this.config.styles,["PreloadWebFonts",this]);
|
274
|
+
},
|
275
|
+
|
276
|
+
PreloadWebFonts: function () {
|
277
|
+
if (!HTMLCSS.allowWebFonts || !HTMLCSS.config.preloadWebFonts) return;
|
278
|
+
for (var i = 0, m = HTMLCSS.config.preloadWebFonts.length; i < m; i++) {
|
279
|
+
var FONT = HTMLCSS.FONTDATA.FONTS[HTMLCSS.config.preloadWebFonts[i]];
|
280
|
+
if (!FONT.available) {HTMLCSS.Font.testFont(FONT)}
|
281
|
+
}
|
282
|
+
},
|
283
|
+
|
284
|
+
Translate: function (script) {
|
285
|
+
var math = script.MathJax.elementJax.root;
|
286
|
+
var span = this.Element("span",{className:"MathJax"}), div = span;
|
287
|
+
if (math.Get("display") === "block") {
|
288
|
+
div = this.Element("div",{className:"MathJax_Display", style:{width:"100%", position:"relative"}});
|
289
|
+
div.appendChild(span);
|
290
|
+
}
|
291
|
+
// (screen readers don't know about role="math" yet, so use "textbox" instead)
|
292
|
+
div.setAttribute("role","textbox"); div.setAttribute("aria-readonly","true");
|
293
|
+
script.parentNode.insertBefore(div,script);
|
294
|
+
this.getScales(div,span); var isHidden = (this.em === 0 || String(this.em) === "NaN");
|
295
|
+
if (isHidden) {this.hiddenDiv.appendChild(div); this.getScales(div,span)}
|
296
|
+
this.initImg(span);
|
297
|
+
this.initHTML(math,span);
|
298
|
+
math.setTeXclass();
|
299
|
+
try {math.toHTML(span,div)} catch (err) {
|
300
|
+
if (err.restart) {div.parentNode.removeChild(div)}
|
301
|
+
throw err;
|
302
|
+
}
|
303
|
+
if (isHidden) {script.parentNode.insertBefore(div,script)}
|
304
|
+
},
|
305
|
+
|
306
|
+
initImg: function (span) {},
|
307
|
+
initHTML: function (math,span) {},
|
308
|
+
initFont: function (name) {
|
309
|
+
var FONTS = HTMLCSS.FONTDATA.FONTS, AVAIL = HTMLCSS.config.availableFonts;
|
310
|
+
if (AVAIL && AVAIL.length && HTMLCSS.Font.testFont(FONTS[name]))
|
311
|
+
{FONTS[name].available = true; return null}
|
312
|
+
if (!this.allowWebFonts) {return null}
|
313
|
+
FONTS[name].isWebFont = true;
|
314
|
+
if (HTMLCSS.FontFaceBug) {FONTS[name].family = name}
|
315
|
+
return AJAX.Styles({"@font-face":this.Font.fontFace(name)});
|
316
|
+
},
|
317
|
+
|
318
|
+
Remove: function (jax) {
|
319
|
+
var span = jax.SourceElement(); if (!span) return;
|
320
|
+
span = span.previousSibling; if (!span) return;
|
321
|
+
if (span.className.match(/^MathJax/)) {span.parentNode.removeChild(span)}
|
322
|
+
},
|
323
|
+
|
324
|
+
getScales: function (span,mj) {
|
325
|
+
span.parentNode.insertBefore(this.HDMspan,span);
|
326
|
+
this.HDMspan.className = "";
|
327
|
+
this.HDMimg.style.height = "1px"; this.HDMimg.style.width = "60ex";
|
328
|
+
var ex = this.HDMspan.offsetWidth/60;
|
329
|
+
this.HDMspan.className = "MathJax"; this.HDMimg.style.width = "60em";
|
330
|
+
var em = this.HDMspan.offsetWidth/60;
|
331
|
+
var scale = Math.floor((ex/this.TeX.x_height) / em * this.config.scale);
|
332
|
+
mj.style.fontSize = this.HDMspan.style.fontSize = scale+"%";
|
333
|
+
this.em = MML.mbase.prototype.em = this.HDMspan.offsetWidth/60;
|
334
|
+
span.parentNode.removeChild(this.HDMspan);
|
335
|
+
this.msieMarginScale = this.getMarginScale(mj);
|
336
|
+
},
|
337
|
+
getMarginScale: function (span) {return 1},
|
338
|
+
getMSIEmarginScale: function (span) {
|
339
|
+
span.appendChild(this.marginCheck);
|
340
|
+
var W = this.marginCheck.offsetWidth, w = this.marginMove.offsetWidth;
|
341
|
+
var scale = w/(2*w - W);
|
342
|
+
span.removeChild(this.marginCheck);
|
343
|
+
return scale;
|
344
|
+
},
|
345
|
+
getHD: function (span) {
|
346
|
+
var position = span.style.position;
|
347
|
+
span.style.position = "absolute";
|
348
|
+
this.HDimg.style.height = "0px";
|
349
|
+
span.appendChild(this.HDspan);
|
350
|
+
var HD = {h:span.offsetHeight};
|
351
|
+
this.HDimg.style.height = HD.h+"px";
|
352
|
+
HD.d = span.offsetHeight - HD.h; HD.h -= HD.d;
|
353
|
+
HD.h /= this.em; HD.d /= this.em;
|
354
|
+
span.removeChild(this.HDspan);
|
355
|
+
span.style.position = position;
|
356
|
+
return HD;
|
357
|
+
},
|
358
|
+
getW: function (span) {
|
359
|
+
var W = span.offsetWidth, w = (span.bbox ? span.bbox.w: -1), start = span;
|
360
|
+
if ((w < 0 || this.negativeSkipBug) && W >= 0) {
|
361
|
+
// IE can't deal with a space at the beginning, so put something else first
|
362
|
+
if (this.negativeSkipBug) {
|
363
|
+
var position = span.style.position; span.style.position = "absolute";
|
364
|
+
start = this.startMarker;
|
365
|
+
if (span.firstChild) {span.insertBefore(start,span.firstChild)}
|
366
|
+
else {span.appendChild(start)}
|
367
|
+
start = this.startMarker;
|
368
|
+
}
|
369
|
+
span.appendChild(this.endMarker);
|
370
|
+
W = this.endMarker.offsetLeft - start.offsetLeft;
|
371
|
+
span.removeChild(this.endMarker);
|
372
|
+
if (this.negativeSkipBug) {
|
373
|
+
span.removeChild(start);
|
374
|
+
span.style.position = position;
|
375
|
+
}
|
376
|
+
}
|
377
|
+
return W/this.em;
|
378
|
+
},
|
379
|
+
Measured: function (span,parent) {
|
380
|
+
if (span.bbox.width == null && span.bbox.w) {
|
381
|
+
var w = this.getW(span);
|
382
|
+
span.bbox.rw += w - span.bbox.w;
|
383
|
+
span.bbox.w = w;
|
384
|
+
}
|
385
|
+
if (!parent) {parent = span.parentNode}
|
386
|
+
if (!parent.bbox) {parent.bbox = span.bbox}
|
387
|
+
return span;
|
388
|
+
},
|
389
|
+
Remeasured: function (span,parent) {
|
390
|
+
parent.bbox = this.Measured(span,parent).bbox;
|
391
|
+
},
|
392
|
+
|
393
|
+
Em: function (m) {
|
394
|
+
if (Math.abs(m) < .0006) {return "0em"}
|
395
|
+
return (m < 0 ? "-" : "")+String(Math.abs(m)+.0005).replace(/(\.\d\d\d).+/,'$1') + "em";
|
396
|
+
},
|
397
|
+
Percent: function (m) {
|
398
|
+
return String(m*100+.5).replace(/\..+/,'') + "%";
|
399
|
+
},
|
400
|
+
length2percent: function (length) {
|
401
|
+
return this.Percent(this.length2em(length));
|
402
|
+
},
|
403
|
+
length2em: function (length,size) {
|
404
|
+
if (typeof(length) !== "string") {length = length.toString()}
|
405
|
+
if (length === "") {return ""}
|
406
|
+
if (length === MML.SIZE.NORMAL) {return 1}
|
407
|
+
if (length === MML.SIZE.BIG) {return 2}
|
408
|
+
if (length === MML.SIZE.SMALL) {return .71}
|
409
|
+
if (length === "infinity") {return HTMLCSS.BIGDIMEN}
|
410
|
+
var factor = this.FONTDATA.TeX_factor;
|
411
|
+
if (length.match(/mathspace$/)) {return HTMLCSS.MATHSPACE[length]*factor}
|
412
|
+
var match = length.match(/^\s*([-+]?(?:\.\d+|\d+(?:\.\d*)?))?(pt|em|ex|mu|px|in|mm|cm|%)?/);
|
413
|
+
var m = parseFloat(match[1]||"1"), unit = match[2];
|
414
|
+
if (size == null) {size = 1}
|
415
|
+
if (unit === "em") {return m * factor}
|
416
|
+
if (unit === "ex") {return m * HTMLCSS.TeX.x_height * factor}
|
417
|
+
if (unit === "%") {return m / 100 * size}
|
418
|
+
if (unit === "px") {return m / HTMLCSS.em}
|
419
|
+
if (unit === "pt") {return m / 10 * factor} // 10 pt to an em
|
420
|
+
if (unit === "in") {return m * this.pxPerInch / HTMLCSS.em}
|
421
|
+
if (unit === "cm") {return m * this.pxPerInch / HTMLCSS.em / 2.54} // 2.54 cm to an inch
|
422
|
+
if (unit === "mm") {return m * this.pxPerInch / HTMLCSS.em / 25.4} // 10 mm to a cm
|
423
|
+
if (unit === "pc") {return m * this.pxPerInch / HTMLCSS.em / 12} // 12 pc to an inch
|
424
|
+
if (unit === "mu") {return m / 18 * factor} // FIXME: needs to include scale
|
425
|
+
return m*factor*size; // relative to given size (or 1em as default)
|
426
|
+
},
|
427
|
+
thickness2em: function (length) {
|
428
|
+
var thick = HTMLCSS.TeX.rule_thickness;
|
429
|
+
if (length === MML.LINETHICKNESS.MEDIUM) {return thick}
|
430
|
+
if (length === MML.LINETHICKNESS.THIN) {return .67*thick}
|
431
|
+
if (length === MML.LINETHICKNESS.THICK) {return 1.67*thick}
|
432
|
+
return this.length2em(length,thick);
|
433
|
+
},
|
434
|
+
|
435
|
+
createStrut: function (span,h,before) {
|
436
|
+
var strut = this.Element("span",{
|
437
|
+
style:{display:"inline-block", overflow:"hidden", height:h+"px",
|
438
|
+
width:"1px", marginRight:"-1px"}
|
439
|
+
});
|
440
|
+
if (before) {span.insertBefore(strut,span.firstChild)} else {span.appendChild(strut)}
|
441
|
+
return strut;
|
442
|
+
},
|
443
|
+
createBlank: function (span,w,before) {
|
444
|
+
var blank = this.Element("span",{
|
445
|
+
style: {display:"inline-block", overflow:"hidden", height:"1px", width:this.Em(w)}
|
446
|
+
});
|
447
|
+
if (before) {span.insertBefore(blank,span.firstChild)} else {span.appendChild(blank)}
|
448
|
+
return blank;
|
449
|
+
},
|
450
|
+
createShift: function (span,w,before) {
|
451
|
+
var space = this.Element("span",{style:{marginLeft:this.Em(w)}});
|
452
|
+
if (before) {span.insertBefore(space,span.firstChild)} else {span.appendChild(space)}
|
453
|
+
return space;
|
454
|
+
},
|
455
|
+
createSpace: function (span,h,d,w,color) {
|
456
|
+
var H = this.Em(Math.max(0,h+d)), D = this.Em(-d);
|
457
|
+
if (this.msieInlineBlockAlignBug) {D = this.Em(HTMLCSS.getHD(span.parentNode).d-d)}
|
458
|
+
if (span.isBox || span.className == "mspace") {
|
459
|
+
span.bbox = {
|
460
|
+
h: h*span.scale, d: d*span.scale,
|
461
|
+
w: w*span.scale, rw: w*span.scale, lw: 0
|
462
|
+
};
|
463
|
+
span.style.height = H; span.style.verticalAlign = D;
|
464
|
+
} else {
|
465
|
+
span = this.addElement(span,"span",{style: {height:H, verticalAlign:D}});
|
466
|
+
}
|
467
|
+
if (w >= 0) {
|
468
|
+
span.style.width = this.Em(w);
|
469
|
+
span.style.display = "inline-block";
|
470
|
+
} else {
|
471
|
+
if (this.msieNegativeSpaceBug) {span.style.height = ""}
|
472
|
+
span.style.marginLeft = this.Em(w);
|
473
|
+
if (HTMLCSS.safariNegativeSpaceBug && span.parentNode.firstChild == span)
|
474
|
+
{this.createBlank(span,0,true)}
|
475
|
+
}
|
476
|
+
if (color && color !== MML.COLOR.TRANSPARENT) {span.style.backgroundColor = color}
|
477
|
+
return span;
|
478
|
+
},
|
479
|
+
createRule: function (span,h,d,w,color) {
|
480
|
+
var min = HTMLCSS.TeX.min_rule_thickness;
|
481
|
+
// If rule is very thin, make it at least min_rule_thickness so it doesn't disappear
|
482
|
+
if (w > 0 && w*this.em < min) {w = min/this.em}
|
483
|
+
if (h+d > 0 && (h+d)*this.em < min) {var f = 1/(h+d)*(min/this.em); h *= f; d *= f}
|
484
|
+
if (!color) {color = "solid"} else {color = "solid "+color}
|
485
|
+
color = this.Em(w)+" "+color;
|
486
|
+
var H = this.Em(h+d), D = this.Em(-d);
|
487
|
+
if (span.isBox || span.className == "mspace") {span.bbox = {h:h, d:d, w:w, rw:w, lw: 0}}
|
488
|
+
span = this.addElement(span,"span",{
|
489
|
+
style: {borderLeft: color, display: "inline-block", overflow:"hidden",
|
490
|
+
width:0, height:H, verticalAlign:D}
|
491
|
+
});
|
492
|
+
if (w > 0 && span.offsetWidth == 0) {span.style.width = this.Em(w)}
|
493
|
+
return span;
|
494
|
+
},
|
495
|
+
|
496
|
+
createStack: function (span,nobbox,w) {
|
497
|
+
if (this.msiePaddingWidthBug) {this.createStrut(span,0)}
|
498
|
+
span = this.addElement(span,"span",{
|
499
|
+
style: {display:"inline-block", position:"relative",
|
500
|
+
width:(w == null ? 0: "100%"), height:0}
|
501
|
+
});
|
502
|
+
if (!nobbox) {
|
503
|
+
span.parentNode.bbox = span.bbox = {
|
504
|
+
h: -this.BIGDIMEN, d: -this.BIGDIMEN,
|
505
|
+
w:0, lw: this.BIGDIMEN, rw: -this.BIGDIMEN
|
506
|
+
};
|
507
|
+
if (w != null) {span.bbox.width = span.parentNode.bbox.width = w}
|
508
|
+
}
|
509
|
+
return span;
|
510
|
+
},
|
511
|
+
createBox: function (span,w) {
|
512
|
+
var box = this.addElement(span,"span",{style:{position:"absolute"}, isBox: true});
|
513
|
+
if (w != null) {box.style.width = w}
|
514
|
+
return box;
|
515
|
+
},
|
516
|
+
addBox: function (span,box) {
|
517
|
+
box.style.position = "absolute"; box.isBox = true;
|
518
|
+
return span.appendChild(box);
|
519
|
+
},
|
520
|
+
placeBox: function (span,x,y,noclip) {
|
521
|
+
var parent = span.parentNode, bbox = span.bbox, BBOX = parent.bbox;
|
522
|
+
if (this.msiePlaceBoxBug) {this.addText(span,this.NBSP)}
|
523
|
+
if (this.imgSpaceBug) {this.addText(span,this.imgSpace)}
|
524
|
+
var HD = this.getHD(span), dx = 0;
|
525
|
+
// Make sure vertical alignment of baseline is correct
|
526
|
+
span.style.top = this.Em(-HD.h);
|
527
|
+
if (-span.offsetTop !== Math.floor(HD.h*this.em+.5))
|
528
|
+
{HD.h += .95*Math.floor(HD.h*this.em+span.offsetTop+.5)/this.em};
|
529
|
+
// Clip so that bbox doesn't include extra height and depth
|
530
|
+
if (bbox) {
|
531
|
+
if (this.negativeSkipBug) {
|
532
|
+
if (bbox.lw < 0) {dx = bbox.lw; HTMLCSS.createBlank(span,-dx,true); l = 0}
|
533
|
+
if (bbox.rw > bbox.w) {HTMLCSS.createBlank(span,bbox.rw-bbox.w+.1)}
|
534
|
+
}
|
535
|
+
if (!this.msieClipRectBug && !bbox.noclip && !noclip) {
|
536
|
+
var dd = 3/this.em;
|
537
|
+
var H = (bbox.H == null ? bbox.h : bbox.H), D = (bbox.D == null ? bbox.d : bbox.D);
|
538
|
+
var t = HD.h - H - dd, b = HD.h + D + dd, l = bbox.lw - 3*dd, r = 1000;
|
539
|
+
span.style.clip = "rect("+this.Em(t)+" "+this.Em(r)+" "+this.Em(b)+" "+this.Em(l)+")";
|
540
|
+
}
|
541
|
+
}
|
542
|
+
// Place the box
|
543
|
+
span.style.left = this.Em(x+dx);
|
544
|
+
span.style.top = this.Em(-(y+HD.h));
|
545
|
+
// Update the bounding box
|
546
|
+
if (bbox && BBOX) {
|
547
|
+
if (bbox.H != null && (BBOX.H == null || bbox.H + y > BBOX.H)) {BBOX.H = bbox.H + y}
|
548
|
+
if (bbox.D != null && (BBOX.D == null || bbox.D - y > BBOX.D)) {BBOX.D = bbox.D - y}
|
549
|
+
if (bbox.h + y > BBOX.h) {BBOX.h = bbox.h + y}
|
550
|
+
if (bbox.d - y > BBOX.d) {BBOX.d = bbox.d - y}
|
551
|
+
if (BBOX.H != null && BBOX.H <= BBOX.h) {delete BBOX.H}
|
552
|
+
if (BBOX.D != null && BBOX.D <= BBOX.d) {delete BBOX.D}
|
553
|
+
if (bbox.w + x > BBOX.w) {
|
554
|
+
BBOX.w = bbox.w + x;
|
555
|
+
if (BBOX.width == null) {parent.style.width = this.Em(BBOX.w)}
|
556
|
+
}
|
557
|
+
if (bbox.rw + x > BBOX.rw) {BBOX.rw = bbox.rw + x}
|
558
|
+
if (bbox.lw + x < BBOX.lw) {BBOX.lw = bbox.lw + x}
|
559
|
+
// FIXME: deal with non-percent widths
|
560
|
+
if (bbox.width != null) {
|
561
|
+
if (BBOX.width == null) {parent.style.width = BBOX.width = "100%"}
|
562
|
+
span.style.width = bbox.width;
|
563
|
+
}
|
564
|
+
}
|
565
|
+
},
|
566
|
+
alignBox: function (span,align,y) {
|
567
|
+
this.placeBox(span,0,y); // set y position (and left aligned)
|
568
|
+
var r = 0, c = -span.bbox.w/2;
|
569
|
+
if (this.negativeSkipBug) {r = span.bbox.w-span.bbox.rw-.1; c += span.bbox.lw}
|
570
|
+
// FIXME: handle width that is not a percent
|
571
|
+
c = (span.bbox.width ? "-"+Math.floor(parseInt(span.bbox.width)/2)+"%" :
|
572
|
+
this.Em(c*this.msieMarginScale));
|
573
|
+
MathJax.Hub.Insert(span.style,({
|
574
|
+
right: {left:"", right: this.Em(r)},
|
575
|
+
center: {left:"50%", marginLeft: c}
|
576
|
+
})[align]);
|
577
|
+
},
|
578
|
+
setStackWidth: function (span,w) {
|
579
|
+
if (typeof(w) === "number") {
|
580
|
+
span.style.width = this.Em(Math.max(0,w));
|
581
|
+
if (span.bbox) {span.bbox.w = w};
|
582
|
+
if (span.parentNode.bbox) {span.parentNode.bbox.w = w}
|
583
|
+
} else {
|
584
|
+
span.style.width = span.parentNode.style.width = "100%";
|
585
|
+
if (span.bbox) {span.bbox.width = w}
|
586
|
+
if (span.parentNode.bbox) {span.parentNode.bbox.width = w}
|
587
|
+
}
|
588
|
+
},
|
589
|
+
|
590
|
+
createDelimiter: function (span,code,HW,scale,font) {
|
591
|
+
if (!code) {
|
592
|
+
span.bbox = {h:0, d:0, w:this.TeX.nulldelimiterspace, lw: 0};
|
593
|
+
span.bbox.rw = span.bbox.w;
|
594
|
+
this.createSpace(span,span.bbox.h,span.bbox.d,span.bbox.w);
|
595
|
+
return;
|
596
|
+
}
|
597
|
+
if (!scale) {scale = 1};
|
598
|
+
if (!(HW instanceof Array)) {HW = [HW,HW]}
|
599
|
+
var hw = HW[1]; HW = HW[0];
|
600
|
+
var delim = {alias: code};
|
601
|
+
while (delim.alias) {
|
602
|
+
code = delim.alias; delim = this.FONTDATA.DELIMITERS[code];
|
603
|
+
if (!delim) {delim = {HW: [0,this.FONTDATA.VARIANT[MML.VARIANT.NORMAL]]}}
|
604
|
+
}
|
605
|
+
for (var i = 0, m = delim.HW.length; i < m; i++) {
|
606
|
+
if (delim.HW[i][0]*scale >= HW-.01 || (i == m-1 && !delim.stretch)) {
|
607
|
+
if (delim.HW[i][2]) {scale *= delim.HW[i][2]}
|
608
|
+
if (delim.HW[i][3]) {code = delim.HW[i][3]}
|
609
|
+
var chr = this.addElement(span,"span");
|
610
|
+
this.createChar(chr,[code,delim.HW[i][1]],scale,font);
|
611
|
+
span.bbox = chr.bbox;
|
612
|
+
span.offset = .65 * span.bbox.w;
|
613
|
+
span.scale = scale;
|
614
|
+
return;
|
615
|
+
}
|
616
|
+
}
|
617
|
+
if (delim.stretch) {this["extendDelimiter"+delim.dir](span,hw,delim.stretch,scale,font)}
|
618
|
+
},
|
619
|
+
extendDelimiterV: function (span,H,delim,scale,font) {
|
620
|
+
var stack = this.createStack(span,true);
|
621
|
+
var top = this.createBox(stack), bot = this.createBox(stack);
|
622
|
+
this.createChar(top,(delim.top||delim.ext),scale,font);
|
623
|
+
this.createChar(bot,(delim.bot||delim.ext),scale,font);
|
624
|
+
var ext = {bbox:{w:0,lw:0,rw:0}}, mid = ext;
|
625
|
+
var h = top.bbox.h + top.bbox.d + bot.bbox.h + bot.bbox.d;
|
626
|
+
var y = -top.bbox.h; this.placeBox(top,0,y,true); y -= top.bbox.d;
|
627
|
+
if (delim.mid) {
|
628
|
+
mid = this.createBox(stack); this.createChar(mid,delim.mid,scale,font);
|
629
|
+
h += mid.bbox.h + mid.bbox.d;
|
630
|
+
}
|
631
|
+
if (H > h) {
|
632
|
+
ext = this.Element("span"); this.createChar(ext,delim.ext,scale,font);
|
633
|
+
var eH = ext.bbox.h + ext.bbox.d, eh = eH - .05, n, N, k = (delim.mid ? 2 : 1);
|
634
|
+
N = n = Math.ceil((H-h)/(k*eh));
|
635
|
+
if (!delim.fullExtenders) {eh = (H-h)/(k*n)}
|
636
|
+
var dy = (n/(n+1))*(eH - eh); eh = eH - dy; y += dy + eh - ext.bbox.h;
|
637
|
+
while (k-- > 0) {
|
638
|
+
while (n-- > 0) {y -= eh; this.placeBox(this.addBox(stack,ext.cloneNode(true)),0,y,true)}
|
639
|
+
y += dy - ext.bbox.d;
|
640
|
+
if (delim.mid && k) {
|
641
|
+
this.placeBox(mid,0,y-mid.bbox.h,true); n = N;
|
642
|
+
y += -(mid.bbox.h + mid.bbox.d) + dy + eh - ext.bbox.h;
|
643
|
+
}
|
644
|
+
}
|
645
|
+
} else {
|
646
|
+
y += (h - H)/2;
|
647
|
+
if (delim.mid) {this.placeBox(mid,0,y-mid.bbox.h,true); y += -(mid.bbox.h + mid.bbox.d)}
|
648
|
+
y += (h - H)/2;
|
649
|
+
}
|
650
|
+
this.placeBox(bot,0,y-bot.bbox.h,true); y -= bot.bbox.h + bot.bbox.d;
|
651
|
+
span.bbox = {
|
652
|
+
w: Math.max(top.bbox.w,ext.bbox.w,bot.bbox.w,mid.bbox.w),
|
653
|
+
lw: Math.min(top.bbox.lw,ext.bbox.lw,bot.bbox.lw,mid.bbox.lw),
|
654
|
+
rw: Math.max(top.bbox.rw,ext.bbox.rw,bot.bbox.rw,mid.bbox.rw),
|
655
|
+
h: 0, d: -y
|
656
|
+
}
|
657
|
+
span.scale = scale;
|
658
|
+
span.offset = .55 * span.bbox.w;
|
659
|
+
span.isMultiChar = true;
|
660
|
+
this.setStackWidth(stack,span.bbox.w);
|
661
|
+
},
|
662
|
+
extendDelimiterH: function (span,W,delim,scale,font) {
|
663
|
+
var stack = this.createStack(span,true);
|
664
|
+
var left = this.createBox(stack), right = this.createBox(stack);
|
665
|
+
this.createChar(left,(delim.left||delim.rep),scale,font);
|
666
|
+
this.createChar(right,(delim.right||delim.rep),scale,font);
|
667
|
+
var rep = this.Element("span"); this.createChar(rep,delim.rep,scale,font);
|
668
|
+
var mid = {bbox: {h:-this.BIGDIMEN, d:-this.BIGDIMEN}};
|
669
|
+
this.placeBox(left,-left.bbox.lw,0,true);
|
670
|
+
var w = (left.bbox.rw - left.bbox.lw) + (right.bbox.rw - right.bbox.lw) - .05,
|
671
|
+
x = left.bbox.rw - left.bbox.lw - .025;
|
672
|
+
if (delim.mid) {
|
673
|
+
mid = this.createBox(stack); this.createChar(mid,delim.mid,scale,font);
|
674
|
+
w += mid.bbox.w;
|
675
|
+
}
|
676
|
+
if (W > w) {
|
677
|
+
var rW = rep.bbox.rw-rep.bbox.lw, rw = rW - .05, n, N, k = (delim.mid ? 2 : 1);
|
678
|
+
N = n = Math.ceil((W-w)/(k*rw)); rw = (W-w)/(k*n);
|
679
|
+
var dx = (n/(n+1))*(rW - rw); rw = rW - dx; x -= rep.bbox.lw + dx;
|
680
|
+
while (k-- > 0) {
|
681
|
+
while (n-- > 0) {this.placeBox(this.addBox(stack,rep.cloneNode(true)),x,0,true); x += rw}
|
682
|
+
if (delim.mid && k) {this.placeBox(mid,x,0,true); x += mid.bbox.w - dx; n = N}
|
683
|
+
}
|
684
|
+
} else {
|
685
|
+
x -= (w - W)/2;
|
686
|
+
if (delim.mid) {this.placeBox(mid,x,0,true); x += mid.bbox.w}
|
687
|
+
x -= (w - W)/2;
|
688
|
+
}
|
689
|
+
this.placeBox(right,x,0,true);
|
690
|
+
span.bbox = {
|
691
|
+
w: x+right.bbox.rw, lw: 0, rw: x+right.bbox.rw,
|
692
|
+
H: Math.max(left.bbox.h,rep.bbox.h,right.bbox.h,mid.bbox.h),
|
693
|
+
D: Math.max(left.bbox.d,rep.bbox.d,right.bbox.d,mid.bbox.d),
|
694
|
+
h: rep.bbox.h, d: rep.bbox.d
|
695
|
+
}
|
696
|
+
span.scale = scale;
|
697
|
+
span.isMultiChar = true;
|
698
|
+
this.setStackWidth(stack,span.bbox.w);
|
699
|
+
},
|
700
|
+
createChar: function (span,data,scale,font) {
|
701
|
+
var SPAN = span, text = "", variant = {fonts: [data[1]], noRemap:true};
|
702
|
+
if (font && font === MML.VARIANT.BOLD) {variant.fonts = [data[1]+"-bold",data[1]]}
|
703
|
+
if (typeof(data[1]) !== "string") {variant = data[1]}
|
704
|
+
if (data[0] instanceof Array) {
|
705
|
+
for (var i = 0, m = data[0].length; i < m; i++) {text += String.fromCharCode(data[0][i])}
|
706
|
+
} else {text = String.fromCharCode(data[0])}
|
707
|
+
if (scale !== 1) {
|
708
|
+
SPAN = this.addElement(span,"span",{style:{fontSize: this.Percent(scale)}, scale:scale});
|
709
|
+
this.handleVariant(SPAN,variant,text);
|
710
|
+
span.bbox = SPAN.bbox;
|
711
|
+
} else {this.handleVariant(span,variant,text)}
|
712
|
+
if (data[2]) {span.style.marginLeft = this.Em(data[2])}
|
713
|
+
if (this.AccentBug && span.bbox.w === 0) {
|
714
|
+
// Handle combining characters by adding a non-breaking space and removing that width
|
715
|
+
SPAN.firstChild.nodeValue += this.NBSP;
|
716
|
+
HTMLCSS.createSpace(span,0,0,-span.offsetWidth/HTMLCSS.em);
|
717
|
+
}
|
718
|
+
},
|
719
|
+
positionDelimiter: function (span,h) {
|
720
|
+
h -= span.bbox.h; span.bbox.d -= h; span.bbox.h += h;
|
721
|
+
if (h) {
|
722
|
+
if (this.safariVerticalAlignBug || this.msieVerticalAlignBug || this.konquerorVerticalAlignBug ||
|
723
|
+
(this.operaVerticalAlignBug && span.isMultiChar)) {
|
724
|
+
if (span.firstChild.style.display === "" && span.style.top !== "")
|
725
|
+
{span = span.firstChild; h -= parseFloat(span.style.top)}
|
726
|
+
span.style.position = "relative";
|
727
|
+
span.style.top = this.Em(-h);
|
728
|
+
} else {
|
729
|
+
span.style.verticalAlign = this.Em(h);
|
730
|
+
if (HTMLCSS.ffVerticalAlignBug) {HTMLCSS.createRule(span.parentNode,span.bbox.h,0,0)}
|
731
|
+
}
|
732
|
+
}
|
733
|
+
},
|
734
|
+
|
735
|
+
handleVariant: function (span,variant,text) {
|
736
|
+
var newtext = "", n, c, C, font, noVariant = 1, VARIANT;
|
737
|
+
if (text.length === 0) return;
|
738
|
+
if (!span.bbox) {
|
739
|
+
span.bbox = {
|
740
|
+
w: 0, h: -this.BIGDIMEN, d: -this.BIGDIMEN,
|
741
|
+
rw: -this.BIGDIMEN, lw: this.BIGDIMEN
|
742
|
+
};
|
743
|
+
}
|
744
|
+
if (!variant) {variant = this.FONTDATA.VARIANT[MML.VARIANT.NORMAL]}
|
745
|
+
VARIANT = variant;
|
746
|
+
for (var i = 0, m = text.length; i < m; i++) {
|
747
|
+
variant = VARIANT;
|
748
|
+
n = text.charCodeAt(i); c = text.charAt(i);
|
749
|
+
if (c == this.PLANE1) {
|
750
|
+
i++; n = text.charCodeAt(i) + 0x1D400 - 0xDC00;
|
751
|
+
} else {
|
752
|
+
var id, M, RANGES = this.FONTDATA.RANGES;
|
753
|
+
for (id = 0, M = RANGES.length; id < M; id++) {
|
754
|
+
if (RANGES[id].name === "alpha" && variant.noLowerCase) continue;
|
755
|
+
var N = variant["offset"+RANGES[id].offset];
|
756
|
+
if (N && n >= RANGES[id].low && n <= RANGES[id].high) {
|
757
|
+
if (RANGES[id].remap && RANGES[id].remap[n]) {
|
758
|
+
n = N + RANGES[id].remap[n];
|
759
|
+
} else {
|
760
|
+
n = n - RANGES[id].low + N;
|
761
|
+
if (RANGES[id].add) {n += RANGES[id].add}
|
762
|
+
}
|
763
|
+
if (variant["variant"+RANGES[id].offset])
|
764
|
+
{variant = this.FONTDATA.VARIANT[variant["variant"+RANGES[id].offset]]}
|
765
|
+
break;
|
766
|
+
}
|
767
|
+
}
|
768
|
+
}
|
769
|
+
if (variant.remap && variant.remap[n]) {
|
770
|
+
if (variant.remap[n] instanceof Array) {
|
771
|
+
var remap = variant.remap[n];
|
772
|
+
n = remap[0]; variant = this.FONTDATA.VARIANT[remap[1]];
|
773
|
+
} else {
|
774
|
+
n = variant.remap[n];
|
775
|
+
if (variant.remap.variant) {variant = this.FONTDATA.VARIANT[variant.remap.variant]}
|
776
|
+
}
|
777
|
+
}
|
778
|
+
if (this.FONTDATA.REMAP[n] && !variant.noRemap) {n = this.FONTDATA.REMAP[n]}
|
779
|
+
font = this.lookupChar(variant,n); c = font[n];
|
780
|
+
if (noVariant && !c[5].img) {this.handleFont(span,font); noVariant = 1}
|
781
|
+
newtext = this.handleChar(span,font,c,n,newtext);
|
782
|
+
if (c[0]/1000 > span.bbox.h) {span.bbox.h = c[0]/1000}
|
783
|
+
if (c[1]/1000 > span.bbox.d) {span.bbox.d = c[1]/1000}
|
784
|
+
if (span.bbox.w + c[3]/1000 < span.bbox.lw) {span.bbox.lw = span.bbox.w + c[3]/1000}
|
785
|
+
if (span.bbox.w + c[4]/1000 > span.bbox.rw) {span.bbox.rw = span.bbox.w + c[4]/1000}
|
786
|
+
span.bbox.w += c[2]/1000;
|
787
|
+
}
|
788
|
+
if (newtext.length) {this.addText(span,newtext)}
|
789
|
+
if (span.scale && span.scale !== 1) {
|
790
|
+
span.bbox.h *= span.scale; span.bbox.d *= span.scale;
|
791
|
+
span.bbox.w *= span.scale; span.bbox.lw *= span.scale; span.bbox.rw *= span.scale;
|
792
|
+
}
|
793
|
+
if (text.length == 1 && font.skew && font.skew[n]) {span.bbox.skew = font.skew[n]}
|
794
|
+
},
|
795
|
+
|
796
|
+
handleFont: function (span,font) {
|
797
|
+
span.style.fontFamily = font.family;
|
798
|
+
if (!(HTMLCSS.FontFaceBug && font.isWebFont)) {
|
799
|
+
var style = font.style || this.FONTDATA.DEFAULTSTYLE,
|
800
|
+
weight = font.weight || this.FONTDATA.DEFAULTWEIGHT;
|
801
|
+
if (style !== "normal") {span.style.fontStyle = style}
|
802
|
+
if (weight !== "normal") {span.style.fontWeight = weight}
|
803
|
+
}
|
804
|
+
},
|
805
|
+
|
806
|
+
handleChar: function (span,font,c,n,text) {
|
807
|
+
var C = c[5];
|
808
|
+
if (C.img) {return this.handleImg(span,font,c,n,text)}
|
809
|
+
if (C.c == null) {
|
810
|
+
if (n <= 0xFFFF) {C.c = String.fromCharCode(n)}
|
811
|
+
else {C.c = this.PLANE1 + String.fromCharCode(n-0x1D400+0xDC00)}
|
812
|
+
}
|
813
|
+
if (c[2] || !this.msieAccentBug || text.length) {return text + C.c}
|
814
|
+
// Handle IE accent clipping bug
|
815
|
+
HTMLCSS.createShift(span,c[3]/1000);
|
816
|
+
HTMLCSS.createShift(span,(c[4]-c[3])/1000);
|
817
|
+
this.addText(span,C.c);
|
818
|
+
HTMLCSS.createShift(span,-c[4]/1000);
|
819
|
+
return "";
|
820
|
+
},
|
821
|
+
handleImg: function (span,font,c,n,text) {return text}, // replaced by imageFont extension
|
822
|
+
|
823
|
+
lookupChar: function (variant,n) {
|
824
|
+
var i, m;
|
825
|
+
if (!variant.FONTS) {
|
826
|
+
var FONTS = this.FONTDATA.FONTS;
|
827
|
+
var fonts = (variant.fonts || this.FONTDATA.VARIANT.normal.fonts);
|
828
|
+
if (!(fonts instanceof Array)) {fonts = [fonts]}
|
829
|
+
if (variant.fonts != fonts) {variant.fonts = fonts}
|
830
|
+
variant.FONTS = [];
|
831
|
+
for (i = 0, m = fonts.length; i < m; i++) {
|
832
|
+
if (FONTS[fonts[i]]) {
|
833
|
+
variant.FONTS.push(FONTS[fonts[i]]);
|
834
|
+
FONTS[fonts[i]].name = fonts[i]; // FIXME: should really be in the font files
|
835
|
+
}
|
836
|
+
}
|
837
|
+
}
|
838
|
+
for (i = 0, m = variant.FONTS.length; i < m; i++) {
|
839
|
+
var font = variant.FONTS[i];
|
840
|
+
if (typeof(font) === "string") {
|
841
|
+
delete variant.FONTS; this.loadFont(font);
|
842
|
+
}
|
843
|
+
if (font[n]) {
|
844
|
+
if (font[n].length === 5) {font[n][5] = {}}
|
845
|
+
if (HTMLCSS.allowWebFonts && !font.available)
|
846
|
+
{this.loadWebFont(font)} else {return font}
|
847
|
+
} else {this.findBlock(font,n)}
|
848
|
+
}
|
849
|
+
var unknown = (variant.defaultFont || {family:HTMLCSS.FONTDATA.DEFAULTFAMILY+",serif"});
|
850
|
+
unknown[n] = [800,200,500,0,500,{isUnknown:true}]; // [h,d,w,lw,rw,{data}]
|
851
|
+
return unknown;
|
852
|
+
},
|
853
|
+
|
854
|
+
findBlock: function (font,c) {
|
855
|
+
if (font.Ranges) {
|
856
|
+
// FIXME: do binary search?
|
857
|
+
for (var i = 0, m = font.Ranges.length; i < m; i++) {
|
858
|
+
if (c < font.Ranges[i][0]) return;
|
859
|
+
if (c <= font.Ranges[i][1]) {
|
860
|
+
var file = font.Ranges[i][2];
|
861
|
+
for (var j = font.Ranges.length-1; j >= 0; j--)
|
862
|
+
{if (font.Ranges[j][2] == file) {font.Ranges.splice(j,1)}}
|
863
|
+
this.loadFont(font.directory+"/"+file+".js");
|
864
|
+
}
|
865
|
+
}
|
866
|
+
}
|
867
|
+
},
|
868
|
+
|
869
|
+
loadFont: function (file) {
|
870
|
+
var queue = MathJax.CallBack.Queue();
|
871
|
+
queue.Push(["Require",MathJax.Ajax,this.fontDir+"/"+file]);
|
872
|
+
if (this.imgFonts) {queue.Push(["Require",MathJax.Ajax,this.webfontDir+"/png/"+file])}
|
873
|
+
MathJax.Hub.RestartAfter(queue.Push({}));
|
874
|
+
},
|
875
|
+
|
876
|
+
loadWebFont: function (font) {
|
877
|
+
font.available = font.isWebFont = true;
|
878
|
+
if (HTMLCSS.FontFaceBug) {font.family = font.name}
|
879
|
+
var callback = this.Font.loadWebFont(font);
|
880
|
+
MathJax.Hub.RestartAfter(callback);
|
881
|
+
},
|
882
|
+
|
883
|
+
Element: function (type,def) {
|
884
|
+
var obj = document.createElement(type);
|
885
|
+
for (var i = 1, m = arguments.length; i < m; i++) {
|
886
|
+
if (arguments[i]) {MathJax.Hub.Insert(obj,arguments[i]);}
|
887
|
+
}
|
888
|
+
return obj;
|
889
|
+
},
|
890
|
+
addElement: function (span,type,def) {return span.appendChild(this.Element(type,def))},
|
891
|
+
TextNode: function (text) {return document.createTextNode(text)},
|
892
|
+
addText: function (span,text) {return span.appendChild(this.TextNode(text))},
|
893
|
+
|
894
|
+
BIGDIMEN: 10000000,
|
895
|
+
ID: 0,
|
896
|
+
GetID: function () {this.ID++; return this.ID},
|
897
|
+
|
898
|
+
MATHSPACE: {
|
899
|
+
veryverythinmathspace: 1/18,
|
900
|
+
verythinmathspace: 2/18,
|
901
|
+
thinmathspace: 3/18,
|
902
|
+
mediummathspace: 4/18,
|
903
|
+
thickmathspace: 5/18,
|
904
|
+
verythickmathspace: 6/18,
|
905
|
+
veryverythickmathspace: 7/18,
|
906
|
+
negativeveryverythinmathspace: -1/18,
|
907
|
+
negativeverythinmathspace: -2/18,
|
908
|
+
negativethinmathspace: -3/18,
|
909
|
+
negativemediummathspace: -4/18,
|
910
|
+
negativethickmathspace: -5/18,
|
911
|
+
negativeverythickmathspace: -6/18,
|
912
|
+
negativeveryverythickmathspace: -7/18
|
913
|
+
},
|
914
|
+
|
915
|
+
TeX: {
|
916
|
+
x_height: .430554,
|
917
|
+
quad: 1,
|
918
|
+
num1: .676508,
|
919
|
+
num2: .393732,
|
920
|
+
num3: .44373,
|
921
|
+
denom1: .685951,
|
922
|
+
denom2: .344841,
|
923
|
+
sup1: .412892,
|
924
|
+
sup2: .362892,
|
925
|
+
sup3: .288888,
|
926
|
+
sub1: .15,
|
927
|
+
sub2: .247217,
|
928
|
+
sup_drop: .386108,
|
929
|
+
sub_drop: .05,
|
930
|
+
delim1: 2.39,
|
931
|
+
delim2: 1.0,
|
932
|
+
axis_height: .25,
|
933
|
+
rule_thickness: .06,
|
934
|
+
big_op_spacing1: .111111,
|
935
|
+
big_op_spacing2: .166666,
|
936
|
+
big_op_spacing3: .2,
|
937
|
+
big_op_spacing4: .6,
|
938
|
+
big_op_spacing5: .1,
|
939
|
+
|
940
|
+
scriptspace: .1,
|
941
|
+
nulldelimiterspace: .12,
|
942
|
+
delimiterfactor: 901,
|
943
|
+
delimitershortfall: .1, // originally .3,
|
944
|
+
|
945
|
+
min_rule_thickness: 1.25 // in pixels
|
946
|
+
},
|
947
|
+
|
948
|
+
PLANE1: String.fromCharCode(0xD835),
|
949
|
+
NBSP: String.fromCharCode(0xA0),
|
950
|
+
|
951
|
+
rfuzz: 0 // adjustment to rule placements in roots
|
952
|
+
});
|
953
|
+
|
954
|
+
MML.mbase.Augment({
|
955
|
+
toHTML: function (span) {
|
956
|
+
span = this.HTMLcreateSpan(span);
|
957
|
+
for (var i = 0, m = this.data.length; i < m; i++)
|
958
|
+
{if (this.data[i]) {this.data[i].toHTML(span)}}
|
959
|
+
var stretchy = this.HTMLcomputeBBox(span);
|
960
|
+
var h = span.bbox.h, d = span.bbox.d;
|
961
|
+
for (i = 0, m = stretchy.length; i < m; i++) {stretchy[i].HTMLstretchV(span,h,d)}
|
962
|
+
if (stretchy.length) {this.HTMLcomputeBBox(span,true)}
|
963
|
+
this.HTMLhandleSpace(span);
|
964
|
+
this.HTMLhandleColor(span);
|
965
|
+
return span;
|
966
|
+
},
|
967
|
+
HTMLcomputeBBox: function (span,full) {
|
968
|
+
var i, m, child, bbox, BBOX, hasDimens = 0, width, stretchy = [];
|
969
|
+
BBOX = span.bbox = {};
|
970
|
+
for (i = 0, m = this.data.length; i < m; i++) {
|
971
|
+
var core = this.data[i]; if (!core) continue;
|
972
|
+
if (!full && core.HTMLcanStretch("Vertical"))
|
973
|
+
{stretchy.push(core); core = (core.CoreMO()||core)}
|
974
|
+
this.HTMLcombineBBoxes(core,BBOX);
|
975
|
+
}
|
976
|
+
this.HTMLcleanBBox(BBOX);
|
977
|
+
return stretchy;
|
978
|
+
},
|
979
|
+
HTMLcombineBBoxes: function (core,BBOX) {
|
980
|
+
if (BBOX.w == null) {
|
981
|
+
BBOX.h = BBOX.d = BBOX.H = BBOX.D = BBOX.rw = -HTMLCSS.BIGDIMEN;
|
982
|
+
BBOX.w = 0; BBOX.lw = HTMLCSS.BIGDIMEN;
|
983
|
+
}
|
984
|
+
var child = core.HTMLspanElement(); if (!child || !child.bbox) return;
|
985
|
+
var bbox = child.bbox;
|
986
|
+
if (bbox.d > BBOX.d) {BBOX.d = bbox.d}
|
987
|
+
if (bbox.h > BBOX.h) {BBOX.h = bbox.h}
|
988
|
+
if (bbox.D != null && bbox.D > BBOX.D) {BBOX.D = bbox.D}
|
989
|
+
if (bbox.H != null && bbox.H > BBOX.H) {BBOX.H = bbox.H}
|
990
|
+
if (child.style.paddingLeft) {BBOX.w += parseFloat(child.style.paddingLeft)*(child.scale||1)}
|
991
|
+
if (BBOX.w + bbox.lw < BBOX.lw) {BBOX.lw = BBOX.w + bbox.lw}
|
992
|
+
if (BBOX.w + bbox.rw > BBOX.rw) {BBOX.rw = BBOX.w + bbox.rw}
|
993
|
+
BBOX.w += bbox.w;
|
994
|
+
if (child.style.paddingRight) {BBOX.w += parseFloat(child.style.paddingRight)*(child.scale||1)}
|
995
|
+
if (bbox.width) {BBOX.width = bbox.width}
|
996
|
+
},
|
997
|
+
HTMLcleanBBox: function (BBOX) {
|
998
|
+
if (BBOX.h === this.BIGDIMEN)
|
999
|
+
{BBOX.h = BBOX.d = BBOX.H = BBOX.D = BBOX.w = BBOX.rw = BBOX.lw = 0}
|
1000
|
+
if (BBOX.D <= BBOX.d) {delete BBOX.D}; if (BBOX.H <= BBOX.h) {delete BBOX.H}
|
1001
|
+
},
|
1002
|
+
HTMLcanStretch: function (direction) {
|
1003
|
+
if (this.isEmbellished()) {return this.Core().HTMLcanStretch(direction)}
|
1004
|
+
return false;
|
1005
|
+
},
|
1006
|
+
HTMLstretchH: function (box,W) {return this.HTMLspanElement()},
|
1007
|
+
HTMLstretchV: function (box,h,d) {return this.HTMLspanElement()},
|
1008
|
+
|
1009
|
+
HTMLcreateSpan: function (span) {
|
1010
|
+
if (this.spanID) {
|
1011
|
+
var SPAN = this.HTMLspanElement();
|
1012
|
+
if (SPAN) {
|
1013
|
+
while (SPAN.firstChild) {SPAN.removeChild(SPAN.firstChild)}
|
1014
|
+
SPAN.bbox = {w:0, h:0, d:0, lw:0, rw:0};
|
1015
|
+
SPAN.scale = 1; SPAN.isMultChar = null;
|
1016
|
+
SPAN.style.cssText = "";
|
1017
|
+
return SPAN;
|
1018
|
+
}
|
1019
|
+
}
|
1020
|
+
if (this.href) {span = HTMLCSS.addElement(span,"a",{href:this.href})}
|
1021
|
+
span = HTMLCSS.addElement(span,"span",{className: this.type});
|
1022
|
+
if (HTMLCSS.imgHeightBug) {span.style.display = "inline-block"}
|
1023
|
+
if (this["class"] != null) {span.className += " "+this["class"]}
|
1024
|
+
if (this.style) {span.style.cssText = this.style}
|
1025
|
+
this.spanID = HTMLCSS.GetID(); span.id = (this.id || "MathJax-Span-"+this.spanID);
|
1026
|
+
span.bbox = {w:0, h:0, d:0, lw:0, lr:0};
|
1027
|
+
if (this.href) {span.parentNode.bbox = span.bbox}
|
1028
|
+
return span;
|
1029
|
+
},
|
1030
|
+
HTMLspanElement: function () {
|
1031
|
+
if (!this.spanID) {return null}
|
1032
|
+
return document.getElementById(this.id || "MathJax-Span-"+this.spanID);
|
1033
|
+
},
|
1034
|
+
|
1035
|
+
HTMLhandleVariant: function (span,variant,text) {HTMLCSS.handleVariant(span,variant,text)},
|
1036
|
+
|
1037
|
+
HTMLhandleSize: function (span) {
|
1038
|
+
if (!span.scale) {
|
1039
|
+
span.scale = this.HTMLgetScale();
|
1040
|
+
if (span.scale !== 1) {span.style.fontSize = HTMLCSS.Percent(span.scale)}
|
1041
|
+
}
|
1042
|
+
return span;
|
1043
|
+
},
|
1044
|
+
|
1045
|
+
HTMLhandleColor: function (span) {
|
1046
|
+
var values = this.getValues("mathcolor","color");
|
1047
|
+
if (this.mathbackground) {values.mathbackground = this.mathbackground}
|
1048
|
+
if (this.background) {values.background = this.background}
|
1049
|
+
if (this.style && span.style.backgroundColor) {values.mathbackground = span.style.backgroundColor}
|
1050
|
+
if (values.color && !this.mathcolor) {values.mathcolor = values.color}
|
1051
|
+
if (values.background && !this.mathbackground) {values.mathbackground = values.background}
|
1052
|
+
if (values.mathcolor) {span.style.color = values.mathcolor}
|
1053
|
+
if (values.mathbackground && values.mathbackground !== MML.COLOR.TRANSPARENT) {
|
1054
|
+
var dd = 1/HTMLCSS.em, lW = 0, rW = 0;
|
1055
|
+
if (this.isToken) {lW = span.bbox.lw; rW = span.bbox.rw - span.bbox.w}
|
1056
|
+
if (span.style.paddingLeft !== "") {lW += parseFloat(span.style.paddingLeft)*(span.scale||1)}
|
1057
|
+
if (span.style.paddingRight !== "") {rW -= parseFloat(span.style.paddingRight)*(span.scale||1)}
|
1058
|
+
var W = Math.max(0,HTMLCSS.getW(span) + (HTMLCSS.PaddingWidthBug ? 0 : rW - lW));
|
1059
|
+
if (HTMLCSS.msieCharPaddingWidthBug && span.style.paddingLeft !== "")
|
1060
|
+
{W += parseFloat(span.style.paddingLeft)*(span.scale||1)}
|
1061
|
+
var H = span.bbox.h + span.bbox.d, D = -span.bbox.d;
|
1062
|
+
if (W > 0) {W += 2*dd; lW -= dd}; if (H > 0) {H += 2*dd; D -= dd}; rW = -W-lW;
|
1063
|
+
var frame = HTMLCSS.Element("span",{id:"MathJax-Color-"+this.spanID,
|
1064
|
+
style:{display:"inline-block", backgroundColor:values.mathbackground,
|
1065
|
+
width: HTMLCSS.Em(W), height:HTMLCSS.Em(H), verticalAlign: HTMLCSS.Em(D),
|
1066
|
+
marginLeft: HTMLCSS.Em(lW), marginRight: HTMLCSS.Em(rW)}
|
1067
|
+
});
|
1068
|
+
if (HTMLCSS.msieInlineBlockAlignBug) {
|
1069
|
+
frame.style.position = "relative"; frame.style.width = frame.style.height = 0;
|
1070
|
+
frame.style.verticalAlign = frame.style.marginLeft = frame.style.marginRight = "";
|
1071
|
+
HTMLCSS.placeBox(HTMLCSS.addElement(frame,"span",{
|
1072
|
+
style: {display:"inline-block", position:"absolute", overflow:"hidden",
|
1073
|
+
width: HTMLCSS.Em(W), height: HTMLCSS.Em(H),
|
1074
|
+
background: values.mathbackground}
|
1075
|
+
}),lW,span.bbox.h+dd);
|
1076
|
+
} else {
|
1077
|
+
}
|
1078
|
+
span.parentNode.insertBefore(frame,span);
|
1079
|
+
}
|
1080
|
+
},
|
1081
|
+
HTMLremoveColor: function () {
|
1082
|
+
var color = document.getElementById("MathJax-Color-"+this.spanID);
|
1083
|
+
if (color) {color.parentNode.removeChild(color)}
|
1084
|
+
},
|
1085
|
+
|
1086
|
+
HTMLhandleSpace: function (span) {
|
1087
|
+
if (this.useMMLspacing) {
|
1088
|
+
if (this.type !== "mo") return;
|
1089
|
+
var values = this.getValues("scriptlevel","lspace","rspace");
|
1090
|
+
if (values.scriptlevel <= 0 || this.hasValue("lspace") || this.hasValue("rspace")) {
|
1091
|
+
values.lspace = Math.max(0,HTMLCSS.length2em(values.lspace));
|
1092
|
+
values.rspace = Math.max(0,HTMLCSS.length2em(values.rspace));
|
1093
|
+
var core = this, parent = this.Parent();
|
1094
|
+
while (parent && parent.isEmbellished() && parent.Core() === core)
|
1095
|
+
{core = parent; parent = parent.Parent(); span = core.HTMLspanElement()}
|
1096
|
+
if (values.lspace) {span.style.paddingLeft = HTMLCSS.Em(values.lspace)}
|
1097
|
+
if (values.rspace) {span.style.paddingRight = HTMLCSS.Em(values.rspace)}
|
1098
|
+
}
|
1099
|
+
} else {
|
1100
|
+
var space = this.texSpacing();
|
1101
|
+
if (space !== "") {
|
1102
|
+
space = HTMLCSS.length2em(space)/(span.scale||1);
|
1103
|
+
if (span.style.paddingLeft) {space += parseFloat(span.style.paddingLeft)}
|
1104
|
+
span.style.paddingLeft = HTMLCSS.Em(space);
|
1105
|
+
}
|
1106
|
+
}
|
1107
|
+
},
|
1108
|
+
|
1109
|
+
HTMLgetScale: function () {
|
1110
|
+
var scale = 1, values = this.getValues("mathsize","scriptlevel","fontsize","scriptminsize");
|
1111
|
+
if (this.style) {
|
1112
|
+
var span = this.HTMLspanElement();
|
1113
|
+
if (span.style.fontSize != "") {values.fontsize = span.style.fontSize}
|
1114
|
+
}
|
1115
|
+
if (values.fontsize && !this.mathsize) {values.mathsize = values.fontsize}
|
1116
|
+
if (values.scriptlevel !== 0) {
|
1117
|
+
if (values.scriptlevel > 2) {values.scriptlevel = 2}
|
1118
|
+
scale = Math.pow(this.Get("scriptsizemultiplier"),values.scriptlevel);
|
1119
|
+
values.scriptminsize = HTMLCSS.length2em(values.scriptminsize);
|
1120
|
+
if (scale < values.scriptminsize) {scale = values.scriptminsize}
|
1121
|
+
}
|
1122
|
+
scale *= HTMLCSS.length2em(values.mathsize);
|
1123
|
+
return scale;
|
1124
|
+
},
|
1125
|
+
|
1126
|
+
HTMLgetVariant: function () {
|
1127
|
+
var values = this.getValues("mathvariant","fontfamily","fontweight","fontstyle");
|
1128
|
+
if (this.style) {
|
1129
|
+
var span = this.HTMLspanElement();
|
1130
|
+
if (span.style.fontFamily) {values.fontfamily = span.style.fontFamily}
|
1131
|
+
if (span.style.fontWeight) {values.fontweight = span.style.fontWeight}
|
1132
|
+
if (span.style.fontStyle) {values.fontStyle = span.style.fontStyle}
|
1133
|
+
}
|
1134
|
+
var variant = values.mathvariant; if (this.variantForm) {variant = "-"+HTMLCSS.fontInUse+"-variant"}
|
1135
|
+
if (values.fontfamily && !this.mathvariant) {
|
1136
|
+
if (!values.fontweight && values.mathvariant.match(/bold/)) {values.fontweight = "bold"}
|
1137
|
+
if (!values.fontstyle && values.mathvariant.match(/italic/)) {values.fontstyle = "italic"}
|
1138
|
+
return {FONTS:[], fonts:[], noRemap:true,
|
1139
|
+
defaultFont: {family:values.fontfamily, style:values.fontstyle, weight:values.fontweight}};
|
1140
|
+
}
|
1141
|
+
if (values.fontweight === "bold") {
|
1142
|
+
variant = {
|
1143
|
+
normal:MML.VARIANT.BOLD, italic:MML.VARIANT.BOLDITALIC,
|
1144
|
+
fraktur:MML.VARIANT.BOLDFRAKTUR, script:MML.VARIANT.BOLDSCRIPT,
|
1145
|
+
"sans-serif":MML.VARIANT.BOLDSANSSERIF,
|
1146
|
+
"sans-serif-italic":MML.VARIANT.SANSSERIFBOLDITALIC
|
1147
|
+
}[variant]||variant;
|
1148
|
+
} else if (values.fontweight === "normal") {
|
1149
|
+
variant = {
|
1150
|
+
bold:MML.VARIANT.normal, "bold-italic":MML.VARIANT.ITALIC,
|
1151
|
+
"bold-fraktur":MML.VARIANT.FRAKTUR, "bold-script":MML.VARIANT.SCRIPT,
|
1152
|
+
"bold-sans-serif":MML.VARIANT.SANSSERIF,
|
1153
|
+
"sans-serif-bold-italic":MML.VARIANT.SANSSERIFITALIC
|
1154
|
+
}[variant]||variant;
|
1155
|
+
}
|
1156
|
+
if (values.fontstyle === "italic") {
|
1157
|
+
variant = {
|
1158
|
+
normal:MML.VARIANT.ITALIC, bold:MML.VARIANT.BOLDITALIC,
|
1159
|
+
"sans-serif":MML.VARIANT.SANSSERIFITALIC,
|
1160
|
+
"bold-sans-serif":MML.VARIANT.SANSSERIFBOLDITALIC
|
1161
|
+
}[variant]||variant;
|
1162
|
+
} else if (values.fontstyle === "normal") {
|
1163
|
+
variant = {
|
1164
|
+
italic:MML.VARIANT.NORMAL, "bold-italic":MML.VARIANT.BOLD,
|
1165
|
+
"sans-serif-italic":MML.VARIANT.SANSSERIF,
|
1166
|
+
"sans-serif-bold-italic":MML.VARIANT.BOLDSANSSERIF
|
1167
|
+
}[variant]||variant;
|
1168
|
+
}
|
1169
|
+
return HTMLCSS.FONTDATA.VARIANT[variant];
|
1170
|
+
}
|
1171
|
+
},{
|
1172
|
+
HTMLautoload: function () {
|
1173
|
+
var file = HTMLCSS.autoloadDir+"/"+this.type+".js";
|
1174
|
+
MathJax.Hub.RestartAfter(AJAX.Require(file));
|
1175
|
+
},
|
1176
|
+
|
1177
|
+
HTMLstretchH: function (box,w) {
|
1178
|
+
this.HTMLremoveColor();
|
1179
|
+
return this.toHTML(box,w);
|
1180
|
+
},
|
1181
|
+
|
1182
|
+
HTMLstretchV: function (box,h,d) {
|
1183
|
+
this.HTMLremoveColor();
|
1184
|
+
return this.toHTML(box,h,d);
|
1185
|
+
}
|
1186
|
+
});
|
1187
|
+
|
1188
|
+
MML.chars.Augment({
|
1189
|
+
toHTML: function (span,variant) {
|
1190
|
+
this.HTMLhandleVariant(span,variant,this.data.join("").replace(/[\u2061-\u2064]/g,"")); // remove invisibles
|
1191
|
+
}
|
1192
|
+
});
|
1193
|
+
MML.entity.Augment({
|
1194
|
+
toHTML: function (span,variant) {
|
1195
|
+
this.HTMLhandleVariant(span,variant,this.toString().replace(/[\u2061-\u2064]/g,"")); // remove invisibles
|
1196
|
+
}
|
1197
|
+
});
|
1198
|
+
|
1199
|
+
MML.mi.Augment({
|
1200
|
+
toHTML: function (span) {
|
1201
|
+
span = this.HTMLhandleSize(this.HTMLcreateSpan(span)); span.bbox = null;
|
1202
|
+
var variant = this.HTMLgetVariant();
|
1203
|
+
for (var i = 0, m = this.data.length; i < m; i++)
|
1204
|
+
{if (this.data[i]) {this.data[i].toHTML(span,variant)}}
|
1205
|
+
if (!span.bbox) {span.bbox = {w:0, h:0, d:0, rw:0, lw:0}}
|
1206
|
+
if (this.data.join("").length !== 1) {delete span.bbox.skew}
|
1207
|
+
this.HTMLhandleSpace(span);
|
1208
|
+
this.HTMLhandleColor(span);
|
1209
|
+
return span;
|
1210
|
+
}
|
1211
|
+
});
|
1212
|
+
|
1213
|
+
MML.mn.Augment({
|
1214
|
+
toHTML: function (span) {
|
1215
|
+
span = this.HTMLhandleSize(this.HTMLcreateSpan(span)); span.bbox = null;
|
1216
|
+
var variant = this.HTMLgetVariant();
|
1217
|
+
for (var i = 0, m = this.data.length; i < m; i++)
|
1218
|
+
{if (this.data[i]) {this.data[i].toHTML(span,variant)}}
|
1219
|
+
if (!span.bbox) {span.bbox = {w:0, h:0, d:0, rw:0, lw:0}}
|
1220
|
+
if (this.data.join("").length !== 1) {delete span.bbox.skew}
|
1221
|
+
this.HTMLhandleSpace(span);
|
1222
|
+
this.HTMLhandleColor(span);
|
1223
|
+
return span;
|
1224
|
+
}
|
1225
|
+
});
|
1226
|
+
|
1227
|
+
MML.mo.Augment({
|
1228
|
+
toHTML: function (span) {
|
1229
|
+
span = this.HTMLhandleSize(this.HTMLcreateSpan(span));
|
1230
|
+
if (this.data.length == 0) {return span} else {span.bbox = null}
|
1231
|
+
var text = this.data.join("");
|
1232
|
+
var variant = this.HTMLgetVariant();
|
1233
|
+
var values = this.getValues("largeop","displaystyle");
|
1234
|
+
if (values.largeop)
|
1235
|
+
{variant = HTMLCSS.FONTDATA.VARIANT[values.displaystyle ? "-largeOp" : "-smallOp"]}
|
1236
|
+
for (var i = 0, m = this.data.length; i < m; i++)
|
1237
|
+
{if (this.data[i]) {this.data[i].toHTML(span,variant)}}
|
1238
|
+
if (!span.bbox) {span.bbox = {w:0, h:0, d:0, rw:0, lw:0}}
|
1239
|
+
if (text.length !== 1) {delete span.bbox.skew}
|
1240
|
+
if (HTMLCSS.AccentBug && span.bbox.w === 0 && text.length === 1 && span.firstChild) {
|
1241
|
+
// Handle combining characters by adding a non-breaking space and removing that width
|
1242
|
+
span.firstChild.nodeValue += HTMLCSS.NBSP;
|
1243
|
+
HTMLCSS.createSpace(span,0,0,-span.offsetWidth/HTMLCSS.em);
|
1244
|
+
}
|
1245
|
+
if (values.largeop) {
|
1246
|
+
var p = (span.bbox.h - span.bbox.d)/2 - HTMLCSS.TeX.axis_height*span.scale;
|
1247
|
+
if (HTMLCSS.safariVerticalAlignBug && span.lastChild.nodeName === "IMG") {
|
1248
|
+
span.lastChild.style.verticalAlign =
|
1249
|
+
HTMLCSS.Em(parseFloat(span.lastChild.style.verticalAlign||0)/HTMLCSS.em-p/span.scale);
|
1250
|
+
} else if (HTMLCSS.konquerorVerticalAlignBug && span.lastChild.nodeName === "IMG") {
|
1251
|
+
span.style.position = "relative";
|
1252
|
+
span.lastChild.style.position="relative";
|
1253
|
+
span.lastChild.style.top = HTMLCSS.Em(p/span.scale);
|
1254
|
+
} else {
|
1255
|
+
span.style.verticalAlign = HTMLCSS.Em(-p/span.scale);
|
1256
|
+
}
|
1257
|
+
span.bbox.h -= p; span.bbox.d += p;
|
1258
|
+
if (span.bbox.rw > span.bbox.w) {
|
1259
|
+
span.bbox.ic = span.bbox.rw-span.bbox.w;
|
1260
|
+
HTMLCSS.createBlank(span,span.bbox.ic);
|
1261
|
+
span.bbox.w = span.bbox.rw;
|
1262
|
+
}
|
1263
|
+
}
|
1264
|
+
this.HTMLhandleSpace(span);
|
1265
|
+
this.HTMLhandleColor(span);
|
1266
|
+
return span;
|
1267
|
+
},
|
1268
|
+
HTMLcanStretch: function (direction) {
|
1269
|
+
if (!this.Get("stretchy")) {return false}
|
1270
|
+
var c = this.data.join("");
|
1271
|
+
if (c.length > 1) {return false}
|
1272
|
+
c = HTMLCSS.FONTDATA.DELIMITERS[c.charCodeAt(0)];
|
1273
|
+
return (c && c.dir == direction.substr(0,1));
|
1274
|
+
},
|
1275
|
+
HTMLstretchV: function (box,h,d) {
|
1276
|
+
this.HTMLremoveColor();
|
1277
|
+
var values = this.getValues("symmetric","maxsize","minsize");
|
1278
|
+
var span = this.HTMLspanElement(), H, W = span.bbox.w;
|
1279
|
+
var axis = HTMLCSS.TeX.axis_height, scale = span.scale;
|
1280
|
+
if (values.symmetric) {H = 2*Math.max(h-axis,d+axis)} else {H = h + d}
|
1281
|
+
values.maxsize = HTMLCSS.length2em(values.maxsize,span.bbox.h+span.bbox.d);
|
1282
|
+
values.minsize = HTMLCSS.length2em(values.minsize,span.bbox.h+span.bbox.d);
|
1283
|
+
H = Math.max(values.minsize,Math.min(values.maxsize,H));
|
1284
|
+
span = this.HTMLcreateSpan(box); // clear contents and attributes
|
1285
|
+
HTMLCSS.createDelimiter(span,this.data.join("").charCodeAt(0),H,scale);
|
1286
|
+
if (values.symmetric) {H = (span.bbox.h + span.bbox.d)/2 + axis}
|
1287
|
+
else {H = (span.bbox.h + span.bbox.d) * h/(h + d)}
|
1288
|
+
HTMLCSS.positionDelimiter(span,H);
|
1289
|
+
this.HTMLhandleSpace(span); // add in lspace/rspace, if any
|
1290
|
+
this.HTMLhandleColor(span);
|
1291
|
+
return span;
|
1292
|
+
},
|
1293
|
+
HTMLstretchH: function (box,W) {
|
1294
|
+
this.HTMLremoveColor();
|
1295
|
+
var values = this.getValues("maxsize","minsize","mathvariant","fontweight");
|
1296
|
+
if (values.fontweight === "bold" && !this.mathvariant) {values.mathvariant = MML.VARIANT.BOLD}
|
1297
|
+
var span = this.HTMLspanElement(), scale = span.scale;
|
1298
|
+
values.maxsize = HTMLCSS.length2em(values.maxsize,span.bbox.w);
|
1299
|
+
values.minsize = HTMLCSS.length2em(values.minsize,span.bbox.w);
|
1300
|
+
W = Math.max(values.minsize,Math.min(values.maxsize,W));
|
1301
|
+
span = this.HTMLcreateSpan(box); // clear contents and attributes
|
1302
|
+
HTMLCSS.createDelimiter(span,this.data.join("").charCodeAt(0),W,scale,values.mathvariant);
|
1303
|
+
this.HTMLhandleSpace(span); // add in lspace/rspace, if any
|
1304
|
+
this.HTMLhandleColor(span);
|
1305
|
+
return span;
|
1306
|
+
}
|
1307
|
+
});
|
1308
|
+
|
1309
|
+
MML.mtext.Augment({
|
1310
|
+
toHTML: function (span) {
|
1311
|
+
span = this.HTMLhandleSize(this.HTMLcreateSpan(span)); span.bbox = null;
|
1312
|
+
if (this.Parent().type === "merror") {
|
1313
|
+
// Avoid setting the font style for error text
|
1314
|
+
HTMLCSS.addText(span,this.data.join(""));
|
1315
|
+
var HD = HTMLCSS.getHD(span), W = HTMLCSS.getW(span);
|
1316
|
+
span.bbox = {h: HD.h, d: HD.d, w: W, lw: 0, rw: W};
|
1317
|
+
} else {
|
1318
|
+
var variant = this.HTMLgetVariant();
|
1319
|
+
for (var i = 0, m = this.data.length; i < m; i++)
|
1320
|
+
{if (this.data[i]) {this.data[i].toHTML(span,variant)}}
|
1321
|
+
if (!span.bbox) {span.bbox = {w:0, h:0, d:0, rw:0, lw:0}}
|
1322
|
+
if (this.data.join("").length !== 1) {delete span.bbox.skew}
|
1323
|
+
}
|
1324
|
+
this.HTMLhandleSpace(span);
|
1325
|
+
this.HTMLhandleColor(span);
|
1326
|
+
return span;
|
1327
|
+
}
|
1328
|
+
});
|
1329
|
+
|
1330
|
+
MML.ms.Augment({toHTML: MML.mbase.HTMLautoload});
|
1331
|
+
|
1332
|
+
MML.mglyph.Augment({toHTML: MML.mbase.HTMLautoload});
|
1333
|
+
|
1334
|
+
MML.mspace.Augment({
|
1335
|
+
toHTML: function (span) {
|
1336
|
+
span = this.HTMLhandleSize(this.HTMLcreateSpan(span));
|
1337
|
+
var values = this.getValues("height","depth","width");
|
1338
|
+
values.mathbackground = this.mathbackground;
|
1339
|
+
if (this.background && !this.mathbackground) {values.mathbackground = this.background}
|
1340
|
+
var h = HTMLCSS.length2em(values.height), d = HTMLCSS.length2em(values.depth),
|
1341
|
+
w = HTMLCSS.length2em(values.width);
|
1342
|
+
HTMLCSS.createSpace(span,h,d,w,values.mathbackground);
|
1343
|
+
return span;
|
1344
|
+
}
|
1345
|
+
});
|
1346
|
+
|
1347
|
+
MML.mphantom.Augment({
|
1348
|
+
toHTML: function (span,HW,D) {
|
1349
|
+
span = this.HTMLcreateSpan(span);
|
1350
|
+
var box = HTMLCSS.Measured(this.data[0].toHTML(span),span);
|
1351
|
+
if (D != null) {HTMLCSS.Remeasured(this.data[0].HTMLstretchV(span,HW,D),span)}
|
1352
|
+
else if (HW != null) {HTMLCSS.Remeasured(this.data[0].HTMLstretchH(span,HW),span)}
|
1353
|
+
span.bbox = {w: box.bbox.w, h: box.bbox.h, d: box.bbox.d, lw: 0, rw: 0};
|
1354
|
+
for (var i = 0, m = span.childNodes.length; i < m; i++)
|
1355
|
+
{span.childNodes[i].style.visibility = "hidden"}
|
1356
|
+
this.HTMLhandleSpace(span);
|
1357
|
+
this.HTMLhandleColor(span);
|
1358
|
+
return span;
|
1359
|
+
},
|
1360
|
+
HTMLstretchH: MML.mbase.HTMLstretchH,
|
1361
|
+
HTMLstretchV: MML.mbase.HTMLstretchV
|
1362
|
+
});
|
1363
|
+
|
1364
|
+
MML.mpadded.Augment({
|
1365
|
+
toHTML: function (span,HW,D) {
|
1366
|
+
span = this.HTMLcreateSpan(span);
|
1367
|
+
var stack = HTMLCSS.createStack(span,true);
|
1368
|
+
var box = HTMLCSS.createBox(stack);
|
1369
|
+
HTMLCSS.Measured(this.data[0].toHTML(box),box);
|
1370
|
+
if (D != null) {HTMLCSS.Remeasured(this.data[0].HTMLstretchV(box,HW,D),box)}
|
1371
|
+
else if (HW != null) {HTMLCSS.Remeasured(this.data[0].HTMLstretchH(box,HW),box)}
|
1372
|
+
var values = this.getValues("height","depth","width","lspace","voffset"), x = 0, y = 0, v;
|
1373
|
+
if (values.lspace) {x = this.HTMLlength2em(box,values.lspace)}
|
1374
|
+
if (values.voffset) {y = this.HTMLlength2em(box,values.voffset)}
|
1375
|
+
HTMLCSS.placeBox(box,x,y);
|
1376
|
+
span.bbox = {
|
1377
|
+
h: box.bbox.h, d: box.bbox.d, w: box.bbox.w,
|
1378
|
+
lw: Math.min(0,box.bbox.lw+x), rw: Math.max(box.bbox.w,box.bbox.rw+x),
|
1379
|
+
H: Math.max((box.bbox.H == null ? -HTMLCSS.BIGDIMEN : box.bbox.H),box.bbox.h+y),
|
1380
|
+
D: Math.max((box.bbox.D == null ? -HTMLCSS.BIGDIMEN : box.bbox.D),box.bbox.d-y)
|
1381
|
+
};
|
1382
|
+
if (values.height !== "") {span.bbox.h = this.HTMLlength2em(box,values.height,"h",0)}
|
1383
|
+
if (values.depth !== "") {span.bbox.d = this.HTMLlength2em(box,values.depth,"d",0)}
|
1384
|
+
if (values.width !== "") {span.bbox.w = this.HTMLlength2em(box,values.width,"w",0)}
|
1385
|
+
if (span.bbox.H <= span.bbox.h) {delete span.bbox.H}
|
1386
|
+
if (span.bbox.D <= span.bbox.d) {delete span.bbox.D}
|
1387
|
+
HTMLCSS.setStackWidth(stack,span.bbox.w);
|
1388
|
+
this.HTMLhandleSpace(span);
|
1389
|
+
this.HTMLhandleColor(span);
|
1390
|
+
return span;
|
1391
|
+
},
|
1392
|
+
HTMLlength2em: function (span,length,d,m) {
|
1393
|
+
if (m == null) {m = -HTMLCSS.BIGDIMEN}
|
1394
|
+
var match = String(length).match(/width|height|depth/);
|
1395
|
+
var size = (match ? span.bbox[match[0].charAt(0)] : (d ? span.bbox[d] : null));
|
1396
|
+
var v = HTMLCSS.length2em(length,size);
|
1397
|
+
if (d && String(length).match(/^\s*[-+]/))
|
1398
|
+
{return Math.max(m,span.bbox[d]+v)} else {return v}
|
1399
|
+
},
|
1400
|
+
HTMLstretchH: MML.mbase.HTMLstretchH,
|
1401
|
+
HTMLstretchV: MML.mbase.HTMLstretchV
|
1402
|
+
});
|
1403
|
+
|
1404
|
+
MML.mrow.Augment({
|
1405
|
+
HTMLstretchH: function (box,w) {
|
1406
|
+
this.HTMLremoveColor();
|
1407
|
+
var span = this.HTMLspanElement();
|
1408
|
+
this.data[this.core].HTMLstretchH(span,w);
|
1409
|
+
this.HTMLcomputeBBox(span,true);
|
1410
|
+
this.HTMLhandleColor(span);
|
1411
|
+
return span;
|
1412
|
+
},
|
1413
|
+
HTMLstretchV: function (box,h,d) {
|
1414
|
+
this.HTMLremoveColor();
|
1415
|
+
var span = this.HTMLspanElement();
|
1416
|
+
this.data[this.core].HTMLstretchV(span,h,d);
|
1417
|
+
this.HTMLcomputeBBox(span,true);
|
1418
|
+
this.HTMLhandleColor(span);
|
1419
|
+
return span;
|
1420
|
+
}
|
1421
|
+
});
|
1422
|
+
|
1423
|
+
MML.mstyle.Augment({
|
1424
|
+
toHTML: function (span) {
|
1425
|
+
if (this.data.length) {
|
1426
|
+
span = this.data[0].toHTML(span);
|
1427
|
+
this.spanID = this.data[0].spanID;
|
1428
|
+
this.HTMLhandleSpace(span);
|
1429
|
+
this.HTMLhandleColor(span);
|
1430
|
+
}
|
1431
|
+
return span;
|
1432
|
+
},
|
1433
|
+
HTMLspanElement: function () {
|
1434
|
+
return (this.data.length ? this.data[0].HTMLspanElement() : null);
|
1435
|
+
},
|
1436
|
+
HTMLstretchH: function (box,w) {
|
1437
|
+
return (this.data.length ? this.data[0].HTMLstretchH(box,w) : box);
|
1438
|
+
},
|
1439
|
+
HTMLstretchV: function (box,h,d) {
|
1440
|
+
return (this.data.length ? this.data[0].HTMLstretchV(box,h,d) : box);
|
1441
|
+
}
|
1442
|
+
});
|
1443
|
+
|
1444
|
+
MML.mfrac.Augment({
|
1445
|
+
toHTML: function (span) {
|
1446
|
+
span = this.HTMLcreateSpan(span);
|
1447
|
+
var frac = HTMLCSS.createStack(span);
|
1448
|
+
var num = HTMLCSS.createBox(frac), den = HTMLCSS.createBox(frac);
|
1449
|
+
HTMLCSS.Measured(this.data[0].toHTML(num),num);
|
1450
|
+
HTMLCSS.Measured(this.data[1].toHTML(den),den);
|
1451
|
+
var values = this.getValues("displaystyle","linethickness","numalign","denomalign","bevelled");
|
1452
|
+
var scale = this.HTMLgetScale(), isDisplay = values.displaystyle;
|
1453
|
+
var a = HTMLCSS.TeX.axis_height * scale;
|
1454
|
+
if (values.bevelled) {
|
1455
|
+
var delta = (isDisplay ? .4 : .15);
|
1456
|
+
var H = Math.max(num.bbox.h+num.bbox.d,den.bbox.h+den.bbox.d)+2*delta;
|
1457
|
+
var bevel = HTMLCSS.createBox(frac);
|
1458
|
+
HTMLCSS.createDelimiter(bevel,0x2F,H);
|
1459
|
+
HTMLCSS.placeBox(num,0,(num.bbox.d-num.bbox.h)/2+a+delta);
|
1460
|
+
HTMLCSS.placeBox(bevel,num.bbox.w-delta/2,(bevel.bbox.d-bevel.bbox.h)/2+a);
|
1461
|
+
HTMLCSS.placeBox(den,num.bbox.w+bevel.bbox.w-delta,(den.bbox.d-den.bbox.h)/2+a-delta);
|
1462
|
+
} else {
|
1463
|
+
var W = Math.max(num.bbox.w,den.bbox.w);
|
1464
|
+
var t = HTMLCSS.thickness2em(values.linethickness), p,q, u,v;
|
1465
|
+
var mt = HTMLCSS.TeX.min_rule_thickness/this.em;
|
1466
|
+
if (isDisplay) {u = HTMLCSS.TeX.num1; v = HTMLCSS.TeX.denom1}
|
1467
|
+
else {u = (t === 0 ? HTMLCSS.TeX.num3 : HTMLCSS.TeX.num2); v = HTMLCSS.TeX.denom2}
|
1468
|
+
u *= scale; v *= scale;
|
1469
|
+
if (t === 0) {// \atop
|
1470
|
+
p = Math.max((isDisplay ? 7 : 3) * HTMLCSS.TeX.rule_thickness, 2*mt); // force to at least 2 px
|
1471
|
+
q = (u - num.bbox.d) - (den.bbox.h - v);
|
1472
|
+
if (q < p) {u += (p - q)/2; v += (p - q)/2}
|
1473
|
+
} else {// \over
|
1474
|
+
p = Math.max((isDisplay ? 2 : 0) * mt + t, t/2 + 1.5*mt); // force to be at least 1.5px
|
1475
|
+
q = (u - num.bbox.d) - (a + t/2); if (q < p) {u += p - q}
|
1476
|
+
q = (a - t/2) - (den.bbox.h - v); if (q < p) {v += p - q}
|
1477
|
+
var rule = HTMLCSS.createBox(frac);
|
1478
|
+
HTMLCSS.createRule(rule,t,0,W+2*t);
|
1479
|
+
HTMLCSS.placeBox(rule,0,a-t/2);
|
1480
|
+
}
|
1481
|
+
HTMLCSS.alignBox(num,values.numalign,u);
|
1482
|
+
HTMLCSS.alignBox(den,values.denomalign,-v);
|
1483
|
+
}
|
1484
|
+
this.HTMLhandleSpace(span);
|
1485
|
+
this.HTMLhandleColor(span);
|
1486
|
+
return span;
|
1487
|
+
},
|
1488
|
+
HTMLcanStretch: function (direction) {return false},
|
1489
|
+
HTMLhandleSpace: function (span) {
|
1490
|
+
if (!this.texWithDelims) {
|
1491
|
+
var space = (this.useMMLspacing ? 0 : HTMLCSS.length2em(this.texSpacing()||0)) + .12;
|
1492
|
+
span.style.paddingLeft = HTMLCSS.Em(space);
|
1493
|
+
span.style.paddingRight = ".12em";
|
1494
|
+
}
|
1495
|
+
}
|
1496
|
+
});
|
1497
|
+
|
1498
|
+
MML.msqrt.Augment({
|
1499
|
+
toHTML: function (span) {
|
1500
|
+
span = this.HTMLcreateSpan(span);
|
1501
|
+
var sqrt = HTMLCSS.createStack(span);
|
1502
|
+
var base = HTMLCSS.createBox(sqrt),
|
1503
|
+
rule = HTMLCSS.createBox(sqrt),
|
1504
|
+
surd = HTMLCSS.createBox(sqrt);
|
1505
|
+
HTMLCSS.Measured(this.data[0].toHTML(base),base);
|
1506
|
+
var scale = this.HTMLgetScale();
|
1507
|
+
var t = HTMLCSS.TeX.rule_thickness * scale, p,q, H, W;
|
1508
|
+
if (this.Get("displaystyle")) {p = HTMLCSS.TeX.x_height * scale} else {p = t}
|
1509
|
+
q = Math.max(t + p/4,2*HTMLCSS.TeX.min_rule_thickness/this.em); // force to be at least 2px
|
1510
|
+
H = base.bbox.h + base.bbox.d + q + t;
|
1511
|
+
W = base.bbox.w;
|
1512
|
+
HTMLCSS.createDelimiter(surd,0x221A,H,scale); HTMLCSS.Measured(surd);
|
1513
|
+
var x = 0;
|
1514
|
+
if (surd.isMultiChar || (HTMLCSS.AdjustSurd && HTMLCSS.imgFonts)) {surd.bbox.w *= .95}
|
1515
|
+
if (surd.bbox.h + surd.bbox.d > H) {q += ((surd.bbox.h+surd.bbox.d) - (H-t))/2}
|
1516
|
+
var ruleC = HTMLCSS.FONTDATA.DELIMITERS[HTMLCSS.FONTDATA.RULECHAR];
|
1517
|
+
if (!ruleC || W < ruleC.HW[0][0]*scale || scale < .75) {
|
1518
|
+
HTMLCSS.createRule(rule,t,0,W);
|
1519
|
+
} else {
|
1520
|
+
HTMLCSS.createDelimiter(rule,HTMLCSS.FONTDATA.RULECHAR,W,scale);
|
1521
|
+
}
|
1522
|
+
H = base.bbox.h + q + t;
|
1523
|
+
x = this.HTMLaddRoot(sqrt,surd,x,surd.bbox.h+surd.bbox.d-H,scale);
|
1524
|
+
HTMLCSS.placeBox(surd,x,H-surd.bbox.h);
|
1525
|
+
HTMLCSS.placeBox(rule,x+surd.bbox.w,H-rule.bbox.h+HTMLCSS.rfuzz);
|
1526
|
+
HTMLCSS.placeBox(base,x+surd.bbox.w,0);
|
1527
|
+
span.bbox.h += t;
|
1528
|
+
this.HTMLhandleSpace(span);
|
1529
|
+
this.HTMLhandleColor(span);
|
1530
|
+
return span;
|
1531
|
+
},
|
1532
|
+
HTMLaddRoot: function (sqrt,surd,x,d,scale) {return x}
|
1533
|
+
});
|
1534
|
+
|
1535
|
+
MML.mroot.Augment({
|
1536
|
+
toHTML: MML.msqrt.prototype.toHTML,
|
1537
|
+
HTMLaddRoot: function (sqrt,surd,x,d,scale) {
|
1538
|
+
var box = HTMLCSS.createBox(sqrt);
|
1539
|
+
var root = this.data[1].toHTML(box);
|
1540
|
+
root.style.paddingRight = root.style.paddingLeft = ""; // remove extra padding, if any
|
1541
|
+
HTMLCSS.Measured(root,box);
|
1542
|
+
var h = this.HTMLrootHeight(surd.bbox.h+surd.bbox.d,scale,box)-d;
|
1543
|
+
var w = Math.min(box.bbox.w,box.bbox.rw); // remove extra right-hand padding, if any
|
1544
|
+
x = Math.max(w,surd.offset);
|
1545
|
+
HTMLCSS.placeBox(box,x-w,h);
|
1546
|
+
return x - surd.offset;
|
1547
|
+
},
|
1548
|
+
HTMLrootHeight: function (d,scale,root) {
|
1549
|
+
return .45*(d-.9*scale)+.6*scale + Math.max(0,root.bbox.d-.075);
|
1550
|
+
}
|
1551
|
+
});
|
1552
|
+
|
1553
|
+
MML.mfenced.Augment({
|
1554
|
+
toHTML: function (span) {
|
1555
|
+
span = this.HTMLcreateSpan(span);
|
1556
|
+
if (this.data.open) {this.data.open.toHTML(span)}
|
1557
|
+
if (this.data[0]) {this.data[0].toHTML(span)}
|
1558
|
+
for (var i = 1, m = this.data.length; i < m; i++) {
|
1559
|
+
if (this.data[i]) {
|
1560
|
+
if (this.data["sep"+i]) {this.data["sep"+i].toHTML(span)}
|
1561
|
+
this.data[i].toHTML(span);
|
1562
|
+
}
|
1563
|
+
}
|
1564
|
+
if (this.data.close) {this.data.close.toHTML(span)}
|
1565
|
+
var stretchy = this.HTMLcomputeBBox(span);
|
1566
|
+
var h = span.bbox.h, d = span.bbox.d;
|
1567
|
+
for (i = 0, m = stretchy.length; i < m; i++) {stretchy[i].HTMLstretchV(span,h,d)}
|
1568
|
+
if (stretchy.length) {this.HTMLcomputeBBox(span,true)}
|
1569
|
+
this.HTMLhandleSpace(span);
|
1570
|
+
this.HTMLhandleColor(span);
|
1571
|
+
return span;
|
1572
|
+
},
|
1573
|
+
HTMLcomputeBBox: function (span,full) {
|
1574
|
+
var i, m, child, bbox, BBOX, hasDimens = 0, width, stretchy = [];
|
1575
|
+
BBOX = span.bbox = {};
|
1576
|
+
this.HTMLcheckStretchy(this.data.open,BBOX,stretchy,full);
|
1577
|
+
this.HTMLcheckStretchy(this.data[0],BBOX,stretchy,full);
|
1578
|
+
for (i = 1, m = this.data.length; i < m; i++) {
|
1579
|
+
if (this.data[i]) {
|
1580
|
+
this.HTMLcheckStretchy(this.data["sep"+i],BBOX,stretchy,full);
|
1581
|
+
this.HTMLcheckStretchy(this.data[i],BBOX,stretchy,full);
|
1582
|
+
}
|
1583
|
+
}
|
1584
|
+
this.HTMLcheckStretchy(this.data.close,BBOX,stretchy,full);
|
1585
|
+
this.HTMLcleanBBox(BBOX);
|
1586
|
+
return stretchy;
|
1587
|
+
},
|
1588
|
+
HTMLcheckStretchy: function (core,BBOX,stretchy,full) {
|
1589
|
+
if (core) {
|
1590
|
+
if (!full && core.HTMLcanStretch("Vertical"))
|
1591
|
+
{stretchy.push(core); core = (core.CoreMO()||core)}
|
1592
|
+
this.HTMLcombineBBoxes(core,BBOX);
|
1593
|
+
}
|
1594
|
+
}
|
1595
|
+
});
|
1596
|
+
|
1597
|
+
MML.menclose.Augment({toHTML: MML.mbase.HTMLautoload});
|
1598
|
+
|
1599
|
+
MML.semantics.Augment({
|
1600
|
+
toHTML: function (span) {
|
1601
|
+
if (this.data.length) {
|
1602
|
+
span = this.data[0].toHTML(span);
|
1603
|
+
this.spanID = this.data[0].spanID;
|
1604
|
+
this.HTMLhandleSpace(span);
|
1605
|
+
}
|
1606
|
+
return span;
|
1607
|
+
},
|
1608
|
+
HTMLspanElement: function () {
|
1609
|
+
return (this.data.length ? this.data[0].HTMLspanElement() : null);
|
1610
|
+
},
|
1611
|
+
HTMLstretchH: function (box,w) {
|
1612
|
+
return (this.data.length ? this.data[0].HTMLstretchH(box,w) : box);
|
1613
|
+
},
|
1614
|
+
HTMLstretchV: function (box,h,d) {
|
1615
|
+
return (this.data.length ? this.data[0].HTMLstretchV(box,h,d) : box);
|
1616
|
+
}
|
1617
|
+
});
|
1618
|
+
|
1619
|
+
MML.munderover.Augment({
|
1620
|
+
toHTML: function (span,HW,D) {
|
1621
|
+
var values = this.getValues("displaystyle","accent","accentunder","align");
|
1622
|
+
if (!values.displaystyle && this.data[this.base].Get("movablelimits"))
|
1623
|
+
{return MML.msubsup.prototype.toHTML.call(this,span)}
|
1624
|
+
span = this.HTMLcreateSpan(span); var scale = this.HTMLgetScale();
|
1625
|
+
var stack = HTMLCSS.createStack(span);
|
1626
|
+
var boxes = [], stretch = [], box, i, m, W = -HTMLCSS.BIGDIMEN, WW = W;
|
1627
|
+
for (i = 0, m = this.data.length; i < m; i++) {
|
1628
|
+
if (this.data[i]) {
|
1629
|
+
box = boxes[i] = HTMLCSS.createBox(stack);
|
1630
|
+
HTMLCSS.Measured(this.data[i].toHTML(box),box);
|
1631
|
+
if (i == this.base) {
|
1632
|
+
if (D != null) {HTMLCSS.Remeasured(this.data[this.base].HTMLstretchV(box,HW,D),box)}
|
1633
|
+
else if (HW != null) {HTMLCSS.Remeasured(this.data[this.base].HTMLstretchH(box,HW),box)}
|
1634
|
+
stretch[i] = (D == null && HW != null ? false :
|
1635
|
+
this.data[i].HTMLcanStretch("Horizontal"));
|
1636
|
+
} else {
|
1637
|
+
stretch[i] = this.data[i].HTMLcanStretch("Horizontal");
|
1638
|
+
}
|
1639
|
+
if (box.bbox.w > WW) {WW = box.bbox.w}
|
1640
|
+
if (!stretch[i] && WW > W) {W = WW}
|
1641
|
+
}
|
1642
|
+
}
|
1643
|
+
if (W == -HTMLCSS.BIGDIMEN) {W = WW}
|
1644
|
+
if (D == null && HW != null) {W = WW = HW}
|
1645
|
+
var t = HTMLCSS.TeX.rule_thickness, factor = HTMLCSS.FONTDATA.TeX_factor;
|
1646
|
+
var base = boxes[this.base], delta = (base.bbox.ic || 0);
|
1647
|
+
var x, y, z1, z2, z3, dw, k;
|
1648
|
+
for (i = 0, m = this.data.length; i < m; i++) {
|
1649
|
+
if (this.data[i]) {
|
1650
|
+
box = boxes[i];
|
1651
|
+
if (stretch[i]) {box.bbox = this.data[i].HTMLstretchH(box,W).bbox}
|
1652
|
+
z3 = HTMLCSS.TeX.big_op_spacing5 * scale;
|
1653
|
+
var accent = (i != this.base && values[this.ACCENTS[i]]);
|
1654
|
+
if (accent && box.bbox.w <= 1/HTMLCSS.em+.0001) { // images can get the width off by 1px
|
1655
|
+
box.bbox.w = box.bbox.rw - box.bbox.lw; box.bbox.noclip = true;
|
1656
|
+
if (box.bbox.lw)
|
1657
|
+
{box.insertBefore(HTMLCSS.createSpace(box.parentNode,0,0,-box.bbox.lw),box.firstChild)}
|
1658
|
+
HTMLCSS.createBlank(box,0,0,box.bbox.rw+.1);
|
1659
|
+
}
|
1660
|
+
dw = {left:0, center:(W-box.bbox.w)/2, right:W-box.bbox.w}[values.align];
|
1661
|
+
x = dw; y = 0;
|
1662
|
+
if (i == this.over) {
|
1663
|
+
if (accent) {
|
1664
|
+
k = Math.max(t * scale * factor,2.5/this.em); z3 = 0;
|
1665
|
+
if (base.bbox.skew) {x += base.bbox.skew}
|
1666
|
+
} else {
|
1667
|
+
z1 = HTMLCSS.TeX.big_op_spacing1 * scale * factor;
|
1668
|
+
z2 = HTMLCSS.TeX.big_op_spacing3 * scale * factor;
|
1669
|
+
k = Math.max(z1,z2-Math.max(0,box.bbox.d));
|
1670
|
+
}
|
1671
|
+
k = Math.max(k,1.5/this.em); // force to be at least 1.5px
|
1672
|
+
x += delta; y = base.bbox.h + box.bbox.d + k;
|
1673
|
+
box.bbox.h += z3;
|
1674
|
+
} else if (i == this.under) {
|
1675
|
+
if (accent) {
|
1676
|
+
k = 3*t * scale * factor; z3 = 0;
|
1677
|
+
} else {
|
1678
|
+
z1 = HTMLCSS.TeX.big_op_spacing2 * scale * factor;
|
1679
|
+
z2 = HTMLCSS.TeX.big_op_spacing4 * scale * factor;
|
1680
|
+
k = Math.max(z1,z2-box.bbox.h);
|
1681
|
+
}
|
1682
|
+
k = Math.max(k,1.5/this.em); // force to be at least 1.5px
|
1683
|
+
x -= delta; y = -(base.bbox.d + box.bbox.h + k);
|
1684
|
+
box.bbox.d += z3;
|
1685
|
+
}
|
1686
|
+
HTMLCSS.placeBox(box,x,y);
|
1687
|
+
}
|
1688
|
+
}
|
1689
|
+
this.HTMLhandleSpace(span);
|
1690
|
+
this.HTMLhandleColor(span);
|
1691
|
+
return span;
|
1692
|
+
},
|
1693
|
+
HTMLstretchH: MML.mbase.HTMLstretchH,
|
1694
|
+
HTMLstretchV: MML.mbase.HTMLstretchV
|
1695
|
+
});
|
1696
|
+
|
1697
|
+
MML.msubsup.Augment({
|
1698
|
+
toHTML: function (span,HW,D) {
|
1699
|
+
span = this.HTMLcreateSpan(span); var scale = this.HTMLgetScale();
|
1700
|
+
var stack = HTMLCSS.createStack(span), script, box, values;
|
1701
|
+
var base = HTMLCSS.createBox(stack);
|
1702
|
+
HTMLCSS.Measured(this.data[this.base].toHTML(base),base);
|
1703
|
+
if (D != null) {HTMLCSS.Remeasured(this.data[this.base].HTMLstretchV(base,HW,D),base)}
|
1704
|
+
else if (HW != null) {HTMLCSS.Remeasured(this.data[this.base].HTMLstretchH(base,HW),base)}
|
1705
|
+
HTMLCSS.placeBox(base,0,0);
|
1706
|
+
var sscale = (this.data[this.sup] || this.data[this.sub]).HTMLgetScale();
|
1707
|
+
var x_height = HTMLCSS.TeX.x_height * scale,
|
1708
|
+
s = HTMLCSS.TeX.scriptspace * scale * .75; // FIXME: .75 can be removed when IC is right?
|
1709
|
+
var sup, sub;
|
1710
|
+
if (this.data[this.sup]) {
|
1711
|
+
sup = HTMLCSS.createBox(stack);
|
1712
|
+
HTMLCSS.Measured(this.data[this.sup].toHTML(sup),sup);
|
1713
|
+
sup.bbox.w += s; sup.bbox.rw = Math.max(sup.bbox.w,sup.bbox.rw);
|
1714
|
+
}
|
1715
|
+
if (this.data[this.sub]) {
|
1716
|
+
sub = HTMLCSS.createBox(stack);
|
1717
|
+
HTMLCSS.Measured(this.data[this.sub].toHTML(sub),sub);
|
1718
|
+
sub.bbox.w += s; sub.bbox.rw = Math.max(sub.bbox.w,sub.bbox.rw);
|
1719
|
+
}
|
1720
|
+
var q = HTMLCSS.TeX.sup_drop * sscale, r = HTMLCSS.TeX.sub_drop * sscale;
|
1721
|
+
var u = base.bbox.h - q, v = base.bbox.d + r, delta = 0, p;
|
1722
|
+
if (base.bbox.ic) {delta = base.bbox.ic}
|
1723
|
+
if (this.data[this.base].type === "mi" || this.data[this.base].type === "mo") {
|
1724
|
+
if (this.data[this.base].data.join("").length === 1 && base.bbox.scale === 1 &&
|
1725
|
+
!this.data[this.base].Get("largeop")) {u = v = 0}
|
1726
|
+
}
|
1727
|
+
var min = this.getValues("subscriptshift","superscriptshift");
|
1728
|
+
min.subscriptshift = (min.subscriptshift === "" ? 0 : HTMLCSS.length2em(min.subscriptshift));
|
1729
|
+
min.superscriptshift = (min.superscriptshift === "" ? 0 : HTMLCSS.length2em(min.superscriptshift));
|
1730
|
+
if (!sup) {
|
1731
|
+
v = Math.max(v,HTMLCSS.TeX.sub1*scale,sub.bbox.h-(4/5)*x_height,min.subscriptshift);
|
1732
|
+
HTMLCSS.placeBox(sub,base.bbox.w+s-delta,-v,sub.bbox);
|
1733
|
+
} else {
|
1734
|
+
if (!sub) {
|
1735
|
+
var values = this.getValues("displaystyle","texprimestyle");
|
1736
|
+
p = HTMLCSS.TeX[(values.displaystyle ? "sup1" : (values.texprimestyle ? "sup3" : "sup2"))];
|
1737
|
+
u = Math.max(u,p*scale,sup.bbox.d+(1/4)*x_height,min.superscriptshift);
|
1738
|
+
HTMLCSS.placeBox(sup,base.bbox.w+s,u,sup.bbox);
|
1739
|
+
} else {
|
1740
|
+
v = Math.max(v,HTMLCSS.TeX.sub2*scale);
|
1741
|
+
var t = HTMLCSS.TeX.rule_thickness * scale;
|
1742
|
+
if ((u - sup.bbox.d) - (sub.bbox.h - v) < 3*t) {
|
1743
|
+
v = 3*t - u + sup.bbox.d + sub.bbox.h;
|
1744
|
+
q = (4/5)*x_height - (u - sup.bbox.d) + .05*scale*0;
|
1745
|
+
if (q > 0) {u += q; v -= q}
|
1746
|
+
}
|
1747
|
+
HTMLCSS.placeBox(sup,base.bbox.w+s,Math.max(u,min.superscriptshift));
|
1748
|
+
HTMLCSS.placeBox(sub,base.bbox.w+s-delta,-Math.max(v,min.subscriptshift));
|
1749
|
+
}
|
1750
|
+
}
|
1751
|
+
this.HTMLhandleSpace(span);
|
1752
|
+
this.HTMLhandleColor(span);
|
1753
|
+
return span;
|
1754
|
+
},
|
1755
|
+
HTMLstretchH: MML.mbase.HTMLstretchH,
|
1756
|
+
HTMLstretchV: MML.mbase.HTMLstretchV
|
1757
|
+
});
|
1758
|
+
|
1759
|
+
MML.mtable.Augment({
|
1760
|
+
toHTML: function (span) {
|
1761
|
+
span = this.HTMLcreateSpan(span);
|
1762
|
+
if (this.data.length === 0) {return span}
|
1763
|
+
var values = this.getValues("columnalign","columnspacing","rowspacing",
|
1764
|
+
"align","useHeight","width","side","minlabelspacing");
|
1765
|
+
var WIDTH = (values.width === "auto" ? null : values.width);
|
1766
|
+
var COLWIDTH = (WIDTH ? "100%" : null);
|
1767
|
+
var stack = HTMLCSS.createStack(span,false,WIDTH);
|
1768
|
+
var scale = this.HTMLgetScale(); var LABEL = -1;
|
1769
|
+
//
|
1770
|
+
// Create cells and measure columns and rows
|
1771
|
+
//
|
1772
|
+
var H = [], D = [], W = [], A = [], i, j, J = 0, m, M, s, row, C = [];
|
1773
|
+
var LHD = HTMLCSS.FONTDATA.baselineskip * scale * values.useHeight,
|
1774
|
+
LH = HTMLCSS.FONTDATA.lineH * scale, LD = HTMLCSS.FONTDATA.lineD * scale;
|
1775
|
+
for (i = 0, m = this.data.length; i < m; i++) {
|
1776
|
+
row = this.data[i]; s = (row.type === "mlabeledtr" ? LABEL : 0);
|
1777
|
+
A[i] = []; H[i] = 0; D[i] = 0;
|
1778
|
+
for (j = s, M = row.data.length + s; j < M; j++) {
|
1779
|
+
if (W[j] == null) {
|
1780
|
+
W[j] = -HTMLCSS.BIGDIMEN; if (j > J) {J =j}
|
1781
|
+
// FIXME: these widths should come from columnwidths attribute
|
1782
|
+
C[j] = HTMLCSS.createStack(HTMLCSS.createBox(stack,COLWIDTH),false,COLWIDTH);
|
1783
|
+
}
|
1784
|
+
A[i][j] = HTMLCSS.createBox(C[j]);
|
1785
|
+
HTMLCSS.Measured(row.data[j-s].toHTML(A[i][j]),A[i][j]);
|
1786
|
+
if (A[i][j].bbox.h > H[i]) {H[i] = A[i][j].bbox.h}
|
1787
|
+
if (A[i][j].bbox.d > D[i]) {D[i] = A[i][j].bbox.d}
|
1788
|
+
if (A[i][j].bbox.w > W[j]) {W[j] = A[i][j].bbox.w}
|
1789
|
+
}
|
1790
|
+
}
|
1791
|
+
H[0] = Math.max(H[0],LH); D[A.length-1] = Math.max(D[A.length-1],LD);
|
1792
|
+
//
|
1793
|
+
// Determine spacing and alignment
|
1794
|
+
//
|
1795
|
+
var CSPACE = values.columnspacing.split(/ /),
|
1796
|
+
RSPACE = values.rowspacing.split(/ /),
|
1797
|
+
CALIGN = values.columnalign.split(/ /);
|
1798
|
+
for (i = 0, m = CSPACE.length; i < m; i++) {CSPACE[i] = HTMLCSS.length2em(CSPACE[i])}
|
1799
|
+
for (i = 0, m = RSPACE.length; i < m; i++) {RSPACE[i] = HTMLCSS.length2em(RSPACE[i])}
|
1800
|
+
while (CSPACE.length <= J) {CSPACE.push(CSPACE[CSPACE.length-1])}
|
1801
|
+
while (CALIGN.length <= J) {CALIGN.push(CALIGN[CALIGN.length-1])}
|
1802
|
+
while (RSPACE.length <= A.length) {RSPACE.push(RSPACE[RSPACE.length-1])}
|
1803
|
+
if (C[LABEL]) {
|
1804
|
+
CALIGN[LABEL] = (values.side.substr(0,1) === "l" ? "left" : "right");
|
1805
|
+
CSPACE[LABEL] = -W[LABEL];
|
1806
|
+
}
|
1807
|
+
//
|
1808
|
+
// Determine array total height
|
1809
|
+
//
|
1810
|
+
var HD = H[0] + D[A.length-1];
|
1811
|
+
for (i = 0, m = A.length-1; i < m; i++) {HD += Math.max(LHD,D[i]+H[i+1]+RSPACE[i])}
|
1812
|
+
//
|
1813
|
+
// Compute alignment
|
1814
|
+
//
|
1815
|
+
var Y = HD/2 + HTMLCSS.TeX.axis_height*scale - H[0];
|
1816
|
+
//
|
1817
|
+
// Lay out array by columns
|
1818
|
+
//
|
1819
|
+
var x = 0, y = Y; s = (C[LABEL] ? LABEL : 0);
|
1820
|
+
for (j = s; j <= J; j++) {
|
1821
|
+
for (i = 0, m = A.length; i < m; i++) {
|
1822
|
+
s = (this.data[i].type === "mlabeledtr" ? LABEL : 0);
|
1823
|
+
if (A[i][j])
|
1824
|
+
{HTMLCSS.alignBox(A[i][j],(this.data[i].data[j-s].columnalign||CALIGN[j]),y)}
|
1825
|
+
if (i < A.length-1) {y -= Math.max(LHD,D[i]+H[i+1]+ RSPACE[i])}
|
1826
|
+
}
|
1827
|
+
HTMLCSS.placeBox(C[j].parentNode,x,0);
|
1828
|
+
x += W[j] + CSPACE[j]; y = Y;
|
1829
|
+
}
|
1830
|
+
//
|
1831
|
+
// Place the labels, if any
|
1832
|
+
//
|
1833
|
+
if (C[LABEL]) {
|
1834
|
+
var eqn = HTMLCSS.createStack(span,false,"100%");
|
1835
|
+
var align = HTMLCSS.config.styles[".MathJax_Display"]["text-align"];
|
1836
|
+
HTMLCSS.addBox(eqn,stack); HTMLCSS.alignBox(stack,align,0);
|
1837
|
+
HTMLCSS.addBox(eqn,C[LABEL]); HTMLCSS.alignBox(C[LABEL],CALIGN[LABEL],0);
|
1838
|
+
C[LABEL].style.marginRight = C[LABEL].style.marginLeft =
|
1839
|
+
HTMLCSS.Em(HTMLCSS.length2em(values.minlabelspacing));
|
1840
|
+
}
|
1841
|
+
//
|
1842
|
+
// Finish the table
|
1843
|
+
//
|
1844
|
+
this.HTMLhandleSpace(span);
|
1845
|
+
this.HTMLhandleColor(span);
|
1846
|
+
return span;
|
1847
|
+
},
|
1848
|
+
HTMLhandleSpace: function (span) {
|
1849
|
+
span.style.paddingLeft = span.style.paddingRight = ".1667em";
|
1850
|
+
}
|
1851
|
+
});
|
1852
|
+
|
1853
|
+
MML.math.Augment({
|
1854
|
+
toHTML: function (span,node) {
|
1855
|
+
var alttext = this.Get("alttext"); if (alttext) {node.setAttribute("aria-label",alttext)}
|
1856
|
+
var nobr = HTMLCSS.addElement(span,"nobr",{style:{visibility:"hidden"}});
|
1857
|
+
span = this.HTMLcreateSpan(nobr);
|
1858
|
+
var stack = HTMLCSS.createStack(span);
|
1859
|
+
var box = HTMLCSS.createBox(stack);
|
1860
|
+
if (HTMLCSS.msieColorBug) {
|
1861
|
+
this.data[0].background = this.background;
|
1862
|
+
this.data[0].mathbackground = this.mathbackground;
|
1863
|
+
delete this.background; delete this.mathbackground;
|
1864
|
+
}
|
1865
|
+
var math = HTMLCSS.Measured(this.data[0].toHTML(box),box);
|
1866
|
+
HTMLCSS.placeBox(box,0,0);
|
1867
|
+
if (math.bbox.width != null) {
|
1868
|
+
stack.style.width = math.bbox.width;
|
1869
|
+
box.style.width = "100%";
|
1870
|
+
}
|
1871
|
+
this.HTMLhandleColor(span);
|
1872
|
+
HTMLCSS.createRule(span,math.bbox.h,math.bbox.d,0);
|
1873
|
+
nobr.style.visibility = "";
|
1874
|
+
return span;
|
1875
|
+
}
|
1876
|
+
});
|
1877
|
+
|
1878
|
+
MML.TeXAtom.Augment({
|
1879
|
+
toHTML: function (span) {
|
1880
|
+
span = this.HTMLcreateSpan(span);
|
1881
|
+
if (this.texClass === MML.TEXCLASS.VCENTER) {
|
1882
|
+
var stack = HTMLCSS.createStack(span);
|
1883
|
+
var box = HTMLCSS.createBox(stack);
|
1884
|
+
HTMLCSS.Measured(this.data[0].toHTML(box),box);
|
1885
|
+
// FIXME: should the axis height be scaled?
|
1886
|
+
HTMLCSS.placeBox(box,0,HTMLCSS.TeX.axis_height-(box.bbox.h+box.bbox.d)/2+box.bbox.d);
|
1887
|
+
} else {
|
1888
|
+
span.bbox = this.data[0].toHTML(span).bbox;
|
1889
|
+
}
|
1890
|
+
this.HTMLhandleSpace(span);
|
1891
|
+
this.HTMLhandleColor(span);
|
1892
|
+
return span;
|
1893
|
+
}
|
1894
|
+
});
|
1895
|
+
|
1896
|
+
//
|
1897
|
+
// Handle browser-specific setup
|
1898
|
+
//
|
1899
|
+
MathJax.Hub.Browser.Select({
|
1900
|
+
MSIE: function (browser) {
|
1901
|
+
var isIE7 = browser.versionAtLeast("7.0");
|
1902
|
+
var isIE8 = browser.versionAtLeast("8.0") && document.documentMode > 7;
|
1903
|
+
var quirks = (document.compatMode === "BackCompat");
|
1904
|
+
// MSIE can't measure widths properly without this
|
1905
|
+
HTMLCSS.config.styles[".MathJax span"] = {position: "relative"};
|
1906
|
+
// FIXME: work out tests for these?
|
1907
|
+
HTMLCSS.Augment({
|
1908
|
+
getMarginScale: HTMLCSS.getMSIEmarginScale,
|
1909
|
+
PaddingWidthBug: true,
|
1910
|
+
msieAccentBug: true,
|
1911
|
+
msieColorBug: true,
|
1912
|
+
msieMarginWidthBug: true,
|
1913
|
+
msiePaddingWidthBug: true,
|
1914
|
+
msieCharPaddingWidthBug: (isIE8 && !quirks),
|
1915
|
+
msieBorderWidthBug: quirks,
|
1916
|
+
msieInlineBlockAlignBug: (!isIE8 || quirks),
|
1917
|
+
msieVerticalAlignBug: (isIE8 && !quirks),
|
1918
|
+
msiePlaceBoxBug: (isIE8 && !quirks),
|
1919
|
+
msieClipRectBug: !isIE8,
|
1920
|
+
msieNegativeSpaceBug: quirks,
|
1921
|
+
negativeSkipBug: true,
|
1922
|
+
msieIE6: !isIE7,
|
1923
|
+
msieItalicWidthBug: true,
|
1924
|
+
FontFaceBug: true,
|
1925
|
+
allowWebFonts: "eot"
|
1926
|
+
});
|
1927
|
+
},
|
1928
|
+
|
1929
|
+
Firefox: function (browser) {
|
1930
|
+
var webFonts = false;
|
1931
|
+
if (browser.versionAtLeast("3.5")) {
|
1932
|
+
var root = String(document.location).replace(/[^\/]*$/,"");
|
1933
|
+
if (document.location.protocol !== "file:" ||
|
1934
|
+
(MathJax.Hub.config.root+"/").substr(0,root.length) === root) {webFonts = "otf"}
|
1935
|
+
}
|
1936
|
+
HTMLCSS.Augment({
|
1937
|
+
ffVerticalAlignBug: true,
|
1938
|
+
AccentBug: true,
|
1939
|
+
allowWebFonts: webFonts
|
1940
|
+
});
|
1941
|
+
},
|
1942
|
+
|
1943
|
+
Safari: function (browser) {
|
1944
|
+
var v3p0 = browser.versionAtLeast("3.0");
|
1945
|
+
var v3p1 = browser.versionAtLeast("3.1");
|
1946
|
+
browser.isMobile = (navigator.appVersion.match(/Mobile/i) != null);
|
1947
|
+
HTMLCSS.Augment({
|
1948
|
+
rfuzz: .05,
|
1949
|
+
AccentBug: true,
|
1950
|
+
AdjustSurd: true,
|
1951
|
+
safariNegativeSpaceBug: true,
|
1952
|
+
safariVerticalAlignBug: !v3p1,
|
1953
|
+
safariTextNodeBug: !v3p0,
|
1954
|
+
safariWebFontSerif: ["serif"],
|
1955
|
+
allowWebFonts: (v3p1 && !browser.isMobile ? (browser.isPC ? "svg" : "otf") : false)
|
1956
|
+
});
|
1957
|
+
},
|
1958
|
+
|
1959
|
+
Chrome: function (browser) {
|
1960
|
+
HTMLCSS.Augment({
|
1961
|
+
rfuzz: .05,
|
1962
|
+
AccentBug: true,
|
1963
|
+
AdjustSurd: true,
|
1964
|
+
allowWebFonts: "svg",
|
1965
|
+
safariNegativeSpaceBug: true,
|
1966
|
+
safariWebFontSerif: [""]
|
1967
|
+
});
|
1968
|
+
},
|
1969
|
+
|
1970
|
+
Opera: function (browser) {
|
1971
|
+
HTMLCSS.config.styles[".MathJax .merror"]["vertical-align"] = null;
|
1972
|
+
HTMLCSS.Augment({
|
1973
|
+
operaHeightBug: true,
|
1974
|
+
operaVerticalAlignBug: true,
|
1975
|
+
negativeSkipBug: true,
|
1976
|
+
FontFaceBug: true,
|
1977
|
+
PaddingWidthBug: true,
|
1978
|
+
allowWebFonts: (browser.versionAtLeast("10.0") ? "otf" : false)
|
1979
|
+
});
|
1980
|
+
},
|
1981
|
+
|
1982
|
+
Konqueror: function (browser) {
|
1983
|
+
HTMLCSS.Augment({
|
1984
|
+
konquerorVerticalAlignBug: true
|
1985
|
+
});
|
1986
|
+
}
|
1987
|
+
});
|
1988
|
+
|
1989
|
+
HTMLCSS.loadComplete("jax.js");
|
1990
|
+
|
1991
|
+
})(MathJax.ElementJax.mml, MathJax.Ajax, MathJax.OutputJax["HTML-CSS"]);
|