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.

Files changed (463) hide show
  1. data/HISTORY.md +3 -0
  2. data/LICENSE +21 -0
  3. data/README.md +435 -0
  4. data/Rakefile +146 -0
  5. data/bin/gollum +41 -0
  6. data/docs/sanitization.md +32 -0
  7. data/gollum.gemspec +506 -0
  8. data/lib/gollum.rb +58 -0
  9. data/lib/gollum/albino.rb +17 -0
  10. data/lib/gollum/file.rb +60 -0
  11. data/lib/gollum/frontend/app.rb +154 -0
  12. data/lib/gollum/frontend/public/css/editbar.css +194 -0
  13. data/lib/gollum/frontend/public/css/gollum.css +55 -0
  14. data/lib/gollum/frontend/public/css/screen.css +726 -0
  15. data/lib/gollum/frontend/public/css/syntax.css +61 -0
  16. data/lib/gollum/frontend/public/images/buttons.png +0 -0
  17. data/lib/gollum/frontend/public/images/editbar-buttons.png +0 -0
  18. data/lib/gollum/frontend/public/images/example.png +0 -0
  19. data/lib/gollum/frontend/public/images/twiddle-down.png +0 -0
  20. data/lib/gollum/frontend/public/images/twiddle-right.png +0 -0
  21. data/lib/gollum/frontend/public/images/txt.png +0 -0
  22. data/lib/gollum/frontend/public/javascript/MathJax/COPYING.txt +202 -0
  23. data/lib/gollum/frontend/public/javascript/MathJax/MathJax.js +1704 -0
  24. data/lib/gollum/frontend/public/javascript/MathJax/README.txt +480 -0
  25. data/lib/gollum/frontend/public/javascript/MathJax/config/MMLorHTML.js +63 -0
  26. data/lib/gollum/frontend/public/javascript/MathJax/config/MathJax.js +351 -0
  27. data/lib/gollum/frontend/public/javascript/MathJax/config/local/local.js +37 -0
  28. data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/AMSmath.js +376 -0
  29. data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/AMSsymbols.js +385 -0
  30. data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/autobold.js +43 -0
  31. data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/boldsymbol.js +109 -0
  32. data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/mathchoice.js +65 -0
  33. data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/newcommand.js +185 -0
  34. data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/noErrors.js +169 -0
  35. data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/unicode.js +131 -0
  36. data/lib/gollum/frontend/public/javascript/MathJax/extensions/TeX/verb.js +53 -0
  37. data/lib/gollum/frontend/public/javascript/MathJax/extensions/jsMath2jax.js +77 -0
  38. data/lib/gollum/frontend/public/javascript/MathJax/extensions/mml2jax.js +101 -0
  39. data/lib/gollum/frontend/public/javascript/MathJax/extensions/tex2jax.js +242 -0
  40. data/lib/gollum/frontend/public/javascript/MathJax/extensions/toMathML.js +140 -0
  41. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/jax.js +1474 -0
  42. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/Arrows.js +122 -0
  43. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/BasicLatin.js +58 -0
  44. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/CombDiacritMarks.js +35 -0
  45. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/CombDiactForSymbols.js +35 -0
  46. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/Dingbats.js +35 -0
  47. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/GeneralPunctuation.js +40 -0
  48. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/GeometricShapes.js +66 -0
  49. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/GreekAndCoptic.js +35 -0
  50. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/Latin1Supplement.js +37 -0
  51. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/LetterlikeSymbols.js +39 -0
  52. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/MathOperators.js +228 -0
  53. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/MiscMathSymbolsA.js +38 -0
  54. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/MiscMathSymbolsB.js +167 -0
  55. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/MiscTechnical.js +38 -0
  56. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/SpacingModLetters.js +36 -0
  57. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/SuppMathOperators.js +289 -0
  58. data/lib/gollum/frontend/public/javascript/MathJax/jax/element/mml/optable/SupplementalArrowsB.js +162 -0
  59. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/config.js +39 -0
  60. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/a.js +87 -0
  61. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/b.js +114 -0
  62. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/c.js +111 -0
  63. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/d.js +112 -0
  64. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/e.js +88 -0
  65. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/f.js +58 -0
  66. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/fr.js +79 -0
  67. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/g.js +82 -0
  68. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/h.js +52 -0
  69. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/i.js +85 -0
  70. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/j.js +36 -0
  71. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/k.js +36 -0
  72. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/l.js +175 -0
  73. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/m.js +61 -0
  74. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/n.js +219 -0
  75. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/o.js +88 -0
  76. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/opf.js +79 -0
  77. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/p.js +84 -0
  78. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/q.js +34 -0
  79. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/r.js +134 -0
  80. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/s.js +168 -0
  81. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/scr.js +79 -0
  82. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/t.js +82 -0
  83. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/u.js +91 -0
  84. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/v.js +73 -0
  85. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/w.js +35 -0
  86. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/x.js +47 -0
  87. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/y.js +41 -0
  88. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/entities/z.js +39 -0
  89. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/MathML/jax.js +590 -0
  90. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/TeX/config.js +40 -0
  91. data/lib/gollum/frontend/public/javascript/MathJax/jax/input/TeX/jax.js +1652 -0
  92. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/autoload/menclose.js +61 -0
  93. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/autoload/mglyph.js +98 -0
  94. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/autoload/ms.js +49 -0
  95. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/blank.gif +0 -0
  96. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/config.js +127 -0
  97. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/AlphaPresentForms.js +32 -0
  98. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/Arrows.js +109 -0
  99. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/BoldFraktur.js +79 -0
  100. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/BoxDrawing.js +67 -0
  101. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/CombDiacritMarks.js +98 -0
  102. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/CombDiactForSymbols.js +49 -0
  103. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/ControlPictures.js +28 -0
  104. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/CurrencySymbols.js +31 -0
  105. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/Cyrillic.js +129 -0
  106. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/EnclosedAlphanum.js +89 -0
  107. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/GeneralPunctuation.js +67 -0
  108. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/GeometricShapes.js +33 -0
  109. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/GreekAndCoptic.js +109 -0
  110. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/GreekBold.js +85 -0
  111. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/GreekSSBold.js +85 -0
  112. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/IPAExtensions.js +116 -0
  113. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/Latin1Supplement.js +123 -0
  114. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/LatinExtendedA.js +155 -0
  115. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/LatinExtendedAdditional.js +35 -0
  116. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/LatinExtendedB.js +59 -0
  117. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/LetterlikeSymbols.js +69 -0
  118. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/Main.js +172 -0
  119. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/MathBold.js +89 -0
  120. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/MathOperators.js +260 -0
  121. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/MathSSBold.js +89 -0
  122. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/MiscMathSymbolsA.js +31 -0
  123. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/MiscMathSymbolsB.js +37 -0
  124. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/MiscSymbols.js +30 -0
  125. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/MiscTechnical.js +42 -0
  126. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/NumberForms.js +39 -0
  127. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/PhoneticExtensions.js +30 -0
  128. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/SpacingModLetters.js +87 -0
  129. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/SuperAndSubscripts.js +28 -0
  130. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/SuppMathOperators.js +84 -0
  131. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/AlphaPresentForms.js +32 -0
  132. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/BasicLatin.js +122 -0
  133. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/BoxDrawing.js +67 -0
  134. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/CombDiactForSymbols.js +28 -0
  135. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/ControlPictures.js +28 -0
  136. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/CurrencySymbols.js +31 -0
  137. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/Cyrillic.js +129 -0
  138. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/EnclosedAlphanum.js +89 -0
  139. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/GeneralPunctuation.js +50 -0
  140. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/GreekAndCoptic.js +119 -0
  141. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/GreekBoldItalic.js +85 -0
  142. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/GreekSSBoldItalic.js +85 -0
  143. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/IPAExtensions.js +116 -0
  144. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/Latin1Supplement.js +123 -0
  145. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/LatinExtendedA.js +155 -0
  146. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/LatinExtendedAdditional.js +35 -0
  147. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/LatinExtendedB.js +59 -0
  148. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/LetterlikeSymbols.js +56 -0
  149. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/Main.js +56 -0
  150. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/MathBoldItalic.js +79 -0
  151. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/MathBoldScript.js +79 -0
  152. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/MathOperators.js +29 -0
  153. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/MathSSItalicBold.js +79 -0
  154. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/SpacingModLetters.js +54 -0
  155. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/AlphaPresentForms.js +32 -0
  156. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/BoxDrawing.js +67 -0
  157. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/CombDiactForSymbols.js +47 -0
  158. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/ControlPictures.js +28 -0
  159. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/CurrencySymbols.js +31 -0
  160. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/Cyrillic.js +129 -0
  161. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/EnclosedAlphanum.js +89 -0
  162. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/GeneralPunctuation.js +50 -0
  163. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/GreekAndCoptic.js +78 -0
  164. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/GreekItalic.js +85 -0
  165. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/IPAExtensions.js +116 -0
  166. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/Latin1Supplement.js +123 -0
  167. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/LatinExtendedA.js +154 -0
  168. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/LatinExtendedAdditional.js +35 -0
  169. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/LatinExtendedB.js +58 -0
  170. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/LetterlikeSymbols.js +56 -0
  171. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/Main.js +192 -0
  172. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/MathItalic.js +78 -0
  173. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/MathOperators.js +29 -0
  174. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/MathSSItalic.js +79 -0
  175. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/MathScript.js +68 -0
  176. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/SpacingModLetters.js +54 -0
  177. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/ij.js +29 -0
  178. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/AlphaPresentForms.js +32 -0
  179. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Arrows.js +106 -0
  180. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/BBBold.js +82 -0
  181. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/BlockElements.js +35 -0
  182. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/BoldFraktur.js +79 -0
  183. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/BoxDrawing.js +72 -0
  184. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/CJK.js +29 -0
  185. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/CombDiacritMarks.js +86 -0
  186. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/CombDiactForSymbols.js +50 -0
  187. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/ControlPictures.js +28 -0
  188. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/CurrencySymbols.js +31 -0
  189. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Cyrillic.js +129 -0
  190. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Dingbats.js +57 -0
  191. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/EnclosedAlphanum.js +89 -0
  192. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Fraktur.js +74 -0
  193. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GeneralPunctuation.js +68 -0
  194. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GeometricShapes.js +118 -0
  195. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GreekAndCoptic.js +109 -0
  196. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GreekBold.js +85 -0
  197. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GreekBoldItalic.js +85 -0
  198. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GreekItalic.js +85 -0
  199. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GreekSSBold.js +85 -0
  200. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GreekSSBoldItalic.js +85 -0
  201. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Hiragana.js +28 -0
  202. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/IPAExtensions.js +118 -0
  203. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Latin1Supplement.js +115 -0
  204. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/LatinExtendedA.js +154 -0
  205. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/LatinExtendedAdditional.js +35 -0
  206. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/LatinExtendedB.js +63 -0
  207. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/LatinExtendedD.js +28 -0
  208. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/LetterlikeSymbols.js +82 -0
  209. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Main.js +380 -0
  210. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathBold.js +89 -0
  211. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathBoldItalic.js +79 -0
  212. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathBoldScript.js +79 -0
  213. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathItalic.js +78 -0
  214. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathOperators.js +207 -0
  215. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathSS.js +89 -0
  216. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathSSBold.js +90 -0
  217. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathSSItalic.js +79 -0
  218. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathSSItalicBold.js +79 -0
  219. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathScript.js +68 -0
  220. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MathTT.js +88 -0
  221. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MiscMathSymbolsA.js +66 -0
  222. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MiscMathSymbolsB.js +154 -0
  223. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MiscSymbols.js +74 -0
  224. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MiscSymbolsAndArrows.js +91 -0
  225. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MiscTechnical.js +80 -0
  226. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/NumberForms.js +39 -0
  227. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/PhoneticExtensions.js +36 -0
  228. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/SpacingModLetters.js +79 -0
  229. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Specials.js +28 -0
  230. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/SuperAndSubscripts.js +28 -0
  231. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/SuppMathOperators.js +271 -0
  232. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/SupplementalArrowsA.js +35 -0
  233. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/SupplementalArrowsB.js +155 -0
  234. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/ij.js +29 -0
  235. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsD/Bold/All.js +55 -0
  236. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsD/Regular/All.js +54 -0
  237. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsD/Regular/Main.js +36 -0
  238. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsSm/Bold/All.js +55 -0
  239. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsSm/Regular/All.js +54 -0
  240. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsSm/Regular/Main.js +36 -0
  241. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUp/Bold/All.js +55 -0
  242. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUp/Regular/All.js +54 -0
  243. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUp/Regular/Main.js +36 -0
  244. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUpD/Bold/All.js +55 -0
  245. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUpD/Regular/All.js +54 -0
  246. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUpD/Regular/Main.js +36 -0
  247. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUpSm/Bold/All.js +55 -0
  248. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUpSm/Regular/All.js +54 -0
  249. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUpSm/Regular/Main.js +36 -0
  250. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Bold/All.js +29 -0
  251. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Bold/Main.js +35 -0
  252. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Bold/PrivateUse.js +182 -0
  253. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/BoldItalic/All.js +29 -0
  254. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/BoldItalic/Main.js +36 -0
  255. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/BoldItalic/PrivateUse.js +215 -0
  256. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Italic/All.js +29 -0
  257. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Italic/Main.js +60 -0
  258. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Italic/PrivateUse.js +242 -0
  259. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Regular/All.js +29 -0
  260. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Regular/Main.js +57 -0
  261. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/Regular/PrivateUse.js +387 -0
  262. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeFiveSym/Regular/All.js +51 -0
  263. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeFiveSym/Regular/Main.js +43 -0
  264. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeFourSym/Bold/Main.js +46 -0
  265. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeFourSym/Regular/All.js +63 -0
  266. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeFourSym/Regular/Main.js +62 -0
  267. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeOneSym/Bold/All.js +28 -0
  268. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeOneSym/Bold/Main.js +52 -0
  269. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeOneSym/Regular/All.js +77 -0
  270. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeOneSym/Regular/Main.js +105 -0
  271. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeThreeSym/Bold/Main.js +46 -0
  272. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeThreeSym/Regular/All.js +63 -0
  273. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeThreeSym/Regular/Main.js +62 -0
  274. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeTwoSym/Bold/Main.js +46 -0
  275. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeTwoSym/Regular/All.js +64 -0
  276. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/SizeTwoSym/Regular/Main.js +63 -0
  277. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/Variants/Bold/All.js +60 -0
  278. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/Variants/Bold/Main.js +44 -0
  279. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/Variants/Regular/All.js +120 -0
  280. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/Variants/Regular/Main.js +49 -0
  281. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/fontdata-beta.js +373 -0
  282. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/STIX/fontdata.js +1403 -0
  283. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/Arrows.js +65 -0
  284. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/BBBold.js +55 -0
  285. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/BoxDrawing.js +33 -0
  286. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/CombDiacritMarks.js +29 -0
  287. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/Dingbats.js +29 -0
  288. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/EnclosedAlphanum.js +28 -0
  289. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/GeneralPunctuation.js +28 -0
  290. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/GeometricShapes.js +36 -0
  291. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/GreekAndCoptic.js +29 -0
  292. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/Latin1Supplement.js +31 -0
  293. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/LatinExtendedA.js +28 -0
  294. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/LetterlikeSymbols.js +34 -0
  295. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/Main.js +51 -0
  296. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/MathOperators.js +138 -0
  297. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/MiscMathSymbolsB.js +28 -0
  298. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/MiscSymbols.js +28 -0
  299. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/MiscTechnical.js +29 -0
  300. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/PUA.js +43 -0
  301. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/SpacingModLetters.js +29 -0
  302. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/SuppMathOperators.js +50 -0
  303. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Caligraphic/Bold/Main.js +96 -0
  304. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Caligraphic/Regular/Main.js +95 -0
  305. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Fraktur/Bold/BasicLatin.js +109 -0
  306. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Fraktur/Bold/Main.js +36 -0
  307. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Fraktur/Bold/Other.js +30 -0
  308. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Fraktur/Bold/PUA.js +34 -0
  309. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Fraktur/Regular/BasicLatin.js +109 -0
  310. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Fraktur/Regular/Main.js +35 -0
  311. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Fraktur/Regular/Other.js +30 -0
  312. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Fraktur/Regular/PUA.js +35 -0
  313. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Greek/Bold/Main.js +43 -0
  314. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Greek/BoldItalic/Main.js +110 -0
  315. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Greek/Italic/Main.js +109 -0
  316. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Greek/Regular/Main.js +42 -0
  317. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/Arrows.js +51 -0
  318. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/CombDiacritMarks.js +39 -0
  319. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/CombDiactForSymbols.js +28 -0
  320. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/GeneralPunctuation.js +44 -0
  321. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/GeometricShapes.js +32 -0
  322. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/GreekAndCoptic.js +38 -0
  323. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/Latin1Supplement.js +36 -0
  324. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/LatinExtendedA.js +28 -0
  325. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/LatinExtendedB.js +28 -0
  326. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/LetterlikeSymbols.js +33 -0
  327. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/Main.js +161 -0
  328. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/MathOperators.js +94 -0
  329. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/MiscMathSymbolsA.js +29 -0
  330. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/MiscSymbols.js +34 -0
  331. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/MiscTechnical.js +33 -0
  332. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/SpacingModLetters.js +36 -0
  333. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/SuppMathOperators.js +30 -0
  334. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/SupplementalArrowsA.js +34 -0
  335. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Italic/CombDiacritMarks.js +38 -0
  336. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Italic/GeneralPunctuation.js +33 -0
  337. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Italic/GreekAndCoptic.js +38 -0
  338. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Italic/Latin1Supplement.js +28 -0
  339. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Italic/LatinExtendedA.js +28 -0
  340. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Italic/LatinExtendedB.js +28 -0
  341. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Italic/LetterlikeSymbols.js +28 -0
  342. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Italic/Main.js +137 -0
  343. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/Arrows.js +51 -0
  344. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/CombDiacritMarks.js +39 -0
  345. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/CombDiactForSymbols.js +28 -0
  346. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/GeneralPunctuation.js +38 -0
  347. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/GeometricShapes.js +32 -0
  348. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/GreekAndCoptic.js +38 -0
  349. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/Latin1Supplement.js +32 -0
  350. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/LatinExtendedA.js +28 -0
  351. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/LatinExtendedB.js +28 -0
  352. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/LetterlikeSymbols.js +33 -0
  353. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/Main.js +304 -0
  354. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/MathOperators.js +94 -0
  355. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/MiscMathSymbolsA.js +31 -0
  356. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/MiscSymbols.js +34 -0
  357. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/MiscTechnical.js +35 -0
  358. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/SpacingModLetters.js +28 -0
  359. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/SuppMathOperators.js +30 -0
  360. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Regular/SupplementalArrowsA.js +34 -0
  361. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Math/BoldItalic/Main.js +205 -0
  362. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Math/Italic/Main.js +204 -0
  363. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Bold/BasicLatin.js +115 -0
  364. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Bold/CombDiacritMarks.js +38 -0
  365. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Bold/Main.js +36 -0
  366. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Bold/Other.js +47 -0
  367. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Italic/BasicLatin.js +115 -0
  368. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Italic/CombDiacritMarks.js +38 -0
  369. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Italic/Main.js +36 -0
  370. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Italic/Other.js +47 -0
  371. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Regular/BasicLatin.js +115 -0
  372. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Regular/CombDiacritMarks.js +38 -0
  373. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Regular/Main.js +35 -0
  374. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Regular/Other.js +47 -0
  375. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Script/Regular/BasicLatin.js +54 -0
  376. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Script/Regular/Main.js +62 -0
  377. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Script/Regular/Other.js +28 -0
  378. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Size1/Regular/Main.js +74 -0
  379. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Size2/Regular/Main.js +66 -0
  380. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Size3/Regular/Main.js +50 -0
  381. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Size4/Regular/Main.js +77 -0
  382. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Typewriter/Regular/BasicLatin.js +123 -0
  383. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Typewriter/Regular/CombDiacritMarks.js +36 -0
  384. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Typewriter/Regular/Main.js +35 -0
  385. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/Typewriter/Regular/Other.js +44 -0
  386. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/WinChrome/Regular/Main.js +43 -0
  387. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/WinIE6/Regular/AMS.js +56 -0
  388. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/WinIE6/Regular/Bold.js +82 -0
  389. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/WinIE6/Regular/Main.js +111 -0
  390. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/fonts/TeX/fontdata.js +1691 -0
  391. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/imageFonts.js +185 -0
  392. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/HTML-CSS/jax.js +1991 -0
  393. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/NativeMML/config.js +51 -0
  394. data/lib/gollum/frontend/public/javascript/MathJax/jax/output/NativeMML/jax.js +230 -0
  395. data/lib/gollum/frontend/public/javascript/MathJax/test/index-images.html +119 -0
  396. data/lib/gollum/frontend/public/javascript/MathJax/test/index.html +127 -0
  397. data/lib/gollum/frontend/public/javascript/MathJax/test/sample.html +99 -0
  398. data/lib/gollum/frontend/public/javascript/gollum.js +244 -0
  399. data/lib/gollum/frontend/public/javascript/jquery-1.4.2.min.js +154 -0
  400. data/lib/gollum/frontend/public/javascript/jquery.previewable_comment_form.js +57 -0
  401. data/lib/gollum/frontend/public/javascript/jquery.tabs.js +59 -0
  402. data/lib/gollum/frontend/public/javascript/jquery.text_selection-1.0.0.min.js +1 -0
  403. data/lib/gollum/frontend/templates/compare.mustache +33 -0
  404. data/lib/gollum/frontend/templates/create.mustache +39 -0
  405. data/lib/gollum/frontend/templates/edit.mustache +38 -0
  406. data/lib/gollum/frontend/templates/editbar.mustache +1196 -0
  407. data/lib/gollum/frontend/templates/history.mustache +37 -0
  408. data/lib/gollum/frontend/templates/layout.mustache +33 -0
  409. data/lib/gollum/frontend/templates/page.mustache +27 -0
  410. data/lib/gollum/frontend/views/compare.rb +90 -0
  411. data/lib/gollum/frontend/views/create.rb +21 -0
  412. data/lib/gollum/frontend/views/edit.rb +13 -0
  413. data/lib/gollum/frontend/views/editable.rb +13 -0
  414. data/lib/gollum/frontend/views/history.rb +44 -0
  415. data/lib/gollum/frontend/views/layout.rb +14 -0
  416. data/lib/gollum/frontend/views/page.rb +38 -0
  417. data/lib/gollum/markup.rb +331 -0
  418. data/lib/gollum/page.rb +354 -0
  419. data/lib/gollum/pagination.rb +61 -0
  420. data/lib/gollum/wiki.rb +335 -0
  421. data/templates/formatting.html +92 -0
  422. data/test/examples/lotr.git/HEAD +1 -0
  423. data/test/examples/lotr.git/config +5 -0
  424. data/test/examples/lotr.git/description +1 -0
  425. data/test/examples/lotr.git/hooks/applypatch-msg.sample +15 -0
  426. data/test/examples/lotr.git/hooks/commit-msg.sample +24 -0
  427. data/test/examples/lotr.git/hooks/post-commit.sample +8 -0
  428. data/test/examples/lotr.git/hooks/post-receive.sample +15 -0
  429. data/test/examples/lotr.git/hooks/post-update.sample +8 -0
  430. data/test/examples/lotr.git/hooks/pre-applypatch.sample +14 -0
  431. data/test/examples/lotr.git/hooks/pre-commit.sample +46 -0
  432. data/test/examples/lotr.git/hooks/pre-rebase.sample +169 -0
  433. data/test/examples/lotr.git/hooks/prepare-commit-msg.sample +36 -0
  434. data/test/examples/lotr.git/hooks/update.sample +128 -0
  435. data/test/examples/lotr.git/info/exclude +6 -0
  436. data/test/examples/lotr.git/info/refs +1 -0
  437. data/test/examples/lotr.git/objects/06/131480411710c92a82fe2d1e76932c70feb2e5 +0 -0
  438. data/test/examples/lotr.git/objects/0a/de1e2916346d4c1f2fb63b863fd3c16808fe44 +0 -0
  439. data/test/examples/lotr.git/objects/0e/d8cbe0a25235bd867e65193c7d837c66b328ef +3 -0
  440. data/test/examples/lotr.git/objects/24/49c2681badfd3c189e8ed658dacffe8ba48fe5 +0 -0
  441. data/test/examples/lotr.git/objects/2c/b9156ad383914561a8502fc70f5a1d887e48ad +4 -0
  442. data/test/examples/lotr.git/objects/5d/cac289a8603188d2c5caf481dcba2985126aaa +0 -0
  443. data/test/examples/lotr.git/objects/60/f12f4254f58801b9ee7db7bca5fa8aeefaa56b +0 -0
  444. data/test/examples/lotr.git/objects/71/4323c104239440a5c66ab12a67ed07a83c404f +0 -0
  445. data/test/examples/lotr.git/objects/93/6b83ee0dd8837adb82511e40d5e4ebe59bb675 +0 -0
  446. data/test/examples/lotr.git/objects/94/523d7ae48aeba575099dd12926420d8fd0425d +2 -0
  447. data/test/examples/lotr.git/objects/96/97dc65e095658bbd1b8e8678e08881e86d32f1 +0 -0
  448. data/test/examples/lotr.git/objects/aa/b61fe89d56f8614c0a8151da34f939dcedfa68 +0 -0
  449. data/test/examples/lotr.git/objects/c3/b43e9f08966b088e7a0192e436b7a884542e05 +0 -0
  450. data/test/examples/lotr.git/objects/dc/596d6b2dd89ab05c66f4abd7d5eb706bc17f19 +0 -0
  451. data/test/examples/lotr.git/objects/ec/da3205bee14520aab5a7bb307392064b938e83 +0 -0
  452. data/test/examples/lotr.git/objects/fa/e7ef5344202bba4129abdc13060d9297d99465 +3 -0
  453. data/test/examples/lotr.git/objects/info/packs +2 -0
  454. data/test/examples/lotr.git/objects/pack/pack-dcbeaf3f6ff6c5eb08ea2b0a2d83626e8763546b.idx +0 -0
  455. data/test/examples/lotr.git/objects/pack/pack-dcbeaf3f6ff6c5eb08ea2b0a2d83626e8763546b.pack +0 -0
  456. data/test/examples/lotr.git/packed-refs +2 -0
  457. data/test/examples/lotr.git/refs/heads/master +1 -0
  458. data/test/helper.rb +38 -0
  459. data/test/test_file.rb +18 -0
  460. data/test/test_markup.rb +348 -0
  461. data/test/test_page.rb +112 -0
  462. data/test/test_wiki.rb +201 -0
  463. metadata +626 -0
@@ -0,0 +1,40 @@
1
+ /*************************************************************
2
+ *
3
+ * MathJax/jax/input/TeX/config.js
4
+ *
5
+ * Initializes the TeX InputJax (the main definition is in
6
+ * MathJax/jax/input/TeX/jax.js, which is loaded when needed).
7
+ *
8
+ * ---------------------------------------------------------------------
9
+ *
10
+ * Copyright (c) 2009 Design Science, Inc.
11
+ *
12
+ * Licensed under the Apache License, Version 2.0 (the "License");
13
+ * you may not use this file except in compliance with the License.
14
+ * You may obtain a copy of the License at
15
+ *
16
+ * http://www.apache.org/licenses/LICENSE-2.0
17
+ *
18
+ * Unless required by applicable law or agreed to in writing, software
19
+ * distributed under the License is distributed on an "AS IS" BASIS,
20
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
+ * See the License for the specific language governing permissions and
22
+ * limitations under the License.
23
+ */
24
+
25
+ MathJax.InputJax.TeX = MathJax.InputJax({
26
+ name: "TeX",
27
+ version: 1.0,
28
+ directory: MathJax.InputJax.directory + "/TeX",
29
+ extensionDir: MathJax.InputJax.extensionDir + "/TeX",
30
+ require: [MathJax.ElementJax.directory + "/mml/jax.js"],
31
+
32
+ config: {
33
+ TagSide: "right",
34
+ TagIndent: "0.8em",
35
+ MultLineWidth: "85%"
36
+ }
37
+ });
38
+ MathJax.InputJax.TeX.Register("math/tex");
39
+
40
+ MathJax.InputJax.TeX.loadComplete("config.js");
@@ -0,0 +1,1652 @@
1
+ /*************************************************************
2
+ *
3
+ * MathJax/jax/input/TeX/jax.js
4
+ *
5
+ * Implements the TeX InputJax that reads mathematics in
6
+ * TeX and LaTeX format and converts it to the MML ElementJax
7
+ * internal format.
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 (TEX) {
27
+ var TRUE = true, FALSE = false, MML;
28
+
29
+ TEX.Stack = MathJax.Object.Subclass({
30
+ Init: function (env) {
31
+ this.global = {};
32
+ this.data = [STACKITEM.start().With({global: this.global})];
33
+ if (env) {this.data[0].env = env}
34
+ this.env = this.data[0].env;
35
+ },
36
+ Push: function () {
37
+ var i, m, item, top;
38
+ for (i = 0, m = arguments.length; i < m; i++) {
39
+ item = arguments[i];
40
+ if (item instanceof MML.mbase) {item = STACKITEM.mml(item)}
41
+ item.global = this.global;
42
+ top = (this.data.length ? this.Top().checkItem(item) : TRUE);
43
+ if (top instanceof Array) {this.Pop(); this.Push.apply(this,top)}
44
+ else if (top instanceof STACKITEM) {this.Pop(); this.Push(top)}
45
+ else if (top) {
46
+ this.data.push(item);
47
+ if (item.env) {
48
+ for (var id in this.env)
49
+ {if (this.env.hasOwnProperty(id)) {item.env[id] = this.env[id]}}
50
+ this.env = item.env;
51
+ } else {item.env = this.env}
52
+ }
53
+ }
54
+ },
55
+ Pop: function () {
56
+ var item = this.data.pop(); if (!item.isOpen) {delete item.env}
57
+ this.env = (this.data.length ? this.Top().env : {});
58
+ return item;
59
+ },
60
+ Top: function (n) {
61
+ if (n == null) {n = 1}
62
+ if (this.data.length < n) {return null}
63
+ return this.data[this.data.length-n];
64
+ },
65
+ Prev: function (noPop) {
66
+ var top = this.Top();
67
+ if (noPop) {return top.data[top.data.length-1]}
68
+ else {return top.Pop()}
69
+ },
70
+ toString: function () {return "stack[\n "+this.data.join("\n ")+"\n]"}
71
+ });
72
+
73
+ var STACKITEM = TEX.Stack.Item = MathJax.Object.Subclass({
74
+ type: "base",
75
+ closeError: "Extra close brace or missing open brace",
76
+ rightError: "Missing \\left or extra \\right",
77
+ Init: function () {
78
+ if (this.isOpen) {this.env = {}}
79
+ this.data = [];
80
+ this.Push.apply(this,arguments);
81
+ },
82
+ Push: function () {this.data.push.apply(this.data,arguments)},
83
+ Pop: function () {return this.data.pop()},
84
+ mmlData: function (inferred,forceRow) {
85
+ if (inferred == null) {inferred = TRUE}
86
+ if (this.data.length === 1 && !forceRow) {return this.data[0]}
87
+ return MML.mrow.apply(MML,this.data).With((inferred ? {inferred: TRUE}: {}));
88
+ },
89
+ checkItem: function (item) {
90
+ if (item.type === "over" && this.isOpen) {item.num = this.mmlData(FALSE); this.data = []}
91
+ if (item.type === "cell" && this.isOpen) {TEX.Error("Misplaced "+item.name)}
92
+ if (item.isClose && this[item.type+"Error"]) {TEX.Error(this[item.type+"Error"])}
93
+ if (!item.isNotStack) {return TRUE}
94
+ this.Push(item.data[0]); return FALSE;
95
+ },
96
+ With: function (def) {
97
+ for (var id in def) {if (def.hasOwnProperty(id)) {this[id] = def[id]}}
98
+ return this;
99
+ },
100
+ toString: function () {return this.type+"["+this.data.join("; ")+"]"}
101
+ });
102
+
103
+ STACKITEM.start = STACKITEM.Subclass({
104
+ type: "start", isOpen: TRUE,
105
+ checkItem: function (item) {
106
+ if (item.type === "stop") {return STACKITEM.mml(this.mmlData())}
107
+ return this.SUPER(arguments).checkItem.call(this,item);
108
+ }
109
+ });
110
+
111
+ STACKITEM.stop = STACKITEM.Subclass({
112
+ type: "stop", isClose: TRUE
113
+ });
114
+
115
+ STACKITEM.open = STACKITEM.Subclass({
116
+ type: "open", isOpen: TRUE,
117
+ stopError: "Extra open brace or missing close brace",
118
+ checkItem: function (item) {
119
+ if (item.type === "close") {
120
+ var mml = this.mmlData(); // this.mmlData(TRUE,TRUE); // force row
121
+ return STACKITEM.mml(MML.TeXAtom(mml)); // TeXAtom make it an ORD to prevent spacing (FIXME: should be another way)
122
+ }
123
+ return this.SUPER(arguments).checkItem.call(this,item);
124
+ }
125
+ });
126
+
127
+ STACKITEM.close = STACKITEM.Subclass({
128
+ type: "close", isClose: TRUE
129
+ });
130
+
131
+ STACKITEM.subsup = STACKITEM.Subclass({
132
+ type: "subsup",
133
+ stopError: "Missing superscript or subscript argument",
134
+ checkItem: function (item) {
135
+ var script = ["","subscript","superscript"][this.position];
136
+ if (item.type === "open" || item.type === "left") {return TRUE}
137
+ if (item.type === "mml") {
138
+ this.data[0].SetData(this.position,item.data[0]);
139
+ return STACKITEM.mml(this.data[0]);
140
+ }
141
+ if (this.SUPER(arguments).checkItem.call(this,item))
142
+ {TEX.Error("Missing open brace for "+script)}
143
+ },
144
+ Pop: function () {}
145
+ });
146
+
147
+ STACKITEM.over = STACKITEM.Subclass({
148
+ type: "over", isClose: TRUE, name: "\\over",
149
+ checkItem: function (item,stack) {
150
+ if (item.type === "over") {TEX.Error("Ambiguous use of "+item.name)}
151
+ if (item.isClose) {
152
+ var mml = MML.mfrac(this.num,this.mmlData(FALSE));
153
+ if (this.thickness != null) {mml.linethickness = this.thickness}
154
+ if (this.open || this.close) {
155
+ mml.texClass = MML.TEXCLASS.INNER;
156
+ mml.texWithDelims = TRUE;
157
+ mml = MML.mfenced(mml).With({open: this.open, close: this.close});
158
+ }
159
+ return [STACKITEM.mml(mml), item];
160
+ }
161
+ return this.SUPER(arguments).checkItem.call(this,item);
162
+ },
163
+ toString: function () {return "over["+this.num+" / "+this.data.join("; ")+"]"}
164
+ });
165
+
166
+ STACKITEM.left = STACKITEM.Subclass({
167
+ type: "left", isOpen: TRUE, delim: '(',
168
+ stopError: "Extra \\left or missing \\right",
169
+ checkItem: function (item) {
170
+ if (item.type === "right") {
171
+ var mml = MML.mfenced(this.data.length === 1 ? this.data[0] : MML.mrow.apply(MML,this.data));
172
+ return STACKITEM.mml(mml.With({open: this.delim, close: item.delim}));
173
+ }
174
+ return this.SUPER(arguments).checkItem.call(this,item);
175
+ }
176
+ });
177
+
178
+ STACKITEM.right = STACKITEM.Subclass({
179
+ type: "right", isClose: TRUE, delim: ')'
180
+ });
181
+
182
+ STACKITEM.begin = STACKITEM.Subclass({
183
+ type: "begin", isOpen: TRUE,
184
+ checkItem: function (item) {
185
+ if (item.type === "end") {
186
+ if (item.name !== this.name)
187
+ {TEX.Error("\\begin{"+this.name+"} ended with \\end{"+item.name+"}")}
188
+ if (!this.end) {return STACKITEM.mml(this.mmlData())}
189
+ return this.parse[this.end].call(this.parse,this,this.data);
190
+ }
191
+ if (item.type === "stop") {TEX.Error("Missing \\end{"+this.name+"}")}
192
+ return this.SUPER(arguments).checkItem.call(this,item);
193
+ }
194
+ });
195
+
196
+ STACKITEM.end = STACKITEM.Subclass({
197
+ type: "end", isClose: TRUE
198
+ });
199
+
200
+ STACKITEM.style = STACKITEM.Subclass({
201
+ type: "style",
202
+ checkItem: function (item) {
203
+ if (!item.isClose) {return this.SUPER(arguments).checkItem.call(this,item)}
204
+ var mml = MML.mstyle.apply(MML,this.data).With(this.styles);
205
+ return [STACKITEM.mml(mml),item];
206
+ }
207
+ });
208
+
209
+ STACKITEM.position = STACKITEM.Subclass({
210
+ type: "position",
211
+ checkItem: function (item) {
212
+ if (item.isClose) {TEX.Error("Missing box for "+this.name)}
213
+ if (item.isNotStack) {
214
+ var mml = item.mmlData();
215
+ switch (this.move) {
216
+ case 'vertical':
217
+ var mml = MML.mpadded(mml).With({height: this.dh, depth: this.dd, voffset: this.dh});
218
+ return [STACKITEM.mml(mml)];
219
+ case 'horizontal':
220
+ return [STACKITEM.mml(this.left),item,STACKITEM.mml(this.right)];
221
+ }
222
+ }
223
+ return this.SUPER(arguments).checkItem.call(this,item);
224
+ }
225
+ });
226
+
227
+ STACKITEM.array = STACKITEM.Subclass({
228
+ type: "array", isOpen: TRUE, arraydef: {},
229
+ Init: function () {
230
+ this.table = []; this.row = []; this.env = {};
231
+ this.SUPER(arguments).Init.apply(this,arguments);
232
+ },
233
+ checkItem: function (item) {
234
+ if (item.isClose) {
235
+ if (item.isEntry) {this.EndEntry(); this.clearEnv(); return FALSE}
236
+ if (item.isCR) {this.EndEntry(); this.EndRow(); this.clearEnv(); return FALSE}
237
+ this.EndTable(); this.clearEnv();
238
+ var mml = MML.mtable.apply(MML,this.table).With(this.arraydef);
239
+ if (this.open || this.close) {
240
+ mml = MML.mfenced(mml).With({open: this.open, close: this.close});
241
+ }
242
+ mml = STACKITEM.mml(mml);
243
+ if (this.requireClose) {
244
+ if (item.type === 'close') {return mml}
245
+ TEX.Error("Missing close brace");
246
+ }
247
+ return [mml,item];
248
+ }
249
+ return this.SUPER(arguments).checkItem.call(this,item);
250
+ },
251
+ EndEntry: function () {this.row.push(MML.mtd.apply(MML,this.data)); this.data = []},
252
+ EndRow: function () {this.table.push(MML.mtr.apply(MML,this.row)); this.row = []},
253
+ EndTable: function () {
254
+ if (this.data.length || this.row.length) {this.EndEntry(); this.EndRow()}
255
+ },
256
+ clearEnv: function () {
257
+ for (var id in this.env) {if (this.env.hasOwnProperty(id)) {delete this.env[id]}}
258
+ }
259
+ });
260
+
261
+ STACKITEM.cell = STACKITEM.Subclass({
262
+ type: "cell", isClose: TRUE
263
+ });
264
+
265
+ STACKITEM.mml = STACKITEM.Subclass({
266
+ type: "mml", isNotStack: TRUE,
267
+ Push: function () {
268
+ // embellished are type ORD in TeX (but not MML) so wrap them in TeXAtom
269
+ for (var i = 0, m = arguments.length; i < m; i++) {
270
+ if (arguments[i].type !== "mo" && arguments[i].isEmbellished())
271
+ {arguments[i] = MML.TeXAtom(arguments[i]).With({isEmbellishedWrapper: TRUE})}
272
+ }
273
+ this.data.push.apply(this.data,arguments);
274
+ },
275
+ Add: function () {this.data.push.apply(this.data,arguments); return this}
276
+ });
277
+
278
+
279
+ var TEXDEF = TEX.Definitions = {};
280
+
281
+ TEX.Startup = function () {
282
+ MML = MathJax.ElementJax.mml;
283
+ MathJax.Hub.Insert(TEXDEF,{
284
+
285
+ // patterns for letters and numbers
286
+ letter: /[a-z]/i,
287
+ digit: /[0-9.]/,
288
+ number: /^(?:[0-9]+(?:\{,\}[0-9]{3})*(?:\.[0-9]*)*|\.[0-9]+)/,
289
+
290
+ special: {
291
+ '\\': 'ControlSequence',
292
+ '{': 'Open',
293
+ '}': 'Close',
294
+ '~': 'Tilde',
295
+ '^': 'Superscript',
296
+ '_': 'Subscript',
297
+ ' ': 'Space',
298
+ "\t": 'Space',
299
+ "\r": 'Space',
300
+ "\n": 'Space',
301
+ "'": 'Prime',
302
+ '%': 'Comment',
303
+ '&': 'Entry',
304
+ '#': 'Hash',
305
+ '\u2019': 'Prime'
306
+ },
307
+
308
+ remap: {
309
+ '-': '2212',
310
+ '*': '2217'
311
+ },
312
+
313
+ mathchar0mi: {
314
+ // Lower-case greek
315
+ alpha: '03B1',
316
+ beta: '03B2',
317
+ gamma: '03B3',
318
+ delta: '03B4',
319
+ epsilon: '03F5',
320
+ zeta: '03B6',
321
+ eta: '03B7',
322
+ theta: '03B8',
323
+ iota: '03B9',
324
+ kappa: '03BA',
325
+ lambda: '03BB',
326
+ mu: '03BC',
327
+ nu: '03BD',
328
+ xi: '03BE',
329
+ omicron: '03BF', // added for completeness
330
+ pi: '03C0',
331
+ rho: '03C1',
332
+ sigma: '03C3',
333
+ tau: '03C4',
334
+ upsilon: '03C5',
335
+ phi: '03D5',
336
+ chi: '03C7',
337
+ psi: '03C8',
338
+ omega: '03C9',
339
+ varepsilon: '03B5',
340
+ vartheta: '03D1',
341
+ varpi: '03D6',
342
+ varrho: '03F1',
343
+ varsigma: '03C2',
344
+ varphi: '03C6',
345
+
346
+ // Ord symbols
347
+ S: '00A7',
348
+ aleph: ['2135',{mathvariant: MML.VARIANT.NORMAL}],
349
+ hbar: '210F',
350
+ imath: '0131',
351
+ jmath: '0237',
352
+ ell: '2113',
353
+ wp: ['2118',{mathvariant: MML.VARIANT.NORMAL}],
354
+ Re: ['211C',{mathvariant: MML.VARIANT.NORMAL}],
355
+ Im: ['2111',{mathvariant: MML.VARIANT.NORMAL}],
356
+ partial: ['2202',{mathvariant: MML.VARIANT.NORMAL}],
357
+ infty: ['221E',{mathvariant: MML.VARIANT.NORMAL}],
358
+ prime: ['2032',{mathvariant: MML.VARIANT.NORMAL}],
359
+ emptyset: ['2205',{mathvariant: MML.VARIANT.NORMAL}],
360
+ nabla: ['2207',{mathvariant: MML.VARIANT.NORMAL}],
361
+ top: ['22A4',{mathvariant: MML.VARIANT.NORMAL}],
362
+ bot: ['22A5',{mathvariant: MML.VARIANT.NORMAL}],
363
+ angle: ['2220',{mathvariant: MML.VARIANT.NORMAL}],
364
+ triangle: ['25B3',{mathvariant: MML.VARIANT.NORMAL}],
365
+ backslash: ['2216',{mathvariant: MML.VARIANT.NORMAL}],
366
+ forall: ['2200',{mathvariant: MML.VARIANT.NORMAL}],
367
+ exists: ['2203',{mathvariant: MML.VARIANT.NORMAL}],
368
+ neg: ['00AC',{mathvariant: MML.VARIANT.NORMAL}],
369
+ lnot: ['00AC',{mathvariant: MML.VARIANT.NORMAL}],
370
+ flat: ['266D',{mathvariant: MML.VARIANT.NORMAL}],
371
+ natural: ['266E',{mathvariant: MML.VARIANT.NORMAL}],
372
+ sharp: ['266F',{mathvariant: MML.VARIANT.NORMAL}],
373
+ clubsuit: ['2663',{mathvariant: MML.VARIANT.NORMAL}],
374
+ diamondsuit: ['2662',{mathvariant: MML.VARIANT.NORMAL}],
375
+ heartsuit: ['2661',{mathvariant: MML.VARIANT.NORMAL}],
376
+ spadesuit: ['2660',{mathvariant: MML.VARIANT.NORMAL}]
377
+ },
378
+
379
+ mathchar0mo: {
380
+ surd: '221A',
381
+
382
+ // big ops
383
+ coprod: ['2210',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
384
+ bigvee: ['22C1',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
385
+ bigwedge: ['22C0',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
386
+ biguplus: ['2A04',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
387
+ bigcap: ['22C2',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
388
+ bigcup: ['22C3',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
389
+ 'int': ['222B',{texClass: MML.TEXCLASS.OP}],
390
+ intop: ['222B',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE, movablelimits:TRUE}],
391
+ iint: ['222C',{texClass: MML.TEXCLASS.OP}],
392
+ iiint: ['222D',{texClass: MML.TEXCLASS.OP}],
393
+ prod: ['220F',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
394
+ sum: ['2211',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
395
+ bigotimes: ['2A02',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
396
+ bigoplus: ['2A01',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
397
+ bigodot: ['2A00',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
398
+ oint: ['222E',{texClass: MML.TEXCLASS.OP}],
399
+ bigsqcup: ['2A06',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
400
+ smallint: ['222B',{largeop:FALSE}],
401
+
402
+ // binary operations
403
+ triangleleft: '25C3',
404
+ triangleright: '25B9',
405
+ bigtriangleup: '25B3',
406
+ bigtriangledown: '25BD',
407
+ wedge: '2227',
408
+ land: '2227',
409
+ vee: '2228',
410
+ lor: '2228',
411
+ cap: '2229',
412
+ cup: '222A',
413
+ ddagger: '2021',
414
+ dagger: '2020',
415
+ sqcap: '2293',
416
+ sqcup: '2294',
417
+ uplus: '228E',
418
+ amalg: '2A3F',
419
+ diamond: '22C4',
420
+ bullet: '2219',
421
+ wr: '2240',
422
+ div: '00F7',
423
+ odot: ['2299',{largeop: FALSE}],
424
+ oslash: ['2298',{largeop: FALSE}],
425
+ otimes: ['2297',{largeop: FALSE}],
426
+ ominus: ['2296',{largeop: FALSE}],
427
+ oplus: ['2295',{largeop: FALSE}],
428
+ mp: '2213',
429
+ pm: '00B1',
430
+ circ: '2218',
431
+ bigcirc: '25EF',
432
+ setminus: '2216',
433
+ cdot: '22C5',
434
+ ast: '2217',
435
+ times: '00D7',
436
+ star: '22C6',
437
+
438
+ // Relations
439
+ propto: '221D',
440
+ sqsubseteq: '2291',
441
+ sqsupseteq: '2292',
442
+ parallel: '2225',
443
+ mid: '2223',
444
+ dashv: '22A3',
445
+ vdash: '22A2',
446
+ leq: '2264',
447
+ le: '2264',
448
+ geq: '2265',
449
+ ge: '2265',
450
+ lt: '003C',
451
+ gt: '003E',
452
+ succ: '227B',
453
+ prec: '227A',
454
+ approx: '2248',
455
+ succeq: '2AB0', // or '227C',
456
+ preceq: '2AAF', // or '227D',
457
+ supset: '2283',
458
+ subset: '2282',
459
+ supseteq: '2287',
460
+ subseteq: '2286',
461
+ 'in': '2208',
462
+ ni: '220B',
463
+ notin: '2209',
464
+ owns: '220B',
465
+ gg: '226B',
466
+ ll: '226A',
467
+ sim: '223C',
468
+ simeq: '2243',
469
+ perp: '22A5',
470
+ equiv: '2261',
471
+ asymp: '224D',
472
+ smile: '2323',
473
+ frown: '2322',
474
+ ne: '2260',
475
+ neq: '2260',
476
+ cong: '2245',
477
+ doteq: '2250',
478
+ bowtie: '22C8',
479
+ models: '22A8',
480
+
481
+ notChar: '0338',
482
+
483
+
484
+ // Arrows
485
+ Leftrightarrow: '21D4',
486
+ Leftarrow: '21D0',
487
+ Rightarrow: '21D2',
488
+ leftrightarrow: '2194',
489
+ leftarrow: '2190',
490
+ gets: '2190',
491
+ rightarrow: '2192',
492
+ to: '2192',
493
+ mapsto: '21A6',
494
+ leftharpoonup: '21BC',
495
+ leftharpoondown: '21BD',
496
+ rightharpoonup: '21C0',
497
+ rightharpoondown: '21C1',
498
+ nearrow: '2197',
499
+ searrow: '2198',
500
+ nwarrow: '2196',
501
+ swarrow: '2199',
502
+ rightleftharpoons: '21CC',
503
+ hookrightarrow: '21AA',
504
+ hookleftarrow: '21A9',
505
+ longleftarrow: '27F5',
506
+ Longleftarrow: '27F8',
507
+ longrightarrow: '27F6',
508
+ Longrightarrow: '27F9',
509
+ Longleftrightarrow: '27FA',
510
+ longleftrightarrow: '27F7',
511
+ longmapsto: '27FC',
512
+
513
+
514
+ // Misc.
515
+ ldots: '2026',
516
+ cdots: '22EF',
517
+ vdots: '22EE',
518
+ ddots: '22F1',
519
+ dots: '2026', // should be more complex than this
520
+ dotsc: '2026', // dots with commas
521
+ dotsb: '22EF', // dots with binary ops and relations
522
+ dotsm: '22EF', // dots with multiplication
523
+ dotsi: '22EF', // dots with integrals
524
+ dotso: '2026', // other dots
525
+
526
+ ldotp: ['002E', {texClass: MML.TEXCLASS.PUNCT}],
527
+ cdotp: ['22C5', {texClass: MML.TEXCLASS.PUNCT}],
528
+ colon: ['003A', {texClass: MML.TEXCLASS.PUNCT}]
529
+ },
530
+
531
+ mathchar7: {
532
+ Gamma: '0393',
533
+ Delta: '0394',
534
+ Theta: '0398',
535
+ Lambda: '039B',
536
+ Xi: '039E',
537
+ Pi: '03A0',
538
+ Sigma: '03A3',
539
+ Upsilon: '03A5',
540
+ Phi: '03A6',
541
+ Psi: '03A8',
542
+ Omega: '03A9',
543
+
544
+ '_': '005F',
545
+ '#': '0023',
546
+ '$': '0024',
547
+ '%': '0025',
548
+ '&': '0026',
549
+ And: '0026'
550
+ },
551
+
552
+ delimiter: {
553
+ '(': '(',
554
+ ')': ')',
555
+ '[': '[',
556
+ ']': ']',
557
+ '<': '27E8',
558
+ '>': '27E9',
559
+ '\\lt': '27E8',
560
+ '\\gt': '27E9',
561
+ '/': '/',
562
+ '|': ['|',{texClass:MML.TEXCLASS.ORD}],
563
+ '.': '',
564
+ '\\\\': '\\',
565
+ '\\lmoustache': '23B0', // non-standard
566
+ '\\rmoustache': '23B1', // non-standard
567
+ '\\lgroup': '27EE', // non-standard
568
+ '\\rgroup': '27EF', // non-standard
569
+ '\\arrowvert': '23D0',
570
+ '\\Arrowvert': '2016',
571
+ '\\bracevert': '23AA', // non-standard
572
+ '\\Vert': ['2225',{texClass:MML.TEXCLASS.ORD}],
573
+ '\\|': ['2225',{texClass:MML.TEXCLASS.ORD}],
574
+ '\\vert': ['|',{texClass:MML.TEXCLASS.ORD}],
575
+ '\\uparrow': '2191',
576
+ '\\downarrow': '2193',
577
+ '\\updownarrow': '2195',
578
+ '\\Uparrow': '21D1',
579
+ '\\Downarrow': '21D3',
580
+ '\\Updownarrow': '21D5',
581
+ '\\backslash': '\\',
582
+ '\\rangle': '27E9',
583
+ '\\langle': '27E8',
584
+ '\\rbrace': '}',
585
+ '\\lbrace': '{',
586
+ '\\}': '}',
587
+ '\\{': '{',
588
+ '\\rceil': '2309',
589
+ '\\lceil': '2308',
590
+ '\\rfloor': '230B',
591
+ '\\lfloor': '230A',
592
+ '\\lbrack': '[',
593
+ '\\rbrack': ']'
594
+ },
595
+
596
+ macros: {
597
+ displaystyle: ['SetStyle','D',TRUE,0],
598
+ textstyle: ['SetStyle','T',FALSE,0],
599
+ scriptstyle: ['SetStyle','S',FALSE,1],
600
+ scriptscriptstyle: ['SetStyle','SS',FALSE,2],
601
+
602
+ rm: ['SetFont',MML.VARIANT.NORMAL],
603
+ mit: ['SetFont',MML.VARIANT.ITALIC],
604
+ oldstyle: ['SetFont',MML.VARIANT.OLDSTYLE],
605
+ cal: ['SetFont',MML.VARIANT.CALIGRAPHIC],
606
+ it: ['SetFont',MML.VARIANT.ITALIC], // may need special handling
607
+ bf: ['SetFont',MML.VARIANT.BOLD],
608
+ bbFont: ['SetFont',MML.VARIANT.DOUBLESTRUCK],
609
+ scr: ['SetFont',MML.VARIANT.SCRIPT],
610
+ frak: ['SetFont',MML.VARIANT.FRAKTUR],
611
+ sf: ['SetFont',MML.VARIANT.SANSSERIF],
612
+ tt: ['SetFont',MML.VARIANT.MONOSPACE],
613
+
614
+ // font:
615
+
616
+ tiny: ['SetSize',0.5],
617
+ Tiny: ['SetSize',0.6], // non-standard
618
+ scriptsize: ['SetSize',0.7],
619
+ small: ['SetSize',0.85],
620
+ normalsize: ['SetSize',1.0],
621
+ large: ['SetSize',1.2],
622
+ Large: ['SetSize',1.44],
623
+ LARGE: ['SetSize',1.73],
624
+ huge: ['SetSize',2.07],
625
+ Huge: ['SetSize',2.49],
626
+
627
+ arcsin: ['NamedOp',0],
628
+ arccos: ['NamedOp',0],
629
+ arctan: ['NamedOp',0],
630
+ arg: ['NamedOp',0],
631
+ cos: ['NamedOp',0],
632
+ cosh: ['NamedOp',0],
633
+ cot: ['NamedOp',0],
634
+ coth: ['NamedOp',0],
635
+ csc: ['NamedOp',0],
636
+ deg: ['NamedOp',0],
637
+ det: 'NamedOp',
638
+ dim: ['NamedOp',0],
639
+ exp: ['NamedOp',0],
640
+ gcd: 'NamedOp',
641
+ hom: ['NamedOp',0],
642
+ inf: 'NamedOp',
643
+ ker: ['NamedOp',0],
644
+ lg: ['NamedOp',0],
645
+ lim: 'NamedOp',
646
+ liminf: ['NamedOp',null,'lim&thinsp;inf'],
647
+ limsup: ['NamedOp',null,'lim&thinsp;sup'],
648
+ ln: ['NamedOp',0],
649
+ log: ['NamedOp',0],
650
+ max: 'NamedOp',
651
+ min: 'NamedOp',
652
+ Pr: 'NamedOp',
653
+ sec: ['NamedOp',0],
654
+ sin: ['NamedOp',0],
655
+ sinh: ['NamedOp',0],
656
+ sup: 'NamedOp',
657
+ tan: ['NamedOp',0],
658
+ tanh: ['NamedOp',0],
659
+
660
+ limits: ['Limits',1],
661
+ nolimits: ['Limits',0],
662
+
663
+ overline: ['UnderOver','203E'],
664
+ underline: ['UnderOver','005F'],
665
+ overbrace: ['UnderOver','23DE',1],
666
+ underbrace: ['UnderOver','23DF',1],
667
+ overrightarrow: ['UnderOver','2192'],
668
+ underrightarrow: ['UnderOver','2192'],
669
+ overleftarrow: ['UnderOver','2190'],
670
+ underleftarrow: ['UnderOver','2190'],
671
+ overleftrightarrow: ['UnderOver','2194'],
672
+ underleftrightarrow: ['UnderOver','2194'],
673
+
674
+ overset: 'Overset',
675
+ underset: 'Underset',
676
+ stackrel: ['Macro','\\mathrel{\\mathop{#2}\\limits^{#1}}',2],
677
+
678
+ over: 'Over',
679
+ overwithdelims: 'Over',
680
+ atop: 'Over',
681
+ atopwithdelims: 'Over',
682
+ above: 'Over',
683
+ abovewithdelims: 'Over',
684
+ brace: ['Over','{','}'],
685
+ brack: ['Over','[',']'],
686
+ choose: ['Over','(',')'],
687
+
688
+ frac: 'Frac',
689
+ sqrt: 'Sqrt',
690
+ root: 'Root',
691
+ uproot: ['MoveRoot','upRoot'],
692
+ leftroot: ['MoveRoot','leftRoot'],
693
+
694
+ left: 'LeftRight',
695
+ right: 'LeftRight',
696
+
697
+ llap: 'Lap',
698
+ rlap: 'Lap',
699
+ raise: 'RaiseLower',
700
+ lower: 'RaiseLower',
701
+ moveleft: 'MoveLeftRight',
702
+ moveright: 'MoveLeftRight',
703
+
704
+ ',': ['Spacer',MML.LENGTH.THINMATHSPACE],
705
+ ':': ['Spacer',MML.LENGTH.THINMATHSPACE], // for LaTeX
706
+ '>': ['Spacer',MML.LENGTH.MEDIUMMATHSPACE],
707
+ ';': ['Spacer',MML.LENGTH.THICKMATHSPACE],
708
+ '!': ['Spacer',MML.LENGTH.NEGATIVETHINMATHSPACE],
709
+ enspace: ['Spacer',".5em"],
710
+ quad: ['Spacer',"1em"],
711
+ qquad: ['Spacer',"2em"],
712
+ thinspace: ['Spacer',MML.LENGTH.THINMATHSPACE],
713
+ negthinspace: ['Spacer',MML.LENGTH.NEGATIVETHINMATHSPACE],
714
+
715
+ hskip: 'Hskip',
716
+ hspace: 'Hskip',
717
+ kern: 'Hskip',
718
+ mskip: 'Hskip',
719
+ mspace: 'Hskip',
720
+ mkern: 'Hskip',
721
+ Rule: ['Rule'],
722
+ Space: ['Rule','blank'],
723
+
724
+ big: ['MakeBig',MML.TEXCLASS.ORD,0.85],
725
+ Big: ['MakeBig',MML.TEXCLASS.ORD,1.15],
726
+ bigg: ['MakeBig',MML.TEXCLASS.ORD,1.45],
727
+ Bigg: ['MakeBig',MML.TEXCLASS.ORD,1.75],
728
+ bigl: ['MakeBig',MML.TEXCLASS.OPEN,0.85],
729
+ Bigl: ['MakeBig',MML.TEXCLASS.OPEN,1.15],
730
+ biggl: ['MakeBig',MML.TEXCLASS.OPEN,1.45],
731
+ Biggl: ['MakeBig',MML.TEXCLASS.OPEN,1.75],
732
+ bigr: ['MakeBig',MML.TEXCLASS.CLOSE,0.85],
733
+ Bigr: ['MakeBig',MML.TEXCLASS.CLOSE,1.15],
734
+ biggr: ['MakeBig',MML.TEXCLASS.CLOSE,1.45],
735
+ Biggr: ['MakeBig',MML.TEXCLASS.CLOSE,1.75],
736
+ bigm: ['MakeBig',MML.TEXCLASS.REL,0.85],
737
+ Bigm: ['MakeBig',MML.TEXCLASS.REL,1.15],
738
+ biggm: ['MakeBig',MML.TEXCLASS.REL,1.45],
739
+ Biggm: ['MakeBig',MML.TEXCLASS.REL,1.75],
740
+
741
+ mathord: ['TeXAtom',MML.TEXCLASS.ORD],
742
+ mathop: ['TeXAtom',MML.TEXCLASS.OP],
743
+ mathopen: ['TeXAtom',MML.TEXCLASS.OPEN],
744
+ mathclose: ['TeXAtom',MML.TEXCLASS.CLOSE],
745
+ mathbin: ['TeXAtom',MML.TEXCLASS.BIN],
746
+ mathrel: ['TeXAtom',MML.TEXCLASS.REL],
747
+ mathpunct: ['TeXAtom',MML.TEXCLASS.PUNCT],
748
+ mathinner: ['TeXAtom',MML.TEXCLASS.INNER],
749
+
750
+ vcenter: ['TeXAtom',MML.TEXCLASS.VCENTER],
751
+
752
+ mathchoice: ['Extension','mathchoice'],
753
+ buildrel: 'BuildRel',
754
+
755
+ hbox: ['HBox',0],
756
+ text: 'HBox',
757
+ mbox: ['HBox',0],
758
+ fbox: 'FBox',
759
+
760
+ strut: 'Strut',
761
+ mathstrut: ['Macro','\\vphantom{(}'],
762
+ phantom: 'Phantom',
763
+ vphantom: ['Phantom',1,0],
764
+ hphantom: ['Phantom',0,1],
765
+ smash: 'Smash',
766
+
767
+ acute: ['Accent', "02CA"], // or 0301
768
+ grave: ['Accent', "02CB"], // or 0300
769
+ ddot: ['Accent', "00A8"], // or 0308
770
+ tilde: ['Accent', "02DC"], // or 0303
771
+ bar: ['Accent', "02C9"], // or 0304
772
+ breve: ['Accent', "02D8"], // or 0306
773
+ check: ['Accent', "02C7"], // or 030C
774
+ hat: ['Accent', "02C6"], // or 0302
775
+ vec: ['Accent', "20D7"],
776
+ dot: ['Accent', "02D9"], // or 0307
777
+ widetilde: ['Accent', "02DC",1], // or 0303
778
+ widehat: ['Accent', "02C6",1], // or 0302
779
+
780
+ matrix: 'Matrix',
781
+ array: 'Matrix',
782
+ pmatrix: ['Matrix','(',')'],
783
+ cases: ['Matrix','{','',"left left",null,".1em"],
784
+ eqalign: ['Matrix',null,null,"right left",MML.LENGTH.THICKMATHSPACE,".5em",'D'],
785
+ displaylines: ['Matrix',null,null,"center",null,".5em",'D'],
786
+ cr: 'Cr',
787
+ '\\': 'Cr',
788
+ newline: 'Cr',
789
+ // noalign: 'HandleNoAlign',
790
+ eqalignno: ['Matrix',null,null,"right left right",MML.LENGTH.THICKMATHSPACE+" 3em",".5em",'D'],
791
+ leqalignno: ['Matrix',null,null,"right left right",MML.LENGTH.THICKMATHSPACE+" 3em",".5em",'D'],
792
+
793
+ // TeX substitution macros
794
+ bmod: ['Macro','\\mathbin{\\rm mod}'],
795
+ pmod: ['Macro','\\pod{{\\rm mod}\\kern 6mu #1}',1],
796
+ mod: ['Macro','\\mathchoice{\\kern18mu}{\\kern12mu}{\\kern12mu}{\\kern12mu}{\\rm mod}\\,\\,#1',1],
797
+ pod: ['Macro','\\mathchoice{\\kern18mu}{\\kern8mu}{\\kern8mu}{\\kern8mu}(#1)',1],
798
+ iff: ['Macro','\\;\\Longleftrightarrow\\;'],
799
+ skew: ['Macro','{{#2{#3\\mkern#1mu}\\mkern-#1mu}{}}',3],
800
+ mathcal: ['Macro','{\\cal #1}',1],
801
+ mathscr: ['Macro','{\\scr #1}',1],
802
+ mathrm: ['Macro','{\\rm #1}',1],
803
+ mathbf: ['Macro','{\\bf #1}',1],
804
+ mathbb: ['Macro','{\\bbFont #1}',1],
805
+ Bbb: ['Macro','{\\bbFont #1}',1],
806
+ mathit: ['Macro','{\\it #1}',1],
807
+ mathfrak: ['Macro','{\\frak #1}',1],
808
+ mathsf: ['Macro','{\\sf #1}',1],
809
+ mathtt: ['Macro','{\\tt #1}',1],
810
+ textrm: ['Macro','\\mathord{\\rm\\text{#1}}',1],
811
+ textit: ['Macro','\\mathord{\\it{\\text{#1}}}',1],
812
+ textbf: ['Macro','\\mathord{\\bf{\\text{#1}}}',1],
813
+ pmb: ['Macro','\\rlap{#1}\\kern1px{#1}',1],
814
+ TeX: ['Macro','T\\kern-.14em\\lower.5ex{E}\\kern-.115em X'],
815
+ LaTeX: ['Macro','L\\kern-.325em\\raise.21em{\\scriptstyle{A}}\\kern-.17em\\TeX'],
816
+ not: ['Macro','\\mathrel{\\rlap{\\kern.5em\\notChar}}'],
817
+ ' ': ['Macro','\\text{ }'],
818
+ space: 'Tilde',
819
+
820
+
821
+ // LaTeX
822
+ begin: 'Begin',
823
+ end: 'End',
824
+
825
+ newcommand: ['Extension','newcommand'],
826
+ newenvironment: ['Extension','newcommand'],
827
+ def: ['Extension','newcommand'],
828
+
829
+ verb: ['Extension','verb'],
830
+
831
+ boldsymbol: ['Extension','boldsymbol'],
832
+
833
+ tag: ['Extension','AMSmath'],
834
+ notag: ['Extension','AMSmath'],
835
+ label: ['Macro','',1], // not implemented yet
836
+ nonumber: ['Macro',''], // not implemented yet
837
+
838
+ // Extensions to TeX
839
+ unicode: ['Extension','unicode'],
840
+ color: 'Color',
841
+
842
+ // href: ['Extension','HTML'],
843
+ // 'class': ['Extension','HTML'],
844
+ // style: ['Extension','HTML'],
845
+ // cssId: ['Extension','HTML'],
846
+ // bbox: ['Extension','bbox'],
847
+
848
+ require: 'Require'
849
+
850
+ },
851
+
852
+ environment: {
853
+ array: ['Array'],
854
+ matrix: ['Array',null,null,null,'c'],
855
+ pmatrix: ['Array',null,'(',')','c'],
856
+ bmatrix: ['Array',null,'[',']','c'],
857
+ Bmatrix: ['Array',null,'\\{','\\}','c'],
858
+ vmatrix: ['Array',null,'\\vert','\\vert','c'],
859
+ Vmatrix: ['Array',null,'\\Vert','\\Vert','c'],
860
+ cases: ['Array',null,'\\{','.','ll',null,".1em"],
861
+ eqnarray: ['Array',null,null,null,'rcl',MML.LENGTH.THICKMATHSPACE,".5em",'D'],
862
+ 'eqnarray*': ['Array',null,null,null,'rcl',MML.LENGTH.THICKMATHSPACE,".5em",'D'],
863
+
864
+ equation: [null,'Equation'],
865
+ 'equation*': [null,'Equation'],
866
+
867
+ align: ['ExtensionEnv',null,'AMSmath'],
868
+ 'align*': ['ExtensionEnv',null,'AMSmath'],
869
+ aligned: ['ExtensionEnv',null,'AMSmath'],
870
+ multline: ['ExtensionEnv',null,'AMSmath'],
871
+ 'multline*': ['ExtensionEnv',null,'AMSmath'],
872
+ split: ['ExtensionEnv',null,'AMSmath'],
873
+ gather: ['ExtensionEnv',null,'AMSmath'],
874
+ 'gather*': ['ExtensionEnv',null,'AMSmath'],
875
+ gathered: ['ExtensionEnv',null,'AMSmath'],
876
+ alignat: ['ExtensionEnv',null,'AMSmath'],
877
+ 'alignat*': ['ExtensionEnv',null,'AMSmath'],
878
+ alignedat: ['ExtensionEnv',null,'AMSmath']
879
+ },
880
+
881
+ p_height: 1.2 / .85 // cmex10 height plus depth over .85
882
+
883
+ });
884
+ };
885
+
886
+ /************************************************************************/
887
+ /*
888
+ * The TeX Parser
889
+ */
890
+
891
+ TEX.Parse = MathJax.Object.Subclass({
892
+ Init: function (string,env) {
893
+ this.string = string; this.i = 0;
894
+ var ENV; if (env) {ENV = {}; for (var id in env) {if (env.hasOwnProperty(id)) {ENV[id] = env[id]}}}
895
+ this.stack = TEX.Stack(ENV);
896
+ this.Parse();
897
+ this.Push(STACKITEM.stop());
898
+ },
899
+ Parse: function () {
900
+ var c;
901
+ while (this.i < this.string.length) {
902
+ c = this.string.charAt(this.i++);
903
+ if (TEXDEF.special[c]) {this[TEXDEF.special[c]](c)}
904
+ else if (TEXDEF.letter.test(c)) {this.Variable(c)}
905
+ else if (TEXDEF.digit.test(c)) {this.Number(c)}
906
+ else {this.Other(c)}
907
+ }
908
+ },
909
+ Push: function () {this.stack.Push.apply(this.stack,arguments)},
910
+ mml: function () {
911
+ if (this.stack.Top().type !== "mml") {return null}
912
+ return this.stack.Top().data[0];
913
+ },
914
+ mmlToken: function (token) {return token}, // used by boldsymbol extension
915
+
916
+ /************************************************************************/
917
+ /*
918
+ * Handle various token classes
919
+ */
920
+
921
+ /*
922
+ * Lookup a control-sequence and process it
923
+ */
924
+ ControlSequence: function (c) {
925
+ var name = this.GetCS();
926
+ if (TEXDEF.macros[name]) { // javascript macro
927
+ var macro = TEXDEF.macros[name];
928
+ if (!(macro instanceof Array)) {macro = [macro]}
929
+ var fn = macro[0]; if (!(fn instanceof Function)) {fn = this[fn]}
930
+ fn.apply(this,["\\"+name].concat(macro.slice(1)));
931
+ } else if (TEXDEF.mathchar0mi[name]) { // normal mathchar (mi)
932
+ var mchar = TEXDEF.mathchar0mi[name]; var def = {mathvariant: MML.VARIANT.ITALIC};
933
+ if (mchar instanceof Array) {def = mchar[1]; mchar = mchar[0]}
934
+ this.Push(this.mmlToken(MML.mi(MML.entity("#x"+mchar)).With(def)));
935
+ } else if (TEXDEF.mathchar0mo[name]) { // normal mathchar (mo)
936
+ var mchar = TEXDEF.mathchar0mo[name]; var def = {stretchy: FALSE};
937
+ if (mchar instanceof Array) {def = mchar[1]; def.stretchy = FALSE; mchar = mchar[0]}
938
+ this.Push(this.mmlToken(MML.mo(MML.entity("#x"+mchar)).With(def)));
939
+ } else if (TEXDEF.mathchar7[name]) { // mathchar in current family
940
+ var mchar = TEXDEF.mathchar7[name]; var def = {mathvariant: MML.VARIANT.NORMAL};
941
+ if (mchar instanceof Array) {def = mchar[1]; mchar = mchar[0]}
942
+ if (this.stack.env.font) {def.mathvariant = this.stack.env.font}
943
+ this.Push(this.mmlToken(MML.mi(MML.entity("#x"+mchar)).With(def)));
944
+ } else if (TEXDEF.delimiter["\\"+name] != null) { // delimiter
945
+ var delim = TEXDEF.delimiter["\\"+name], def = {};
946
+ if (delim instanceof Array) {def = delim[1]; delim = delim[0]}
947
+ if (delim.length === 4) {delim = MML.entity('#x'+delim)} else {delim = MML.chars(delim)}
948
+ this.Push(this.mmlToken(MML.mo(delim).With({fence: FALSE, stretchy: FALSE}).With(def)));
949
+ } else { // error
950
+ TEX.Error("Undefined control sequence \\"+name);
951
+ }
952
+ },
953
+
954
+ /*
955
+ * Handle a variable (a single letter)
956
+ */
957
+ Variable: function (c) {
958
+ var def = {}; if (this.stack.env.font) {def.mathvariant = this.stack.env.font}
959
+ this.Push(this.mmlToken(MML.mi(MML.chars(c)).With(def)));
960
+ },
961
+
962
+ /*
963
+ * Determine the extent of a number (pattern may need work)
964
+ */
965
+ Number: function (c) {
966
+ var mml, n = this.string.slice(this.i-1).match(TEXDEF.number);
967
+ if (n) {mml = MML.mn(n[0].replace(/[{}]/g,"")); this.i += n[0].length - 1}
968
+ else {mml = MML.mo(MML.chars(c))}
969
+ if (this.stack.env.font) {mml.mathvariant = this.stack.env.font}
970
+ this.Push(this.mmlToken(mml));
971
+ },
972
+
973
+ /*
974
+ * Handle { and }
975
+ */
976
+ Open: function (c) {this.Push(STACKITEM.open())},
977
+ Close: function (c) {this.Push(STACKITEM.close())},
978
+
979
+ /*
980
+ * Handle tilde and spaces
981
+ */
982
+ Tilde: function (c) {this.Push(MML.mtext(MML.chars(" ")))},
983
+ Space: function (c) {},
984
+
985
+ /*
986
+ * Handle ^, _, and '
987
+ */
988
+ Superscript: function (c) {
989
+ var position, base = this.stack.Prev(); if (!base) {base = MML.mi("")}
990
+ if (base.isEmbellishedWrapper) {base = base.data[0].data[0]}
991
+ if (base.type === "msubsup") {
992
+ if (base.data[base.sup]) {
993
+ if (!base.data[base.sup].isPrime) {TEX.Error("Double exponent: use braces to clarify")}
994
+ base = MML.msubsup(base,null,null);
995
+ }
996
+ position = base.sup;
997
+ } else if (base.movesupsub) {
998
+ if (base.type !== "munderover" || base.data[base.over])
999
+ {base = MML.munderover(base,null,null).With({movesupsub:TRUE})}
1000
+ position = base.over;
1001
+ } else {
1002
+ base = MML.msubsup(base,null,null);
1003
+ position = base.sup;
1004
+ }
1005
+ this.Push(STACKITEM.subsup(base).With({position: position}));
1006
+ },
1007
+ Subscript: function (c) {
1008
+ var position, base = this.stack.Prev(); if (!base) {base = MML.mi("")}
1009
+ if (base.isEmbellishedWrapper) {base = base.data[0].data[0]}
1010
+ if (base.type === "msubsup") {
1011
+ if (base.data[base.sub]) {TEX.Error("Double subscripts: use braces to clarify")}
1012
+ position = base.sub;
1013
+ } else if (base.movesupsub) {
1014
+ if (base.type !== "munderover" || base.data[base.under])
1015
+ {base = MML.munderover(base,null,null).With({movesupsub:TRUE})}
1016
+ position = base.under;
1017
+ } else {
1018
+ base = MML.msubsup(base,null,null);
1019
+ position = base.sub;
1020
+ }
1021
+ this.Push(STACKITEM.subsup(base).With({position: position}));
1022
+ },
1023
+ PRIME: String.fromCharCode(0x2032), SMARTQUOTE: String.fromCharCode(0x2019),
1024
+ Prime: function (c) {
1025
+ var base = this.stack.Prev(); if (!base) {base = MML.mi()}
1026
+ if (base.type === "msubsup" && base.data[base.sup])
1027
+ {TEX.Error("Prime causes double exponent: use braces to clarify")}
1028
+ var sup = ""; this.i--;
1029
+ do {sup += this.PRIME; this.i++, c = this.GetNext()}
1030
+ while (c === "'" || c === this.SMARTQUOTE);
1031
+ sup = this.mmlToken(MML.mo(MML.chars(sup)).With({isPrime: TRUE, variantForm: TEX.isSTIX}));
1032
+ this.Push(MML.msubsup(base,null,sup));
1033
+ },
1034
+
1035
+ /*
1036
+ * Handle comments
1037
+ */
1038
+ Comment: function (c) {
1039
+ while (this.i < this.string.length && this.string.charAt(this.i) != "\n") {this.i++}
1040
+ },
1041
+
1042
+ /*
1043
+ * Handle hash marks outside of definitions
1044
+ */
1045
+ Hash: function (c) {
1046
+ TEX.Error("You can't use 'macro parameter character #' in math mode");
1047
+ },
1048
+
1049
+ /*
1050
+ * Handle other characters (as <mo> elements)
1051
+ */
1052
+ Other: function (c) {
1053
+ var def = {stretchy: false}, mo;
1054
+ if (this.stack.env.font) {def.mathvariant = this.stack.env.font}
1055
+ if (TEXDEF.remap[c]) {
1056
+ c = TEXDEF.remap[c];
1057
+ if (c instanceof Array) {def = c[1]; c = c[0]}
1058
+ mo = MML.mo(MML.entity('#x'+c));
1059
+ } else {
1060
+ mo = MML.mo(c);
1061
+ }
1062
+ if (mo.autoDefault("texClass",true) == "") {mo = MML.TeXAtom(mo)}
1063
+ this.Push(this.mmlToken(mo.With(def)));
1064
+ },
1065
+
1066
+ /************************************************************************/
1067
+ /*
1068
+ * Macros
1069
+ */
1070
+
1071
+ SetFont: function (name,font) {this.stack.env.font = font},
1072
+ SetStyle: function (name,texStyle,style,level) {
1073
+ this.stack.env.style = texStyle; this.stack.env.level = level;
1074
+ this.Push(STACKITEM.style().With({styles: {displaystyle: style, scriptlevel: level}}));
1075
+ },
1076
+ SetSize: function (name,size) {
1077
+ this.stack.env.size = size;
1078
+ this.Push(STACKITEM.style().With({styles: {mathsize: size+"em"}})); // convert to absolute?
1079
+ },
1080
+
1081
+ Color: function (name) {
1082
+ var color = this.GetArgument(name);
1083
+ var old = this.stack.env.color; this.stack.env.color = color;
1084
+ var math = this.ParseArg(name);
1085
+ if (old) {this.stack.env.color} else {delete this.stack.env.color}
1086
+ this.Push(MML.mstyle(math).With({mathcolor: color}));
1087
+ },
1088
+
1089
+ Spacer: function (name,space) {
1090
+ this.Push(MML.mspace().With({width: space, mathsize: MML.SIZE.NORMAL, scriptlevel:1}));
1091
+ },
1092
+
1093
+ LeftRight: function (name) {
1094
+ this.Push(STACKITEM[name.substr(1)]().With({delim: this.GetDelimiter(name)}));
1095
+ },
1096
+
1097
+ NamedOp: function (name,limits,id) {
1098
+ var underover = (limits != null && limits === 0 ? FALSE : TRUE);
1099
+ if (!id) {id = name.substr(1)}; limits = ((limits || limits == null) ? TRUE : FALSE);
1100
+ id = id.replace(/&thinsp;/,String.fromCharCode(0x2006));
1101
+ var mml = MML.mo(id).With({
1102
+ movablelimits: limits,
1103
+ movesupsub: underover,
1104
+ form: MML.FORM.PREFIX,
1105
+ texClass: MML.TEXCLASS.OP
1106
+ });
1107
+ mml.useMMLspacing &= ~mml.SPACE_ATTR.form; // don't count this explicit form setting
1108
+ this.Push(this.mmlToken(mml));
1109
+ },
1110
+ Limits: function (name,limits) {
1111
+ var op = this.stack.Prev("nopop");
1112
+ if (op.texClass !== MML.TEXCLASS.OP) {TEX.Error(name+" is allowed only on operators")}
1113
+ op.movesupsub = (limits ? TRUE : FALSE);
1114
+ op.movablelimits = FALSE;
1115
+ },
1116
+
1117
+ Over: function (name,open,close) {
1118
+ var mml = STACKITEM.over().With({name: name});
1119
+ if (open || close) {
1120
+ mml.open = open; mml.close = close;
1121
+ } else if (name.match(/withdelims$/)) {
1122
+ mml.open = this.GetDelimiter(name);
1123
+ mml.close = this.GetDelimiter(name);
1124
+ }
1125
+ if (name.match(/^\\above/)) {mml.thickness = this.GetDimen(name)}
1126
+ else if (name.match(/^\\atop/) || open || close) {mml.thickness = 0}
1127
+ this.Push(mml);
1128
+ },
1129
+
1130
+ Frac: function (name) {
1131
+ var num = this.ParseArg(name);
1132
+ var den = this.ParseArg(name);
1133
+ this.Push(MML.mfrac(num,den));
1134
+ },
1135
+
1136
+ Sqrt: function (name) {
1137
+ var n = this.GetBrackets(name), mml = this.ParseArg(name);
1138
+ if (n == "") {mml = MML.msqrt.apply(MML,mml.array())}
1139
+ else {mml = MML.mroot(mml,this.parseRoot(n))}
1140
+ this.Push(mml);
1141
+ },
1142
+ Root: function (name) {
1143
+ var n = this.GetUpTo(name,"\\of");
1144
+ var arg = this.ParseArg(name);
1145
+ this.Push(MML.mroot(arg,this.parseRoot(n)));
1146
+ },
1147
+ parseRoot: function (n) {
1148
+ var env = this.stack.env, inRoot = env.inRoot; env.inRoot = true;
1149
+ var parser = TEX.Parse(n,env); n = parser.mml(); var global = parser.stack.global;
1150
+ if (global.leftRoot || global.upRoot) {
1151
+ n = MML.mpadded(n);
1152
+ if (global.leftRoot) {n.width = global.leftRoot}
1153
+ if (global.upRoot) {n.voffset = global.upRoot; n.height = global.upRoot}
1154
+ }
1155
+ env.inRoot = inRoot;
1156
+ return n;
1157
+ },
1158
+ MoveRoot: function (name,id) {
1159
+ if (!this.stack.env.inRoot) TEX.Error(name+" can appear only within a root");
1160
+ if (this.stack.global[id]) TEX.Error("Multiple use of "+name);
1161
+ var n = this.GetArgument(name);
1162
+ if (!n.match(/-?[0-9]+/)) TEX.Error("The argument to "+name+" must be an integer");
1163
+ n = (n/15)+"em";
1164
+ if (n.substr(0,1) !== "-") {n = "+"+n}
1165
+ this.stack.global[id] = n;
1166
+ },
1167
+
1168
+ Accent: function (name,accent,stretchy) {
1169
+ var c = this.ParseArg(name);
1170
+ var mml = this.mmlToken(MML.mo(MML.entity("#x"+accent)).With({accent: TRUE}));
1171
+ mml.stretchy = (stretchy ? TRUE : FALSE);
1172
+ this.Push(MML.munderover(c,null,mml).With({accent: TRUE}));
1173
+ },
1174
+
1175
+ UnderOver: function (name,c,stack) {
1176
+ var pos = {o: "over", u: "under"}[name.charAt(1)];
1177
+ var base = this.ParseArg(name);
1178
+ var mml = MML.munderover(base,null,null);
1179
+ if (stack) {mml.movesupsub = TRUE}
1180
+ mml.data[mml[pos]] =
1181
+ this.mmlToken(MML.mo(MML.entity("#x"+c)).With({stretchy: TRUE, accent: (pos == "under")}));
1182
+ this.Push(mml);
1183
+ },
1184
+
1185
+ Overset: function (name) {
1186
+ var top = this.ParseArg(name), base = this.ParseArg(name);
1187
+ this.Push(MML.munderover(base,null,top));
1188
+ },
1189
+ Underset: function (name) {
1190
+ var bot = this.ParseArg(name), base = this.ParseArg(name);
1191
+ this.Push(MML.munderover(base,bot,null));
1192
+ },
1193
+
1194
+ TeXAtom: function (name,mclass) {
1195
+ var def = {texClass: mclass};
1196
+ if (mclass == MML.TEXCLASS.OP) {def.movesupsub = def.movablelimits = TRUE}
1197
+ this.Push(MML.TeXAtom(this.ParseArg(name)).With(def));
1198
+ },
1199
+
1200
+ Strut: function (name) {
1201
+ this.Push(MML.mpadded().With({height: "8.6pt", depth: "3pt", width: 0}));
1202
+ },
1203
+
1204
+ Phantom: function (name,v,h) {
1205
+ var box = MML.mphantom(this.ParseArg(name));
1206
+ if (v || h) {
1207
+ box = MML.mpadded(box);
1208
+ if (h) {box.height = box.depth = 0}
1209
+ if (v) {box.width = 0}
1210
+ }
1211
+ this.Push(box);
1212
+ },
1213
+
1214
+ Smash: function (name) {
1215
+ var bt = this.trimSpaces(this.GetBrackets(name));
1216
+ var smash = MML.mpadded(this.ParseArg(name));
1217
+ switch (bt) {
1218
+ case "b": smash.depth = 0; break;
1219
+ case "t": smash.height = 0; break;
1220
+ default: smash.height = smash.depth = 0;
1221
+ }
1222
+ this.Push(smash);
1223
+ },
1224
+
1225
+ Lap: function (name) {
1226
+ var mml = MML.mpadded(this.ParseArg(name)).With({width: 0});
1227
+ if (name === "\\llap") {mml.lspace = "-1 width"}
1228
+ this.Push(mml);
1229
+ },
1230
+
1231
+ RaiseLower: function (name) {
1232
+ var h = this.GetDimen(name);
1233
+ var item = STACKITEM.position().With({name: name, move: 'vertical'});
1234
+ if (h.charAt(0) === '-') {h = h.slice(1); name = {raise: "\\lower", lower: "\\raise"}[name.substr(1)]}
1235
+ if (name === "\\lower") {item.dh = '-'+h; item.dd = h} else {item.dh = h; item.dd = '-'+h}
1236
+ this.Push(item);
1237
+ },
1238
+
1239
+ MoveLeftRight: function (name) {
1240
+ var h = this.GetDimen(name);
1241
+ var nh = (h.charAt(0) === '-' ? h.slice(1) : '-'+h);
1242
+ if (name === "\\moveleft") {var tmp = h; h = nh; nh = tmp}
1243
+ this.Push(STACKITEM.position().With({
1244
+ name: name, move: 'horizontal',
1245
+ left: MML.mspace().With({width: h, mathsize: MML.SIZE.NORMAL, scriptlevel:1}),
1246
+ right: MML.mspace().With({width: nh, mathsize: MML.SIZE.NORMAL, scriptlevel:1})
1247
+ }));
1248
+ },
1249
+
1250
+ Hskip: function (name) {
1251
+ this.Push(MML.mspace().With({
1252
+ width: this.GetDimen(name), mathsize: MML.SIZE.NORMAL, scriptlevel:0
1253
+ }));
1254
+ },
1255
+
1256
+ Rule: function (name,style) {
1257
+ var w = this.GetDimen(name),
1258
+ h = this.GetDimen(name),
1259
+ d = this.GetDimen(name);
1260
+ var mml, type = "mspace", def = {width:w, height:h, depth:d};
1261
+ if (style !== 'blank') {
1262
+ def.mathbackground = (this.stack.env.color || "black");
1263
+ type = "mpadded";
1264
+ }
1265
+ mml = (MML[type])().With(def);
1266
+ this.Push(mml);
1267
+ },
1268
+
1269
+ MakeBig: function (name,mclass,size) {
1270
+ size *= TEXDEF.p_height;
1271
+ size = String(size).replace(/(\.\d\d\d).+/,'$1')+"em";
1272
+ var delim = this.GetDelimiter(name);
1273
+ this.Push(MML.TeXAtom(MML.mo(delim).With({
1274
+ minsize: size, maxsize: size, scriptlevel: 0,
1275
+ fence: TRUE, stretchy: TRUE, symmetric: TRUE
1276
+ })).With({texClass: mclass}));
1277
+ },
1278
+
1279
+ BuildRel: function (name) {
1280
+ var top = this.ParseUpTo(name,"\\over");
1281
+ var bot = this.ParseArg(name);
1282
+ this.Push(MML.TeXAtom(MML.munderover(bot,null,top)).With({mclass: MML.TEXCLASS.REL}));
1283
+ },
1284
+
1285
+ HBox: function (name,style) {
1286
+ this.Push.apply(this,this.InternalMath(this.GetArgument(name),style));
1287
+ },
1288
+
1289
+ FBox: function (name) {
1290
+ this.Push(MML.menclose.apply(MML,this.InternalMath(this.GetArgument(name))));
1291
+ },
1292
+
1293
+ Require: function (name) {
1294
+ var file = this.GetArgument(name); // @@@ FIXME: check for OK URL
1295
+ this.Extension(null,file);
1296
+ },
1297
+
1298
+ Extension: function (name,file,array) {
1299
+ if (name && !typeof(name) === "string") {name = name.name}
1300
+ file = TEX.extensionDir+"/"+file;
1301
+ if (!file.match(/\.js$/)) {file += ".js"}
1302
+ if (!MathJax.Ajax.loaded[MathJax.Ajax.fileURL(file)]) {
1303
+ if (name != null) {delete TEXDEF[array || 'macros'][name.replace(/^\\/,"")]}
1304
+ MathJax.Hub.RestartAfter(MathJax.Ajax.Require(file));
1305
+ }
1306
+ },
1307
+
1308
+ Macro: function (name,macro,argcount) {
1309
+ if (argcount) {
1310
+ var args = [];
1311
+ for (var i = 0; i < argcount; i++) {args.push(this.GetArgument(name))}
1312
+ macro = this.SubstituteArgs(args,macro);
1313
+ }
1314
+ this.string = this.AddArgs(macro,this.string.slice(this.i));
1315
+ this.i = 0;
1316
+ },
1317
+
1318
+ Matrix: function (name,open,close,align,spacing,vspacing,style) {
1319
+ var c = this.GetNext(); if (c === "") {TEX.Error("Missing argument for "+name)}
1320
+ if (c === "{") {this.i++} else {this.string = c+"}"+this.string.slice(this.i+1); this.i = 0}
1321
+ var array = STACKITEM.array().With({
1322
+ requireClose: TRUE,
1323
+ arraydef: {
1324
+ rowspacing: (vspacing||"3pt"),
1325
+ columnspacing: (spacing||"1em")
1326
+ }
1327
+ });
1328
+ if (open || close) {array.open = open; array.close = close}
1329
+ if (style === "D") {array.arraydef.displaystyle = TRUE}
1330
+ if (align != null) {array.arraydef.columnalign = align}
1331
+ this.Push(array);
1332
+ },
1333
+
1334
+ Entry: function (name) {
1335
+ this.Push(STACKITEM.cell().With({isEntry: TRUE, name: name}));
1336
+ },
1337
+
1338
+ Cr: function (name) {
1339
+ this.Push(STACKITEM.cell().With({isCR: TRUE, name: name}));
1340
+ },
1341
+
1342
+ /************************************************************************/
1343
+ /*
1344
+ * LaTeX environments
1345
+ */
1346
+
1347
+ Begin: function (name) {
1348
+ var env = this.GetArgument(name);
1349
+ if (env.match(/[^a-z*]/i)) {TEX.Error('Invalid environment name "'+env+'"')}
1350
+ if (!TEXDEF.environment[env]) {TEX.Error('Unknown environment "'+env+'"')}
1351
+ var cmd = TEXDEF.environment[env]; if (!(cmd instanceof Array)) {cmd = [cmd]}
1352
+ var mml = STACKITEM.begin().With({name: env, end: cmd[1], parse:this});
1353
+ if (cmd[0] && this[cmd[0]]) {mml = this[cmd[0]].apply(this,[mml].concat(cmd.slice(2)))}
1354
+ this.Push(mml);
1355
+ },
1356
+ End: function (name) {
1357
+ this.Push(STACKITEM.end().With({name: this.GetArgument(name)}));
1358
+ },
1359
+
1360
+ Equation: function (begin,row) {return row},
1361
+
1362
+ ExtensionEnv: function (begin,file) {this.Extension(begin.name,file,"environment")},
1363
+
1364
+ Array: function (begin,open,close,align,spacing,vspacing,style,raggedHeight) {
1365
+ if (!align) {align = this.GetArgument("\\begin{"+begin.name+"}")}
1366
+ var lines = align.replace(/[^clr|]/g,'').replace(/[^|]\|/g,'|').split('').join(' ');
1367
+ align = align.replace(/[^clr]/g,'').split('').join(' ');
1368
+ align = align.replace(/l/g,'left').replace(/r/g,'right').replace(/c/g,'center');
1369
+ var array = STACKITEM.array().With({
1370
+ arraydef: {
1371
+ columnalign: align,
1372
+ columnspacing: (spacing||"1em"),
1373
+ rowspacing: (vspacing||"3pt")
1374
+ }
1375
+ });
1376
+ // FIXME: do something about initial (and terminal?) vertical line
1377
+ if (lines.match(/\|/))
1378
+ {array.arraydef.columnlines = lines.replace(/[^| ]/g,'none').replace(/\|/g,'solid')}
1379
+ if (open) {array.open = this.convertDelimiter(open)}
1380
+ if (close) {array.close = this.convertDelimiter(close)}
1381
+ if (style === "D") {array.arraydef.displaystyle = TRUE}
1382
+ if (style === "S") {array.arraydef.scriptlevel = 1} // FIXME: should use mstyle?
1383
+ if (raggedHeight) {array.arraydef.useHeight = FALSE}
1384
+ this.Push(begin);
1385
+ return array;
1386
+ },
1387
+
1388
+ /************************************************************************/
1389
+ /*
1390
+ * String handling routines
1391
+ */
1392
+
1393
+ /*
1394
+ * Convert delimiter to character
1395
+ */
1396
+ convertDelimiter: function (c) {
1397
+ if (c) {c = TEXDEF.delimiter[c]}
1398
+ if (c == null) {return null}
1399
+ if (c instanceof Array) {c = c[0]}
1400
+ if (c.length === 4) {c = String.fromCharCode(parseInt(c,16))}
1401
+ return c;
1402
+ },
1403
+
1404
+ /*
1405
+ * Trim spaces from a string
1406
+ */
1407
+ trimSpaces: function (text) {
1408
+ if (typeof(text) != 'string') {return text}
1409
+ return text.replace(/^\s+|\s+$/g,'');
1410
+ },
1411
+
1412
+ /*
1413
+ * Check if the next character is a space
1414
+ */
1415
+ nextIsSpace: function () {
1416
+ return this.string.charAt(this.i).match(/[ \n\r\t]/);
1417
+ },
1418
+
1419
+ /*
1420
+ * Get the next non-space character
1421
+ */
1422
+ GetNext: function () {
1423
+ while (this.nextIsSpace()) {this.i++}
1424
+ return this.string.charAt(this.i);
1425
+ },
1426
+
1427
+ /*
1428
+ * Get and return a control-sequence name
1429
+ */
1430
+ GetCS: function () {
1431
+ var CS = this.string.slice(this.i).match(/^([a-z]+|.) ?/i);
1432
+ if (CS) {this.i += CS[1].length; return CS[1]} else {this.i++; return " "}
1433
+ },
1434
+
1435
+ /*
1436
+ * Get and return a TeX argument (either a single character or control sequence,
1437
+ * or the contents of the next set of braces).
1438
+ */
1439
+ GetArgument: function (name,noneOK) {
1440
+ switch (this.GetNext()) {
1441
+ case "":
1442
+ if (!noneOK) {TEX.Error("Missing argument for "+name)}
1443
+ return null;
1444
+ case '}':
1445
+ if (!noneOK) {TEX.Error("Extra close brace or missing open brace")}
1446
+ return null;
1447
+ case '\\':
1448
+ this.i++; return "\\"+this.GetCS();
1449
+ case '{':
1450
+ var j = ++this.i, parens = 1;
1451
+ while (this.i < this.string.length) {
1452
+ switch (this.string.charAt(this.i++)) {
1453
+ case '\\': this.i++; break;
1454
+ case '{': parens++; break;
1455
+ case '}':
1456
+ if (parens == 0) {TEX.Error("Extra close brace")}
1457
+ if (--parens == 0) {return this.string.slice(j,this.i-1)}
1458
+ break;
1459
+ }
1460
+ }
1461
+ TEX.Error("Missing close brace");
1462
+ break;
1463
+ }
1464
+ return this.string.charAt(this.i++);
1465
+ },
1466
+
1467
+ /*
1468
+ * Get an optional LaTeX argument in brackets
1469
+ */
1470
+ GetBrackets: function (name) {
1471
+ if (this.GetNext() != '[') {return ''};
1472
+ var j = ++this.i, parens = 0;
1473
+ while (this.i < this.string.length) {
1474
+ switch (this.string.charAt(this.i++)) {
1475
+ case '{': parens++; break;
1476
+ case '\\': this.i++; break;
1477
+ case '}':
1478
+ if (parens-- <= 0) {TEX.Error("Extra close brace while looking for ']'")}
1479
+ break;
1480
+ case ']':
1481
+ if (parens == 0) {return this.string.slice(j,this.i-1)}
1482
+ break;
1483
+ }
1484
+ }
1485
+ TEX.Error("Couldn't find closing ']' for argument to "+name);
1486
+ },
1487
+
1488
+ /*
1489
+ * Get the name of a delimiter (check it in the delimiter list).
1490
+ */
1491
+ GetDelimiter: function (name) {
1492
+ while (this.nextIsSpace()) {this.i++}
1493
+ var c = this.string.charAt(this.i);
1494
+ if (this.i < this.string.length) {
1495
+ this.i++; if (c == "\\") {c += this.GetCS(name)}
1496
+ if (TEXDEF.delimiter[c] != null) {return this.convertDelimiter(c)}
1497
+ }
1498
+ TEX.Error("Missing or unrecognized delimiter for "+name);
1499
+ },
1500
+
1501
+ /*
1502
+ * Get a dimension (including its units).
1503
+ */
1504
+ GetDimen: function (name) {
1505
+ if (this.nextIsSpace()) {this.i++}
1506
+ if (this.string.charAt(this.i) == '{') {
1507
+ var dimen = this.GetArgument(name);
1508
+ if (dimen.match(/^\s*([-+]?(\.\d+|\d+(\.\d*)?))\s*(pt|em|ex|mu|px|mm|cm|in|pc)\s*$/))
1509
+ {return dimen.replace(/ /g,"")}
1510
+ } else {
1511
+ var dimen = this.string.slice(this.i);
1512
+ var match = dimen.match(/^\s*(([-+]?(\.\d+|\d+(\.\d*)?))\s*(pt|em|ex|mu|px|mm|cm|in|pc)) ?/);
1513
+ if (match) {
1514
+ this.i += match[0].length;
1515
+ return match[1].replace(/ /g,"");
1516
+ }
1517
+ }
1518
+ TEX.Error("Missing dimension or its units for "+name);
1519
+ },
1520
+
1521
+ /*
1522
+ * Get everything up to the given control sequence (token)
1523
+ */
1524
+ GetUpTo: function (name,token) {
1525
+ while (this.nextIsSpace()) {this.i++}
1526
+ var j = this.i, k, c, parens = 0;
1527
+ while (this.i < this.string.length) {
1528
+ k = this.i; c = this.string.charAt(this.i++);
1529
+ switch (c) {
1530
+ case '\\': c += this.GetCS(); break;
1531
+ case '{': parens++; break;
1532
+ case '}':
1533
+ if (parens == 0) {TEX.Error("Extra close brace while looking for "+token)}
1534
+ parens--;
1535
+ break;
1536
+ }
1537
+ if (parens == 0 && c == token) {return this.string.slice(j,k)}
1538
+ }
1539
+ TEX.Error("Couldn't find "+token+" for "+name);
1540
+ },
1541
+
1542
+ /*
1543
+ * Parse various substrings
1544
+ */
1545
+ ParseArg: function (name) {return TEX.Parse(this.GetArgument(name),this.stack.env).mml()},
1546
+ ParseUpTo: function (name,token) {return TEX.Parse(this.GetUpTo(name,token),this.stack.env).mml()},
1547
+
1548
+ /*
1549
+ * Break up a string into text and math blocks
1550
+ * @@@ FIXME: skip over braced groups? @@@
1551
+ * @@@ FIXME: pass environment to TEX.Parse? @@@
1552
+ */
1553
+ InternalMath: function (text,level) {
1554
+ var def = {displaystyle: FALSE}; if (level != null) {def.scriptlevel = level}
1555
+ if (this.stack.env.font) {def.mathvariant = this.stack.env.font}
1556
+ if (!text.match(/\$|\\\(/)) {return [MML.mtext(MML.chars(text)).With(def)]}
1557
+ var i = 0, k = 0, c, match = '';
1558
+ var mml = [];
1559
+ while (i < text.length) {
1560
+ c = text.charAt(i++);
1561
+ if (c === '$') {
1562
+ if (match === '$') {
1563
+ mml.push(MML.TeXAtom(TEX.Parse(text.slice(k,i-1)).mml().With(def)));
1564
+ match = ''; k = i;
1565
+ } else {
1566
+ if (k < i-1) {mml.push(MML.mtext(MML.chars(text.slice(k,i-1))).With(def))}
1567
+ match = '$'; k = i;
1568
+ }
1569
+ } else if (c === '\\') {
1570
+ c = text.charAt(i++);
1571
+ if (c === '(' && match == '') {
1572
+ if (k < i-2) {mml.push(MML.mtext(MML.chars(text.slice(k,i-2))).With(def))}
1573
+ match = ')'; k = i;
1574
+ } else if (c === ')' && match === ')') {
1575
+ mml.push(MML.TeXAtom(TEX.Parse(text.slice(k,i-2)).mml().With(def)));
1576
+ match = ''; k = i;
1577
+ }
1578
+ }
1579
+ }
1580
+ if (match !== '') {TEX.Error("Math not terminated in text box")}
1581
+ if (k < text.length) {mml.push(MML.mtext(MML.chars(text.slice(k))).With(def))}
1582
+ return mml;
1583
+ },
1584
+
1585
+ /*
1586
+ * Replace macro paramters with their values
1587
+ */
1588
+ SubstituteArgs: function (args,string) {
1589
+ var text = ''; var newstring = ''; var c; var i = 0;
1590
+ while (i < string.length) {
1591
+ c = string.charAt(i++);
1592
+ if (c === "\\") {text += c + string.charAt(i++)}
1593
+ else if (c === '#') {
1594
+ c = string.charAt(i++);
1595
+ if (c === '#') {text += c} else {
1596
+ if (!c.match(/[1-9]/) || c > args.length)
1597
+ {TEX.Error("Illegal macro parameter reference")}
1598
+ newstring = this.AddArgs(this.AddArgs(newstring,text),args[c-1]);
1599
+ text = '';
1600
+ }
1601
+ } else {text += c}
1602
+ }
1603
+ return this.AddArgs(newstring,text);
1604
+ },
1605
+
1606
+ /*
1607
+ * Make sure that macros are followed by a space if their names
1608
+ * could accidentally be continued into the following text.
1609
+ */
1610
+ AddArgs: function (s1,s2) {
1611
+ if (s2.match(/^[a-z]/i) && s1.match(/(^|[^\\])(\\\\)*\\[a-z]+$/i)) {s1 += ' '}
1612
+ return s1+s2;
1613
+ }
1614
+
1615
+ });
1616
+
1617
+ /************************************************************************/
1618
+
1619
+ TEX.Augment({
1620
+ Translate: function (script) {
1621
+ var mml, math = script.innerHTML.replace(/^\s+/,"").replace(/\s+$/,"");
1622
+ if (MathJax.Hub.Browser.isKonqueror)
1623
+ {math = math.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}
1624
+ var displaystyle =
1625
+ (script.type.replace(/\n/g," ").match(/(;|\s|\n)mode\s*=\s*display(;|\s|\n|$)/) != null);
1626
+ math = TEX.prefilterMath(math,displaystyle,script);
1627
+ try {
1628
+ mml = TEX.Parse(math).mml();
1629
+ // mml = MML.semantics(mml,MML.annotation(math).With({encoding:"application:x-tex"}));
1630
+ } catch(err) {
1631
+ if (!err.texError) {throw err}
1632
+ mml = this.formatError(err,math,displaystyle,script);
1633
+ }
1634
+ if (mml.inferred) {mml = MML.apply(MathJax.ElementJax,mml.data)} else {mml = MML(mml)}
1635
+ if (displaystyle) {mml.root.display = "block"}
1636
+ return mml;
1637
+ },
1638
+ prefilterMath: function (math,displaystyle,script) {return math},
1639
+ formatError: function (err,math,displaystyle,script) {
1640
+ return MML.merror(err.message.replace(/\n.*/,""));
1641
+ },
1642
+ Error: function (message) {
1643
+ throw MathJax.Hub.Insert(Error(message),{texError: TRUE});
1644
+ },
1645
+ Macro: function (name,def,argn) {
1646
+ TEXDEF.macros[name] = ['Macro'].concat([].slice.call(arguments,1));
1647
+ }
1648
+ });
1649
+
1650
+ TEX.loadComplete("jax.js");
1651
+
1652
+ })(MathJax.InputJax.TeX);