mathematical 1.6.17 → 1.6.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1186) hide show
  1. checksums.yaml +4 -4
  2. data/ext/mathematical/lasem/COPYING +502 -0
  3. data/ext/mathematical/lasem/NEWS.md +146 -0
  4. data/ext/mathematical/lasem/README.md +65 -0
  5. data/ext/mathematical/lasem/TODO +50 -0
  6. data/ext/mathematical/lasem/docs/lasem-render-0.6.1 +106 -0
  7. data/ext/mathematical/lasem/docs/meson.build +3 -0
  8. data/ext/mathematical/lasem/docs/reference/lasem/building.md +32 -0
  9. data/ext/mathematical/lasem/docs/reference/lasem/lasem.toml.in +47 -0
  10. data/ext/mathematical/lasem/docs/reference/lasem/meson.build +44 -0
  11. data/ext/mathematical/lasem/docs/reference/lasem/overview.md +24 -0
  12. data/ext/mathematical/lasem/docs/reference/lasem/urlmap.js +5 -0
  13. data/ext/mathematical/lasem/itex2mml/COPYING.itex2MML +3 -0
  14. data/ext/mathematical/lasem/itex2mml/README.itex2MML +16 -0
  15. data/ext/mathematical/lasem/itex2mml/itex2MML.h +63 -0
  16. data/ext/mathematical/lasem/itex2mml/itex2MML.l +1183 -0
  17. data/ext/mathematical/lasem/itex2mml/itex2MML.y +2108 -0
  18. data/ext/mathematical/lasem/itex2mml/meson.build +17 -0
  19. data/ext/mathematical/lasem/lasem.doap +21 -0
  20. data/ext/mathematical/lasem/meson.build +46 -0
  21. data/ext/mathematical/lasem/meson_options.txt +5 -0
  22. data/ext/mathematical/lasem/org.lasem.Viewer.json +41 -0
  23. data/ext/mathematical/lasem/po/LINGUAS +31 -0
  24. data/ext/mathematical/lasem/po/POTFILES.in +195 -0
  25. data/ext/mathematical/lasem/po/POTFILES.skip +1 -0
  26. data/ext/mathematical/lasem/po/bs.po +65 -0
  27. data/ext/mathematical/lasem/po/cs.po +102 -0
  28. data/ext/mathematical/lasem/po/da.po +99 -0
  29. data/ext/mathematical/lasem/po/de.po +104 -0
  30. data/ext/mathematical/lasem/po/el.po +73 -0
  31. data/ext/mathematical/lasem/po/es.po +107 -0
  32. data/ext/mathematical/lasem/po/eu.po +66 -0
  33. data/ext/mathematical/lasem/po/fr.po +65 -0
  34. data/ext/mathematical/lasem/po/fur.po +101 -0
  35. data/ext/mathematical/lasem/po/gl.po +64 -0
  36. data/ext/mathematical/lasem/po/hu.po +105 -0
  37. data/ext/mathematical/lasem/po/id.po +102 -0
  38. data/ext/mathematical/lasem/po/it.po +104 -0
  39. data/ext/mathematical/lasem/po/lt.po +106 -0
  40. data/ext/mathematical/lasem/po/lv.po +109 -0
  41. data/ext/mathematical/lasem/po/meson.build +4 -0
  42. data/ext/mathematical/lasem/po/nb.po +62 -0
  43. data/ext/mathematical/lasem/po/nl.po +102 -0
  44. data/ext/mathematical/lasem/po/oc.po +65 -0
  45. data/ext/mathematical/lasem/po/pl.po +102 -0
  46. data/ext/mathematical/lasem/po/pt.po +77 -0
  47. data/ext/mathematical/lasem/po/pt_BR.po +105 -0
  48. data/ext/mathematical/lasem/po/ru.po +66 -0
  49. data/ext/mathematical/lasem/po/sl.po +117 -0
  50. data/ext/mathematical/lasem/po/sr.po +105 -0
  51. data/ext/mathematical/lasem/po/sr@latin.po +105 -0
  52. data/ext/mathematical/lasem/po/sv.po +105 -0
  53. data/ext/mathematical/lasem/po/tg.po +64 -0
  54. data/ext/mathematical/lasem/po/tr.po +105 -0
  55. data/ext/mathematical/lasem/po/zh_CN.po +100 -0
  56. data/ext/mathematical/lasem/src/lasemrender.c +357 -0
  57. data/ext/mathematical/lasem/src/lsm.c +33 -0
  58. data/ext/mathematical/lasem/src/lsm.h +39 -0
  59. data/ext/mathematical/lasem/src/lsmattributes.c +276 -0
  60. data/ext/mathematical/lasem/src/lsmattributes.h +75 -0
  61. data/ext/mathematical/lasem/src/lsmcairo.c +598 -0
  62. data/ext/mathematical/lasem/src/lsmcairo.h +51 -0
  63. data/ext/mathematical/lasem/src/lsmdebug.c +185 -0
  64. data/ext/mathematical/lasem/src/lsmdebug.h +73 -0
  65. data/ext/mathematical/lasem/src/lsmdom.h +43 -0
  66. data/ext/mathematical/lasem/src/lsmdomcharacterdata.c +131 -0
  67. data/ext/mathematical/lasem/src/lsmdomcharacterdata.h +59 -0
  68. data/ext/mathematical/lasem/src/lsmdomdocument.c +272 -0
  69. data/ext/mathematical/lasem/src/lsmdomdocument.h +75 -0
  70. data/ext/mathematical/lasem/src/lsmdomdocumentfragment.c +81 -0
  71. data/ext/mathematical/lasem/src/lsmdomdocumentfragment.h +55 -0
  72. data/ext/mathematical/lasem/src/lsmdomelement.c +148 -0
  73. data/ext/mathematical/lasem/src/lsmdomelement.h +62 -0
  74. data/ext/mathematical/lasem/src/lsmdomentities.c +2166 -0
  75. data/ext/mathematical/lasem/src/lsmdomentities.h +35 -0
  76. data/ext/mathematical/lasem/src/lsmdomimplementation.c +82 -0
  77. data/ext/mathematical/lasem/src/lsmdomimplementation.h +41 -0
  78. data/ext/mathematical/lasem/src/lsmdomnamednodemap.c +118 -0
  79. data/ext/mathematical/lasem/src/lsmdomnamednodemap.h +64 -0
  80. data/ext/mathematical/lasem/src/lsmdomnode.c +737 -0
  81. data/ext/mathematical/lasem/src/lsmdomnode.h +122 -0
  82. data/ext/mathematical/lasem/src/lsmdomnodelist.c +70 -0
  83. data/ext/mathematical/lasem/src/lsmdomnodelist.h +58 -0
  84. data/ext/mathematical/lasem/src/lsmdomparser.c +523 -0
  85. data/ext/mathematical/lasem/src/lsmdomparser.h +54 -0
  86. data/ext/mathematical/lasem/src/lsmdomtext.c +82 -0
  87. data/ext/mathematical/lasem/src/lsmdomtext.h +55 -0
  88. data/ext/mathematical/lasem/src/lsmdomtypes.h +44 -0
  89. data/ext/mathematical/lasem/src/lsmdomview.c +423 -0
  90. data/ext/mathematical/lasem/src/lsmdomview.h +94 -0
  91. data/ext/mathematical/lasem/src/lsmitex.c +79 -0
  92. data/ext/mathematical/lasem/src/lsmitex.h +36 -0
  93. data/ext/mathematical/lasem/src/lsmmathml.h +66 -0
  94. data/ext/mathematical/lasem/src/lsmmathmlactionelement.c +93 -0
  95. data/ext/mathematical/lasem/src/lsmmathmlactionelement.h +57 -0
  96. data/ext/mathematical/lasem/src/lsmmathmlaligngroupelement.c +102 -0
  97. data/ext/mathematical/lasem/src/lsmmathmlaligngroupelement.h +56 -0
  98. data/ext/mathematical/lasem/src/lsmmathmlalignmarkelement.c +102 -0
  99. data/ext/mathematical/lasem/src/lsmmathmlalignmarkelement.h +56 -0
  100. data/ext/mathematical/lasem/src/lsmmathmlattributes.c +219 -0
  101. data/ext/mathematical/lasem/src/lsmmathmlattributes.h +126 -0
  102. data/ext/mathematical/lasem/src/lsmmathmldocument.c +307 -0
  103. data/ext/mathematical/lasem/src/lsmmathmldocument.h +61 -0
  104. data/ext/mathematical/lasem/src/lsmmathmlelement.c +491 -0
  105. data/ext/mathematical/lasem/src/lsmmathmlelement.h +107 -0
  106. data/ext/mathematical/lasem/src/lsmmathmlencloseelement.c +142 -0
  107. data/ext/mathematical/lasem/src/lsmmathmlencloseelement.h +64 -0
  108. data/ext/mathematical/lasem/src/lsmmathmlenums.c +500 -0
  109. data/ext/mathematical/lasem/src/lsmmathmlenums.h +224 -0
  110. data/ext/mathematical/lasem/src/lsmmathmlerrorelement.c +58 -0
  111. data/ext/mathematical/lasem/src/lsmmathmlerrorelement.h +56 -0
  112. data/ext/mathematical/lasem/src/lsmmathmlfencedelement.c +180 -0
  113. data/ext/mathematical/lasem/src/lsmmathmlfencedelement.h +65 -0
  114. data/ext/mathematical/lasem/src/lsmmathmlfractionelement.c +253 -0
  115. data/ext/mathematical/lasem/src/lsmmathmlfractionelement.h +62 -0
  116. data/ext/mathematical/lasem/src/lsmmathmlglyphtableams.c +661 -0
  117. data/ext/mathematical/lasem/src/lsmmathmlglyphtableams.h +45 -0
  118. data/ext/mathematical/lasem/src/lsmmathmlitexelement.c +189 -0
  119. data/ext/mathematical/lasem/src/lsmmathmlitexelement.h +60 -0
  120. data/ext/mathematical/lasem/src/lsmmathmllayoututils.c +191 -0
  121. data/ext/mathematical/lasem/src/lsmmathmllayoututils.h +58 -0
  122. data/ext/mathematical/lasem/src/lsmmathmlmathelement.c +212 -0
  123. data/ext/mathematical/lasem/src/lsmmathmlmathelement.h +81 -0
  124. data/ext/mathematical/lasem/src/lsmmathmloperatordictionary.c +3342 -0
  125. data/ext/mathematical/lasem/src/lsmmathmloperatordictionary.h +55 -0
  126. data/ext/mathematical/lasem/src/lsmmathmloperatorelement.c +314 -0
  127. data/ext/mathematical/lasem/src/lsmmathmloperatorelement.h +73 -0
  128. data/ext/mathematical/lasem/src/lsmmathmlpaddedelement.c +137 -0
  129. data/ext/mathematical/lasem/src/lsmmathmlpaddedelement.h +61 -0
  130. data/ext/mathematical/lasem/src/lsmmathmlphantomelement.c +71 -0
  131. data/ext/mathematical/lasem/src/lsmmathmlphantomelement.h +56 -0
  132. data/ext/mathematical/lasem/src/lsmmathmlpresentationcontainer.c +43 -0
  133. data/ext/mathematical/lasem/src/lsmmathmlpresentationcontainer.h +54 -0
  134. data/ext/mathematical/lasem/src/lsmmathmlpresentationtoken.c +303 -0
  135. data/ext/mathematical/lasem/src/lsmmathmlpresentationtoken.h +83 -0
  136. data/ext/mathematical/lasem/src/lsmmathmlradicalelement.c +266 -0
  137. data/ext/mathematical/lasem/src/lsmmathmlradicalelement.h +71 -0
  138. data/ext/mathematical/lasem/src/lsmmathmlrowelement.c +58 -0
  139. data/ext/mathematical/lasem/src/lsmmathmlrowelement.h +56 -0
  140. data/ext/mathematical/lasem/src/lsmmathmlscriptelement.c +282 -0
  141. data/ext/mathematical/lasem/src/lsmmathmlscriptelement.h +78 -0
  142. data/ext/mathematical/lasem/src/lsmmathmlsemanticselement.c +84 -0
  143. data/ext/mathematical/lasem/src/lsmmathmlsemanticselement.h +56 -0
  144. data/ext/mathematical/lasem/src/lsmmathmlspaceelement.c +156 -0
  145. data/ext/mathematical/lasem/src/lsmmathmlspaceelement.h +60 -0
  146. data/ext/mathematical/lasem/src/lsmmathmlstringelement.c +123 -0
  147. data/ext/mathematical/lasem/src/lsmmathmlstringelement.h +58 -0
  148. data/ext/mathematical/lasem/src/lsmmathmlstyle.c +130 -0
  149. data/ext/mathematical/lasem/src/lsmmathmlstyle.h +89 -0
  150. data/ext/mathematical/lasem/src/lsmmathmlstyleelement.c +391 -0
  151. data/ext/mathematical/lasem/src/lsmmathmlstyleelement.h +94 -0
  152. data/ext/mathematical/lasem/src/lsmmathmltablecellelement.c +122 -0
  153. data/ext/mathematical/lasem/src/lsmmathmltablecellelement.h +62 -0
  154. data/ext/mathematical/lasem/src/lsmmathmltableelement.c +572 -0
  155. data/ext/mathematical/lasem/src/lsmmathmltableelement.h +78 -0
  156. data/ext/mathematical/lasem/src/lsmmathmltablerowelement.c +120 -0
  157. data/ext/mathematical/lasem/src/lsmmathmltablerowelement.h +64 -0
  158. data/ext/mathematical/lasem/src/lsmmathmltraits.c +867 -0
  159. data/ext/mathematical/lasem/src/lsmmathmltraits.h +129 -0
  160. data/ext/mathematical/lasem/src/lsmmathmltypes.h +67 -0
  161. data/ext/mathematical/lasem/src/lsmmathmlunderoverelement.c +485 -0
  162. data/ext/mathematical/lasem/src/lsmmathmlunderoverelement.h +82 -0
  163. data/ext/mathematical/lasem/src/lsmmathmlutils.c +170 -0
  164. data/ext/mathematical/lasem/src/lsmmathmlutils.h +57 -0
  165. data/ext/mathematical/lasem/src/lsmmathmlview.c +1343 -0
  166. data/ext/mathematical/lasem/src/lsmmathmlview.h +179 -0
  167. data/ext/mathematical/lasem/src/lsmmisc.c +15 -0
  168. data/ext/mathematical/lasem/src/lsmmisc.h +32 -0
  169. data/ext/mathematical/lasem/src/lsmproperties.c +415 -0
  170. data/ext/mathematical/lasem/src/lsmproperties.h +85 -0
  171. data/ext/mathematical/lasem/src/lsmstr.c +231 -0
  172. data/ext/mathematical/lasem/src/lsmstr.h +114 -0
  173. data/ext/mathematical/lasem/src/lsmsvg.h +67 -0
  174. data/ext/mathematical/lasem/src/lsmsvgaelement.c +73 -0
  175. data/ext/mathematical/lasem/src/lsmsvgaelement.h +55 -0
  176. data/ext/mathematical/lasem/src/lsmsvgattributes.h +168 -0
  177. data/ext/mathematical/lasem/src/lsmsvgcircleelement.c +153 -0
  178. data/ext/mathematical/lasem/src/lsmsvgcircleelement.h +59 -0
  179. data/ext/mathematical/lasem/src/lsmsvgclippathelement.c +134 -0
  180. data/ext/mathematical/lasem/src/lsmsvgclippathelement.h +59 -0
  181. data/ext/mathematical/lasem/src/lsmsvgcolors.c +212 -0
  182. data/ext/mathematical/lasem/src/lsmsvgcolors.h +39 -0
  183. data/ext/mathematical/lasem/src/lsmsvgdefselement.c +74 -0
  184. data/ext/mathematical/lasem/src/lsmsvgdefselement.h +55 -0
  185. data/ext/mathematical/lasem/src/lsmsvgdocument.c +306 -0
  186. data/ext/mathematical/lasem/src/lsmsvgdocument.h +64 -0
  187. data/ext/mathematical/lasem/src/lsmsvgelement.c +371 -0
  188. data/ext/mathematical/lasem/src/lsmsvgelement.h +80 -0
  189. data/ext/mathematical/lasem/src/lsmsvgellipseelement.c +158 -0
  190. data/ext/mathematical/lasem/src/lsmsvgellipseelement.h +60 -0
  191. data/ext/mathematical/lasem/src/lsmsvgenums.c +674 -0
  192. data/ext/mathematical/lasem/src/lsmsvgenums.h +416 -0
  193. data/ext/mathematical/lasem/src/lsmsvgfilterblend.c +105 -0
  194. data/ext/mathematical/lasem/src/lsmsvgfilterblend.h +58 -0
  195. data/ext/mathematical/lasem/src/lsmsvgfiltercolormatrix.c +115 -0
  196. data/ext/mathematical/lasem/src/lsmsvgfiltercolormatrix.h +58 -0
  197. data/ext/mathematical/lasem/src/lsmsvgfiltercomposite.c +109 -0
  198. data/ext/mathematical/lasem/src/lsmsvgfiltercomposite.h +58 -0
  199. data/ext/mathematical/lasem/src/lsmsvgfilterconvolvematrix.c +206 -0
  200. data/ext/mathematical/lasem/src/lsmsvgfilterconvolvematrix.h +64 -0
  201. data/ext/mathematical/lasem/src/lsmsvgfilterdisplacementmap.c +124 -0
  202. data/ext/mathematical/lasem/src/lsmsvgfilterdisplacementmap.h +60 -0
  203. data/ext/mathematical/lasem/src/lsmsvgfilterelement.c +266 -0
  204. data/ext/mathematical/lasem/src/lsmsvgfilterelement.h +66 -0
  205. data/ext/mathematical/lasem/src/lsmsvgfilterflood.c +86 -0
  206. data/ext/mathematical/lasem/src/lsmsvgfilterflood.h +55 -0
  207. data/ext/mathematical/lasem/src/lsmsvgfiltergaussianblur.c +114 -0
  208. data/ext/mathematical/lasem/src/lsmsvgfiltergaussianblur.h +57 -0
  209. data/ext/mathematical/lasem/src/lsmsvgfilterimage.c +169 -0
  210. data/ext/mathematical/lasem/src/lsmsvgfilterimage.h +61 -0
  211. data/ext/mathematical/lasem/src/lsmsvgfiltermerge.c +98 -0
  212. data/ext/mathematical/lasem/src/lsmsvgfiltermerge.h +55 -0
  213. data/ext/mathematical/lasem/src/lsmsvgfiltermergenode.c +87 -0
  214. data/ext/mathematical/lasem/src/lsmsvgfiltermergenode.h +57 -0
  215. data/ext/mathematical/lasem/src/lsmsvgfiltermorphology.c +116 -0
  216. data/ext/mathematical/lasem/src/lsmsvgfiltermorphology.h +58 -0
  217. data/ext/mathematical/lasem/src/lsmsvgfilteroffset.c +112 -0
  218. data/ext/mathematical/lasem/src/lsmsvgfilteroffset.h +58 -0
  219. data/ext/mathematical/lasem/src/lsmsvgfilterprimitive.c +168 -0
  220. data/ext/mathematical/lasem/src/lsmsvgfilterprimitive.h +66 -0
  221. data/ext/mathematical/lasem/src/lsmsvgfilterspecularlighting.c +134 -0
  222. data/ext/mathematical/lasem/src/lsmsvgfilterspecularlighting.h +60 -0
  223. data/ext/mathematical/lasem/src/lsmsvgfiltersurface.c +1540 -0
  224. data/ext/mathematical/lasem/src/lsmsvgfiltersurface.h +92 -0
  225. data/ext/mathematical/lasem/src/lsmsvgfiltertile.c +102 -0
  226. data/ext/mathematical/lasem/src/lsmsvgfiltertile.h +57 -0
  227. data/ext/mathematical/lasem/src/lsmsvgfilterturbulence.c +142 -0
  228. data/ext/mathematical/lasem/src/lsmsvgfilterturbulence.h +61 -0
  229. data/ext/mathematical/lasem/src/lsmsvggelement.c +73 -0
  230. data/ext/mathematical/lasem/src/lsmsvggelement.h +55 -0
  231. data/ext/mathematical/lasem/src/lsmsvggradientelement.c +151 -0
  232. data/ext/mathematical/lasem/src/lsmsvggradientelement.h +68 -0
  233. data/ext/mathematical/lasem/src/lsmsvgimageelement.c +261 -0
  234. data/ext/mathematical/lasem/src/lsmsvgimageelement.h +67 -0
  235. data/ext/mathematical/lasem/src/lsmsvglength.c +152 -0
  236. data/ext/mathematical/lasem/src/lsmsvglength.h +65 -0
  237. data/ext/mathematical/lasem/src/lsmsvglineargradientelement.c +271 -0
  238. data/ext/mathematical/lasem/src/lsmsvglineargradientelement.h +60 -0
  239. data/ext/mathematical/lasem/src/lsmsvglineelement.c +153 -0
  240. data/ext/mathematical/lasem/src/lsmsvglineelement.h +60 -0
  241. data/ext/mathematical/lasem/src/lsmsvgmarkerelement.c +266 -0
  242. data/ext/mathematical/lasem/src/lsmsvgmarkerelement.h +74 -0
  243. data/ext/mathematical/lasem/src/lsmsvgmaskelement.c +232 -0
  244. data/ext/mathematical/lasem/src/lsmsvgmaskelement.h +64 -0
  245. data/ext/mathematical/lasem/src/lsmsvgmatrix.c +221 -0
  246. data/ext/mathematical/lasem/src/lsmsvgmatrix.h +60 -0
  247. data/ext/mathematical/lasem/src/lsmsvgpathelement.c +115 -0
  248. data/ext/mathematical/lasem/src/lsmsvgpathelement.h +59 -0
  249. data/ext/mathematical/lasem/src/lsmsvgpatternelement.c +398 -0
  250. data/ext/mathematical/lasem/src/lsmsvgpatternelement.h +69 -0
  251. data/ext/mathematical/lasem/src/lsmsvgpolygonelement.c +106 -0
  252. data/ext/mathematical/lasem/src/lsmsvgpolygonelement.h +57 -0
  253. data/ext/mathematical/lasem/src/lsmsvgpolylineelement.c +106 -0
  254. data/ext/mathematical/lasem/src/lsmsvgpolylineelement.h +57 -0
  255. data/ext/mathematical/lasem/src/lsmsvgradialgradientelement.c +323 -0
  256. data/ext/mathematical/lasem/src/lsmsvgradialgradientelement.h +61 -0
  257. data/ext/mathematical/lasem/src/lsmsvgrectelement.c +184 -0
  258. data/ext/mathematical/lasem/src/lsmsvgrectelement.h +62 -0
  259. data/ext/mathematical/lasem/src/lsmsvgstopelement.c +106 -0
  260. data/ext/mathematical/lasem/src/lsmsvgstopelement.h +57 -0
  261. data/ext/mathematical/lasem/src/lsmsvgstyle.c +546 -0
  262. data/ext/mathematical/lasem/src/lsmsvgstyle.h +217 -0
  263. data/ext/mathematical/lasem/src/lsmsvgsvgelement.c +266 -0
  264. data/ext/mathematical/lasem/src/lsmsvgsvgelement.h +71 -0
  265. data/ext/mathematical/lasem/src/lsmsvgswitchelement.c +103 -0
  266. data/ext/mathematical/lasem/src/lsmsvgswitchelement.h +55 -0
  267. data/ext/mathematical/lasem/src/lsmsvgsymbolelement.c +148 -0
  268. data/ext/mathematical/lasem/src/lsmsvgsymbolelement.h +58 -0
  269. data/ext/mathematical/lasem/src/lsmsvgtextelement.c +203 -0
  270. data/ext/mathematical/lasem/src/lsmsvgtextelement.h +60 -0
  271. data/ext/mathematical/lasem/src/lsmsvgtraits.c +1490 -0
  272. data/ext/mathematical/lasem/src/lsmsvgtraits.h +122 -0
  273. data/ext/mathematical/lasem/src/lsmsvgtransformable.c +106 -0
  274. data/ext/mathematical/lasem/src/lsmsvgtransformable.h +54 -0
  275. data/ext/mathematical/lasem/src/lsmsvgtspanelement.c +174 -0
  276. data/ext/mathematical/lasem/src/lsmsvgtspanelement.h +60 -0
  277. data/ext/mathematical/lasem/src/lsmsvgtypes.h +83 -0
  278. data/ext/mathematical/lasem/src/lsmsvguseelement.c +238 -0
  279. data/ext/mathematical/lasem/src/lsmsvguseelement.h +69 -0
  280. data/ext/mathematical/lasem/src/lsmsvgview.c +2797 -0
  281. data/ext/mathematical/lasem/src/lsmsvgview.h +203 -0
  282. data/ext/mathematical/lasem/src/lsmtraits.c +171 -0
  283. data/ext/mathematical/lasem/src/lsmtraits.h +51 -0
  284. data/ext/mathematical/lasem/src/lsmtypes.h +36 -0
  285. data/ext/mathematical/lasem/src/lsmutils.c +54 -0
  286. data/ext/mathematical/lasem/src/lsmutils.h +56 -0
  287. data/ext/mathematical/lasem/src/meson.build +321 -0
  288. data/ext/mathematical/lasem/subprojects/gi-docgen.wrap +6 -0
  289. data/ext/mathematical/lasem/tests/data/mathml/gtkmathview/README +5 -0
  290. data/ext/mathematical/lasem/tests/data/mathml/tex/fractions/fraction-02.tex +1 -0
  291. data/ext/mathematical/lasem/tests/data/mathml/tex/fractions/fraction-03-inline.tex +1 -0
  292. data/ext/mathematical/lasem/tests/data/mathml/tex/fractions/fraction-03.tex +1 -0
  293. data/ext/mathematical/lasem/tests/data/mathml/tex/fractions/fraction.tex +1 -0
  294. data/ext/mathematical/lasem/tests/data/mathml/tex/integrals/closed.tex +1 -0
  295. data/ext/mathematical/lasem/tests/data/mathml/tex/integrals/multiples.tex +1 -0
  296. data/ext/mathematical/lasem/tests/data/mathml/tex/integrals/standard.tex +1 -0
  297. data/ext/mathematical/lasem/tests/data/mathml/tex/matrices/matrix-01.tex +5 -0
  298. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/array.tex +3 -0
  299. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/cases-cr.tex +7 -0
  300. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/cases-space.tex +7 -0
  301. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/cases.tex +7 -0
  302. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/color.tex +1 -0
  303. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/complex-2.tex +1 -0
  304. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/complex-inline.tex +7 -0
  305. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/complex.tex +7 -0
  306. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/quadratic-inline.tex +1 -0
  307. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/quadratic.tex +1 -0
  308. data/ext/mathematical/lasem/tests/data/mathml/tex/radicals/radical-01.tex +1 -0
  309. data/ext/mathematical/lasem/tests/data/mathml/tex/radicals/radical-02.tex +1 -0
  310. data/ext/mathematical/lasem/tests/data/mathml/tex/scripts/accents.tex +1 -0
  311. data/ext/mathematical/lasem/tests/data/mathml/tex/scripts/script.tex +1 -0
  312. data/ext/mathematical/lasem/tests/data/mathml/tex/scripts/stack.tex +1 -0
  313. data/ext/mathematical/lasem/tests/data/mathml/tex/scripts/subscript.tex +1 -0
  314. data/ext/mathematical/lasem/tests/data/mathml/tex/scripts/sums-inline.tex +1 -0
  315. data/ext/mathematical/lasem/tests/data/mathml/tex/scripts/sums.tex +1 -0
  316. data/ext/mathematical/lasem/tests/data/mathml/tex/scripts/superscript-inline.tex +1 -0
  317. data/ext/mathematical/lasem/tests/data/mathml/tex/scripts/superscript.tex +1 -0
  318. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/bmpCursor.bmp +0 -0
  319. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/brushedMetal.jpg +0 -0
  320. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/jpeg.jpg +0 -0
  321. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/jpegCursor.jpg +0 -0
  322. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/operaBridge.jpg +0 -0
  323. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/operaSteps.jpg +0 -0
  324. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/operaWalk.jpg +0 -0
  325. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/sm_colors.tif +0 -0
  326. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/sm_colors_pb.tif +0 -0
  327. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/sm_colors_pb_tile.tif +0 -0
  328. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/sm_colors_tile.tif +0 -0
  329. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/tde.jpg +0 -0
  330. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/tiffCursor.tif +0 -0
  331. data/ext/mathematical/lasem/tests/data/svg/svg1.1/images/image1.jpg +0 -0
  332. data/ext/mathematical/lasem/tests/data/svg/svg1.1/images/struct-image-01.jpg +0 -0
  333. data/ext/mathematical/lasem/tests/data/svg/svg1.1/images/struct-image-02.jpg +0 -0
  334. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/CNN.3gp +0 -0
  335. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/SVG-1.1-monolithic-fixed.dtd +1622 -0
  336. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/TraitAccess.common.es +672 -0
  337. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/advice.wav +0 -0
  338. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/beep.wav +0 -0
  339. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/boing_x.wav +0 -0
  340. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/clock.mp4 +0 -0
  341. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloud-ps411q4app.jpg +0 -0
  342. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloud411q25s.jpg +0 -0
  343. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloud411q65float.jpg +0 -0
  344. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloud411q75o.jpg +0 -0
  345. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloud411q75p.jpg +0 -0
  346. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloud411q75s.jpg +0 -0
  347. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloud444q65o.jpg +0 -0
  348. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloudgsq75s.jpg +0 -0
  349. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloudoddq65o.jpg +0 -0
  350. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloudqllo.jpg +0 -0
  351. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/copyright-documents-19990405.html +89 -0
  352. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/disco.jpg +0 -0
  353. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/dogandball.3gp +0 -0
  354. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/dogandball.jpg +0 -0
  355. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/dogandball.mov +0 -0
  356. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/duckfeeding.3gp +0 -0
  357. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/duckfeeding.mov +0 -0
  358. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/excuse_me.wav +0 -0
  359. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/externalscript.js +1 -0
  360. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/greentopbutton.jpg +0 -0
  361. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/greentopbutton1.jpg +0 -0
  362. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/greentopbutton2.jpg +0 -0
  363. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/greentopbutton3.jpg +0 -0
  364. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/greentopbutton4.jpg +0 -0
  365. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/heroesLanding.3gp +0 -0
  366. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/image1.jpg +0 -0
  367. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/image2_b.jpg +0 -0
  368. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/myimage.jpg +0 -0
  369. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pacman.wav +0 -0
  370. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/plant.jpg +0 -0
  371. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image0.jpg +0 -0
  372. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image1.jpg +0 -0
  373. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image2.jpg +0 -0
  374. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image3.jpg +0 -0
  375. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image4.jpg +0 -0
  376. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image5.jpg +0 -0
  377. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image6.jpg +0 -0
  378. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image7.jpg +0 -0
  379. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image8.jpg +0 -0
  380. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image9.jpg +0 -0
  381. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script1.js +1 -0
  382. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script10.js +1 -0
  383. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script2.js +1 -0
  384. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script3.js +1 -0
  385. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script4.js +1 -0
  386. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script5.js +1 -0
  387. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script6.js +1 -0
  388. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script7.js +1 -0
  389. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script8.js +1 -0
  390. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script9.js +1 -0
  391. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/skier.3gp +0 -0
  392. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/skier.jpg +0 -0
  393. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/struct-image-01.jpg +0 -0
  394. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/struct-image-02.jpg +0 -0
  395. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/svgRef4.css +4 -0
  396. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/welcome.wav +0 -0
  397. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/xmltree.xml +4 -0
  398. data/ext/mathematical/lasem/tests/dom.c +266 -0
  399. data/ext/mathematical/lasem/tests/filter.c +153 -0
  400. data/ext/mathematical/lasem/tests/fuzztest.sh +12 -0
  401. data/ext/mathematical/lasem/tests/lasem.supp +185 -0
  402. data/ext/mathematical/lasem/tests/lsmtest.c +592 -0
  403. data/ext/mathematical/lasem/tests/meson.build +39 -0
  404. data/ext/mathematical/lasem/tests/str.c +44 -0
  405. data/ext/mathematical/lasem/tests/suite.c +140 -0
  406. data/ext/mathematical/lasem/tests/suite.ini +27 -0
  407. data/ext/mathematical/lasem/tools/change-license +3 -0
  408. data/ext/mathematical/lasem/tools/charlist.dtd +73 -0
  409. data/ext/mathematical/lasem/tools/entities-to-c.xsl +1067 -0
  410. data/ext/mathematical/lasem/tools/fuzzxml +243 -0
  411. data/ext/mathematical/lasem/tools/generate-entity-array.c +2136 -0
  412. data/ext/mathematical/lasem/tools/unicode.xml +44303 -0
  413. data/ext/mathematical/lasem/viewer/meson.build +17 -0
  414. data/ext/mathematical/lasem/viewer/viewer.c +248 -0
  415. data/ext/mathematical/lasem_overrides.c +4 -8
  416. data/ext/mathematical/mathematical.c +7 -9
  417. data/ext/mathematical/mtex2MML/CMakeLists.txt +255 -0
  418. data/ext/mathematical/mtex2MML/CONTRIBUTING.md +22 -0
  419. data/ext/mathematical/mtex2MML/README.md +143 -0
  420. data/ext/mathematical/mtex2MML/SUPPORTED.md +1216 -0
  421. data/ext/mathematical/mtex2MML/appveyor.yml +35 -0
  422. data/ext/mathematical/mtex2MML/cmake/Modules/astyle.cmake +12 -0
  423. data/ext/mathematical/mtex2MML/deps/uthash/package.json +27 -0
  424. data/ext/mathematical/mtex2MML/deps/uthash/utarray.h +239 -0
  425. data/ext/mathematical/mtex2MML/deps/uthash/uthash.h +1074 -0
  426. data/ext/mathematical/mtex2MML/deps/uthash/utlist.h +895 -0
  427. data/ext/mathematical/mtex2MML/deps/uthash/utringbuffer.h +108 -0
  428. data/ext/mathematical/mtex2MML/deps/uthash/utstring.h +398 -0
  429. data/ext/mathematical/mtex2MML/script/bootstrap +39 -0
  430. data/ext/mathematical/mtex2MML/script/cibuild +58 -0
  431. data/ext/mathematical/mtex2MML/script/tag +28 -0
  432. data/ext/mathematical/mtex2MML/src/colors.c +44 -0
  433. data/ext/mathematical/mtex2MML/src/colors.h +23 -0
  434. data/ext/mathematical/mtex2MML/src/em.c +99 -0
  435. data/ext/mathematical/mtex2MML/src/em.h +31 -0
  436. data/ext/mathematical/mtex2MML/src/environment.c +515 -0
  437. data/ext/mathematical/mtex2MML/src/environment.h +85 -0
  438. data/ext/mathematical/mtex2MML/src/lexer.l +1594 -0
  439. data/ext/mathematical/mtex2MML/src/libmtex2MML.pc.in +10 -0
  440. data/ext/mathematical/mtex2MML/src/main.c +187 -0
  441. data/ext/mathematical/mtex2MML/src/mtex2MML.h +89 -0
  442. data/ext/mathematical/mtex2MML/src/parser.y +3817 -0
  443. data/ext/mathematical/mtex2MML/src/string_dup.c +23 -0
  444. data/ext/mathematical/mtex2MML/src/string_dup.h +23 -0
  445. data/ext/mathematical/mtex2MML/src/string_extras.c +47 -0
  446. data/ext/mathematical/mtex2MML/src/string_extras.h +30 -0
  447. data/ext/mathematical/mtex2MML/src/win32-shims/unistd.h +51 -0
  448. data/ext/mathematical/mtex2MML/tests/array.c +127 -0
  449. data/ext/mathematical/mtex2MML/tests/basic.c +96 -0
  450. data/ext/mathematical/mtex2MML/tests/clar/fixtures.h +38 -0
  451. data/ext/mathematical/mtex2MML/tests/clar/fs.h +335 -0
  452. data/ext/mathematical/mtex2MML/tests/clar/print.h +66 -0
  453. data/ext/mathematical/mtex2MML/tests/clar/sandbox.h +141 -0
  454. data/ext/mathematical/mtex2MML/tests/clar.c +644 -0
  455. data/ext/mathematical/mtex2MML/tests/clar.h +163 -0
  456. data/ext/mathematical/mtex2MML/tests/clar_test.h +20 -0
  457. data/ext/mathematical/mtex2MML/tests/cornercases.c +46 -0
  458. data/ext/mathematical/mtex2MML/tests/debug/mtex2MML_debug.cc +21 -0
  459. data/ext/mathematical/mtex2MML/tests/delimiters.c +242 -0
  460. data/ext/mathematical/mtex2MML/tests/deps/file2str/file2str.c +62 -0
  461. data/ext/mathematical/mtex2MML/tests/deps/file2str/file2str.h +12 -0
  462. data/ext/mathematical/mtex2MML/tests/deps/file2str/package.json +9 -0
  463. data/ext/mathematical/mtex2MML/tests/deps/mkdtemp/mkdtemp.c +151 -0
  464. data/ext/mathematical/mtex2MML/tests/deps/mkdtemp/mkdtemp.h +10 -0
  465. data/ext/mathematical/mtex2MML/tests/deps/trim/package.json +7 -0
  466. data/ext/mathematical/mtex2MML/tests/deps/trim/trim.c +27 -0
  467. data/ext/mathematical/mtex2MML/tests/deps/trim/trim.h +7 -0
  468. data/ext/mathematical/mtex2MML/tests/env.c +334 -0
  469. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/AMScd/amscd-1.html +86 -0
  470. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/AMScd/amscd-2.html +148 -0
  471. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/AMScd/amscd-3.html +188 -0
  472. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/AMScd/arrows-2.html +156 -0
  473. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/AMScd/min-1.html +45 -0
  474. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/AMScd/min-2.html +35 -0
  475. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/accents-1.html +16 -0
  476. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/accents-2.html +3 -0
  477. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/accents-3.html +5 -0
  478. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/buildrel-1.html +3 -0
  479. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/issue490.html +0 -0
  480. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/issue877.html +3 -0
  481. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/issue937.html +3 -0
  482. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/overbrace-1.html +3 -0
  483. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/overbracket-1.html +3 -0
  484. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/overset-1.html +3 -0
  485. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/sideset-1.html +5 -0
  486. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/stackrel-1.html +3 -0
  487. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/subarray-1.html +1 -0
  488. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/substack-1.html +3 -0
  489. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/underbrace-1.html +3 -0
  490. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/underbracket-1.html +3 -0
  491. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/underset-1.html +3 -0
  492. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/action/mathtip-1.html +6 -0
  493. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/action/texttip-1.html +6 -0
  494. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/action/toggle-1.html +7 -0
  495. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/arrows/Newextarrow-1.html +10 -0
  496. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/arrows/arrows-1.html +34 -0
  497. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/arrows/arrows-2.html +30 -0
  498. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/arrows/arrows-3.html +9 -0
  499. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/arrows/arrows-4.html +13 -0
  500. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/arrows/arrows-5.html +7 -0
  501. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathbin-1.html +7 -0
  502. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathinner-1.html +3 -0
  503. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathop-1a.html +3 -0
  504. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathop-1b.html +5 -0
  505. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathop-2.html +5 -0
  506. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathopenclose-1.html +3 -0
  507. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathord-1.html +3 -0
  508. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathpunct-1.html +3 -0
  509. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathrel-1.html +3 -0
  510. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/basic-operators/backslashed-1.html +16 -0
  511. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/basic-operators/basic-operators-1.html +3 -0
  512. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/basic-operators/basic-operators-2.html +25 -0
  513. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/basic-operators/remap-1.html +5 -0
  514. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/colors/color-1.html +3 -0
  515. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/colors/colorbox-1.html +3 -0
  516. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/colors/definecolor-1.html +37 -0
  517. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/colors/definecolor-2.html +79 -0
  518. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/colors/fcolorbox-1.html +7 -0
  519. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/colors/issue446.html +5 -0
  520. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/colors/namedcolors-1.html +70 -0
  521. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/big-1.html +3 -0
  522. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/big-2.html +3 -0
  523. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/big-3.html +3 -0
  524. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/delimiters-1.html +3 -0
  525. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/delimiters-2.html +4 -0
  526. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/issue775.html +3 -0
  527. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/issue776-1a.html +6 -0
  528. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/issue776-1b.html +6 -0
  529. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/issue776-2.html +6 -0
  530. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/issue776-3.html +6 -0
  531. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/issue776-4.html +6 -0
  532. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/issue776-5.html +6 -0
  533. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/left-right-1.html +3 -0
  534. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/align-1a.html +7 -0
  535. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/align-1b.html +7 -0
  536. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/alignat-1a.html +6 -0
  537. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/alignat-1b.html +6 -0
  538. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/aligned-1.html +9 -0
  539. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/aligned-2.html +14 -0
  540. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/alignedat-1.html +8 -0
  541. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/eqalign-1.html +8 -0
  542. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/eqalignno-1.html +8 -0
  543. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/eqnarray-1a.html +7 -0
  544. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/eqnarray-1b.html +7 -0
  545. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/eqnarray-2.html +64 -0
  546. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/equation-1.html +5 -0
  547. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/equation-2.html +5 -0
  548. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/gather-1a.html +7 -0
  549. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/gather-1b.html +7 -0
  550. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/gathered-1.html +7 -0
  551. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/gathered-2.html +12 -0
  552. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/issue982-1a.html +5 -0
  553. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/issue982-1b.html +5 -0
  554. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/issue982-2a.html +5 -0
  555. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/issue982-2b.html +5 -0
  556. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/issue982-3a.html +5 -0
  557. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/issue982-3b.html +5 -0
  558. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/leqalignno-1.html +11 -0
  559. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/multline-1a.html +7 -0
  560. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/multline-1b.html +7 -0
  561. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/split-1.html +9 -0
  562. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/errors/noErrors-1.html +5 -0
  563. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/errors/noUndefined-1.html +3 -0
  564. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/above-1.html +3 -0
  565. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/abovewithdelims-1.html +3 -0
  566. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/atop-1.html +3 -0
  567. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/atopwithdelims-1.html +3 -0
  568. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/binom-1.html +3 -0
  569. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/brace-1.html +3 -0
  570. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/brack-1.html +3 -0
  571. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/cfrac-1.html +3 -0
  572. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/choose-1.html +3 -0
  573. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/dbinom-1.html +3 -0
  574. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/dfrac-1.html +3 -0
  575. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/frac-1a.html +3 -0
  576. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/frac-1b.html +3 -0
  577. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/genfrac-1.html +3 -0
  578. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/issue969.html +3 -0
  579. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/overwithdelims-1.html +3 -0
  580. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/tbinom-1.html +3 -0
  581. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/tfrac-1.html +3 -0
  582. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/issues/issue1152-1.html +1 -0
  583. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/issues/issue1152-2.html +4 -0
  584. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/issues/issue375.html +3 -0
  585. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/issues/issue856.html +3 -0
  586. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/issues/issue901-1a.html +5 -0
  587. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/issues/issue901-1b.html +5 -0
  588. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/issues/issue901-1c.html +5 -0
  589. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/issues/issue901-1d.html +5 -0
  590. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/boxes-1.html +5 -0
  591. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/kern-1a.html +3 -0
  592. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/kern-1b.html +3 -0
  593. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/llap-1.html +3 -0
  594. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/lower-1.html +4 -0
  595. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/mathstrut-1.html +3 -0
  596. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/moveleft-1.html +3 -0
  597. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/moveright-1.html +3 -0
  598. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/newline-1.html +3 -0
  599. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/phantom-1.html +4 -0
  600. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/raise-1.html +3 -0
  601. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/rlap-1.html +3 -0
  602. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/shove-1.html +19 -0
  603. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/skip-1a.html +3 -0
  604. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/skip-1b.html +3 -0
  605. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/smash-1.html +3 -0
  606. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/spaces-1.html +18 -0
  607. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/strut-1.html +3 -0
  608. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/vcenter-1.html +3 -0
  609. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/letters/greek-1.html +32 -0
  610. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/letters/greek-2.html +13 -0
  611. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/letters/greek-3.html +6 -0
  612. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/letters/greek-4.html +13 -0
  613. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/letters/hebrew-1.html +6 -0
  614. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/begingroup-1.html +15 -0
  615. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/def-1.html +5 -0
  616. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/let-1.html +14 -0
  617. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/macro-1.html +7 -0
  618. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/macro-2.html +25 -0
  619. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/macro-3.html +50 -0
  620. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/macro-5.html +5 -0
  621. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/macro-6.html +7 -0
  622. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/macro-7.html +7 -0
  623. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/Bbb-1.html +3 -0
  624. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/bf-1.html +3 -0
  625. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/boldsymbol-1.html +9 -0
  626. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/cal-1.html +3 -0
  627. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/frak-1.html +3 -0
  628. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/it-1.html +3 -0
  629. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathbb-1.html +3 -0
  630. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathbf-1a.html +3 -0
  631. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathbf-1b.html +3 -0
  632. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathbf-2.html +3 -0
  633. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathcal-1.html +3 -0
  634. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathfrak-1.html +3 -0
  635. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathit-1.html +3 -0
  636. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathrm-1.html +3 -0
  637. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathscr-1.html +3 -0
  638. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathsf-1.html +3 -0
  639. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathtt-1.html +3 -0
  640. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mit-1.html +3 -0
  641. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/pmb-1.html +3 -0
  642. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/rm-1.html +3 -0
  643. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/scr-1.html +3 -0
  644. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/sf-1.html +3 -0
  645. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/text-1.html +3 -0
  646. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/textbf-1.html +3 -0
  647. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/textit-1.html +3 -0
  648. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/textrm-1.html +3 -0
  649. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/textsf-1.html +3 -0
  650. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/texttt-1.html +3 -0
  651. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/tt-1.html +3 -0
  652. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/array-1a.html +7 -0
  653. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/array-1b.html +7 -0
  654. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/array-2.html +3 -0
  655. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/array-3.html +3 -0
  656. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/bmatrix-1.html +7 -0
  657. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/bmatrix-2.html +7 -0
  658. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/matrix-1.html +7 -0
  659. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/matrix-2.html +7 -0
  660. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/pmatrix-1.html +7 -0
  661. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/pmatrix-2.html +8 -0
  662. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/smallmatrix-1.html +3 -0
  663. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/vmatrix-1.html +7 -0
  664. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/vmatrix-2.html +7 -0
  665. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/advanced-1.html +120 -0
  666. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/advanced-2.html +35 -0
  667. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/advanced-3.html +138 -0
  668. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/amounts-1.html +46 -0
  669. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/arrows-1.html +235 -0
  670. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/arrows-2.html +159 -0
  671. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/basics-1.html +139 -0
  672. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/bonds-1.html +256 -0
  673. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/environments-1.html +81 -0
  674. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/isotopes-1.html +30 -0
  675. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/math-1.html +101 -0
  676. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/special_symbols-1.html +176 -0
  677. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/Rule-1.html +5 -0
  678. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/Tiny-1.html +3 -0
  679. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/class-1.html +3 -0
  680. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/cssId-1.html +3 -0
  681. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/href-1.html +3 -0
  682. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/href-2.html +3 -0
  683. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/require-1.html +3 -0
  684. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/style-1.html +3 -0
  685. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/unicode-1.html +8 -0
  686. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/LaTeX-1.html +4 -0
  687. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/bbox-1.html +6 -0
  688. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/boxed-1.html +3 -0
  689. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/cancel-1.html +6 -0
  690. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/cases-1.html +3 -0
  691. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/displaylines-1.html +7 -0
  692. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/enclose-1.html +8 -0
  693. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/functions-1.html +34 -0
  694. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/limits-1.html +5 -0
  695. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/limits-2.html +8 -0
  696. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/limits-3.html +3 -0
  697. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/mathsize-1.html +11 -0
  698. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/mod-1.html +5 -0
  699. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/not-1.html +5 -0
  700. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/pod-1.html +3 -0
  701. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/primes-1.html +8 -0
  702. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/primes-2.html +4 -0
  703. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/primes-3.html +3 -0
  704. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/style-1.html +7 -0
  705. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/style-2.html +0 -0
  706. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/verb-1.html +3 -0
  707. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/verb-2.html +3 -0
  708. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/references/eqref-1.html +5 -0
  709. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/references/label-1.html +7 -0
  710. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/references/label-2.html +1 -0
  711. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/references/notag-1.html +5 -0
  712. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/references/ref-1.html +5 -0
  713. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/references/ref-2.html +5 -0
  714. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/references/ref-3.html +5 -0
  715. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/roots/root-1.html +3 -0
  716. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/roots/root-2.html +3 -0
  717. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/roots/root-3.html +3 -0
  718. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/roots/sqrt-1.html +3 -0
  719. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/roots/sqrt-2.html +3 -0
  720. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/binaryops-1.html +32 -0
  721. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/dots-1.html +26 -0
  722. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/largeops-1.html +4 -0
  723. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/largeops-2.html +3 -0
  724. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/relations-1.html +39 -0
  725. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/symbols-1.html +25 -0
  726. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/symbols-2.html +31 -0
  727. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/symbols-3.html +40 -0
  728. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/symbols-4.html +39 -0
  729. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/symbols-5.html +56 -0
  730. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/symbols-6.html +49 -0
  731. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/AMScd/amscd-1.no_tex +8 -0
  732. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/AMScd/amscd-2.no_tex +13 -0
  733. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/AMScd/amscd-3.no_tex +23 -0
  734. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/AMScd/arrows-1.no_tex +23 -0
  735. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/AMScd/arrows-2.no_tex +26 -0
  736. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/AMScd/min-1.no_tex +14 -0
  737. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/AMScd/min-2.no_tex +14 -0
  738. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/accents-1.txt +16 -0
  739. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/accents-2.txt +3 -0
  740. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/accents-3.txt +5 -0
  741. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/buildrel-1.txt +3 -0
  742. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/issue490.no_tex +3 -0
  743. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/issue877.txt +3 -0
  744. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/issue937.txt +3 -0
  745. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/overbrace-1.txt +3 -0
  746. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/overbracket-1.txt +3 -0
  747. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/overset-1.txt +3 -0
  748. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/sideset-1.txt +6 -0
  749. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/stackrel-1.txt +3 -0
  750. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/subarray-1.txt +1 -0
  751. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/substack-1.txt +3 -0
  752. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/underbrace-1.txt +3 -0
  753. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/underbracket-1.txt +3 -0
  754. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/underset-1.txt +3 -0
  755. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/action/mathtip-1.no_tex +2 -0
  756. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/action/texttip-1.no_tex +2 -0
  757. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/action/toggle-1.no_tex +3 -0
  758. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/arrows/Newextarrow-1.xtex +4 -0
  759. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/arrows/arrows-1.txt +34 -0
  760. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/arrows/arrows-2.txt +30 -0
  761. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/arrows/arrows-3.txt +9 -0
  762. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/arrows/arrows-4.txt +13 -0
  763. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/arrows/arrows-5.txt +7 -0
  764. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathbin-1.no_tex +3 -0
  765. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathinner-1.txt +3 -0
  766. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathop-1a.txt +3 -0
  767. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathop-1b.txt +5 -0
  768. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathop-2.xtex +3 -0
  769. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathopenclose-1.txt +3 -0
  770. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathord-1.txt +3 -0
  771. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathpunct-1.txt +3 -0
  772. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathrel-1.txt +3 -0
  773. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/basic-operators/backslashed-1.txt +16 -0
  774. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/basic-operators/basic-operators-1.txt +3 -0
  775. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/basic-operators/basic-operators-2.xtex +5 -0
  776. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/basic-operators/remap-1.txt +5 -0
  777. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/color-1.txt +3 -0
  778. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/colorbox-1.txt +3 -0
  779. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/definecolor-1a.xtex +7 -0
  780. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/definecolor-1b.xtex +7 -0
  781. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/definecolor-1c.xtex +7 -0
  782. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/definecolor-2.xtex +13 -0
  783. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/fcolorbox-1.xtex +3 -0
  784. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/issue446.xtex +5 -0
  785. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/namedcolors-1.txt +70 -0
  786. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/big-1.txt +3 -0
  787. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/big-2.txt +3 -0
  788. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/big-3.txt +3 -0
  789. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/delimiters-1.txt +3 -0
  790. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/delimiters-2.txt +4 -0
  791. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/issue775.txt +3 -0
  792. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/issue776-1a.txt +6 -0
  793. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/issue776-1b.txt +6 -0
  794. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/issue776-2.txt +6 -0
  795. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/issue776-3.txt +6 -0
  796. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/issue776-4.txt +6 -0
  797. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/issue776-5.txt +6 -0
  798. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/left-right-1.txt +3 -0
  799. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/align-1a.txt +7 -0
  800. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/align-1b.txt +7 -0
  801. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/alignat-1a.txt +6 -0
  802. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/alignat-1b.txt +6 -0
  803. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/aligned-1.txt +9 -0
  804. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/aligned-2.txt +14 -0
  805. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/alignedat-1.txt +8 -0
  806. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/eqalign-1.txt +8 -0
  807. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/eqalignno-1.txt +8 -0
  808. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/eqnarray-1a.txt +7 -0
  809. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/eqnarray-1b.txt +7 -0
  810. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/eqnarray-1c.no_tex +7 -0
  811. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/eqnarray-2a.no_tex +8 -0
  812. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/equation-1.txt +5 -0
  813. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/equation-2.txt +5 -0
  814. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/gather-1a.txt +7 -0
  815. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/gather-1b.txt +7 -0
  816. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/gathered-1.txt +7 -0
  817. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/gathered-2.txt +12 -0
  818. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/issue982-1a.txt +5 -0
  819. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/issue982-1b.txt +5 -0
  820. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/issue982-2a.txt +5 -0
  821. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/issue982-2b.txt +5 -0
  822. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/issue982-3a.txt +5 -0
  823. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/issue982-3b.txt +5 -0
  824. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/leqalignno-1.xtex +8 -0
  825. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/multline-1a.txt +7 -0
  826. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/multline-1b.txt +7 -0
  827. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/split-1.txt +9 -0
  828. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/errors/noErrors-1.no_tex +3 -0
  829. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/errors/noUndefined-1.no_tex +2 -0
  830. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/above-1.txt +3 -0
  831. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/abovewithdelims-1.txt +3 -0
  832. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/atop-1.txt +3 -0
  833. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/atopwithdelims-1.txt +3 -0
  834. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/binom-1.txt +3 -0
  835. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/brace-1.txt +3 -0
  836. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/brack-1.txt +3 -0
  837. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/cfrac-1.txt +3 -0
  838. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/choose-1.txt +3 -0
  839. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/dbinom-1.txt +3 -0
  840. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/dfrac-1.txt +3 -0
  841. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/frac-1a.txt +3 -0
  842. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/frac-1b.txt +3 -0
  843. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/genfrac-1.txt +3 -0
  844. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/issue969.txt +3 -0
  845. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/overwithdelims-1.txt +3 -0
  846. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/tbinom-1.txt +3 -0
  847. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/tfrac-1.txt +3 -0
  848. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue1151.no_tex +3 -0
  849. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue1152-1.xtex +1 -0
  850. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue1152-2.txt +4 -0
  851. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue375.txt +3 -0
  852. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue856.txt +3 -0
  853. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue901-1a.txt +5 -0
  854. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue901-1b.txt +5 -0
  855. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue901-1c.txt +5 -0
  856. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue901-1d.txt +5 -0
  857. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue903-1.xtex +6 -0
  858. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue903-2.xtex +16 -0
  859. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/boxes-1.txt +5 -0
  860. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/kern-1a.txt +3 -0
  861. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/kern-1b.txt +3 -0
  862. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/llap-1.txt +3 -0
  863. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/lower-1.txt +4 -0
  864. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/mathstrut-1.txt +3 -0
  865. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/moveleft-1.txt +3 -0
  866. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/moveright-1.txt +3 -0
  867. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/newline-1.txt +3 -0
  868. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/phantom-1.txt +4 -0
  869. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/raise-1.txt +3 -0
  870. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/rlap-1.txt +3 -0
  871. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/shove-1.xtex +7 -0
  872. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/skip-1a.txt +3 -0
  873. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/skip-1b.txt +3 -0
  874. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/smash-1.txt +3 -0
  875. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/spaces-1.txt +18 -0
  876. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/strut-1.txt +3 -0
  877. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/vcenter-1.txt +3 -0
  878. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/letters/greek-1.txt +32 -0
  879. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/letters/greek-2.txt +13 -0
  880. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/letters/greek-3.txt +6 -0
  881. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/letters/greek-4.txt +13 -0
  882. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/letters/hebrew-1.txt +6 -0
  883. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/begingroup-1.no_tex +8 -0
  884. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/def-1.no_tex +4 -0
  885. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/let-1.no_tex +5 -0
  886. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/macro-1a.no_tex +3 -0
  887. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/macro-1b.no_tex +3 -0
  888. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/macro-2.no_tex +3 -0
  889. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/macro-3.no_tex +5 -0
  890. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/macro-5.no_tex +3 -0
  891. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/macro-6.no_tex +5 -0
  892. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/macro-7.no_tex +11 -0
  893. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/Bbb-1.txt +3 -0
  894. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/bf-1.txt +3 -0
  895. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/boldsymbol-1.txt +9 -0
  896. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/cal-1.txt +3 -0
  897. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/frak-1.txt +3 -0
  898. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/it-1.txt +3 -0
  899. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathbb-1.txt +3 -0
  900. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathbf-1a.txt +3 -0
  901. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathbf-1b.txt +3 -0
  902. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathbf-2.txt +3 -0
  903. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathcal-1.txt +3 -0
  904. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathfrak-1.txt +3 -0
  905. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathit-1.txt +3 -0
  906. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathrm-1.txt +3 -0
  907. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathscr-1.txt +3 -0
  908. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathsf-1.txt +3 -0
  909. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathtt-1.txt +3 -0
  910. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mit-1.txt +3 -0
  911. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/pmb-1.txt +3 -0
  912. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/rm-1.txt +3 -0
  913. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/scr-1.txt +3 -0
  914. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/sf-1.txt +3 -0
  915. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/text-1.txt +3 -0
  916. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/textbf-1.txt +3 -0
  917. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/textit-1.txt +3 -0
  918. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/textrm-1.txt +3 -0
  919. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/textsf-1.txt +3 -0
  920. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/texttt-1.txt +3 -0
  921. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/tt-1.txt +3 -0
  922. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/array-1a.txt +7 -0
  923. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/array-1b.txt +7 -0
  924. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/array-2.txt +3 -0
  925. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/array-3.txt +3 -0
  926. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/bmatrix-1.txt +7 -0
  927. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/bmatrix-2.txt +7 -0
  928. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/matrix-1.txt +7 -0
  929. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/matrix-2.txt +7 -0
  930. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/pmatrix-1.txt +7 -0
  931. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/pmatrix-2.txt +8 -0
  932. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/smallmatrix-1.txt +3 -0
  933. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/vmatrix-1.txt +7 -0
  934. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/vmatrix-2.txt +7 -0
  935. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/advanced-1.no_tex +8 -0
  936. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/advanced-2.no_tex +3 -0
  937. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/advanced-3.no_tex +7 -0
  938. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/amounts-1.no_tex +4 -0
  939. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/arrows-1.no_tex +10 -0
  940. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/arrows-2.no_tex +9 -0
  941. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/basics-1.no_tex +13 -0
  942. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/bonds-1.no_tex +11 -0
  943. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/environments-1.no_tex +6 -0
  944. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/isotopes-1.no_tex +3 -0
  945. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/math-1.no_tex +4 -0
  946. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/special_symbols-1.no_tex +7 -0
  947. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/Rule-1.no_tex +3 -0
  948. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/Tiny-1.txt +3 -0
  949. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/class-1.no_tex +3 -0
  950. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/cssId-1.no_tex +3 -0
  951. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/href-1.no_tex +3 -0
  952. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/href-2.no_tex +3 -0
  953. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/require-1.no_tex +5 -0
  954. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/style-1.no_tex +3 -0
  955. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/unicode-1.no_tex +3 -0
  956. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/LaTeX-1.txt +4 -0
  957. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/bbox-1.txt +6 -0
  958. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/boxed-1.txt +3 -0
  959. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/cancel-1.txt +6 -0
  960. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/cases-1.txt +3 -0
  961. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/displaylines-1.xtex +8 -0
  962. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/enclose-1.txt +8 -0
  963. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/functions-1.txt +34 -0
  964. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/limits-1.txt +7 -0
  965. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/limits-2.txt +8 -0
  966. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/limits-3.txt +3 -0
  967. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/mathsize-1.txt +11 -0
  968. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/mod-1.txt +5 -0
  969. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/not-1.txt +5 -0
  970. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/pod-1.txt +3 -0
  971. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/primes-1.txt +8 -0
  972. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/primes-2.txt +4 -0
  973. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/primes-3.txt +3 -0
  974. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/style-1.txt +7 -0
  975. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/style-2.no_tex +10 -0
  976. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/verb-1.txt +3 -0
  977. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/verb-2.txt +3 -0
  978. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/eqref-1.no_tex +7 -0
  979. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/label-1.no_tex +3 -0
  980. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/label-2.no_tex +2 -0
  981. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/notag-1.txt +5 -0
  982. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/ref-1a.no_tex +2 -0
  983. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/ref-1b.no_tex +2 -0
  984. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/ref-2.no_tex +2 -0
  985. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/ref-3.no_tex +2 -0
  986. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/tag-1.no_tex +1 -0
  987. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/tag-2.no_tex +1 -0
  988. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/tag-3.no_tex +3 -0
  989. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/tag-4.no_tex +3 -0
  990. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/roots/root-1.txt +3 -0
  991. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/roots/root-2.txt +3 -0
  992. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/roots/root-3.txt +3 -0
  993. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/roots/sqrt-1.txt +3 -0
  994. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/roots/sqrt-2.txt +3 -0
  995. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/binaryops-1.txt +32 -0
  996. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/dots-1.txt +26 -0
  997. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/largeops-1.txt +4 -0
  998. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/largeops-2.txt +3 -0
  999. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/relations-1.txt +39 -0
  1000. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/symbols-1.txt +25 -0
  1001. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/symbols-2.txt +31 -0
  1002. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/symbols-3.txt +40 -0
  1003. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/symbols-4.txt +39 -0
  1004. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/symbols-5.txt +56 -0
  1005. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/symbols-6.txt +49 -0
  1006. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/TODO.md +3 -0
  1007. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_nesting.html +32 -0
  1008. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_nesting.txt +32 -0
  1009. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_pos_alignment.html +8 -0
  1010. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_pos_alignment.txt +8 -0
  1011. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_pos_alignment_with_hline.html +12 -0
  1012. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_pos_alignment_with_hline.txt +12 -0
  1013. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_vertical_column.html +5 -0
  1014. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_vertical_column.txt +5 -0
  1015. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_vertical_column_with_align.html +5 -0
  1016. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_vertical_column_with_align.txt +5 -0
  1017. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_with_hline.html +9 -0
  1018. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_with_hline.txt +9 -0
  1019. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_with_hline_and_hdashline.html +10 -0
  1020. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_with_hline_and_hdashline.txt +10 -0
  1021. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_with_vertical_and_horizontal_dashes.html +10 -0
  1022. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_with_vertical_and_horizontal_dashes.txt +10 -0
  1023. data/ext/mathematical/mtex2MML/tests/fixtures/array/augmented_matrix.html +6 -0
  1024. data/ext/mathematical/mtex2MML/tests/fixtures/array/augmented_matrix.txt +6 -0
  1025. data/ext/mathematical/mtex2MML/tests/fixtures/array/basic_array.html +5 -0
  1026. data/ext/mathematical/mtex2MML/tests/fixtures/array/basic_array.txt +5 -0
  1027. data/ext/mathematical/mtex2MML/tests/fixtures/array/strip_excess_whitespace_in_array_attributes.html +7 -0
  1028. data/ext/mathematical/mtex2MML/tests/fixtures/array/strip_excess_whitespace_in_array_attributes.txt +8 -0
  1029. data/ext/mathematical/mtex2MML/tests/fixtures/basic/block.html +1 -0
  1030. data/ext/mathematical/mtex2MML/tests/fixtures/basic/block.txt +1 -0
  1031. data/ext/mathematical/mtex2MML/tests/fixtures/basic/comments.html +6 -0
  1032. data/ext/mathematical/mtex2MML/tests/fixtures/basic/comments.txt +6 -0
  1033. data/ext/mathematical/mtex2MML/tests/fixtures/basic/filter.html +1 -0
  1034. data/ext/mathematical/mtex2MML/tests/fixtures/basic/filter.txt +3 -0
  1035. data/ext/mathematical/mtex2MML/tests/fixtures/basic/inline.html +1 -0
  1036. data/ext/mathematical/mtex2MML/tests/fixtures/basic/inline.txt +1 -0
  1037. data/ext/mathematical/mtex2MML/tests/fixtures/basic/strict_filter.html +3 -0
  1038. data/ext/mathematical/mtex2MML/tests/fixtures/basic/strict_filter.txt +3 -0
  1039. data/ext/mathematical/mtex2MML/tests/fixtures/basic/text_filter.html +3 -0
  1040. data/ext/mathematical/mtex2MML/tests/fixtures/basic/text_filter.txt +3 -0
  1041. data/ext/mathematical/mtex2MML/tests/fixtures/basic/text_rendering.html +23 -0
  1042. data/ext/mathematical/mtex2MML/tests/fixtures/basic/text_rendering.txt +23 -0
  1043. data/ext/mathematical/mtex2MML/tests/fixtures/cornercases/broken_up_inline_env.html +3 -0
  1044. data/ext/mathematical/mtex2MML/tests/fixtures/cornercases/broken_up_inline_env.txt +3 -0
  1045. data/ext/mathematical/mtex2MML/tests/fixtures/cornercases/some_crazy_alignment.html +24 -0
  1046. data/ext/mathematical/mtex2MML/tests/fixtures/cornercases/some_crazy_alignment.txt +24 -0
  1047. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/align.html +1 -0
  1048. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/align.txt +3 -0
  1049. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/alignat-1a.html +1 -0
  1050. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/alignat-1a.txt +4 -0
  1051. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/aligned_ex_spacing.html +1 -0
  1052. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/aligned_ex_spacing.txt +4 -0
  1053. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/basic_array.html +1 -0
  1054. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/basic_array.txt +3 -0
  1055. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/brackets.html +1 -0
  1056. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/dollar_spacings_filter.html +2 -0
  1057. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/dollar_spacings_filter.txt +27 -0
  1058. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/dollar_spacings_text_filter.html +27 -0
  1059. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/dollar_spacings_text_filter.txt +27 -0
  1060. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/double_dollar.html +1 -0
  1061. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/escaping.txt +35 -0
  1062. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/escaping_with_brackets.html +35 -0
  1063. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/escaping_with_dollars.html +35 -0
  1064. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/escaping_with_parens.html +35 -0
  1065. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/mixed.html +1 -0
  1066. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/mixed_env.html +8 -0
  1067. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/mixed_env.txt +11 -0
  1068. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/parens.html +1 -0
  1069. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/single_dollar.html +1 -0
  1070. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/single_equation.html +1 -0
  1071. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/single_equation.txt +3 -0
  1072. data/ext/mathematical/mtex2MML/tests/fixtures/env/aligned_ex_spacing.html +6 -0
  1073. data/ext/mathematical/mtex2MML/tests/fixtures/env/aligned_ex_spacing.txt +6 -0
  1074. data/ext/mathematical/mtex2MML/tests/fixtures/env/aligned_no_ex_spacing.html +6 -0
  1075. data/ext/mathematical/mtex2MML/tests/fixtures/env/aligned_no_ex_spacing.txt +6 -0
  1076. data/ext/mathematical/mtex2MML/tests/fixtures/env/aligned_no_lines.html +5 -0
  1077. data/ext/mathematical/mtex2MML/tests/fixtures/env/aligned_no_lines.txt +5 -0
  1078. data/ext/mathematical/mtex2MML/tests/fixtures/env/bbmatrix_ex_spacing.html +5 -0
  1079. data/ext/mathematical/mtex2MML/tests/fixtures/env/bbmatrix_ex_spacing.txt +5 -0
  1080. data/ext/mathematical/mtex2MML/tests/fixtures/env/bbmatrix_no_ex_spacing.html +5 -0
  1081. data/ext/mathematical/mtex2MML/tests/fixtures/env/bbmatrix_no_ex_spacing.txt +5 -0
  1082. data/ext/mathematical/mtex2MML/tests/fixtures/env/bbmatrix_no_lines.html +4 -0
  1083. data/ext/mathematical/mtex2MML/tests/fixtures/env/bbmatrix_no_lines.txt +4 -0
  1084. data/ext/mathematical/mtex2MML/tests/fixtures/env/bmatrix_ex_spacing.html +5 -0
  1085. data/ext/mathematical/mtex2MML/tests/fixtures/env/bmatrix_ex_spacing.txt +5 -0
  1086. data/ext/mathematical/mtex2MML/tests/fixtures/env/bmatrix_no_ex_spacing.html +5 -0
  1087. data/ext/mathematical/mtex2MML/tests/fixtures/env/bmatrix_no_ex_spacing.txt +5 -0
  1088. data/ext/mathematical/mtex2MML/tests/fixtures/env/bmatrix_no_lines.html +4 -0
  1089. data/ext/mathematical/mtex2MML/tests/fixtures/env/bmatrix_no_lines.txt +4 -0
  1090. data/ext/mathematical/mtex2MML/tests/fixtures/env/cases_ex_spacing.html +7 -0
  1091. data/ext/mathematical/mtex2MML/tests/fixtures/env/cases_ex_spacing.txt +7 -0
  1092. data/ext/mathematical/mtex2MML/tests/fixtures/env/cases_no_ex_spacing.html +7 -0
  1093. data/ext/mathematical/mtex2MML/tests/fixtures/env/cases_no_ex_spacing.txt +7 -0
  1094. data/ext/mathematical/mtex2MML/tests/fixtures/env/cases_no_lines.html +6 -0
  1095. data/ext/mathematical/mtex2MML/tests/fixtures/env/cases_no_lines.txt +6 -0
  1096. data/ext/mathematical/mtex2MML/tests/fixtures/env/gathered_ex_spacing.html +6 -0
  1097. data/ext/mathematical/mtex2MML/tests/fixtures/env/gathered_ex_spacing.txt +6 -0
  1098. data/ext/mathematical/mtex2MML/tests/fixtures/env/gathered_no_ex_spacing.html +6 -0
  1099. data/ext/mathematical/mtex2MML/tests/fixtures/env/gathered_no_ex_spacing.txt +6 -0
  1100. data/ext/mathematical/mtex2MML/tests/fixtures/env/gathered_no_lines.html +5 -0
  1101. data/ext/mathematical/mtex2MML/tests/fixtures/env/gathered_no_lines.txt +5 -0
  1102. data/ext/mathematical/mtex2MML/tests/fixtures/env/matrix_ex_spacing.html +7 -0
  1103. data/ext/mathematical/mtex2MML/tests/fixtures/env/matrix_ex_spacing.txt +7 -0
  1104. data/ext/mathematical/mtex2MML/tests/fixtures/env/matrix_no_ex_spacing.html +7 -0
  1105. data/ext/mathematical/mtex2MML/tests/fixtures/env/matrix_no_ex_spacing.txt +7 -0
  1106. data/ext/mathematical/mtex2MML/tests/fixtures/env/matrix_no_lines.html +6 -0
  1107. data/ext/mathematical/mtex2MML/tests/fixtures/env/matrix_no_lines.txt +6 -0
  1108. data/ext/mathematical/mtex2MML/tests/fixtures/env/pmatrix_ex_spacing.html +5 -0
  1109. data/ext/mathematical/mtex2MML/tests/fixtures/env/pmatrix_ex_spacing.txt +5 -0
  1110. data/ext/mathematical/mtex2MML/tests/fixtures/env/pmatrix_no_ex_spacing.html +5 -0
  1111. data/ext/mathematical/mtex2MML/tests/fixtures/env/pmatrix_no_ex_spacing.txt +5 -0
  1112. data/ext/mathematical/mtex2MML/tests/fixtures/env/pmatrix_no_lines.html +4 -0
  1113. data/ext/mathematical/mtex2MML/tests/fixtures/env/pmatrix_no_lines.txt +4 -0
  1114. data/ext/mathematical/mtex2MML/tests/fixtures/env/smallmatrix_ex_spacing.html +8 -0
  1115. data/ext/mathematical/mtex2MML/tests/fixtures/env/smallmatrix_ex_spacing.txt +8 -0
  1116. data/ext/mathematical/mtex2MML/tests/fixtures/env/smallmatrix_no_ex_spacing.html +7 -0
  1117. data/ext/mathematical/mtex2MML/tests/fixtures/env/smallmatrix_no_ex_spacing.txt +7 -0
  1118. data/ext/mathematical/mtex2MML/tests/fixtures/env/smallmatrix_no_lines.html +5 -0
  1119. data/ext/mathematical/mtex2MML/tests/fixtures/env/smallmatrix_no_lines.txt +5 -0
  1120. data/ext/mathematical/mtex2MML/tests/fixtures/env/spaces_after_rowsep.html +7 -0
  1121. data/ext/mathematical/mtex2MML/tests/fixtures/env/spaces_after_rowsep.txt +7 -0
  1122. data/ext/mathematical/mtex2MML/tests/fixtures/env/split_ex_spacing.html +6 -0
  1123. data/ext/mathematical/mtex2MML/tests/fixtures/env/split_ex_spacing.txt +6 -0
  1124. data/ext/mathematical/mtex2MML/tests/fixtures/env/split_no_ex_spacing.html +6 -0
  1125. data/ext/mathematical/mtex2MML/tests/fixtures/env/split_no_ex_spacing.txt +6 -0
  1126. data/ext/mathematical/mtex2MML/tests/fixtures/env/split_no_lines.html +5 -0
  1127. data/ext/mathematical/mtex2MML/tests/fixtures/env/split_no_lines.txt +5 -0
  1128. data/ext/mathematical/mtex2MML/tests/fixtures/env/vmatrix_ex_spacing.html +5 -0
  1129. data/ext/mathematical/mtex2MML/tests/fixtures/env/vmatrix_ex_spacing.txt +5 -0
  1130. data/ext/mathematical/mtex2MML/tests/fixtures/env/vmatrix_no_ex_spacing.html +5 -0
  1131. data/ext/mathematical/mtex2MML/tests/fixtures/env/vmatrix_no_ex_spacing.txt +5 -0
  1132. data/ext/mathematical/mtex2MML/tests/fixtures/env/vmatrix_no_lines.html +4 -0
  1133. data/ext/mathematical/mtex2MML/tests/fixtures/env/vmatrix_no_lines.txt +4 -0
  1134. data/ext/mathematical/mtex2MML/tests/fixtures/env/vvmatrix_ex_spacing.html +6 -0
  1135. data/ext/mathematical/mtex2MML/tests/fixtures/env/vvmatrix_ex_spacing.txt +6 -0
  1136. data/ext/mathematical/mtex2MML/tests/fixtures/env/vvmatrix_no_ex_spacing.html +6 -0
  1137. data/ext/mathematical/mtex2MML/tests/fixtures/env/vvmatrix_no_ex_spacing.txt +6 -0
  1138. data/ext/mathematical/mtex2MML/tests/fixtures/env/vvmatrix_no_lines.html +5 -0
  1139. data/ext/mathematical/mtex2MML/tests/fixtures/env/vvmatrix_no_lines.txt +5 -0
  1140. data/ext/mathematical/mtex2MML/tests/fixtures/functions/max_limits.html +1 -0
  1141. data/ext/mathematical/mtex2MML/tests/fixtures/functions/max_limits.txt +1 -0
  1142. data/ext/mathematical/mtex2MML/tests/fixtures/functions/min_limits.html +1 -0
  1143. data/ext/mathematical/mtex2MML/tests/fixtures/functions/min_limits.txt +1 -0
  1144. data/ext/mathematical/mtex2MML/tests/fixtures/functions/prod_limits.html +1 -0
  1145. data/ext/mathematical/mtex2MML/tests/fixtures/functions/prod_limits.txt +1 -0
  1146. data/ext/mathematical/mtex2MML/tests/fixtures/maliciousness/excess_parsing.txt +1 -0
  1147. data/ext/mathematical/mtex2MML/tests/fixtures/maliciousness/just_enough_parsing.html +1 -0
  1148. data/ext/mathematical/mtex2MML/tests/fixtures/maliciousness/just_enough_parsing.txt +1 -0
  1149. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/multiple_equations.html +11 -0
  1150. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/multiple_equations.txt +13 -0
  1151. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/multiple_notag_nonumber.html +7 -0
  1152. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/multiple_notag_nonumber.txt +7 -0
  1153. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/single_equation.html +5 -0
  1154. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/single_equation.txt +5 -0
  1155. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/single_nonumber.html +6 -0
  1156. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/single_nonumber.txt +6 -0
  1157. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/single_notag.html +6 -0
  1158. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/single_notag.txt +6 -0
  1159. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/skip_label.html +3 -0
  1160. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/skip_label.txt +3 -0
  1161. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/skip_tag.html +3 -0
  1162. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/skip_tag.txt +3 -0
  1163. data/ext/mathematical/mtex2MML/tests/fixtures/performance/big_file.html +12 -0
  1164. data/ext/mathematical/mtex2MML/tests/fixtures/performance/big_file.txt +1755 -0
  1165. data/ext/mathematical/mtex2MML/tests/fixtures/symbols/gt.html +1 -0
  1166. data/ext/mathematical/mtex2MML/tests/fixtures/symbols/gt.txt +1 -0
  1167. data/ext/mathematical/mtex2MML/tests/fixtures/symbols/lt.html +1 -0
  1168. data/ext/mathematical/mtex2MML/tests/fixtures/symbols/lt.txt +1 -0
  1169. data/ext/mathematical/mtex2MML/tests/fixtures/symbols/textgreater.html +1 -0
  1170. data/ext/mathematical/mtex2MML/tests/fixtures/symbols/textgreater.txt +1 -0
  1171. data/ext/mathematical/mtex2MML/tests/fixtures/symbols/textless.html +1 -0
  1172. data/ext/mathematical/mtex2MML/tests/fixtures/symbols/textless.txt +1 -0
  1173. data/ext/mathematical/mtex2MML/tests/functions.c +55 -0
  1174. data/ext/mathematical/mtex2MML/tests/generate.py +244 -0
  1175. data/ext/mathematical/mtex2MML/tests/helpers.c +29 -0
  1176. data/ext/mathematical/mtex2MML/tests/helpers.h +8 -0
  1177. data/ext/mathematical/mtex2MML/tests/main.c +35 -0
  1178. data/ext/mathematical/mtex2MML/tests/maliciousness.c +107 -0
  1179. data/ext/mathematical/mtex2MML/tests/mathjax.c +2040 -0
  1180. data/ext/mathematical/mtex2MML/tests/mathjax_generate.py +72 -0
  1181. data/ext/mathematical/mtex2MML/tests/numbered_equations.c +92 -0
  1182. data/ext/mathematical/mtex2MML/tests/performance.c +39 -0
  1183. data/ext/mathematical/mtex2MML/tests/symbols.c +69 -0
  1184. data/lib/mathematical/version.rb +1 -1
  1185. data/mathematical.gemspec +1 -1
  1186. metadata +1191 -6
@@ -0,0 +1,3817 @@
1
+ %parse-param {char **ret_str}
2
+
3
+ %{
4
+ #include <stdio.h>
5
+ #include <string.h>
6
+ #include <stdlib.h>
7
+ #include <ctype.h>
8
+
9
+ #include "mtex2MML.h"
10
+ #include "colors.h"
11
+ #include "em.h"
12
+ #include "environment.h"
13
+ #include "string_extras.h"
14
+
15
+ #include "string_dup.h"
16
+ #include "../deps/uthash/uthash.h"
17
+
18
+ struct css_colors *colors = NULL;
19
+
20
+ #define YYSTYPE char *
21
+ #define YYPARSE_PARAM_TYPE char **
22
+ #define YYPARSE_PARAM ret_str
23
+ /* set max nesting. utterly arbitrary number determined from http://git.io/FlWHfw */
24
+ #define YYMAXDEPTH 430
25
+
26
+ /*
27
+ #define YYDEBUG 1
28
+ yydebug = 1;
29
+ */
30
+
31
+ #define YYERROR_VERBOSE 1
32
+
33
+ #define yytext mtex2MML_yytext
34
+
35
+ UT_array *environment_data_stack;
36
+
37
+ encaseType encase = NONE;
38
+
39
+ extern int yylex (void);
40
+
41
+ extern char * yytext;
42
+
43
+ int global_label = 1;
44
+ int line_counter = 1;
45
+ int delimiter_options = 0;
46
+
47
+ static void mtex2MML_default_error (const char * msg)
48
+ {
49
+ if (msg) {
50
+ fprintf(stderr, "Line: %d Error: %s\n", mtex2MML_lineno, msg);
51
+ }
52
+ }
53
+
54
+ void (*mtex2MML_error) (const char * msg) = mtex2MML_default_error;
55
+
56
+ static void yyerror (char **ret_str, const char * s)
57
+ {
58
+ char * msg = mtex2MML_copy3 (s, " at token ", yytext);
59
+ if (mtex2MML_error) {
60
+ (*mtex2MML_error) (msg);
61
+ }
62
+ mtex2MML_free_string (msg);
63
+ }
64
+
65
+ /* Note: If length is 0, then buffer is treated like a string; otherwise only length bytes are written.
66
+ */
67
+
68
+ static void mtex2MML_default_write (const char * buffer, unsigned long length)
69
+ {
70
+ if (buffer) {
71
+ if (length) {
72
+ fwrite (buffer, 1, length, stdout);
73
+ } else {
74
+ fputs (buffer, stdout);
75
+ }
76
+ }
77
+ }
78
+
79
+ static void mtex2MML_default_write_mathml (const char * mathml)
80
+ {
81
+ if (mtex2MML_write) {
82
+ (*mtex2MML_write) (mathml, 0);
83
+ }
84
+ }
85
+
86
+ #ifdef mtex2MML_CAPTURE
87
+ static char * mtex2MML_output_string = "" ;
88
+
89
+ char * mtex2MML_output (void)
90
+ {
91
+ char * copy = (char *) malloc((mtex2MML_output_string ? strlen(mtex2MML_output_string) : 0) + 1);
92
+ if (copy) {
93
+ if (mtex2MML_output_string) {
94
+ strcpy(copy, mtex2MML_output_string);
95
+ if (*mtex2MML_output_string != '\0') {
96
+ mtex2MML_free_string(mtex2MML_output_string);
97
+ }
98
+ } else {
99
+ copy[0] = 0;
100
+ }
101
+ mtex2MML_output_string = "";
102
+ }
103
+ return copy;
104
+ }
105
+
106
+ static void mtex2MML_capture (const char * buffer, unsigned long length)
107
+ {
108
+ if (buffer) {
109
+ if (length) {
110
+ unsigned long first_length = mtex2MML_output_string ? strlen(mtex2MML_output_string) : 0;
111
+ char * copy = (char *) malloc(first_length + length + 1);
112
+ if (copy) {
113
+ if (mtex2MML_output_string) {
114
+ strcpy(copy, mtex2MML_output_string);
115
+ if (*mtex2MML_output_string != '\0') {
116
+ mtex2MML_free_string(mtex2MML_output_string);
117
+ }
118
+ } else {
119
+ copy[0] = 0;
120
+ }
121
+ strncat(copy, buffer, length);
122
+ mtex2MML_output_string = copy;
123
+ }
124
+ } else {
125
+ char * copy = mtex2MML_copy2(mtex2MML_output_string, buffer);
126
+ if (*mtex2MML_output_string != '\0') {
127
+ mtex2MML_free_string(mtex2MML_output_string);
128
+ }
129
+ mtex2MML_output_string = copy;
130
+ }
131
+ }
132
+ }
133
+
134
+ static void mtex2MML_capture_mathml (const char * buffer)
135
+ {
136
+ char * temp = mtex2MML_copy2(mtex2MML_output_string, buffer);
137
+ if (*mtex2MML_output_string != '\0') {
138
+ mtex2MML_free_string(mtex2MML_output_string);
139
+ }
140
+ mtex2MML_output_string = temp;
141
+ }
142
+ void (*mtex2MML_write) (const char * buffer, unsigned long length) = mtex2MML_capture;
143
+ void (*mtex2MML_write_mathml) (const char * mathml) = mtex2MML_capture_mathml;
144
+ #else
145
+ void (*mtex2MML_write) (const char * buffer, unsigned long length) = mtex2MML_default_write;
146
+ void (*mtex2MML_write_mathml) (const char * mathml) = mtex2MML_default_write_mathml;
147
+ #endif
148
+
149
+ char * mtex2MML_empty_string = (char *) "";
150
+
151
+ /* Create a copy of a string, adding space for extra chars
152
+ */
153
+ char * mtex2MML_copy_string_extra (const char * str, unsigned extra)
154
+ {
155
+ char * copy = (char *) malloc(extra + (str ? strlen (str) : 0) + 1);
156
+ if (copy) {
157
+ if (str) {
158
+ strcpy(copy, str);
159
+ } else {
160
+ copy[0] = 0;
161
+ }
162
+ }
163
+ return copy ? copy : mtex2MML_empty_string;
164
+ }
165
+
166
+ /* Create a copy of a string, appending two strings
167
+ */
168
+ char * mtex2MML_copy3 (const char * first, const char * second, const char * third)
169
+ {
170
+ int first_length = first ? strlen( first) : 0;
171
+ int second_length = second ? strlen(second) : 0;
172
+ int third_length = third ? strlen( third) : 0;
173
+
174
+ char * copy = (char *) malloc(first_length + second_length + third_length + 1);
175
+
176
+ if (copy) {
177
+ if (first) {
178
+ strcpy(copy, first);
179
+ } else {
180
+ copy[0] = 0;
181
+ }
182
+
183
+ if (second) { strcat(copy, second); }
184
+ if ( third) { strcat(copy, third); }
185
+ }
186
+ return copy ? copy : mtex2MML_empty_string;
187
+ }
188
+
189
+ /* Create a copy of a string, appending a second string
190
+ */
191
+ char * mtex2MML_copy2 (const char * first, const char * second)
192
+ {
193
+ return mtex2MML_copy3(first, second, 0);
194
+ }
195
+
196
+ /* Create a copy of a string
197
+ */
198
+ char * mtex2MML_copy_string (const char * str)
199
+ {
200
+ return mtex2MML_copy3(str, 0, 0);
201
+ }
202
+
203
+ /* Create a copy of a string, escaping unsafe characters for XML
204
+ */
205
+ char * mtex2MML_copy_escaped (const char * str)
206
+ {
207
+ unsigned long length = 0;
208
+
209
+ const char * ptr1 = str;
210
+
211
+ char * ptr2 = 0;
212
+ char * copy = 0;
213
+
214
+ if ( str == 0) { return mtex2MML_empty_string; }
215
+ if (*str == 0) { return mtex2MML_empty_string; }
216
+
217
+ while (*ptr1) {
218
+ switch (*ptr1) {
219
+ case '<': /* &lt; */
220
+ case '>': /* &gt; */
221
+ length += 4;
222
+ break;
223
+ case '&': /* &amp; */
224
+ length += 5;
225
+ break;
226
+ case '\'': /* &apos; */
227
+ case '"': /* &quot; */
228
+ case '-': /* &#x2d; */
229
+ length += 6;
230
+ break;
231
+ default:
232
+ length += 1;
233
+ break;
234
+ }
235
+ ++ptr1;
236
+ }
237
+
238
+ copy = (char *) malloc (length + 1);
239
+
240
+ if (copy) {
241
+ ptr1 = str;
242
+ ptr2 = copy;
243
+
244
+ while (*ptr1) {
245
+ switch (*ptr1) {
246
+ case '<':
247
+ strcpy (ptr2, "&lt;");
248
+ ptr2 += 4;
249
+ break;
250
+ case '>':
251
+ strcpy (ptr2, "&gt;");
252
+ ptr2 += 4;
253
+ break;
254
+ case '&': /* &amp; */
255
+ strcpy (ptr2, "&amp;");
256
+ ptr2 += 5;
257
+ break;
258
+ case '\'': /* &apos; */
259
+ strcpy (ptr2, "&apos;");
260
+ ptr2 += 6;
261
+ break;
262
+ case '"': /* &quot; */
263
+ strcpy (ptr2, "&quot;");
264
+ ptr2 += 6;
265
+ break;
266
+ case '-': /* &#x2d; */
267
+ strcpy (ptr2, "&#x2d;");
268
+ ptr2 += 6;
269
+ break;
270
+ default:
271
+ *ptr2++ = *ptr1;
272
+ break;
273
+ }
274
+ ++ptr1;
275
+ }
276
+ *ptr2 = 0;
277
+ }
278
+ return copy ? copy : mtex2MML_empty_string;
279
+ }
280
+
281
+ /* Returns a string representation of the global_label, and increments the label */
282
+ char * mtex2MML_global_label(void)
283
+ {
284
+ char * n = (char *) malloc(256);
285
+ #ifdef _WIN32
286
+ _snprintf(n, 256, "%d", global_label);
287
+ #else
288
+ snprintf(n, 256, "%d", global_label);
289
+ #endif
290
+ global_label++;
291
+ char *prefix = mtex2MML_copy3("<mtd><mtext>(", n, ")</mtext></mtd>");
292
+ mtex2MML_free_string(n);
293
+
294
+ return prefix;
295
+ }
296
+
297
+ /* Create a hex character reference string corresponding to code
298
+ */
299
+ char * mtex2MML_character_reference (unsigned long int code)
300
+ {
301
+ #define ENTITY_LENGTH 10
302
+ char * entity = (char *) malloc(ENTITY_LENGTH);
303
+ sprintf(entity, "&#x%05lx;", code);
304
+ return entity;
305
+ }
306
+
307
+ void mtex2MML_free_string (char * str)
308
+ {
309
+ if (str && str != mtex2MML_empty_string) {
310
+ free(str);
311
+ }
312
+ }
313
+
314
+
315
+ %}
316
+
317
+ %left TEXOVER TEXOVERWITHDELIMS TEXATOP TEXATOPWITHDELIMS TEXABOVE TEXABOVEWITHDELIMS LIMITS
318
+ %token CHAR STARTMATH STARTDMATH ENDMATH MTEXT MI MIB MN MO LIMITS NOLIMITS SUP SUB MROWOPEN MROWCLOSE MATHOPEN MATHCLOSE MATHORD MATHPUNCT VCENTER LEFT RIGHT BIG BBIG BIGG BBIGG BIGL BBIGL BIGGL BBIGGL BIGM BBIGM BIGGM BBIGGM FRAC TFRAC DFRAC CFRAC GENFRAC OPERATORNAME MATHOP MATHBIN MATHREL MATHINNER MOP MOL MOLL MOF MOR PERIODDELIM COMMADELIM OTHERDELIM LEFTDELIM RIGHTDELIM MOS MOB SQRT ROOT OF LEFTROOT UPROOT BINOM TBINOM BRACE BRACK CHOOSE DBINOM UNDER BUILDREL OVER OVERBRACE OVERBRACKET UNDERLINE UNDERBRACE UNDERBRACKET UNDEROVER TENSOR MULTI ALIGNATVALUE ARRAYALIGN COLUMNALIGN ARRAY SPACECUBE HSPACE MOVELEFT MOVERIGHT RAISE LOWER PXSTRING COLSEP COLSEPSPACE ROWSEP NEWLINE ARRAYOPTS COLLAYOUT COLALIGN ROWALIGN ALIGN EQROWS EQCOLS ROWLINES COLLINES FRAME PADDING ATTRLIST ITALICS SANS TT ENCLOSE ENCLOSENOTATION ENCLOSEATTR ENCLOSETEXT BOLD BOXED FBOX HBOX MBOX BCANCELED XCANCELED CANCELEDTO NOT SLASHED PMB SCR RM BB ST END BBLOWERCHAR BBUPPERCHAR BBDIGIT CALCHAR FRAKCHAR CAL FRAK CLAP LLAP RLAP ROWOPTS TEXTSIZE OLDSTYLE SCSTY SCSIZE SCSCSIZE TINY TTINY SMALL NORMALSIZE LARGE LLARGE LLLARGE HUGE HHUGE DISPLAY TEXTSTY TEXTBOX TEXTSTRING COLORSTRING STYLESTRING VERBBOX VERBSTRING ACUTE GRAVE BREVE MATHRING XMLSTRING CELLOPTS ROWSPAN COLSPAN THINSPACE ENSPACE MEDSPACE THICKSPACE QUAD QQUAD NEGSPACE NEGMEDSPACE NEGTHICKSPACE STRUT MATHSTRUT SMASH PHANTOM HPHANTOM VPHANTOM HREF UNKNOWNCHAR EMPTYMROW STATLINE TOOLTIP TOGGLE TOGGLESTART TOGGLEEND FGHIGHLIGHT BGHIGHLIGHT COLORBOX SPACE NUMBER INTONE INTTWO INTTHREE OVERLEFTARROW OVERLEFTRIGHTARROW OVERRIGHTARROW UNDERLEFTARROW UNDERLEFTRIGHTARROW UNDERRIGHTARROW BAR WIDEBAR SKEW VEC WIDEVEC HAT WIDEHAT CHECK WIDECHECK TILDE WIDETILDE DOT DDOT DDDOT DDDDOT UNARYMINUS UNARYPLUS BEGINENV ENDENV EQUATION EQUATION_STAR EQALIGN EQALIGNNO MATRIX PMATRIX BMATRIX BBMATRIX VMATRIX VVMATRIX SUBARRAY SVG ENDSVG SMALLMATRIX CASES ALIGNED ALIGNENV ALIGNENV_STAR ALIGNAT ALIGNAT_STAR ALIGNEDAT GATHERED EQNARRAY EQNARRAY_STAR MULTLINE MULTLINE_STAR GATHER_STAR GATHER SUBSTACK SIDESET BMOD PMOD POD RMCHAR SCRCHAR PMBCHAR COLOR BGCOLOR LABEL TAG BBOX XARROW OPTARGOPEN OPTARGCLOSE MTEXNUM RAISEBOX NEG LATEXSYMBOL TEXSYMBOL VARINJLIM VARLIMINF VARLIMSUP VARPROJLIM
319
+
320
+ %%
321
+
322
+ doc: xmlmmlTermList {/* all processing done in body*/};
323
+
324
+ xmlmmlTermList:
325
+ {/* nothing - do nothing*/}
326
+ | char {/* proc done in body*/}
327
+ | expression {/* all proc. in body*/}
328
+ | xmlmmlTermList char {/* all proc. in body*/}
329
+ | xmlmmlTermList expression {/* all proc. in body*/};
330
+
331
+ char: CHAR { mtex2MML_free_string($1); /* Do nothing...but what did this used to do? printf("%s", $1); */ };
332
+
333
+ expression: STARTMATH ENDMATH {/* empty math group - ignore*/}
334
+ | STARTDMATH ENDMATH {/* ditto */}
335
+ | STARTMATH compoundTermList ENDMATH {
336
+ char ** r = (char **) ret_str;
337
+ char * p = mtex2MML_copy3("<math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><semantics><mrow>", $2, "</mrow><annotation encoding='application/x-tex'>");
338
+ char * s = mtex2MML_copy3(p, $3, "</annotation></semantics></math>");
339
+ mtex2MML_free_string(p);
340
+ mtex2MML_free_string($2);
341
+ mtex2MML_free_string($3);
342
+ if (r) {
343
+ (*r) = (s == mtex2MML_empty_string) ? 0 : s;
344
+ }
345
+ else {
346
+ if (mtex2MML_write_mathml)
347
+ (*mtex2MML_write_mathml) (s);
348
+ mtex2MML_free_string(s);
349
+ }
350
+ }
351
+ | STARTDMATH compoundTermList ENDMATH {
352
+ char ** r = (char **) ret_str;
353
+ char * p = mtex2MML_copy3("<math xmlns='http://www.w3.org/1998/Math/MathML' display='block'><semantics><mrow>", $2, "</mrow><annotation encoding='application/x-tex'>");
354
+ char * s = mtex2MML_copy3(p, $3, "</annotation></semantics></math>");
355
+ mtex2MML_free_string(p);
356
+ mtex2MML_free_string($2);
357
+ mtex2MML_free_string($3);
358
+ if (r) {
359
+ (*r) = (s == mtex2MML_empty_string) ? 0 : s;
360
+ }
361
+ else {
362
+ if (mtex2MML_write_mathml)
363
+ (*mtex2MML_write_mathml) (s);
364
+ mtex2MML_free_string(s);
365
+ }
366
+ }
367
+ | mathenv {
368
+ char ** r = (char **) ret_str;
369
+ char * p = mtex2MML_copy3("<math xmlns='http://www.w3.org/1998/Math/MathML' display='block'><semantics><mrow>", $1, "</mrow><annotation encoding='application/x-tex'>");
370
+ char * s = mtex2MML_copy2(p, "</annotation></semantics></math>");
371
+ mtex2MML_free_string(p);
372
+ mtex2MML_free_string($1);
373
+ if (r) {
374
+ (*r) = (s == mtex2MML_empty_string) ? 0 : s;
375
+ }
376
+ else {
377
+ if (mtex2MML_write_mathml)
378
+ (*mtex2MML_write_mathml) (s);
379
+ mtex2MML_free_string(s);
380
+ }
381
+ }
382
+ /* plugs away some memory leaks when errors occur */
383
+ | compoundTermList error { mtex2MML_free_string($1); mtex2MML_free_string($2); YYABORT; }
384
+ | compoundTerm error { mtex2MML_free_string($1); mtex2MML_free_string($2); YYABORT; }
385
+ | error { YYABORT; }; /* tosses away the final token so that future parses are not affected */
386
+
387
+ compoundTermList: compoundTerm {
388
+ $$ = mtex2MML_copy_string($1);
389
+ mtex2MML_free_string($1);
390
+ }
391
+ | compoundTermList compoundTerm {
392
+ $$ = mtex2MML_copy2($1, $2);
393
+ mtex2MML_free_string($1);
394
+ mtex2MML_free_string($2);
395
+ };
396
+
397
+ compoundTerm: mob SUB closedTerm SUP closedTerm {
398
+ if (mtex2MML_displaymode == 1) {
399
+ char * s1 = mtex2MML_copy3("<munderover>", $1, " ");
400
+ char * s2 = mtex2MML_copy3($3, " ", $5);
401
+ $$ = mtex2MML_copy3(s1, s2, "</munderover>");
402
+ mtex2MML_free_string(s1);
403
+ mtex2MML_free_string(s2);
404
+ }
405
+ else {
406
+ char * s1 = mtex2MML_copy3("<msubsup>", $1, " ");
407
+ char * s2 = mtex2MML_copy3($3, " ", $5);
408
+ $$ = mtex2MML_copy3(s1, s2, "</msubsup>");
409
+ mtex2MML_free_string(s1);
410
+ mtex2MML_free_string(s2);
411
+ }
412
+ mtex2MML_free_string($1);
413
+ mtex2MML_free_string($3);
414
+ mtex2MML_free_string($5);
415
+ }
416
+ | MATHOP closedTerm SUB closedTerm SUP closedTerm {
417
+ char * s1 = mtex2MML_copy3("<munderover><mrow>", $2, "</mrow>");
418
+ char * s2 = mtex2MML_copy3(s1, $4, $6);
419
+ $$ = mtex2MML_copy2(s2, "</munderover>");
420
+ mtex2MML_free_string(s1);
421
+ mtex2MML_free_string(s2);
422
+
423
+ mtex2MML_free_string($2);
424
+ mtex2MML_free_string($4);
425
+ mtex2MML_free_string($6);
426
+ }
427
+ | OPERATORNAME closedTerm closedTerm {
428
+ char * s1 = mtex2MML_copy3("<mi>", $2, "</mi>");
429
+ $$ = mtex2MML_copy2(s1, $3);
430
+
431
+ mtex2MML_free_string(s1);
432
+ mtex2MML_free_string($2);
433
+ mtex2MML_free_string($3);
434
+ }
435
+ | OPERATORNAME closedTerm SUB closedTerm SUP closedTerm closedTerm {
436
+ char *s1 = mtex2MML_copy3("<msubsup><mi>", $2, "</mi>");
437
+ char *s2 = mtex2MML_copy3(s1, $4, $6);
438
+ $$ = mtex2MML_copy3(s2, "</msubsup><mo>&#x2061;</mo>", $7);
439
+
440
+ mtex2MML_free_string(s1);
441
+ mtex2MML_free_string(s2);
442
+ mtex2MML_free_string($2);
443
+ mtex2MML_free_string($4);
444
+ mtex2MML_free_string($6);
445
+ mtex2MML_free_string($7);
446
+ }
447
+ | mob SUB closedTerm {
448
+ if (mtex2MML_displaymode == 1) {
449
+ char * s1 = mtex2MML_copy3("<munder>", $1, " ");
450
+ $$ = mtex2MML_copy3(s1, $3, "</munder>");
451
+ mtex2MML_free_string(s1);
452
+ }
453
+ else {
454
+ char * s1 = mtex2MML_copy3("<msub>", $1, " ");
455
+ $$ = mtex2MML_copy3(s1, $3, "</msub>");
456
+ mtex2MML_free_string(s1);
457
+ }
458
+ mtex2MML_free_string($1);
459
+ mtex2MML_free_string($3);
460
+ }
461
+ | mob SUP closedTerm SUB closedTerm {
462
+ char * s1 = mtex2MML_copy3("<munderover>", $1, " ");
463
+ char * s2 = mtex2MML_copy3($5, " ", $3);
464
+ $$ = mtex2MML_copy3(s1, s2, "</munderover>");
465
+
466
+ mtex2MML_free_string(s1);
467
+ mtex2MML_free_string(s2);
468
+ mtex2MML_free_string($1);
469
+ mtex2MML_free_string($3);
470
+ mtex2MML_free_string($5);
471
+ }
472
+ | mob SUP closedTerm {
473
+ if (mtex2MML_displaymode == 1) {
474
+ char * s1 = mtex2MML_copy3("<mover>", $1, " ");
475
+ $$ = mtex2MML_copy3(s1, $3, "</mover>");
476
+ mtex2MML_free_string(s1);
477
+ }
478
+ else {
479
+ char * s1 = mtex2MML_copy3("<msup>", $1, " ");
480
+ $$ = mtex2MML_copy3(s1, $3, "</msup>");
481
+ mtex2MML_free_string(s1);
482
+ }
483
+ mtex2MML_free_string($1);
484
+ mtex2MML_free_string($3);
485
+ }
486
+ | mob SUP closedTerm LIMITS SUB closedTerm {
487
+ char * mo = mtex2MML_str_replace($1, "<mo>", "<mo movablelimits=\"false\">");
488
+ char * s1 = mtex2MML_copy2("<munderover>", mo);
489
+ char * s2 = mtex2MML_copy3($6, " ", $3);
490
+ $$ = mtex2MML_copy3(s1, s2, "</munderover>");
491
+
492
+ mtex2MML_free_string(mo);
493
+ mtex2MML_free_string(s1);
494
+ mtex2MML_free_string(s2);
495
+ mtex2MML_free_string($1);
496
+ mtex2MML_free_string($3);
497
+ mtex2MML_free_string($6);
498
+ }
499
+ | mob LIMITS SUP closedTerm SUB closedTerm {
500
+ char * mo = mtex2MML_str_replace($1, "<mo>", "<mo movablelimits=\"false\">");
501
+ char * s1 = mtex2MML_copy2("<munderover>", mo);
502
+ char * s2 = mtex2MML_copy2($6, $4);
503
+ $$ = mtex2MML_copy3(s1, s2, "</munderover>");
504
+ mtex2MML_free_string(mo);
505
+ mtex2MML_free_string(s1);
506
+ mtex2MML_free_string(s2);
507
+ mtex2MML_free_string($1);
508
+ mtex2MML_free_string($4);
509
+ mtex2MML_free_string($6);
510
+ }
511
+ | mob SUP closedTerm NOLIMITS SUB closedTerm {
512
+ char * mo = mtex2MML_str_replace($1, "<mo>", "<mo movablelimits=\"false\">");
513
+ char * s1 = mtex2MML_copy2("<msubsup>", mo);
514
+ char * s2 = mtex2MML_copy3($6, " ", $3);
515
+ $$ = mtex2MML_copy3(s1, s2, "</msubsup>");
516
+
517
+ mtex2MML_free_string(mo);
518
+ mtex2MML_free_string(s1);
519
+ mtex2MML_free_string(s2);
520
+ mtex2MML_free_string($1);
521
+ mtex2MML_free_string($3);
522
+ mtex2MML_free_string($6);
523
+ }
524
+ | mib SUB closedTerm SUP closedTerm {
525
+ if (mtex2MML_displaymode == 1) {
526
+ char * s1 = mtex2MML_copy3("<munderover>", $1, " ");
527
+ char * s2 = mtex2MML_copy3($3, " ", $5);
528
+ $$ = mtex2MML_copy3(s1, s2, "</munderover>");
529
+ mtex2MML_free_string(s1);
530
+ mtex2MML_free_string(s2);
531
+ }
532
+ else {
533
+ char * s1 = mtex2MML_copy3("<msubsup>", $1, " ");
534
+ char * s2 = mtex2MML_copy3($3, " ", $5);
535
+ $$ = mtex2MML_copy3(s1, s2, "</msubsup>");
536
+ mtex2MML_free_string(s1);
537
+ mtex2MML_free_string(s2);
538
+ }
539
+ mtex2MML_free_string($1);
540
+ mtex2MML_free_string($3);
541
+ mtex2MML_free_string($5);
542
+ }
543
+ | mib SUB closedTerm {
544
+ if (mtex2MML_displaymode == 1) {
545
+ char * s1 = mtex2MML_copy3("<munder>", $1, " ");
546
+ $$ = mtex2MML_copy3(s1, $3, "</munder>");
547
+ mtex2MML_free_string(s1);
548
+ }
549
+ else {
550
+ char * s1 = mtex2MML_copy3("<msub>", $1, " ");
551
+ $$ = mtex2MML_copy3(s1, $3, "</msub>");
552
+ mtex2MML_free_string(s1);
553
+ }
554
+ mtex2MML_free_string($1);
555
+ mtex2MML_free_string($3);
556
+ }
557
+ | mib SUP closedTerm SUB closedTerm {
558
+ if (mtex2MML_displaymode == 1) {
559
+ char * s1 = mtex2MML_copy3("<munderover>", $1, " ");
560
+ char * s2 = mtex2MML_copy3($5, " ", $3);
561
+ $$ = mtex2MML_copy3(s1, s2, "</munderover>");
562
+ mtex2MML_free_string(s1);
563
+ mtex2MML_free_string(s2);
564
+ }
565
+ else {
566
+ char * s1 = mtex2MML_copy3("<msubsup>", $1, " ");
567
+ char * s2 = mtex2MML_copy3($5, " ", $3);
568
+ $$ = mtex2MML_copy3(s1, s2, "</msubsup>");
569
+ mtex2MML_free_string(s1);
570
+ mtex2MML_free_string(s2);
571
+ }
572
+ mtex2MML_free_string($1);
573
+ mtex2MML_free_string($3);
574
+ mtex2MML_free_string($5);
575
+ }
576
+ | mib SUP closedTerm {
577
+ if (mtex2MML_displaymode == 1) {
578
+ char * s1 = mtex2MML_copy3("<mover>", $1, " ");
579
+ $$ = mtex2MML_copy3(s1, $3, "</mover>");
580
+ mtex2MML_free_string(s1);
581
+ }
582
+ else {
583
+ char * s1 = mtex2MML_copy3("<msup>", $1, " ");
584
+ $$ = mtex2MML_copy3(s1, $3, "</msup>");
585
+ mtex2MML_free_string(s1);
586
+ }
587
+ mtex2MML_free_string($1);
588
+ mtex2MML_free_string($3);
589
+ }
590
+ | mib LIMITS SUB closedTerm {
591
+ char * s1 = mtex2MML_copy3("<munder>", $1, " ");
592
+ $$ = mtex2MML_copy3(s1, $4, "</munder>");
593
+ mtex2MML_free_string(s1);
594
+
595
+ mtex2MML_free_string($1);
596
+ mtex2MML_free_string($4);
597
+ }
598
+ | closedTerm SUB closedTerm SUP closedTerm {
599
+ char * s1 = mtex2MML_copy3("<msubsup>", $1, " ");
600
+ char * s2 = mtex2MML_copy3($3, " ", $5);
601
+ $$ = mtex2MML_copy3(s1, s2, "</msubsup>");
602
+ mtex2MML_free_string(s1);
603
+ mtex2MML_free_string(s2);
604
+ mtex2MML_free_string($1);
605
+ mtex2MML_free_string($3);
606
+ mtex2MML_free_string($5);
607
+ }
608
+ | closedTerm NOLIMITS SUB closedTerm SUP closedTerm {
609
+ char * s1 = mtex2MML_copy3("<msubsup>", $1, " ");
610
+ char * s2 = mtex2MML_copy3($4, " ", $6);
611
+ $$ = mtex2MML_copy3(s1, s2, "</msubsup>");
612
+ mtex2MML_free_string(s1);
613
+ mtex2MML_free_string(s2);
614
+ mtex2MML_free_string($1);
615
+ mtex2MML_free_string($4);
616
+ mtex2MML_free_string($6);
617
+ }
618
+ | closedTerm SUP closedTerm SUB closedTerm {
619
+ char * s1 = mtex2MML_copy3("<msubsup>", $1, " ");
620
+ char * s2 = mtex2MML_copy3($5, " ", $3);
621
+ $$ = mtex2MML_copy3(s1, s2, "</msubsup>");
622
+ mtex2MML_free_string(s1);
623
+ mtex2MML_free_string(s2);
624
+ mtex2MML_free_string($1);
625
+ mtex2MML_free_string($3);
626
+ mtex2MML_free_string($5);
627
+ }
628
+ | closedTerm SUB closedTerm {
629
+ char * s1 = mtex2MML_copy3("<msub>", $1, " ");
630
+ $$ = mtex2MML_copy3(s1, $3, "</msub>");
631
+ mtex2MML_free_string(s1);
632
+ mtex2MML_free_string($1);
633
+ mtex2MML_free_string($3);
634
+ }
635
+ | closedTerm SUP closedTerm {
636
+ char * s1 = mtex2MML_copy3("<msup>", $1, " ");
637
+ $$ = mtex2MML_copy3(s1, $3, "</msup>");
638
+ mtex2MML_free_string(s1);
639
+ mtex2MML_free_string($1);
640
+ mtex2MML_free_string($3);
641
+ }
642
+ | SUB closedTerm {
643
+ $$ = mtex2MML_copy3("<msub><mo/>", $2, "</msub>");
644
+ mtex2MML_free_string($2);
645
+ }
646
+ | SUP closedTerm {
647
+ $$ = mtex2MML_copy3("<msup><mo/>", $2, "</msup>");
648
+ mtex2MML_free_string($2);
649
+ }
650
+ | closedTerm {
651
+ $$ = mtex2MML_copy_string($1);
652
+ mtex2MML_free_string($1);
653
+ };
654
+
655
+ closedTerm: array
656
+ | cases
657
+ | eqalign
658
+ | eqalignno
659
+ | unaryminus
660
+ | unaryplus
661
+ | mib
662
+ | mtext {
663
+ $$ = mtex2MML_copy3("<mtext>", $1, "</mtext>");
664
+ mtex2MML_free_string($1);
665
+ }
666
+ | mi {
667
+ $$ = mtex2MML_copy3("<mi>", $1, "</mi>");
668
+ mtex2MML_free_string($1);
669
+ }
670
+ | mn {
671
+ $$ = mtex2MML_copy3("<mn>", $1, "</mn>");
672
+ mtex2MML_free_string($1);
673
+ }
674
+ | mo
675
+ | tensor
676
+ | multi
677
+ | mfrac
678
+ | mathopen
679
+ | mathclose
680
+ | mathord
681
+ | mathpunct
682
+ | vcenter
683
+ | enclose
684
+ | binom
685
+ | brace
686
+ | brack
687
+ | choose
688
+ | msqrt
689
+ | mroot
690
+ | leftroot
691
+ | uproot
692
+ | raisebox
693
+ | munder
694
+ | mover
695
+ | bar
696
+ | vec
697
+ | hat
698
+ | skew
699
+ | acute
700
+ | grave
701
+ | breve
702
+ | mathring
703
+ | dot
704
+ | ddot
705
+ | dddot
706
+ | ddddot
707
+ | check
708
+ | tilde
709
+ | overleftarrow
710
+ | overleftrightarrow
711
+ | overrightarrow
712
+ | underleftarrow
713
+ | underleftrightarrow
714
+ | underrightarrow
715
+ | moverbrace
716
+ | moverbracket
717
+ | munderbrace
718
+ | munderbracket
719
+ | munderline
720
+ | munderover
721
+ | emptymrow
722
+ | mathclap
723
+ | mathllap
724
+ | mathrlap
725
+ | displaystyle
726
+ | textstyle
727
+ | textsize
728
+ | scriptstyle
729
+ | scriptsize
730
+ | tiny
731
+ | ttiny
732
+ | small
733
+ | normalsize
734
+ | large
735
+ | llarge
736
+ | lllarge
737
+ | huge
738
+ | hhuge
739
+ | scriptscriptsize
740
+ | oldstyle
741
+ | moveleft
742
+ | moveright
743
+ | raise
744
+ | lower
745
+ | italics
746
+ | sans
747
+ | mono
748
+ | bold
749
+ | roman
750
+ | rmchars
751
+ | script
752
+ | scrchars
753
+ | pmb
754
+ | pmbchars
755
+ | bbold
756
+ | frak
757
+ | not
758
+ | slashed
759
+ | bcanceled
760
+ | xcanceled
761
+ | canceledto
762
+ | boxed
763
+ | fbox
764
+ | hbox
765
+ | mbox
766
+ | cal
767
+ | space
768
+ | textstring
769
+ | verbstring
770
+ | thinspace
771
+ | medspace
772
+ | thickspace
773
+ | enspace
774
+ | spacecube
775
+ | quad
776
+ | qquad
777
+ | negspace
778
+ | negmedspace
779
+ | negthickspace
780
+ | strut
781
+ | mathstrut
782
+ | smash
783
+ | phantom
784
+ | hphantom
785
+ | vphantom
786
+ | tex
787
+ | latex
788
+ | varinjlim
789
+ | varliminf
790
+ | varlimsup
791
+ | varprojlm
792
+ | href
793
+ | statusline
794
+ | tooltip
795
+ | toggle
796
+ | label
797
+ | tag
798
+ | fghighlight
799
+ | bghighlight
800
+ | colorbox
801
+ | color
802
+ | hspace
803
+ | newline
804
+ | buildrel
805
+ | texover
806
+ | texoverwithdelims
807
+ | texatop
808
+ | texatopwithdelims
809
+ | texabove
810
+ | texabovewithdelims
811
+ | MROWOPEN closedTerm MROWCLOSE {
812
+ $$ = mtex2MML_copy_string($2);
813
+ mtex2MML_free_string($2);
814
+ }
815
+ | MROWOPEN compoundTermList MROWCLOSE {
816
+ $$ = mtex2MML_copy3("<mrow>", $2, "</mrow>");
817
+ mtex2MML_free_string($2);
818
+ }
819
+ | left compoundTermList right {
820
+ char * s1 = mtex2MML_copy3("<mrow>", $1, $2);
821
+ $$ = mtex2MML_copy3(s1, $3, "</mrow>");
822
+ mtex2MML_free_string(s1);
823
+ mtex2MML_free_string($1);
824
+ mtex2MML_free_string($2);
825
+ mtex2MML_free_string($3);
826
+ }
827
+ | mathenv
828
+ | substack
829
+ | sideset
830
+ | bmod
831
+ | pmod
832
+ | pod
833
+ | unrecognized;
834
+
835
+ left: LEFT LEFTDELIM {
836
+ mtex2MML_rowposn = 2;
837
+ $$ = mtex2MML_copy3("<mo>", $2, "</mo>");
838
+ mtex2MML_free_string($2);
839
+ }
840
+ | LEFT OTHERDELIM {
841
+ mtex2MML_rowposn = 2;
842
+ $$ = mtex2MML_copy3("<mo>", $2, "</mo>");
843
+ mtex2MML_free_string($2);
844
+ }
845
+ | LEFT PERIODDELIM {
846
+ mtex2MML_rowposn = 2;
847
+ $$ = mtex2MML_copy_string("");
848
+ mtex2MML_free_string($2);
849
+ };
850
+
851
+ right: RIGHT RIGHTDELIM {
852
+ $$ = mtex2MML_copy3("<mo>", $2, "</mo>");
853
+ mtex2MML_free_string($2);
854
+ }
855
+ | RIGHT OTHERDELIM {
856
+ $$ = mtex2MML_copy3("<mo>", $2, "</mo>");
857
+ mtex2MML_free_string($2);
858
+ }
859
+ | RIGHT PERIODDELIM {
860
+ $$ = mtex2MML_copy_string("");
861
+ mtex2MML_free_string($2);
862
+ };
863
+
864
+ bigdelim: BIG LEFTDELIM {
865
+ mtex2MML_rowposn = 2;
866
+ $$ = mtex2MML_copy3("<mo maxsize=\"1.2em\" minsize=\"1.2em\">", $2, "</mo>");
867
+ mtex2MML_free_string($2);
868
+ }
869
+ | BIG RIGHTDELIM {
870
+ $$ = mtex2MML_copy3("<mo maxsize=\"1.2em\" minsize=\"1.2em\">", $2, "</mo>");
871
+ mtex2MML_free_string($2);
872
+ }
873
+ | BIG OTHERDELIM {
874
+ $$ = mtex2MML_copy3("<mo maxsize=\"1.2em\" minsize=\"1.2em\">", $2, "</mo>");
875
+ mtex2MML_free_string($2);
876
+ }
877
+ | BBIG LEFTDELIM {
878
+ mtex2MML_rowposn = 2;
879
+ $$ = mtex2MML_copy3("<mo maxsize=\"1.8em\" minsize=\"1.8em\">", $2, "</mo>");
880
+ mtex2MML_free_string($2);
881
+ }
882
+ | BBIG RIGHTDELIM {
883
+ $$ = mtex2MML_copy3("<mo maxsize=\"1.8em\" minsize=\"1.8em\">", $2, "</mo>");
884
+ mtex2MML_free_string($2);
885
+ }
886
+ | BBIG OTHERDELIM {
887
+ $$ = mtex2MML_copy3("<mo maxsize=\"1.8em\" minsize=\"1.8em\">", $2, "</mo>");
888
+ mtex2MML_free_string($2);
889
+ }
890
+ | BIGG LEFTDELIM {
891
+ mtex2MML_rowposn = 2;
892
+ $$ = mtex2MML_copy3("<mo maxsize=\"2.4em\" minsize=\"2.4em\">", $2, "</mo>");
893
+ mtex2MML_free_string($2);
894
+ }
895
+ | BIGG RIGHTDELIM {
896
+ $$ = mtex2MML_copy3("<mo maxsize=\"2.4em\" minsize=\"2.4em\">", $2, "</mo>");
897
+ mtex2MML_free_string($2);
898
+ }
899
+ | BIGG OTHERDELIM {
900
+ $$ = mtex2MML_copy3("<mo maxsize=\"2.4em\" minsize=\"2.4em\">", $2, "</mo>");
901
+ mtex2MML_free_string($2);
902
+ }
903
+ | BBIGG LEFTDELIM {
904
+ mtex2MML_rowposn = 2;
905
+ $$ = mtex2MML_copy3("<mo maxsize=\"3em\" minsize=\"3em\">", $2, "</mo>");
906
+ mtex2MML_free_string($2);
907
+ }
908
+ | BBIGG RIGHTDELIM {
909
+ $$ = mtex2MML_copy3("<mo maxsize=\"3em\" minsize=\"3em\">", $2, "</mo>");
910
+ mtex2MML_free_string($2);
911
+ }
912
+ | BBIGG OTHERDELIM {
913
+ $$ = mtex2MML_copy3("<mo maxsize=\"3em\" minsize=\"3em\">", $2, "</mo>");
914
+ mtex2MML_free_string($2);
915
+ }
916
+ | BIGL LEFTDELIM {
917
+ mtex2MML_rowposn = 2;
918
+ $$ = mtex2MML_copy3("<mo maxsize=\"1.2em\" minsize=\"1.2em\">", $2, "</mo>");
919
+ mtex2MML_free_string($2);
920
+ }
921
+ | BIGL OTHERDELIM {
922
+ mtex2MML_rowposn = 2;
923
+ $$ = mtex2MML_copy3("<mo maxsize=\"1.2em\" minsize=\"1.2em\">", $2, "</mo>");
924
+ mtex2MML_free_string($2);
925
+ }
926
+ | BBIGL LEFTDELIM {
927
+ mtex2MML_rowposn = 2;
928
+ $$ = mtex2MML_copy3("<mo maxsize=\"1.8em\" minsize=\"1.8em\">", $2, "</mo>");
929
+ mtex2MML_free_string($2);
930
+ }
931
+ | BBIGL OTHERDELIM {
932
+ mtex2MML_rowposn = 2;
933
+ $$ = mtex2MML_copy3("<mo maxsize=\"1.8em\" minsize=\"1.8em\">", $2, "</mo>");
934
+ mtex2MML_free_string($2);
935
+ }
936
+ | BIGGL LEFTDELIM {
937
+ mtex2MML_rowposn = 2;
938
+ $$ = mtex2MML_copy3("<mo maxsize=\"2.4em\" minsize=\"2.4em\">", $2, "</mo>");
939
+ mtex2MML_free_string($2);
940
+ }
941
+ | BIGGL OTHERDELIM {
942
+ mtex2MML_rowposn = 2;
943
+ $$ = mtex2MML_copy3("<mo maxsize=\"2.4em\" minsize=\"2.4em\">", $2, "</mo>");
944
+ mtex2MML_free_string($2);
945
+ }
946
+ | BBIGGL LEFTDELIM {
947
+ mtex2MML_rowposn = 2;
948
+ $$ = mtex2MML_copy3("<mo maxsize=\"3em\" minsize=\"3em\">", $2, "</mo>");
949
+ mtex2MML_free_string($2);
950
+ }
951
+ | BBIGGL OTHERDELIM {
952
+ mtex2MML_rowposn = 2;
953
+ $$ = mtex2MML_copy3("<mo maxsize=\"3em\" minsize=\"3em\">", $2, "</mo>");
954
+ mtex2MML_free_string($2);
955
+ }
956
+ | BIGM LEFTDELIM {
957
+ mtex2MML_rowposn = 2;
958
+ $$ = mtex2MML_copy3("<mo maxsize=\"1.2em\" minsize=\"1.2em\" fence=\"true\" stretchy=\"true\" symmetric=\"true\">", $2, "</mo>");
959
+ mtex2MML_free_string($2);
960
+ }
961
+ | BIGM OTHERDELIM {
962
+ mtex2MML_rowposn = 2;
963
+ $$ = mtex2MML_copy3("<mo maxsize=\"1.2em\" minsize=\"1.2em\" fence=\"true\" stretchy=\"true\" symmetric=\"true\">", $2, "</mo>");
964
+ mtex2MML_free_string($2);
965
+ }
966
+ | BBIGM LEFTDELIM {
967
+ mtex2MML_rowposn = 2;
968
+ $$ = mtex2MML_copy3("<mo maxsize=\"1.8em\" minsize=\"1.8em\" fence=\"true\" stretchy=\"true\" symmetric=\"true\">", $2, "</mo>");
969
+ mtex2MML_free_string($2);
970
+ }
971
+ | BBIGM OTHERDELIM {
972
+ mtex2MML_rowposn = 2;
973
+ $$ = mtex2MML_copy3("<mo maxsize=\"1.8em\" minsize=\"1.8em\" fence=\"true\" stretchy=\"true\" symmetric=\"true\">", $2, "</mo>");
974
+ mtex2MML_free_string($2);
975
+ }
976
+ | BIGGM LEFTDELIM {
977
+ mtex2MML_rowposn = 2;
978
+ $$ = mtex2MML_copy3("<mo maxsize=\"2.4em\" minsize=\"2.4em\" fence=\"true\" stretchy=\"true\" symmetric=\"true\">", $2, "</mo>");
979
+ mtex2MML_free_string($2);
980
+ }
981
+ | BIGGM OTHERDELIM {
982
+ mtex2MML_rowposn = 2;
983
+ $$ = mtex2MML_copy3("<mo maxsize=\"2.4em\" minsize=\"2.4em\" fence=\"true\" stretchy=\"true\" symmetric=\"true\">", $2, "</mo>");
984
+ mtex2MML_free_string($2);
985
+ }
986
+ | BBIGGM LEFTDELIM {
987
+ mtex2MML_rowposn = 2;
988
+ $$ = mtex2MML_copy3("<mo maxsize=\"3em\" minsize=\"3em\" fence=\"true\" stretchy=\"true\" symmetric=\"true\">", $2, "</mo>");
989
+ mtex2MML_free_string($2);
990
+ }
991
+ | BBIGGM OTHERDELIM {
992
+ mtex2MML_rowposn = 2;
993
+ $$ = mtex2MML_copy3("<mo maxsize=\"3em\" minsize=\"3em\" fence=\"true\" stretchy=\"true\" symmetric=\"true\">", $2, "</mo>");
994
+ mtex2MML_free_string($2);
995
+ };
996
+
997
+ unrecognized: UNKNOWNCHAR {
998
+ $$ = mtex2MML_copy_string("<merror><mtext>Unknown character</mtext></merror>");
999
+ };
1000
+
1001
+ unaryminus: UNARYMINUS {
1002
+ $$ = mtex2MML_copy_string("<mo lspace=\"verythinmathspace\" rspace=\"0em\">&minus;</mo>");
1003
+ };
1004
+
1005
+ unaryplus: UNARYPLUS {
1006
+ $$ = mtex2MML_copy_string("<mo lspace=\"verythinmathspace\" rspace=\"0em\">+</mo>");
1007
+ };
1008
+
1009
+ varinjlim: VARINJLIM {
1010
+ $$ = mtex2MML_copy_string("<munder>lim<mo>&#x2192;</mo></munder>");
1011
+ };
1012
+
1013
+ varliminf: VARLIMINF {
1014
+ $$ = mtex2MML_copy_string("<munder>lim<mo>_</mo></munder>");
1015
+ };
1016
+
1017
+ varlimsup: VARLIMSUP {
1018
+ $$ = mtex2MML_copy_string("<mover>lim<mo>&#xAF;</mo></mover>");
1019
+ };
1020
+
1021
+ varprojlm: VARPROJLIM {
1022
+ $$ = mtex2MML_copy_string("<munder>lim<mo>&#x2190;</mo></munder>");
1023
+ };
1024
+
1025
+ mi: MI;
1026
+
1027
+ mtext: MTEXT;
1028
+
1029
+ mib: MIB {
1030
+ mtex2MML_rowposn=2;
1031
+ $$ = mtex2MML_copy3("<mi>", $1, "</mi>");
1032
+ mtex2MML_free_string($1);
1033
+ };
1034
+
1035
+ mn: MN
1036
+ | MTEXNUM TEXTSTRING {
1037
+ mtex2MML_rowposn = 2;
1038
+ $$ = mtex2MML_copy_string($2);
1039
+ mtex2MML_free_string($2);
1040
+ };
1041
+
1042
+ mob: MOB {
1043
+ mtex2MML_rowposn = 2;
1044
+ $$ = mtex2MML_copy3("<mo>", $1, "</mo>");
1045
+ mtex2MML_free_string($1);
1046
+ };
1047
+
1048
+ mo: mob
1049
+ | bigdelim
1050
+ | MO {
1051
+ mtex2MML_rowposn = 2;
1052
+ $$ = mtex2MML_copy3("<mo>", $1, "</mo>");
1053
+ mtex2MML_free_string($1);
1054
+ }
1055
+ | MOL {
1056
+ mtex2MML_rowposn = 2;
1057
+ $$ = mtex2MML_copy3("<mo>", $1, "</mo>");
1058
+ mtex2MML_free_string($1);
1059
+ }
1060
+ | MOLL {
1061
+ mtex2MML_rowposn = 2;
1062
+ $$ = mtex2MML_copy3("<mstyle scriptlevel=\"0\"><mo>", $1, "</mo></mstyle>");
1063
+ mtex2MML_free_string($1);
1064
+ }
1065
+ | MOL LIMITS SUB closedTerm SUP closedTerm {
1066
+ if (mtex2MML_displaymode == 1) {
1067
+ char * s1 = mtex2MML_copy3("<munderover>", $1, " ");
1068
+ char * s2 = mtex2MML_copy3($4, " ", $6);
1069
+ $$ = mtex2MML_copy3(s1, s2, "</munderover>");
1070
+ mtex2MML_free_string(s1);
1071
+ mtex2MML_free_string(s2);
1072
+ }
1073
+ else {
1074
+ char * s1 = mtex2MML_copy3("<msubsup>", $1, " ");
1075
+ char * s2 = mtex2MML_copy3($4, " ", $6);
1076
+ $$ = mtex2MML_copy3(s1, s2, "</msubsup>");
1077
+ mtex2MML_free_string(s1);
1078
+ mtex2MML_free_string(s2);
1079
+ }
1080
+ mtex2MML_free_string($1);
1081
+ mtex2MML_free_string($4);
1082
+ mtex2MML_free_string($6);
1083
+ }
1084
+ | RIGHTDELIM {
1085
+ $$ = mtex2MML_copy3("<mo stretchy=\"false\">", $1, "</mo>");
1086
+ mtex2MML_free_string($1);
1087
+ }
1088
+ | LEFTDELIM {
1089
+ mtex2MML_rowposn = 2;
1090
+ $$ = mtex2MML_copy3("<mo stretchy=\"false\">", $1, "</mo>");
1091
+ mtex2MML_free_string($1);
1092
+ }
1093
+ | OTHERDELIM {
1094
+ $$ = mtex2MML_copy3("<mo stretchy=\"false\">", $1, "</mo>");
1095
+ mtex2MML_free_string($1);
1096
+ }
1097
+ | MOF {
1098
+ $$ = mtex2MML_copy3("<mo stretchy=\"false\">", $1, "</mo>");
1099
+ mtex2MML_free_string($1);
1100
+ }
1101
+ | PERIODDELIM {
1102
+ $$ = mtex2MML_copy3("<mo>", $1, "</mo>");
1103
+ mtex2MML_free_string($1);
1104
+ }
1105
+ | COMMADELIM {
1106
+ $$ = mtex2MML_copy3("<mo>", $1, "</mo>");
1107
+ mtex2MML_free_string($1);
1108
+ }
1109
+ | MOS {
1110
+ mtex2MML_rowposn=2;
1111
+ $$ = mtex2MML_copy3("<mo lspace=\"mediummathspace\" rspace=\"mediummathspace\">", $1, "</mo>");
1112
+ mtex2MML_free_string($1);
1113
+ }
1114
+ | MOP {
1115
+ mtex2MML_rowposn = 2;
1116
+ $$ = mtex2MML_copy3("<mo lspace=\"0em\" rspace=\"thinmathspace\">", $1, "</mo>");
1117
+ mtex2MML_free_string($1);
1118
+ }
1119
+ | MOR {
1120
+ mtex2MML_rowposn = 2;
1121
+ $$ = mtex2MML_copy3("<mo lspace=\"verythinmathspace\">", $1, "</mo>");
1122
+ mtex2MML_free_string($1);
1123
+ }
1124
+ | MATHBIN TEXTSTRING {
1125
+ mtex2MML_rowposn = 2;
1126
+ $$ = mtex2MML_copy3("<mo lspace=\"mediummathspace\" rspace=\"mediummathspace\">", $2, "</mo>");
1127
+ mtex2MML_free_string($2);
1128
+ }
1129
+ | MATHINNER TEXTSTRING {
1130
+ mtex2MML_rowposn = 2;
1131
+ $$ = mtex2MML_copy3("<mo lspace=\"mediummathspace\" rspace=\"mediummathspace\">", $2, "</mo>");
1132
+ mtex2MML_free_string($2);
1133
+ }
1134
+ | MATHREL TEXTSTRING {
1135
+ mtex2MML_rowposn = 2;
1136
+ $$ = mtex2MML_copy3("<mo lspace=\"thickmathspace\" rspace=\"thickmathspace\">", $2, "</mo>");
1137
+ mtex2MML_free_string($2);
1138
+ };
1139
+
1140
+ space: SPACE ST INTONE END ST INTTWO END ST INTTHREE END {
1141
+ char * s1 = mtex2MML_copy3("<mspace height=\"", $3, "ex\" depth=\"");
1142
+ char * s2 = mtex2MML_copy3($6, "ex\" width=\"", $9);
1143
+ $$ = mtex2MML_copy3(s1, s2, "em\"/>");
1144
+ mtex2MML_free_string(s1);
1145
+ mtex2MML_free_string(s2);
1146
+ mtex2MML_free_string($3);
1147
+ mtex2MML_free_string($6);
1148
+ mtex2MML_free_string($9);
1149
+ };
1150
+
1151
+ /* TODO: intentional no op -- figure this out */
1152
+ label: LABEL ATTRLIST {
1153
+ $$ = mtex2MML_copy_string("");
1154
+ mtex2MML_free_string($2);
1155
+ };
1156
+
1157
+ /* TODO: intentional no op -- figure this out */
1158
+ tag: TAG ATTRLIST {
1159
+ $$ = mtex2MML_copy_string("");
1160
+ mtex2MML_free_string($2);
1161
+ };
1162
+
1163
+ statusline: STATLINE TEXTSTRING closedTerm {
1164
+ char * s1 = mtex2MML_copy3("<maction actiontype=\"statusline\">", $3, "<mtext>");
1165
+ $$ = mtex2MML_copy3(s1, $2, "</mtext></maction>");
1166
+ mtex2MML_free_string(s1);
1167
+ mtex2MML_free_string($2);
1168
+ mtex2MML_free_string($3);
1169
+ };
1170
+
1171
+ tooltip: TOOLTIP TEXTSTRING closedTerm {
1172
+ char * s1 = mtex2MML_copy3("<maction actiontype=\"tooltip\">", $3, "<mtext>");
1173
+ $$ = mtex2MML_copy3(s1, $2, "</mtext></maction>");
1174
+ mtex2MML_free_string(s1);
1175
+ mtex2MML_free_string($2);
1176
+ mtex2MML_free_string($3);
1177
+ };
1178
+
1179
+ toggle: TOGGLE closedTerm closedTerm {
1180
+ char * s1 = mtex2MML_copy3("<maction actiontype=\"toggle\" selection=\"2\">", $2, " ");
1181
+ $$ = mtex2MML_copy3(s1, $3, "</maction>");
1182
+ mtex2MML_free_string(s1);
1183
+ mtex2MML_free_string($2);
1184
+ mtex2MML_free_string($3);
1185
+ }
1186
+ | TOGGLESTART compoundTermList TOGGLEEND {
1187
+ $$ = mtex2MML_copy3("<maction actiontype=\"toggle\">", $2, "</maction>");
1188
+ mtex2MML_free_string($2);
1189
+ };
1190
+
1191
+ fghighlight: FGHIGHLIGHT ATTRLIST closedTerm {
1192
+ char * s1 = mtex2MML_copy3("<maction actiontype=\"highlight\" other='color=", $2, "'>");
1193
+ $$ = mtex2MML_copy3(s1, $3, "</maction>");
1194
+ mtex2MML_free_string(s1);
1195
+ mtex2MML_free_string($2);
1196
+ mtex2MML_free_string($3);
1197
+ };
1198
+
1199
+ bghighlight: BGHIGHLIGHT ATTRLIST closedTerm {
1200
+ char * s1 = mtex2MML_copy3("<maction actiontype=\"highlight\" other='background=", $2, "'>");
1201
+ $$ = mtex2MML_copy3(s1, $3, "</maction>");
1202
+ mtex2MML_free_string(s1);
1203
+ mtex2MML_free_string($2);
1204
+ mtex2MML_free_string($3);
1205
+ };
1206
+
1207
+ colorbox: COLORBOX ATTRLIST closedTerm {
1208
+ char * s1 = mtex2MML_copy3("<mpadded width=\"+10px\" height=\"+5px\" depth=\"+5px\" lspace=\"5px\" mathbackground=", $2, ">");
1209
+ $$ = mtex2MML_copy3(s1, $3, "</mpadded>");
1210
+ mtex2MML_free_string(s1);
1211
+ mtex2MML_free_string($2);
1212
+ mtex2MML_free_string($3);
1213
+ };
1214
+
1215
+ color: COLOR ATTRLIST compoundTermList {
1216
+ char * s1;
1217
+ struct css_colors *c = NULL;
1218
+
1219
+ HASH_FIND_STR( colors, $2, c );
1220
+
1221
+ if (HASH_COUNT(c) > 0)
1222
+ s1 = mtex2MML_copy3("<mstyle mathcolor=", c->color, ">");
1223
+ else
1224
+ s1 = mtex2MML_copy3("<mstyle mathcolor=", $2, ">");
1225
+
1226
+ $$ = mtex2MML_copy3(s1, $3, "</mstyle>");
1227
+ mtex2MML_free_string(s1);
1228
+ mtex2MML_free_string($2);
1229
+ mtex2MML_free_string($3);
1230
+ }
1231
+ | BGCOLOR ATTRLIST compoundTermList {
1232
+ char * s1 = mtex2MML_copy3("<mstyle mathbackground=", $2, ">");
1233
+ $$ = mtex2MML_copy3(s1, $3, "</mstyle>");
1234
+ mtex2MML_free_string(s1);
1235
+ mtex2MML_free_string($2);
1236
+ mtex2MML_free_string($3);
1237
+ }
1238
+ | BBOX ST PXSTRING END closedTerm {
1239
+ float padding = mtex2MML_extract_number_from_pxstring($3);
1240
+ char *px = mtex2MML_extract_string_from_pxstring($3);
1241
+ char *dbl_px = mtex2MML_double_pixel(padding, px);
1242
+
1243
+ char *s1 = mtex2MML_copy3("<mpadded width=\"+", dbl_px, "\" height=\"+");
1244
+ char *s2 = mtex2MML_copy3(s1, $3, "\" depth=\"+");
1245
+ char *s3 = mtex2MML_copy3(s2, $3, "\" lspace=\"");
1246
+ char *s4 = mtex2MML_copy3(s3, $3, "\">");
1247
+ $$ = mtex2MML_copy3(s4, $5, "</mpadded>");
1248
+
1249
+ mtex2MML_free_string(px);
1250
+ mtex2MML_free_string(dbl_px);
1251
+ mtex2MML_free_string(s1);
1252
+ mtex2MML_free_string(s2);
1253
+ mtex2MML_free_string(s3);
1254
+ mtex2MML_free_string(s4);
1255
+ mtex2MML_free_string($3);
1256
+ mtex2MML_free_string($5);
1257
+ }
1258
+ | BBOX ST COLORSTRING END closedTerm {
1259
+ char *s1 = mtex2MML_copy3("<mstyle mathbackground=\"", $3, "\">");
1260
+ $$ = mtex2MML_copy3(s1, $5, "</mstyle>");
1261
+
1262
+ mtex2MML_free_string(s1);
1263
+ mtex2MML_free_string($3);
1264
+ mtex2MML_free_string($5);
1265
+ }
1266
+ | BBOX ST COLORSTRING PXSTRING END closedTerm {
1267
+ char *s1 = mtex2MML_copy3("<mstyle mathbackground=\"", $3, "\">");
1268
+
1269
+ float padding = mtex2MML_extract_number_from_pxstring($4);
1270
+ char *px = mtex2MML_extract_string_from_pxstring($4);
1271
+ char *dbl_px = mtex2MML_double_pixel(padding, px);
1272
+
1273
+ char *s2 = mtex2MML_copy3(s1, "<mpadded width=\"+", dbl_px);
1274
+ char *s3 = mtex2MML_copy3(s2, "\" height=\"+", $4);
1275
+ char *s4 = mtex2MML_copy3(s3, "\" depth=\"+", $4);
1276
+ char *s5 = mtex2MML_copy3(s4, "\" lspace=\"", $4);
1277
+ char *s6 = mtex2MML_copy3(s5, "\">", $6);
1278
+ $$ = mtex2MML_copy2(s6, "</mpadded>");
1279
+
1280
+ mtex2MML_free_string(px);
1281
+ mtex2MML_free_string(dbl_px);
1282
+ mtex2MML_free_string(s1);
1283
+ mtex2MML_free_string(s2);
1284
+ mtex2MML_free_string(s3);
1285
+ mtex2MML_free_string(s4);
1286
+ mtex2MML_free_string(s5);
1287
+ mtex2MML_free_string(s6);
1288
+ mtex2MML_free_string($3);
1289
+ mtex2MML_free_string($4);
1290
+ mtex2MML_free_string($6);
1291
+ }
1292
+ | BBOX ST COLORSTRING STYLESTRING PXSTRING END closedTerm {
1293
+ char *s1 = mtex2MML_copy3("<mstyle mathbackground=\"", $3, "\" style=\"");
1294
+ char *s2 = mtex2MML_copy3(s1, $4, "\">");
1295
+
1296
+ float padding = mtex2MML_extract_number_from_pxstring($5);
1297
+ char *px = mtex2MML_extract_string_from_pxstring($5);
1298
+ char *dbl_px = mtex2MML_double_pixel(padding, px);
1299
+
1300
+ char *s3 = mtex2MML_copy3(s2, "<mpadded width=\"+", dbl_px);
1301
+ char *s4 = mtex2MML_copy3(s3, "\" height=\"+", $5);
1302
+ char *s5 = mtex2MML_copy3(s4, "\" depth=\"+", $5);
1303
+ char *s6 = mtex2MML_copy3(s5, "\" lspace=\"", $5);
1304
+ char *s7 = mtex2MML_copy3(s6, "\">", $7);
1305
+ $$ = mtex2MML_copy2(s7, "</mpadded>");
1306
+
1307
+ mtex2MML_free_string(px);
1308
+ mtex2MML_free_string(dbl_px);
1309
+ mtex2MML_free_string(s1);
1310
+ mtex2MML_free_string(s2);
1311
+ mtex2MML_free_string(s3);
1312
+ mtex2MML_free_string(s4);
1313
+ mtex2MML_free_string(s5);
1314
+ mtex2MML_free_string(s6);
1315
+ mtex2MML_free_string(s7);
1316
+ mtex2MML_free_string($3);
1317
+ mtex2MML_free_string($4);
1318
+ mtex2MML_free_string($5);
1319
+ mtex2MML_free_string($7);
1320
+ };
1321
+
1322
+ mathrlap: RLAP closedTerm {
1323
+ $$ = mtex2MML_copy3("<mpadded width=\"0\">", $2, "</mpadded>");
1324
+ mtex2MML_free_string($2);
1325
+ };
1326
+
1327
+ mathllap: LLAP closedTerm {
1328
+ $$ = mtex2MML_copy3("<mpadded width=\"0\" lspace=\"-100%width\">", $2, "</mpadded>");
1329
+ mtex2MML_free_string($2);
1330
+ };
1331
+
1332
+ mathclap: CLAP closedTerm {
1333
+ $$ = mtex2MML_copy3("<mpadded width=\"0\" lspace=\"-50%width\">", $2, "</mpadded>");
1334
+ mtex2MML_free_string($2);
1335
+ };
1336
+
1337
+ textstring: TEXTBOX TEXTSTRING {
1338
+ $$ = mtex2MML_copy3("<mtext>", $2, "</mtext>");
1339
+ mtex2MML_free_string($2);
1340
+ };
1341
+
1342
+ verbstring: VERBBOX VERBSTRING {
1343
+ $$ = mtex2MML_copy3("<mstyle mathvariant=\"monospace\"><mtext>", $2, "</mtext></mstyle>");
1344
+ mtex2MML_free_string($2);
1345
+ };
1346
+
1347
+ displaystyle: DISPLAY MROWOPEN texover MROWCLOSE {
1348
+ $$ = mtex2MML_copy3("<mstyle displaystyle=\"true\" scriptlevel=\"0\"><mrow>", $3, "</mrow></mstyle>");
1349
+ mtex2MML_free_string($3);
1350
+ }
1351
+ | DISPLAY compoundTermList {
1352
+ $$ = mtex2MML_copy3("<mstyle displaystyle=\"true\" scriptlevel=\"0\"><mrow>", $2, "</mrow></mstyle>");
1353
+ mtex2MML_free_string($2);
1354
+ };
1355
+
1356
+ textstyle: TEXTSTY compoundTermList {
1357
+ $$ = mtex2MML_copy3("<mstyle displaystyle=\"false\" scriptlevel=\"0\">", $2, "</mstyle>");
1358
+ mtex2MML_free_string($2);
1359
+ };
1360
+
1361
+ textsize: TEXTSIZE compoundTermList {
1362
+ $$ = mtex2MML_copy3("<mstyle scriptlevel=\"0\">", $2, "</mstyle>");
1363
+ mtex2MML_free_string($2);
1364
+ };
1365
+
1366
+ scriptstyle: SCSTY compoundTermList {
1367
+ $$ = mtex2MML_copy3("<mstyle displaystyle=\"false\" scriptlevel=\"1\">", $2, "</mstyle>");
1368
+ mtex2MML_free_string($2);
1369
+ };
1370
+
1371
+ scriptsize: SCSIZE compoundTermList {
1372
+ $$ = mtex2MML_copy3("<mstyle mathsize=\"0.7em\">", $2, "</mstyle>");
1373
+ mtex2MML_free_string($2);
1374
+ };
1375
+
1376
+ scriptscriptsize: SCSCSIZE compoundTermList {
1377
+ $$ = mtex2MML_copy3("<mstyle displaystyle=\"false\" scriptlevel=\"2\">", $2, "</mstyle>");
1378
+ mtex2MML_free_string($2);
1379
+ };
1380
+
1381
+ oldstyle: OLDSTYLE compoundTermList {
1382
+ $$ = mtex2MML_copy3("<mi mathvariant=\"normal\">", $2, "</mi>");
1383
+ mtex2MML_free_string($2);
1384
+ };
1385
+
1386
+ tiny: TINY compoundTermList {
1387
+ $$ = mtex2MML_copy3("<mstyle mathsize=\"0.5em\">", $2, "</mstyle>");
1388
+ mtex2MML_free_string($2);
1389
+ };
1390
+
1391
+ ttiny: TTINY compoundTermList {
1392
+ $$ = mtex2MML_copy3("<mstyle mathsize=\"0.6em\">", $2, "</mstyle>");
1393
+ mtex2MML_free_string($2);
1394
+ };
1395
+
1396
+ small: SMALL compoundTermList {
1397
+ $$ = mtex2MML_copy3("<mstyle mathsize=\"0.85em\">", $2, "</mstyle>");
1398
+ mtex2MML_free_string($2);
1399
+ };
1400
+
1401
+ normalsize: NORMALSIZE compoundTermList {
1402
+ $$ = mtex2MML_copy3("<mstyle mathsize=\"1em\">", $2, "</mstyle>");
1403
+ mtex2MML_free_string($2);
1404
+ };
1405
+
1406
+ large: LARGE compoundTermList {
1407
+ $$ = mtex2MML_copy3("<mstyle mathsize=\"1.2em\">", $2, "</mstyle>");
1408
+ mtex2MML_free_string($2);
1409
+ };
1410
+
1411
+ llarge: LLARGE compoundTermList {
1412
+ $$ = mtex2MML_copy3("<mstyle mathsize=\"1.44em\">", $2, "</mstyle>");
1413
+ mtex2MML_free_string($2);
1414
+ };
1415
+
1416
+ lllarge: LLLARGE compoundTermList {
1417
+ $$ = mtex2MML_copy3("<mstyle mathsize=\"1.73em\">", $2, "</mstyle>");
1418
+ mtex2MML_free_string($2);
1419
+ };
1420
+
1421
+ huge: HUGE compoundTermList {
1422
+ $$ = mtex2MML_copy3("<mstyle mathsize=\"2.07em\">", $2, "</mstyle>");
1423
+ mtex2MML_free_string($2);
1424
+ };
1425
+
1426
+ hhuge: HHUGE compoundTermList {
1427
+ $$ = mtex2MML_copy3("<mstyle mathsize=\"2.49em\">", $2, "</mstyle>");
1428
+ mtex2MML_free_string($2);
1429
+ };
1430
+
1431
+ lower: LOWER MROWOPEN PXSTRING MROWCLOSE closedTerm {
1432
+ char * s1 = mtex2MML_copy3("<mpadded height=\"-", $3, "\" depth=\"+");
1433
+ char * s2 = mtex2MML_copy3(s1, $3, "\" voffset=\"-");
1434
+ char * s3 = mtex2MML_copy3(s2, $3, "\">");
1435
+ $$ = mtex2MML_copy3(s3, $5, "</mpadded>");
1436
+ mtex2MML_free_string(s1);
1437
+ mtex2MML_free_string(s2);
1438
+ mtex2MML_free_string(s3);
1439
+ mtex2MML_free_string($3);
1440
+ mtex2MML_free_string($5);
1441
+ }
1442
+ | LOWER PXSTRING closedTerm {
1443
+ char * s1 = mtex2MML_copy3("<mpadded height=\"-", $2, "\" depth=\"+");
1444
+ char * s2 = mtex2MML_copy3(s1, $2, "\" voffset=\"-");
1445
+ char * s3 = mtex2MML_copy3(s2, $2, "\">");
1446
+ $$ = mtex2MML_copy3(s3, $3, "</mpadded>");
1447
+ mtex2MML_free_string(s1);
1448
+ mtex2MML_free_string(s2);
1449
+ mtex2MML_free_string(s3);
1450
+ mtex2MML_free_string($2);
1451
+ mtex2MML_free_string($3);
1452
+ };
1453
+
1454
+ moveleft: MOVELEFT MROWOPEN PXSTRING MROWCLOSE closedTerm {
1455
+ char * s1 = mtex2MML_copy3("<mspace width=\"-", $3, "\"/>");
1456
+ char * s2 = mtex2MML_copy3(s1, $5, "<mspace width=\"");
1457
+ $$ = mtex2MML_copy3(s2, $3, "\"/>");
1458
+
1459
+ mtex2MML_free_string(s1);
1460
+ mtex2MML_free_string(s2);
1461
+ mtex2MML_free_string($3);
1462
+ mtex2MML_free_string($5);
1463
+ }
1464
+ | MOVELEFT PXSTRING closedTerm {
1465
+ char * s1 = mtex2MML_copy3("<mspace width=\"-", $2, "\"/>");
1466
+ char * s2 = mtex2MML_copy3(s1, $3, "<mspace width=\"");
1467
+ $$ = mtex2MML_copy3(s2, $2, "\"/>");
1468
+
1469
+ mtex2MML_free_string(s1);
1470
+ mtex2MML_free_string(s2);
1471
+ mtex2MML_free_string($2);
1472
+ mtex2MML_free_string($3);
1473
+ };
1474
+
1475
+ moveright: MOVERIGHT MROWOPEN PXSTRING MROWCLOSE closedTerm {
1476
+ char * s1 = mtex2MML_copy3("<mspace width=\"", $3, "\"/>");
1477
+ char * s2 = mtex2MML_copy3(s1, $5, "<mspace width=\"-");
1478
+ $$ = mtex2MML_copy3(s2, $3, "\"/>");
1479
+
1480
+ mtex2MML_free_string(s1);
1481
+ mtex2MML_free_string(s2);
1482
+ mtex2MML_free_string($3);
1483
+ mtex2MML_free_string($5);
1484
+ }
1485
+ | MOVERIGHT PXSTRING closedTerm {
1486
+ char * s1 = mtex2MML_copy3("<mspace width=\"", $2, "\"/>");
1487
+ char * s2 = mtex2MML_copy3(s1, $3, "<mspace width=\"-");
1488
+ $$ = mtex2MML_copy3(s2, $2, "\"/>");
1489
+
1490
+ mtex2MML_free_string(s1);
1491
+ mtex2MML_free_string(s2);
1492
+ mtex2MML_free_string($2);
1493
+ mtex2MML_free_string($3);
1494
+ };
1495
+
1496
+ raise: RAISE MROWOPEN PXSTRING MROWCLOSE closedTerm {
1497
+ char * s1 = mtex2MML_copy3("<mpadded height=\"+", $3, "\" depth=\"-");
1498
+ char * s2 = mtex2MML_copy3(s1, $3, "\" voffset=\"+");
1499
+ char * s3 = mtex2MML_copy3(s2, $3, "\">");
1500
+ $$ = mtex2MML_copy3(s3, $5, "</mpadded>");
1501
+ mtex2MML_free_string(s1);
1502
+ mtex2MML_free_string(s2);
1503
+ mtex2MML_free_string(s3);
1504
+ mtex2MML_free_string($3);
1505
+ mtex2MML_free_string($5);
1506
+ }
1507
+ | RAISE PXSTRING closedTerm {
1508
+ char * s1 = mtex2MML_copy3("<mpadded height=\"+", $2, "\" depth=\"-");
1509
+ char * s2 = mtex2MML_copy3(s1, $2, "\" voffset=\"+");
1510
+ char * s3 = mtex2MML_copy3(s2, $2, "\">");
1511
+ $$ = mtex2MML_copy3(s3, $3, "</mpadded>");
1512
+ mtex2MML_free_string(s1);
1513
+ mtex2MML_free_string(s2);
1514
+ mtex2MML_free_string(s3);
1515
+ mtex2MML_free_string($2);
1516
+ mtex2MML_free_string($3);
1517
+ };
1518
+
1519
+ italics: ITALICS closedTerm {
1520
+ $$ = mtex2MML_copy3("<mstyle mathvariant=\"italic\">", $2, "</mstyle>");
1521
+ mtex2MML_free_string($2);
1522
+ };
1523
+
1524
+ sans: SANS closedTerm {
1525
+ $$ = mtex2MML_copy3("<mstyle mathvariant=\"sans-serif\">", $2, "</mstyle>");
1526
+ mtex2MML_free_string($2);
1527
+ };
1528
+
1529
+ mono: TT closedTerm {
1530
+ $$ = mtex2MML_copy3("<mstyle mathvariant=\"monospace\">", $2, "</mstyle>");
1531
+ mtex2MML_free_string($2);
1532
+ };
1533
+
1534
+ not: NOT closedTerm {
1535
+ $$ = mtex2MML_copy3("<mi>", $2, "&#x0338;</mi>");
1536
+ mtex2MML_free_string($2);
1537
+ };
1538
+
1539
+ slashed: SLASHED closedTerm {
1540
+ $$ = mtex2MML_copy3("<menclose notation=\"updiagonalstrike\">", $2, "</menclose>");
1541
+ mtex2MML_free_string($2);
1542
+ };
1543
+
1544
+ bcanceled: BCANCELED closedTerm {
1545
+ $$ = mtex2MML_copy3("<menclose notation=\"downdiagonalstrike\">", $2, "</menclose>");
1546
+ mtex2MML_free_string($2);
1547
+ };
1548
+
1549
+ xcanceled: XCANCELED closedTerm {
1550
+ $$ = mtex2MML_copy3("<menclose notation=\"updiagonalstrike downdiagonalstrike\">", $2, "</menclose>");
1551
+ mtex2MML_free_string($2);
1552
+ };
1553
+
1554
+ canceledto: CANCELEDTO closedTerm closedTerm {
1555
+ char * s1 = mtex2MML_copy3("<msup><menclose notation=\"updiagonalstrike updiagonalarrow\"><mn>", $3, "</mn></menclose><mpadded height=\"+.1em\" depth=\"-.1em\" voffset=\".1em\"><mn>");
1556
+ $$ = mtex2MML_copy3(s1, $2, "</mn></mpadded></msup>");
1557
+
1558
+ mtex2MML_free_string($2);
1559
+ mtex2MML_free_string($3);
1560
+ mtex2MML_free_string(s1);
1561
+ };
1562
+
1563
+ mathopen: MATHOPEN closedTerm {
1564
+ $$ = mtex2MML_copy3("<mrow>", $2, "</mrow>");
1565
+
1566
+ mtex2MML_free_string($2);
1567
+ };
1568
+
1569
+ mathclose: MATHCLOSE closedTerm {
1570
+ $$ = mtex2MML_copy3("<mrow>", $2, "</mrow>");
1571
+
1572
+ mtex2MML_free_string($2);
1573
+ };
1574
+
1575
+ mathord: MATHORD closedTerm {
1576
+ $$ = mtex2MML_copy3("<mrow>", $2, "</mrow>");
1577
+
1578
+ mtex2MML_free_string($2);
1579
+ };
1580
+
1581
+ mathpunct: MATHPUNCT closedTerm {
1582
+ $$ = mtex2MML_copy3("<mrow>", $2, "<mspace width=\"0.3em\"/></mrow>");
1583
+
1584
+ mtex2MML_free_string($2);
1585
+ };
1586
+
1587
+ enclose: ENCLOSE ST ENCLOSENOTATION ST ENCLOSETEXT ST {
1588
+ char * notation = mtex2MML_str_replace($3, ",", " ");
1589
+ char * s1 = mtex2MML_copy3("<menclose notation=\"", notation, "\"><mi>");
1590
+ $$ = mtex2MML_copy3(s1, $5, "</mi></menclose>");
1591
+ mtex2MML_free_string(notation);
1592
+ mtex2MML_free_string(s1);
1593
+ mtex2MML_free_string($3);
1594
+ mtex2MML_free_string($5);
1595
+ }
1596
+ | ENCLOSE ST ENCLOSENOTATION ST ENCLOSEATTR ST ENCLOSETEXT ST {
1597
+ char * notation = mtex2MML_str_replace($3, ",", " ");
1598
+ char * attr = mtex2MML_str_replace($5, ",", " ");
1599
+ if (strstr(attr, "arrow=1") != NULL) {
1600
+ mtex2MML_free_string(attr);
1601
+ attr = mtex2MML_str_replace($5, "arrow=1", "");
1602
+
1603
+ char *t = mtex2MML_copy_string(notation);
1604
+ mtex2MML_free_string(notation);
1605
+ notation = mtex2MML_copy2(t, " updiagonalarrow");
1606
+ mtex2MML_free_string(t);
1607
+ }
1608
+ char * s1 = mtex2MML_copy3("<menclose notation=\"", notation, "\" ");
1609
+ char * s2 = mtex2MML_copy3(s1, attr, "><mi>");
1610
+ $$ = mtex2MML_copy3(s2, $7, "</mi></menclose>");
1611
+ mtex2MML_free_string(notation);
1612
+ mtex2MML_free_string(attr);
1613
+ mtex2MML_free_string(s1);
1614
+ mtex2MML_free_string(s2);
1615
+ mtex2MML_free_string($3);
1616
+ mtex2MML_free_string($5);
1617
+ mtex2MML_free_string($7);
1618
+ };
1619
+
1620
+ vcenter: VCENTER compoundTerm {
1621
+ $$ = mtex2MML_copy3("<mrow>", $2, "</mrow>");
1622
+ mtex2MML_free_string($2);
1623
+ };
1624
+
1625
+ boxed: BOXED closedTerm {
1626
+ $$ = mtex2MML_copy3("<menclose notation=\"box\">", $2, "</menclose>");
1627
+ mtex2MML_free_string($2);
1628
+ };
1629
+
1630
+ fbox: FBOX closedTerm {
1631
+ $$ = mtex2MML_copy3("<menclose notation=\"box\"><mtext>", $2, "</mtext></menclose>");
1632
+ mtex2MML_free_string($2);
1633
+ };
1634
+
1635
+ hbox: HBOX closedTerm {
1636
+ $$ = mtex2MML_copy3("<mtext>", $2, "</mtext>");
1637
+ mtex2MML_free_string($2);
1638
+ };
1639
+
1640
+ mbox: MBOX closedTerm {
1641
+ $$ = mtex2MML_copy3("<mtext>", $2, "</mtext>");
1642
+ mtex2MML_free_string($2);
1643
+ };
1644
+
1645
+ bold: BOLD closedTerm {
1646
+ /* TODO: stupid hack to get bold mover working */
1647
+ char * b = mtex2MML_str_replace($2, "<mi>", "<mi mathvariant=\"bold\">");
1648
+
1649
+ $$ = mtex2MML_copy3("<mstyle mathvariant=\"bold\">", b, "</mstyle>");
1650
+ mtex2MML_free_string(b);
1651
+ mtex2MML_free_string($2);
1652
+ };
1653
+
1654
+ roman: RM ST rmchars END {
1655
+ $$ = mtex2MML_copy3("<mrow><mi mathvariant=\"normal\">", $3, "</mi></mrow>");
1656
+ mtex2MML_free_string($3);
1657
+ }
1658
+ | RM rmchars {
1659
+ $$ = mtex2MML_copy3("<mrow><mi mathvariant=\"normal\">", $2, "</mi></mrow>");
1660
+ mtex2MML_free_string($2);
1661
+ };
1662
+
1663
+ rmchars: RMCHAR {
1664
+ $$ = mtex2MML_copy_string($1);
1665
+ mtex2MML_free_string($1);
1666
+ }
1667
+ | rmchars rmchars {
1668
+ $$ = mtex2MML_copy2($1, $2);
1669
+ mtex2MML_free_string($1);
1670
+ mtex2MML_free_string($2);
1671
+ };
1672
+
1673
+ script: SCR ST scrchars END {
1674
+ $$ = mtex2MML_copy3("<mrow><mi mathvariant=\"script\">", $3, "</mi></mrow>");
1675
+ mtex2MML_free_string($3);
1676
+ }
1677
+ | SCR scrchars {
1678
+ $$ = mtex2MML_copy3("<mrow><mi mathvariant=\"script\">", $2, "</mi></mrow>");
1679
+ mtex2MML_free_string($2);
1680
+ };
1681
+
1682
+ scrchars: SCRCHAR {
1683
+ $$ = mtex2MML_copy_string($1);
1684
+ mtex2MML_free_string($1);
1685
+ }
1686
+ | scrchars SCRCHAR {
1687
+ $$ = mtex2MML_copy2($1, $2);
1688
+ mtex2MML_free_string($1);
1689
+ mtex2MML_free_string($2);
1690
+ };
1691
+
1692
+ pmb: PMB ST pmbchars END {
1693
+ char * s1 = mtex2MML_copy3("<mpadded width=\"0\"><mi>", $3, "</mi></mpadded>");
1694
+ char * s2 = mtex2MML_copy3(s1, "<mspace width=\"1px\"></mspace><mrow><mi>", $3);
1695
+ $$ = mtex2MML_copy2(s2, "</mi></mrow>");
1696
+ mtex2MML_free_string($3);
1697
+ mtex2MML_free_string(s1);
1698
+ mtex2MML_free_string(s2);
1699
+ }
1700
+ | PMB pmbchars {
1701
+ char * s1 = mtex2MML_copy3("<mpadded width=\"0\"><mi>", $2, "</mi></mpadded>");
1702
+ char * s2 = mtex2MML_copy3(s1, "<mspace width=\"1px\"></mspace><mrow><mi>", $2);
1703
+ $$ = mtex2MML_copy2(s2, "</mi></mrow>");
1704
+ mtex2MML_free_string($2);
1705
+ mtex2MML_free_string(s1);
1706
+ mtex2MML_free_string(s2);
1707
+ };
1708
+
1709
+ pmbchars: PMBCHAR {
1710
+ $$ = mtex2MML_copy_string($1);
1711
+ mtex2MML_free_string($1);
1712
+ }
1713
+ | pmbchars PMBCHAR {
1714
+ $$ = mtex2MML_copy2($1, $2);
1715
+ mtex2MML_free_string($1);
1716
+ mtex2MML_free_string($2);
1717
+ };
1718
+
1719
+ bbold: BB ST bbchars END {
1720
+ $$ = mtex2MML_copy3("<mi>", $3, "</mi>");
1721
+ mtex2MML_free_string($3);
1722
+ }
1723
+ | BB bbchars {
1724
+ $$ = mtex2MML_copy3("<mi>", $2, "</mi>");
1725
+ mtex2MML_free_string($2);
1726
+ };
1727
+
1728
+ bbchars: bbchar {
1729
+ $$ = mtex2MML_copy_string($1);
1730
+ mtex2MML_free_string($1);
1731
+ }
1732
+ | bbchars bbchar {
1733
+ $$ = mtex2MML_copy2($1, $2);
1734
+ mtex2MML_free_string($1);
1735
+ mtex2MML_free_string($2);
1736
+ };
1737
+
1738
+ bbchar: BBLOWERCHAR {
1739
+ $$ = mtex2MML_copy3("&", $1, "opf;");
1740
+ mtex2MML_free_string($1);
1741
+ }
1742
+ | BBUPPERCHAR {
1743
+ $$ = mtex2MML_copy3("&", $1, "opf;");
1744
+ mtex2MML_free_string($1);
1745
+ }
1746
+ | BBDIGIT {
1747
+ /* Blackboard digits 0-9 correspond to Unicode characters 0x1D7D8-0x1D7E1 */
1748
+ char * end = $1 + 1;
1749
+ int code = 0x1D7D8 + strtoul($1, &end, 10);
1750
+ $$ = mtex2MML_character_reference(code);
1751
+ mtex2MML_free_string($1);
1752
+ };
1753
+
1754
+ frak: FRAK ST frakletters END {
1755
+ $$ = mtex2MML_copy3("<mrow><mi>", $3, "</mi></mrow>");
1756
+ mtex2MML_free_string($3);
1757
+ }
1758
+ | FRAK frakletters {
1759
+ $$ = mtex2MML_copy3("<mrow><mi>", $2, "</mi></mrow>");
1760
+ mtex2MML_free_string($2);
1761
+ };
1762
+
1763
+ frakletters: frakletter {
1764
+ $$ = mtex2MML_copy_string($1);
1765
+ mtex2MML_free_string($1);
1766
+ }
1767
+ | frakletters frakletter {
1768
+ $$ = mtex2MML_copy2($1, $2);
1769
+ mtex2MML_free_string($1);
1770
+ mtex2MML_free_string($2);
1771
+ };
1772
+
1773
+ frakletter: FRAKCHAR {
1774
+ if (strcmp($1, " ") == 0)
1775
+ $$ = mtex2MML_copy_string(" ");
1776
+ else
1777
+ $$ = mtex2MML_copy3("&", $1, "fr;");
1778
+ mtex2MML_free_string($1);
1779
+ };
1780
+
1781
+ cal: CAL ST calletters END {
1782
+ $$ = mtex2MML_copy3("<mrow><mi>", $3, "</mi></mrow>");
1783
+ mtex2MML_free_string($3);
1784
+ }
1785
+ | CAL calletters {
1786
+ $$ = mtex2MML_copy3("<mrow><mi>", $2, "</mi></mrow>");
1787
+ mtex2MML_free_string($2);
1788
+ };
1789
+
1790
+ calletters: calletter {
1791
+ $$ = mtex2MML_copy_string($1);
1792
+ mtex2MML_free_string($1);
1793
+ }
1794
+ | calletters calletter {
1795
+ $$ = mtex2MML_copy2($1, $2);
1796
+ mtex2MML_free_string($1);
1797
+ mtex2MML_free_string($2);
1798
+ };
1799
+
1800
+ calletter: CALCHAR {
1801
+ if (strcmp($1, " ") == 0)
1802
+ $$ = mtex2MML_copy_string(" ");
1803
+ else
1804
+ $$ = mtex2MML_copy3("&", $1, "scr;");
1805
+ mtex2MML_free_string($1);
1806
+ };
1807
+
1808
+ thinspace: THINSPACE {
1809
+ $$ = mtex2MML_copy_string("<mspace width=\"thinmathspace\"/>");
1810
+ };
1811
+
1812
+ medspace: MEDSPACE {
1813
+ $$ = mtex2MML_copy_string("<mspace width=\"mediummathspace\"/>");
1814
+ };
1815
+
1816
+ thickspace: THICKSPACE {
1817
+ $$ = mtex2MML_copy_string("<mspace width=\"thickmathspace\"/>");
1818
+ };
1819
+
1820
+ enspace: ENSPACE {
1821
+ $$ = mtex2MML_copy_string("<mspace width=\".5em\"/>");
1822
+ };
1823
+
1824
+ hspace: HSPACE MROWOPEN PXSTRING MROWCLOSE {
1825
+ $$ = mtex2MML_copy3("<mspace width=\"", $3, "\"/>");
1826
+ mtex2MML_free_string($3);
1827
+ }
1828
+ | HSPACE PXSTRING {
1829
+ $$ = mtex2MML_copy3("<mspace width=\"", $2, "\"/>");
1830
+ mtex2MML_free_string($2);
1831
+ };
1832
+
1833
+ spacecube: SPACECUBE ST PXSTRING ST ST PXSTRING ST ST PXSTRING ST {
1834
+ char * s1 = mtex2MML_copy3("<mspace width=\"", $3, "\" height=\"");
1835
+ char * s2 = mtex2MML_copy3(s1, $6, "\" depth=\"");
1836
+ $$ = mtex2MML_copy3(s2, $9, "\"/>");
1837
+ mtex2MML_free_string(s1);
1838
+ mtex2MML_free_string(s2);
1839
+ mtex2MML_free_string($3);
1840
+ mtex2MML_free_string($6);
1841
+ mtex2MML_free_string($9);
1842
+ };
1843
+
1844
+ quad: QUAD {
1845
+ $$ = mtex2MML_copy_string("<mspace width=\"1em\"/>");
1846
+ };
1847
+
1848
+ qquad: QQUAD {
1849
+ $$ = mtex2MML_copy_string("<mspace width=\"2em\"/>");
1850
+ };
1851
+
1852
+ negspace: NEGSPACE {
1853
+ $$ = mtex2MML_copy_string("<mspace width=\"negativethinmathspace\"/>");
1854
+ };
1855
+
1856
+ negmedspace: NEGMEDSPACE {
1857
+ $$ = mtex2MML_copy_string("<mspace width=\"negativemediummathspace\"/>");
1858
+ };
1859
+
1860
+ negthickspace: NEGTHICKSPACE {
1861
+ $$ = mtex2MML_copy_string("<mspace width=\"negativethickmathspace\"/>");
1862
+ };
1863
+
1864
+ strut: STRUT {
1865
+ $$ = mtex2MML_copy_string("<mpadded width=\"0\" height=\"8.6pt\" depth=\"3pt\"><mrow /></mpadded>");
1866
+ };
1867
+
1868
+ mathstrut: MATHSTRUT {
1869
+ $$ = mtex2MML_copy_string("<mpadded width=\"0\"><mphantom><mo stretchy=\"false\">(</mo></mphantom></mpadded>");
1870
+ };
1871
+
1872
+ smash: SMASH closedTerm {
1873
+ $$ = mtex2MML_copy3("<mpadded height=\"0\" depth=\"0\">", $2, "</mpadded>");
1874
+ mtex2MML_free_string($2);
1875
+ };
1876
+
1877
+ phantom: PHANTOM closedTerm {
1878
+ $$ = mtex2MML_copy3("<mphantom>", $2, "</mphantom>");
1879
+ mtex2MML_free_string($2);
1880
+ };
1881
+
1882
+ hphantom: HPHANTOM closedTerm {
1883
+ $$ = mtex2MML_copy3("<mpadded height=\"0\" depth=\"0\"><mphantom>", $2, "</mphantom></mpadded>");
1884
+ mtex2MML_free_string($2);
1885
+ };
1886
+
1887
+ vphantom: VPHANTOM closedTerm {
1888
+ $$ = mtex2MML_copy3("<mpadded width=\"0\"><mphantom>", $2, "</mphantom></mpadded>");
1889
+ mtex2MML_free_string($2);
1890
+ };
1891
+
1892
+ tex: TEXSYMBOL {
1893
+ $$ = mtex2MML_copy_string("<mi>T</mi><mspace width=\"-.14em\"></mspace><mpadded height=\"-.5ex\" depth=\"+.5ex\" voffset=\"-.5ex\"><mrow><mi>E</mi></mrow></mpadded><mspace width=\"-.115em\"></mspace><mi>X</mi>");
1894
+ };
1895
+
1896
+ latex: LATEXSYMBOL {
1897
+ $$ = mtex2MML_copy_string("<mi>L</mi><mspace width=\"-.325em\"></mspace><mpadded height=\"+.21em\" depth=\"-.21em\" voffset=\"+.21em\"><mrow><mstyle scriptlevel=\"1\" displaystyle=\"false\"><mrow><mi>A</mi></mrow></mstyle></mrow></mpadded><mspace width=\"-.17em\"></mspace><mi>T</mi><mspace width=\"-.14em\"></mspace><mpadded height=\"-.5ex\" depth=\"+.5ex\" voffset=\"-.5ex\"><mrow><mi>E</mi></mrow></mpadded><mspace width=\"-.115em\"></mspace><mi>X</mi>");
1898
+ };
1899
+
1900
+ href: HREF TEXTSTRING closedTerm {
1901
+ char * s1 = mtex2MML_copy3("<mrow href=\"", $2, "\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type=\"simple\" xlink:href=\"");
1902
+ char * s2 = mtex2MML_copy3(s1, $2, "\">");
1903
+ $$ = mtex2MML_copy3(s2, $3, "</mrow>");
1904
+ mtex2MML_free_string(s1);
1905
+ mtex2MML_free_string(s2);
1906
+ mtex2MML_free_string($2);
1907
+ mtex2MML_free_string($3);
1908
+ };
1909
+
1910
+ tensor: TENSOR closedTerm MROWOPEN subsupList MROWCLOSE {
1911
+ char * s1 = mtex2MML_copy3("<mmultiscripts>", $2, $4);
1912
+ $$ = mtex2MML_copy2(s1, "</mmultiscripts>");
1913
+ mtex2MML_free_string(s1);
1914
+ mtex2MML_free_string($2);
1915
+ mtex2MML_free_string($4);
1916
+ }
1917
+ | TENSOR closedTerm subsupList {
1918
+ char * s1 = mtex2MML_copy3("<mmultiscripts>", $2, $3);
1919
+ $$ = mtex2MML_copy2(s1, "</mmultiscripts>");
1920
+ mtex2MML_free_string(s1);
1921
+ mtex2MML_free_string($2);
1922
+ mtex2MML_free_string($3);
1923
+ };
1924
+
1925
+ multi: MULTI MROWOPEN subsupList MROWCLOSE closedTerm MROWOPEN subsupList MROWCLOSE {
1926
+ char * s1 = mtex2MML_copy3("<mmultiscripts>", $5, $7);
1927
+ char * s2 = mtex2MML_copy3("<mprescripts/>", $3, "</mmultiscripts>");
1928
+ $$ = mtex2MML_copy2(s1, s2);
1929
+ mtex2MML_free_string(s1);
1930
+ mtex2MML_free_string(s2);
1931
+ mtex2MML_free_string($3);
1932
+ mtex2MML_free_string($5);
1933
+ mtex2MML_free_string($7);
1934
+ }
1935
+ | MULTI MROWOPEN subsupList MROWCLOSE closedTerm EMPTYMROW {
1936
+ char * s1 = mtex2MML_copy2("<mmultiscripts>", $5);
1937
+ char * s2 = mtex2MML_copy3("<mprescripts/>", $3, "</mmultiscripts>");
1938
+ $$ = mtex2MML_copy2(s1, s2);
1939
+ mtex2MML_free_string(s1);
1940
+ mtex2MML_free_string(s2);
1941
+ mtex2MML_free_string($3);
1942
+ mtex2MML_free_string($5);
1943
+ }
1944
+ | MULTI EMPTYMROW closedTerm MROWOPEN subsupList MROWCLOSE {
1945
+ char * s1 = mtex2MML_copy3("<mmultiscripts>", $3, $5);
1946
+ $$ = mtex2MML_copy2(s1, "</mmultiscripts>");
1947
+ mtex2MML_free_string(s1);
1948
+ mtex2MML_free_string($3);
1949
+ mtex2MML_free_string($5);
1950
+ };
1951
+
1952
+ subsupList: subsupTerm {
1953
+ $$ = mtex2MML_copy_string($1);
1954
+ mtex2MML_free_string($1);
1955
+ }
1956
+ | subsupList subsupTerm {
1957
+ $$ = mtex2MML_copy3($1, " ", $2);
1958
+ mtex2MML_free_string($1);
1959
+ mtex2MML_free_string($2);
1960
+ };
1961
+
1962
+ subsupTerm: SUB closedTerm SUP closedTerm {
1963
+ $$ = mtex2MML_copy3($2, " ", $4);
1964
+ mtex2MML_free_string($2);
1965
+ mtex2MML_free_string($4);
1966
+ }
1967
+ | SUB closedTerm {
1968
+ $$ = mtex2MML_copy2($2, " <none/>");
1969
+ mtex2MML_free_string($2);
1970
+ }
1971
+ | SUP closedTerm {
1972
+ $$ = mtex2MML_copy2("<none/> ", $2);
1973
+ mtex2MML_free_string($2);
1974
+ }
1975
+ | SUB SUP closedTerm {
1976
+ $$ = mtex2MML_copy2("<none/> ", $3);
1977
+ mtex2MML_free_string($3);
1978
+ };
1979
+
1980
+ mfrac: FRAC closedTerm closedTerm {
1981
+ char * s1 = mtex2MML_copy3("<mfrac>", $2, $3);
1982
+ $$ = mtex2MML_copy2(s1, "</mfrac>");
1983
+ mtex2MML_free_string(s1);
1984
+ mtex2MML_free_string($2);
1985
+ mtex2MML_free_string($3);
1986
+ }
1987
+ | TFRAC closedTerm closedTerm {
1988
+ char * s1 = mtex2MML_copy3("<mstyle displaystyle=\"false\"><mfrac>", $2, $3);
1989
+ $$ = mtex2MML_copy2(s1, "</mfrac></mstyle>");
1990
+ mtex2MML_free_string(s1);
1991
+ mtex2MML_free_string($2);
1992
+ mtex2MML_free_string($3);
1993
+ }
1994
+ | DFRAC closedTerm closedTerm {
1995
+ char * s1 = mtex2MML_copy3("<mstyle displaystyle=\"true\" scriptlevel=\"0\"><mfrac>", $2, $3);
1996
+ $$ = mtex2MML_copy2(s1, "</mfrac></mstyle>");
1997
+ mtex2MML_free_string(s1);
1998
+ mtex2MML_free_string($2);
1999
+ mtex2MML_free_string($3);
2000
+ }
2001
+ | CFRAC closedTerm closedTerm {
2002
+ char * s1 = mtex2MML_copy3("<mfrac><mrow><mpadded width=\"0\" height=\"8.6pt\" depth=\"3pt\"><mrow /></mpadded><mstyle displaystyle=\"false\" scriptlevel=\"0\"><mrow>", $2, "</mrow></mstyle></mrow><mrow><mpadded width=\"0\" height=\"8.6pt\" depth=\"3pt\"><mrow /></mpadded><mstyle displaystyle=\"false\" scriptlevel=\"0\"><mrow>");
2003
+ $$ = mtex2MML_copy3(s1, $3, "</mrow></mstyle></mrow></mfrac>");
2004
+
2005
+ mtex2MML_free_string(s1);
2006
+ mtex2MML_free_string($2);
2007
+ mtex2MML_free_string($3);
2008
+ }
2009
+ | GENFRAC MROWOPEN LEFTDELIM MROWCLOSE MROWOPEN RIGHTDELIM MROWCLOSE MROWOPEN PXSTRING MROWCLOSE compoundTermList compoundTermList compoundTermList {
2010
+ char *s1 = NULL, *s2 = NULL, *s3 = NULL, *s4 = NULL;
2011
+ int style = 0;
2012
+ sscanf ($11,"%d", &style);
2013
+
2014
+ switch (style) {
2015
+ case 0:
2016
+ s1 = mtex2MML_copy3("<mrow><mstyle displaystyle=\"true\" scriptlevel=\"0\"><mrow><mrow><mo maxsize=\"2.047em\" minsize=\"2.047em\">", $3, "</mo></mrow><mfrac linethickness=\"");
2017
+ s2 = mtex2MML_copy3(s1, $9, "\">");
2018
+ s3 = mtex2MML_copy3(s2, $12 , $13);
2019
+ s4 = mtex2MML_copy3(s3, "</mfrac><mrow>", "<mo maxsize=\"2.047em\" minsize=\"2.047em\">");
2020
+ break;
2021
+ case 1:
2022
+ s1 = mtex2MML_copy3("<mrow><mstyle displaystyle=\"false\" scriptlevel=\"0\"><mrow><mrow><mo maxsize=\"1.2em\" minsize=\"1.2em\">", $3, "</mo></mrow><mfrac linethickness=\"");
2023
+ s2 = mtex2MML_copy3(s1, $9, "\">");
2024
+ s3 = mtex2MML_copy3(s2, $12 , $13);
2025
+ s4 = mtex2MML_copy3(s3, "</mfrac><mrow>", "<mo maxsize=\"1.2em\" minsize=\"1.2em\">");
2026
+ break;
2027
+ case 2:
2028
+ s1 = mtex2MML_copy3("<mrow><mstyle displaystyle=\"false\" scriptlevel=\"1\"><mrow><mrow><mo maxsize=\"1.2em\" minsize=\"1.2em\">", $3, "</mo></mrow><mfrac linethickness=\"");
2029
+ s2 = mtex2MML_copy3(s1, $9, "\">");
2030
+ s3 = mtex2MML_copy3(s2, $12 , $13);
2031
+ s4 = mtex2MML_copy3(s3, "</mfrac><mrow>", "<mo maxsize=\"1.2em\" minsize=\"1.2em\">");
2032
+ break;
2033
+ case 3:
2034
+ s1 = mtex2MML_copy3("<mrow><mstyle displaystyle=\"false\" scriptlevel=\"2\"><mrow><mrow><mo maxsize=\"1.2em\" minsize=\"1.2em\">", $3, "</mo></mrow><mfrac linethickness=\"");
2035
+ s2 = mtex2MML_copy3(s1, $9, "\">");
2036
+ s3 = mtex2MML_copy3(s2, $12 , $13);
2037
+ s4 = mtex2MML_copy3(s3, "</mfrac><mrow>", "<mo maxsize=\"1.2em\" minsize=\"1.2em\">");
2038
+ break;
2039
+ }
2040
+
2041
+ $$ = mtex2MML_copy3(s4, $6, "</mo></mrow></mrow></mstyle></mrow>");
2042
+
2043
+ mtex2MML_free_string(s1);
2044
+ mtex2MML_free_string(s2);
2045
+ mtex2MML_free_string(s3);
2046
+ mtex2MML_free_string(s4);
2047
+ mtex2MML_free_string($3);
2048
+ mtex2MML_free_string($6);
2049
+ mtex2MML_free_string($9);
2050
+ mtex2MML_free_string($11);
2051
+ mtex2MML_free_string($12);
2052
+ mtex2MML_free_string($13);
2053
+ };
2054
+
2055
+ pod: POD closedTerm {
2056
+ $$ = mtex2MML_copy3( "<mrow><mo lspace=\"mediummathspace\">(</mo>", $2, "<mo rspace=\"mediummathspace\">)</mo></mrow>");
2057
+ mtex2MML_free_string($2);
2058
+ };
2059
+
2060
+ pmod: PMOD closedTerm {
2061
+ $$ = mtex2MML_copy3( "<mrow><mo lspace=\"mediummathspace\">(</mo><mo rspace=\"thinmathspace\">mod</mo>", $2, "<mo rspace=\"mediummathspace\">)</mo></mrow>");
2062
+ mtex2MML_free_string($2);
2063
+ };
2064
+
2065
+ bmod: BMOD closedTerm {
2066
+ $$ = mtex2MML_copy3( "<mrow><mo lspace=\"thickmathspace\" rspace=\"thickmathspace\">mod</mo>", $2, "</mrow>");
2067
+ mtex2MML_free_string($2);
2068
+ };
2069
+
2070
+ buildrel: BUILDREL closedTerm TEXOVER closedTerm {
2071
+ char *s1 = mtex2MML_copy3("<mrow><mover>", $4, $2);
2072
+ $$ = mtex2MML_copy2(s1, "</mover></mrow>");
2073
+
2074
+ mtex2MML_free_string(s1);
2075
+ mtex2MML_free_string($2);
2076
+ mtex2MML_free_string($4);
2077
+ };
2078
+
2079
+ texover: closedTerm TEXOVER closedTerm {
2080
+ char * s1 = mtex2MML_copy3("<mfrac>", $1, $3);
2081
+ $$ = mtex2MML_copy2(s1, "</mfrac>");
2082
+ mtex2MML_free_string(s1);
2083
+ mtex2MML_free_string($1);
2084
+ mtex2MML_free_string($3);
2085
+ }
2086
+ | left compoundTermList TEXOVER compoundTermList right {
2087
+ char * s1 = mtex2MML_copy3("<mrow>", $1, "<mfrac><mrow>");
2088
+ char * s2 = mtex2MML_copy3($2, "</mrow><mrow>", $4);
2089
+ char * s3 = mtex2MML_copy3("</mrow></mfrac>", $5, "</mrow>");
2090
+ $$ = mtex2MML_copy3(s1, s2, s3);
2091
+ mtex2MML_free_string(s1);
2092
+ mtex2MML_free_string(s2);
2093
+ mtex2MML_free_string(s3);
2094
+ mtex2MML_free_string($1);
2095
+ mtex2MML_free_string($2);
2096
+ mtex2MML_free_string($4);
2097
+ mtex2MML_free_string($5);
2098
+ };
2099
+
2100
+ texoverwithdelims: closedTerm TEXOVERWITHDELIMS LEFTDELIM RIGHTDELIM closedTerm {
2101
+ char * s1 = mtex2MML_copy3("<mo fence=\"true\" stretchy=\"true\">", $3, "</mo><mfrac>");
2102
+ char * s2 = mtex2MML_copy3(s1, $1, $5);
2103
+ char * s3 = mtex2MML_copy2(s2, "</mfrac><mo fence=\"true\" stretchy=\"true\">");
2104
+ $$ = mtex2MML_copy3(s3, $4, "</mo>");
2105
+ mtex2MML_free_string(s1);
2106
+ mtex2MML_free_string(s2);
2107
+ mtex2MML_free_string(s3);
2108
+ mtex2MML_free_string($1);
2109
+ mtex2MML_free_string($3);
2110
+ mtex2MML_free_string($4);
2111
+ mtex2MML_free_string($5);
2112
+ };
2113
+
2114
+ texatop: MROWOPEN compoundTermList TEXATOP compoundTermList MROWCLOSE {
2115
+ char * s1 = mtex2MML_copy3("<mfrac linethickness=\"0\"><mrow>", $2, "</mrow><mrow>");
2116
+ $$ = mtex2MML_copy3(s1, $4, "</mrow></mfrac>");
2117
+ mtex2MML_free_string(s1);
2118
+ mtex2MML_free_string($2);
2119
+ mtex2MML_free_string($4);
2120
+ }
2121
+ | closedTerm TEXATOP closedTerm {
2122
+ char * s1 = mtex2MML_copy3("<mfrac linethickness=\"0\">", $1, $3);
2123
+ $$ = mtex2MML_copy2(s1, "</mfrac>");
2124
+ mtex2MML_free_string(s1);
2125
+ mtex2MML_free_string($1);
2126
+ mtex2MML_free_string($3);
2127
+ };
2128
+
2129
+ texatopwithdelims: closedTerm TEXATOPWITHDELIMS LEFTDELIM RIGHTDELIM closedTerm {
2130
+ char * s1 = mtex2MML_copy3("<mo fence=\"true\" stretchy=\"true\">", $3, "</mo><mfrac linethickness=\"0\">");
2131
+ char * s2 = mtex2MML_copy3(s1, $1, $5);
2132
+ char * s3 = mtex2MML_copy2(s2, "</mfrac><mo fence=\"true\" stretchy=\"true\">");
2133
+ $$ = mtex2MML_copy3(s3, $4, "</mo>");
2134
+ mtex2MML_free_string(s1);
2135
+ mtex2MML_free_string(s2);
2136
+ mtex2MML_free_string(s3);
2137
+ mtex2MML_free_string($1);
2138
+ mtex2MML_free_string($3);
2139
+ mtex2MML_free_string($4);
2140
+ mtex2MML_free_string($5);
2141
+ };
2142
+
2143
+ texabove: closedTerm TEXABOVE MROWOPEN PXSTRING MROWCLOSE closedTerm {
2144
+ char * s1 = mtex2MML_copy3("<mfrac linethickness=\"", $4, "\">");
2145
+ char * s2 = mtex2MML_copy3(s1, $1, $6);
2146
+ $$ = mtex2MML_copy2(s2, "</mfrac>");
2147
+ mtex2MML_free_string(s1);
2148
+ mtex2MML_free_string(s2);
2149
+ mtex2MML_free_string($1);
2150
+ mtex2MML_free_string($4);
2151
+ mtex2MML_free_string($6);
2152
+ };
2153
+
2154
+ texabovewithdelims: closedTerm TEXABOVEWITHDELIMS LEFTDELIM RIGHTDELIM PXSTRING closedTerm {
2155
+ char * s1 = mtex2MML_copy3("<mo fence=\"true\" stretchy=\"true\">", $3, "</mo>");
2156
+ char * s2 = mtex2MML_copy3(s1, "<mfrac linethickness=\"", $5);
2157
+ char * s3 = mtex2MML_copy3(s2, "\">", $1);
2158
+ char * s4 = mtex2MML_copy3(s3, $6, "</mfrac><mo fence=\"true\" stretchy=\"true\">");
2159
+ $$ = mtex2MML_copy3(s4, $4, "</mo>");
2160
+ mtex2MML_free_string(s1);
2161
+ mtex2MML_free_string(s2);
2162
+ mtex2MML_free_string(s3);
2163
+ mtex2MML_free_string(s4);
2164
+ mtex2MML_free_string($1);
2165
+ mtex2MML_free_string($3);
2166
+ mtex2MML_free_string($4);
2167
+ mtex2MML_free_string($5);
2168
+ mtex2MML_free_string($6);
2169
+ };
2170
+
2171
+ binom: BINOM closedTerm closedTerm {
2172
+ char * s1 = mtex2MML_copy3("<mrow><mo maxsize=\"2.047em\" minsize=\"2.047em\">(</mo><mfrac linethickness=\"0\">", $2, $3);
2173
+ $$ = mtex2MML_copy2(s1, "</mfrac><mo maxsize=\"2.047em\" minsize=\"2.047em\">)</mo></mrow>");
2174
+ mtex2MML_free_string(s1);
2175
+ mtex2MML_free_string($2);
2176
+ mtex2MML_free_string($3);
2177
+ }
2178
+ | TBINOM closedTerm closedTerm {
2179
+ char * s1 = mtex2MML_copy3("<mrow><mo maxsize=\"2.047em\" minsize=\"2.047em\">(</mo><mstyle displaystyle=\"false\"><mfrac linethickness=\"0\">", $2, $3);
2180
+ $$ = mtex2MML_copy2(s1, "</mfrac></mstyle><mo maxsize=\"2.047em\" minsize=\"2.047em\">)</mo></mrow>");
2181
+ mtex2MML_free_string(s1);
2182
+ mtex2MML_free_string($2);
2183
+ mtex2MML_free_string($3);
2184
+ }
2185
+ | DBINOM closedTerm closedTerm {
2186
+ char * s1 = mtex2MML_copy3("<mstyle displaystyle=\"true\" scriptlevel=\"0\"><mrow><mo maxsize=\"2.047em\" minsize=\"2.047em\">(</mo><mfrac linethickness=\"0\">", $2, $3);
2187
+ $$ = mtex2MML_copy2(s1, "</mfrac><mo maxsize=\"2.047em\" minsize=\"2.047em\">)</mo></mrow></mstyle>");
2188
+ mtex2MML_free_string(s1);
2189
+ mtex2MML_free_string($2);
2190
+ mtex2MML_free_string($3);
2191
+ };
2192
+
2193
+ brace: closedTerm BRACE closedTerm {
2194
+ char * s1 = mtex2MML_copy3("<mrow><mo maxsize=\"2.047em\" minsize=\"2.047em\">{</mo><mfrac linethickness=\"0\">", $1, $3);
2195
+ $$ = mtex2MML_copy2(s1, "</mfrac><mo maxsize=\"2.047em\" minsize=\"2.047em\">}</mo></mrow>");
2196
+ mtex2MML_free_string(s1);
2197
+ mtex2MML_free_string($1);
2198
+ mtex2MML_free_string($3);
2199
+ };
2200
+
2201
+ brack: closedTerm BRACK closedTerm {
2202
+ char * s1 = mtex2MML_copy3("<mrow><mo maxsize=\"2.047em\" minsize=\"2.047em\">[</mo><mfrac linethickness=\"0\">", $1, $3);
2203
+ $$ = mtex2MML_copy2(s1, "</mfrac><mo maxsize=\"2.047em\" minsize=\"2.047em\">]</mo></mrow>");
2204
+ mtex2MML_free_string(s1);
2205
+ mtex2MML_free_string($1);
2206
+ mtex2MML_free_string($3);
2207
+ };
2208
+
2209
+ choose: closedTerm CHOOSE closedTerm {
2210
+ char * s1 = mtex2MML_copy3("<mrow><mrow><mo maxsize=\"2.047em\" minsize=\"2.047em\">(</mo></mrow><mfrac linethickness=\"0\">", $1, $3);
2211
+ $$ = mtex2MML_copy2(s1, "</mfrac><mrow><mo maxsize=\"2.047em\" minsize=\"2.047em\">)</mo></mrow></mrow>");
2212
+
2213
+ mtex2MML_free_string(s1);
2214
+ mtex2MML_free_string($1);
2215
+ mtex2MML_free_string($3);
2216
+ };
2217
+
2218
+ underleftarrow: UNDERLEFTARROW closedTerm {
2219
+ $$ = mtex2MML_copy3("<munder>", $2, "<mo>&larr;</mo></munder>");
2220
+ mtex2MML_free_string($2);
2221
+ };
2222
+
2223
+ underleftrightarrow: UNDERLEFTRIGHTARROW closedTerm {
2224
+ $$ = mtex2MML_copy3("<munder>", $2, "<mo>&harr;</mo></munder>");
2225
+ mtex2MML_free_string($2);
2226
+ };
2227
+
2228
+ underrightarrow: UNDERRIGHTARROW closedTerm {
2229
+ $$ = mtex2MML_copy3("<munder>", $2, "<mo>&rarr;</mo></munder>");
2230
+ mtex2MML_free_string($2);
2231
+ };
2232
+
2233
+ /* TODO: can't seem to get Lasem to render the entity name; hardcode hex code */
2234
+ munderbrace: UNDERBRACE closedTerm {
2235
+ $$ = mtex2MML_copy3("<munder>", $2, "<mo>&#x23DF;</mo></munder>");
2236
+ mtex2MML_free_string($2);
2237
+ }
2238
+ | UNDERBRACE closedTerm SUB closedTerm {
2239
+ char * s1 = mtex2MML_copy3("<munder><munder>", $2, "<mo>&#x23DF;</mo></munder>");
2240
+ $$ = mtex2MML_copy3(s1, $4, "</munder>");
2241
+
2242
+ mtex2MML_free_string(s1);
2243
+ mtex2MML_free_string($2);
2244
+ mtex2MML_free_string($4);
2245
+ }
2246
+ | UNDERBRACE closedTerm LIMITS SUB closedTerm {
2247
+ char * s1 = mtex2MML_copy3("<munder><munder>", $2, "<mo>&#x23DF;</mo></munder>");
2248
+ $$ = mtex2MML_copy3(s1, $5, "</munder>");
2249
+
2250
+ mtex2MML_free_string(s1);
2251
+ mtex2MML_free_string($2);
2252
+ mtex2MML_free_string($5);
2253
+ }
2254
+ | UNDERBRACE closedTerm NOLIMITS SUB closedTerm {
2255
+ char * s1 = mtex2MML_copy3("<msub><munder>", $2, "<mo>&#x23DF;</mo></munder>");
2256
+ $$ = mtex2MML_copy3(s1, $5, "</msub>");
2257
+
2258
+ mtex2MML_free_string(s1);
2259
+ mtex2MML_free_string($2);
2260
+ mtex2MML_free_string($5);
2261
+ };
2262
+
2263
+ munderbracket: UNDERBRACKET closedTerm {
2264
+ $$ = mtex2MML_copy3("<munder>", $2, "<mo>&#9183;</mo></munder>");
2265
+ mtex2MML_free_string($2);
2266
+ };
2267
+
2268
+ munderline: UNDERLINE closedTerm {
2269
+ $$ = mtex2MML_copy3("<munder>", $2, "<mo>&#x00332;</mo></munder>");
2270
+ mtex2MML_free_string($2);
2271
+ };
2272
+
2273
+ moverbrace: OVERBRACE closedTerm {
2274
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo>&#x23DE;</mo></mover>");
2275
+ mtex2MML_free_string($2);
2276
+ };
2277
+
2278
+ moverbracket: OVERBRACKET closedTerm {
2279
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo>&#9183;</mo></mover>");
2280
+ mtex2MML_free_string($2);
2281
+ };
2282
+
2283
+ overleftarrow: OVERLEFTARROW closedTerm {
2284
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo stretchy=\"false\">&larr;</mo></mover>");
2285
+ mtex2MML_free_string($2);
2286
+ };
2287
+
2288
+ overleftrightarrow: OVERLEFTRIGHTARROW closedTerm {
2289
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo stretchy=\"false\">&harr;</mo></mover>");
2290
+ mtex2MML_free_string($2);
2291
+ };
2292
+
2293
+ overrightarrow: OVERRIGHTARROW closedTerm {
2294
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo stretchy=\"false\">&rarr;</mo></mover>");
2295
+ mtex2MML_free_string($2);
2296
+ };
2297
+
2298
+ bar: BAR closedTerm {
2299
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo stretchy=\"false\">&#x000AF;</mo></mover>");
2300
+ mtex2MML_free_string($2);
2301
+ }
2302
+ | WIDEBAR closedTerm {
2303
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo>&#x000AF;</mo></mover>");
2304
+ mtex2MML_free_string($2);
2305
+ };
2306
+
2307
+ vec: VEC closedTerm {
2308
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo stretchy=\"false\">&#x2192;</mo></mover>");
2309
+ mtex2MML_free_string($2);
2310
+ }
2311
+ | WIDEVEC closedTerm {
2312
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo>&#x2192;</mo></mover>");
2313
+ mtex2MML_free_string($2);
2314
+ };
2315
+
2316
+ acute: ACUTE closedTerm {
2317
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo stretchy=\"false\">&acute;</mo></mover>");
2318
+ mtex2MML_free_string($2);
2319
+ };
2320
+
2321
+ grave: GRAVE closedTerm {
2322
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo stretchy=\"false\">&#x60;</mo></mover>");
2323
+ mtex2MML_free_string($2);
2324
+ };
2325
+
2326
+ breve: BREVE closedTerm {
2327
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo stretchy=\"false\">&#x2d8;</mo></mover>");
2328
+ mtex2MML_free_string($2);
2329
+ };
2330
+
2331
+ mathring: MATHRING closedTerm {
2332
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo stretchy=\"false\">&#730;</mo></mover>");
2333
+ mtex2MML_free_string($2);
2334
+ };
2335
+
2336
+ dot: DOT closedTerm {
2337
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo>&dot;</mo></mover>");
2338
+ mtex2MML_free_string($2);
2339
+ };
2340
+
2341
+ ddot: DDOT closedTerm {
2342
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo>&Dot;</mo></mover>");
2343
+ mtex2MML_free_string($2);
2344
+ };
2345
+
2346
+ dddot: DDDOT closedTerm {
2347
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo>&tdot;</mo></mover>");
2348
+ mtex2MML_free_string($2);
2349
+ };
2350
+
2351
+ ddddot: DDDDOT closedTerm {
2352
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo>&DotDot;</mo></mover>");
2353
+ mtex2MML_free_string($2);
2354
+ };
2355
+
2356
+ tilde: TILDE closedTerm {
2357
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo stretchy=\"false\">&tilde;</mo></mover>");
2358
+ mtex2MML_free_string($2);
2359
+ }
2360
+ | WIDETILDE closedTerm {
2361
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo>&tilde;</mo></mover>");
2362
+ mtex2MML_free_string($2);
2363
+ };
2364
+
2365
+ check: CHECK closedTerm {
2366
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo stretchy=\"false\">&#x2c7;</mo></mover>");
2367
+ mtex2MML_free_string($2);
2368
+ }
2369
+ | WIDECHECK closedTerm {
2370
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo>&#x2c7;</mo></mover>");
2371
+ mtex2MML_free_string($2);
2372
+ };
2373
+
2374
+ hat: HAT closedTerm {
2375
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo stretchy=\"false\">&#x5E;</mo></mover>");
2376
+ mtex2MML_free_string($2);
2377
+ }
2378
+ | WIDEHAT closedTerm {
2379
+ $$ = mtex2MML_copy3("<mover>", $2, "<mo>&#x5E;</mo></mover>");
2380
+ mtex2MML_free_string($2);
2381
+ };
2382
+
2383
+ skew: SKEW closedTerm ACUTE closedTerm {
2384
+ char * em_skew = mtex2MML_dbl2em($2);
2385
+
2386
+ $$ = mtex2MML_implement_skew($4, em_skew, "&acute;");
2387
+
2388
+ mtex2MML_free_string(em_skew);
2389
+ mtex2MML_free_string($2);
2390
+ mtex2MML_free_string($4);
2391
+ }
2392
+ | SKEW closedTerm BAR closedTerm {
2393
+ char * em_skew = mtex2MML_dbl2em($2);
2394
+
2395
+ $$ = mtex2MML_implement_skew($4, em_skew, "&#x000AF;");
2396
+
2397
+ mtex2MML_free_string(em_skew);
2398
+ mtex2MML_free_string($2);
2399
+ mtex2MML_free_string($4);
2400
+ }
2401
+ | SKEW closedTerm BREVE closedTerm {
2402
+ char * em_skew = mtex2MML_dbl2em($2);
2403
+
2404
+ $$ = mtex2MML_implement_skew($4, em_skew, "&#x2d8;");
2405
+
2406
+ mtex2MML_free_string(em_skew);
2407
+ mtex2MML_free_string($2);
2408
+ mtex2MML_free_string($4);
2409
+ }
2410
+ | SKEW closedTerm CHECK closedTerm {
2411
+ char * em_skew = mtex2MML_dbl2em($2);
2412
+
2413
+ $$ = mtex2MML_implement_skew($4, em_skew, "&#x2c7;");
2414
+
2415
+ mtex2MML_free_string(em_skew);
2416
+ mtex2MML_free_string($2);
2417
+ mtex2MML_free_string($4);
2418
+ }
2419
+ | SKEW closedTerm DOT closedTerm {
2420
+ char * em_skew = mtex2MML_dbl2em($2);
2421
+
2422
+ $$ = mtex2MML_implement_skew($4, em_skew, "&dot;");
2423
+
2424
+ mtex2MML_free_string(em_skew);
2425
+ mtex2MML_free_string($2);
2426
+ mtex2MML_free_string($4);
2427
+ }
2428
+ | SKEW closedTerm DDOT closedTerm {
2429
+ char * em_skew = mtex2MML_dbl2em($2);
2430
+
2431
+ $$ = mtex2MML_implement_skew($4, em_skew, "&Dot;");
2432
+
2433
+ mtex2MML_free_string(em_skew);
2434
+ mtex2MML_free_string($2);
2435
+ mtex2MML_free_string($4);
2436
+ }
2437
+ | SKEW closedTerm DDDOT closedTerm {
2438
+ char * em_skew = mtex2MML_dbl2em($2);
2439
+
2440
+ $$ = mtex2MML_implement_skew($4, em_skew, "&tdot;");
2441
+
2442
+ mtex2MML_free_string(em_skew);
2443
+ mtex2MML_free_string($2);
2444
+ mtex2MML_free_string($4);
2445
+ }
2446
+ | SKEW closedTerm DDDDOT closedTerm {
2447
+ char * em_skew = mtex2MML_dbl2em($2);
2448
+
2449
+ $$ = mtex2MML_implement_skew($4, em_skew, "&DotDot;");
2450
+
2451
+ mtex2MML_free_string(em_skew);
2452
+ mtex2MML_free_string($2);
2453
+ mtex2MML_free_string($4);
2454
+ }
2455
+ | SKEW closedTerm GRAVE closedTerm {
2456
+ char * em_skew = mtex2MML_dbl2em($2);
2457
+
2458
+ $$ = mtex2MML_implement_skew($4, em_skew, "&#x60;");
2459
+
2460
+ mtex2MML_free_string(em_skew);
2461
+ mtex2MML_free_string($2);
2462
+ mtex2MML_free_string($4);
2463
+ }
2464
+ | SKEW closedTerm HAT closedTerm {
2465
+ char * em_skew = mtex2MML_dbl2em($2);
2466
+
2467
+ $$ = mtex2MML_implement_skew($4, em_skew, "&#x5E;");
2468
+
2469
+ mtex2MML_free_string(em_skew);
2470
+ mtex2MML_free_string($2);
2471
+ mtex2MML_free_string($4);
2472
+ }
2473
+ | SKEW closedTerm TILDE closedTerm {
2474
+ char * em_skew = mtex2MML_dbl2em($2);
2475
+
2476
+ $$ = mtex2MML_implement_skew($4, em_skew, "&tilde;");
2477
+
2478
+ mtex2MML_free_string(em_skew);
2479
+ mtex2MML_free_string($2);
2480
+ mtex2MML_free_string($4);
2481
+ }
2482
+ | SKEW closedTerm WIDEHAT closedTerm {
2483
+ char * em_skew = mtex2MML_dbl2em($2);
2484
+
2485
+ $$ = mtex2MML_implement_skew($4, em_skew, "&#x5E;");
2486
+
2487
+ mtex2MML_free_string(em_skew);
2488
+ mtex2MML_free_string($2);
2489
+ mtex2MML_free_string($4);
2490
+ }
2491
+ | SKEW closedTerm WIDETILDE closedTerm {
2492
+ char * em_skew = mtex2MML_dbl2em($2);
2493
+
2494
+ $$ = mtex2MML_implement_skew($4, em_skew, "&#x5E;");
2495
+
2496
+ mtex2MML_free_string(em_skew);
2497
+ mtex2MML_free_string($2);
2498
+ mtex2MML_free_string($4);
2499
+ };
2500
+
2501
+ msqrt: SQRT closedTerm {
2502
+ $$ = mtex2MML_copy3("<msqrt>", $2, "</msqrt>");
2503
+ mtex2MML_free_string($2);
2504
+ };
2505
+
2506
+ mroot: SQRT OPTARGOPEN compoundTermList OPTARGCLOSE closedTerm {
2507
+ char * s1 = mtex2MML_copy3("<mroot>", $5, $3);
2508
+ $$ = mtex2MML_copy2(s1, "</mroot>");
2509
+ mtex2MML_free_string(s1);
2510
+ mtex2MML_free_string($3);
2511
+ mtex2MML_free_string($5);
2512
+ }
2513
+ | ROOT closedTerm OF closedTerm {
2514
+ char * s1 = mtex2MML_copy3("<mroot>", $4, $2);
2515
+ $$ = mtex2MML_copy2(s1, "</mroot>");
2516
+ mtex2MML_free_string(s1);
2517
+ mtex2MML_free_string($2);
2518
+ mtex2MML_free_string($4);
2519
+ };
2520
+
2521
+ leftroot: LEFTROOT ST NUMBER END closedTerm {
2522
+ char * spacing = mtex2MML_root_pos_to_em($3);
2523
+
2524
+ char *s1 = mtex2MML_copy3("<mpadded width=\"", spacing, "\"><mrow>");
2525
+ $$ = mtex2MML_copy3(s1, $5, "</mrow></mpadded>");
2526
+
2527
+ mtex2MML_free_string(s1);
2528
+ mtex2MML_free_string(spacing);
2529
+ mtex2MML_free_string($3);
2530
+ mtex2MML_free_string($5);
2531
+ };
2532
+
2533
+ uproot: UPROOT ST NUMBER END closedTerm {
2534
+ char * spacing = mtex2MML_root_pos_to_em($3);
2535
+
2536
+ char *s1 = mtex2MML_copy3("<mpadded height=\"", spacing, "\" voffset=\"");
2537
+ char *s2 = mtex2MML_copy3(s1, spacing, "\"><mrow>");
2538
+ $$ = mtex2MML_copy3(s2, $5, "</mrow></mpadded>");
2539
+
2540
+ mtex2MML_free_string(s1);
2541
+ mtex2MML_free_string(s2);
2542
+ mtex2MML_free_string(spacing);
2543
+ mtex2MML_free_string($3);
2544
+ mtex2MML_free_string($5);
2545
+ };
2546
+
2547
+ raisebox: RAISEBOX TEXTSTRING TEXTSTRING TEXTSTRING closedTerm {
2548
+ char * s1 = mtex2MML_copy3("<mpadded voffset='", $2, "' height='");
2549
+ char * s2 = mtex2MML_copy3(s1, $3, "' depth='");
2550
+ char * s3 = mtex2MML_copy3(s2, $4, "'>");
2551
+ $$ = mtex2MML_copy3(s3, $5, "</mpadded>");
2552
+ mtex2MML_free_string(s1);
2553
+ mtex2MML_free_string(s2);
2554
+ mtex2MML_free_string(s3);
2555
+ mtex2MML_free_string($2);
2556
+ mtex2MML_free_string($3);
2557
+ mtex2MML_free_string($4);
2558
+ mtex2MML_free_string($5);
2559
+ }
2560
+ | RAISEBOX NEG TEXTSTRING TEXTSTRING TEXTSTRING closedTerm {
2561
+ char * s1 = mtex2MML_copy3("<mpadded voffset='-", $3, "' height='");
2562
+ char * s2 = mtex2MML_copy3(s1, $4, "' depth='");
2563
+ char * s3 = mtex2MML_copy3(s2, $5, "'>");
2564
+ $$ = mtex2MML_copy3(s3, $6, "</mpadded>");
2565
+ mtex2MML_free_string(s1);
2566
+ mtex2MML_free_string(s2);
2567
+ mtex2MML_free_string(s3);
2568
+ mtex2MML_free_string($3);
2569
+ mtex2MML_free_string($4);
2570
+ mtex2MML_free_string($5);
2571
+ mtex2MML_free_string($6);
2572
+ }
2573
+ | RAISEBOX TEXTSTRING TEXTSTRING closedTerm {
2574
+ char * s1 = mtex2MML_copy3("<mpadded voffset='", $2, "' height='");
2575
+ char * s2 = mtex2MML_copy3(s1, $3, "' depth='depth'>");
2576
+ $$ = mtex2MML_copy3(s2, $4, "</mpadded>");
2577
+ mtex2MML_free_string(s1);
2578
+ mtex2MML_free_string(s2);
2579
+ mtex2MML_free_string($2);
2580
+ mtex2MML_free_string($3);
2581
+ mtex2MML_free_string($4);
2582
+ }
2583
+ | RAISEBOX NEG TEXTSTRING TEXTSTRING closedTerm {
2584
+ char * s1 = mtex2MML_copy3("<mpadded voffset='-", $3, "' height='");
2585
+ char * s2 = mtex2MML_copy3(s1, $4, "' depth='+");
2586
+ char * s3 = mtex2MML_copy3(s2, $3, "'>");
2587
+ $$ = mtex2MML_copy3(s3, $5, "</mpadded>");
2588
+ mtex2MML_free_string(s1);
2589
+ mtex2MML_free_string(s2);
2590
+ mtex2MML_free_string(s3);
2591
+ mtex2MML_free_string($3);
2592
+ mtex2MML_free_string($4);
2593
+ mtex2MML_free_string($5);
2594
+ }
2595
+ | RAISEBOX TEXTSTRING closedTerm {
2596
+ char * s1 = mtex2MML_copy3("<mpadded voffset='", $2, "' height='+");
2597
+ char * s2 = mtex2MML_copy3(s1, $2, "' depth='depth'>");
2598
+ $$ = mtex2MML_copy3(s2, $3, "</mpadded>");
2599
+ mtex2MML_free_string(s1);
2600
+ mtex2MML_free_string(s2);
2601
+ mtex2MML_free_string($2);
2602
+ mtex2MML_free_string($3);
2603
+ }
2604
+ | RAISEBOX NEG TEXTSTRING closedTerm {
2605
+ char * s1 = mtex2MML_copy3("<mpadded voffset='-", $3, "' height='0pt' depth='+");
2606
+ char * s2 = mtex2MML_copy3(s1, $3, "'>");
2607
+ $$ = mtex2MML_copy3(s2, $4, "</mpadded>");
2608
+ mtex2MML_free_string(s1);
2609
+ mtex2MML_free_string(s2);
2610
+ mtex2MML_free_string($3);
2611
+ mtex2MML_free_string($4);
2612
+ };
2613
+
2614
+ munder: XARROW OPTARGOPEN compoundTermList OPTARGCLOSE EMPTYMROW {
2615
+ char * s1 = mtex2MML_copy3("<munder><mo>", $1, "</mo><mrow>");
2616
+ $$ = mtex2MML_copy3(s1, $3, "</mrow></munder>");
2617
+ mtex2MML_free_string(s1);
2618
+ mtex2MML_free_string($1);
2619
+ mtex2MML_free_string($3);
2620
+ }
2621
+ | UNDER closedTerm closedTerm {
2622
+ char * s1 = mtex2MML_copy3("<munder>", $3, $2);
2623
+ $$ = mtex2MML_copy2(s1, "</munder>");
2624
+ mtex2MML_free_string(s1);
2625
+ mtex2MML_free_string($2);
2626
+ mtex2MML_free_string($3);
2627
+ };
2628
+
2629
+ mover: XARROW closedTerm {
2630
+ char * s1 = mtex2MML_copy3("<mover><mo>", $1, "</mo>");
2631
+ $$ = mtex2MML_copy3(s1, $2, "</mover>");
2632
+ mtex2MML_free_string(s1);
2633
+ mtex2MML_free_string($1);
2634
+ mtex2MML_free_string($2);
2635
+ }
2636
+ | OVER closedTerm closedTerm {
2637
+ char * s1 = mtex2MML_copy3("<mover>", $3, $2);
2638
+ $$ = mtex2MML_copy2(s1, "</mover>");
2639
+ mtex2MML_free_string(s1);
2640
+ mtex2MML_free_string($2);
2641
+ mtex2MML_free_string($3);
2642
+ };
2643
+
2644
+ munderover: XARROW OPTARGOPEN compoundTermList OPTARGCLOSE closedTerm {
2645
+ char * s1 = mtex2MML_copy3("<munderover><mo>", $1, "</mo><mrow>");
2646
+ char * s2 = mtex2MML_copy3(s1, $3, "</mrow>");
2647
+ $$ = mtex2MML_copy3(s2, $5, "</munderover>");
2648
+ mtex2MML_free_string(s1);
2649
+ mtex2MML_free_string(s2);
2650
+ mtex2MML_free_string($1);
2651
+ mtex2MML_free_string($3);
2652
+ mtex2MML_free_string($5);
2653
+ }
2654
+ | UNDEROVER closedTerm closedTerm closedTerm {
2655
+ char * s1 = mtex2MML_copy3("<munderover>", $4, $2);
2656
+ $$ = mtex2MML_copy3(s1, $3, "</munderover>");
2657
+ mtex2MML_free_string(s1);
2658
+ mtex2MML_free_string($2);
2659
+ mtex2MML_free_string($3);
2660
+ mtex2MML_free_string($4);
2661
+ };
2662
+
2663
+ emptymrow: EMPTYMROW {
2664
+ $$ = mtex2MML_copy_string("<mrow/>");
2665
+ };
2666
+
2667
+ mathenv: BEGINENV EQUATION tableRowList ENDENV EQUATION {
2668
+ $$ = mtex2MML_copy3("<mtable>", $3, "</mtable>");
2669
+
2670
+ mtex2MML_free_string($3);
2671
+ }
2672
+ | BEGINENV EQUATION_STAR tableRowList ENDENV EQUATION_STAR {
2673
+ $$ = mtex2MML_copy3("<mtable>", $3, "</mtable>");
2674
+
2675
+ mtex2MML_free_string($3);
2676
+ }
2677
+ | BEGINENV MATRIX tableRowList ENDENV MATRIX {
2678
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2679
+
2680
+ char * s1 = mtex2MML_copy3("<mrow><mtable displaystyle=\"false\" ", row_data, ">");
2681
+ if (encase == TOPENCLOSE) {
2682
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2683
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2684
+ mtex2MML_free_string(t);
2685
+ }
2686
+ else
2687
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2688
+
2689
+ mtex2MML_free_string($3);
2690
+ mtex2MML_free_string(s1);
2691
+ mtex2MML_free_string(row_data);
2692
+ }
2693
+ | BEGINENV GATHERED ARRAYALIGN END tableRowList ENDENV GATHERED {
2694
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2695
+
2696
+ char * s1 = mtex2MML_copy3("<mrow><mtable displaystyle=\"true\" align=\"", $3, "\" ");
2697
+ char * s2 = mtex2MML_copy3(s1, row_data, ">");
2698
+ if (encase == TOPENCLOSE) {
2699
+ char *t = mtex2MML_copy3(s2, $5, "</mtable></mrow>");
2700
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2701
+ mtex2MML_free_string(t);
2702
+ }
2703
+ else
2704
+ $$ = mtex2MML_copy3(s2, $5, "</mtable></mrow>");
2705
+
2706
+ mtex2MML_free_string($3);
2707
+ mtex2MML_free_string($5);
2708
+ mtex2MML_free_string(s1);
2709
+ mtex2MML_free_string(s2);
2710
+ mtex2MML_free_string(row_data);
2711
+ }
2712
+ | BEGINENV GATHERED tableRowList ENDENV GATHERED {
2713
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2714
+
2715
+ char * s1 = mtex2MML_copy3("<mrow><mtable displaystyle=\"true\" ", row_data, ">");
2716
+ if (encase == TOPENCLOSE) {
2717
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2718
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2719
+ mtex2MML_free_string(t);
2720
+ }
2721
+ else
2722
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2723
+
2724
+ mtex2MML_free_string($3);
2725
+ mtex2MML_free_string(s1);
2726
+ mtex2MML_free_string(row_data);
2727
+ }
2728
+ | BEGINENV EQNARRAY tableRowList ENDENV EQNARRAY {
2729
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2730
+
2731
+ char * s1 = mtex2MML_copy3("<mrow><mtable displaystyle=\"true\" columnalign=\"right center left\" columnspacing=\"thickmathspace\" ", row_data, ">");
2732
+
2733
+ if (encase == TOPENCLOSE) {
2734
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2735
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2736
+ mtex2MML_free_string(t);
2737
+ }
2738
+ else
2739
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2740
+
2741
+ mtex2MML_free_string($3);
2742
+ mtex2MML_free_string(s1);
2743
+ mtex2MML_free_string(row_data);
2744
+ }
2745
+ | BEGINENV EQNARRAY_STAR tableRowList ENDENV EQNARRAY_STAR {
2746
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2747
+
2748
+ char * s1 = mtex2MML_copy3("<mrow><mtable displaystyle=\"true\" columnalign=\"right center left\" columnspacing=\"thickmathspace\" ", row_data, ">");
2749
+ if (encase == TOPENCLOSE) {
2750
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2751
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2752
+ mtex2MML_free_string(t);
2753
+ }
2754
+ else
2755
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2756
+
2757
+ mtex2MML_free_string($3);
2758
+ mtex2MML_free_string(s1);
2759
+ mtex2MML_free_string(row_data);
2760
+ }
2761
+ | BEGINENV GATHER tableRowList ENDENV GATHER {
2762
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2763
+
2764
+ char * s1 = mtex2MML_copy3("<mrow><mtable displaystyle=\"true\" ", row_data, ">");
2765
+
2766
+ if (encase == TOPENCLOSE) {
2767
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2768
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2769
+ mtex2MML_free_string(t);
2770
+ }
2771
+ else
2772
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2773
+
2774
+ mtex2MML_free_string($3);
2775
+ mtex2MML_free_string(s1);
2776
+ mtex2MML_free_string(row_data);
2777
+ }
2778
+ | BEGINENV GATHER_STAR tableRowList ENDENV GATHER_STAR {
2779
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2780
+
2781
+ char * s1 = mtex2MML_copy3("<mrow><mtable displaystyle=\"true\" ", row_data, ">");
2782
+ if (encase == TOPENCLOSE) {
2783
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2784
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2785
+ mtex2MML_free_string(t);
2786
+ }
2787
+ else
2788
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2789
+
2790
+ mtex2MML_free_string($3);
2791
+ mtex2MML_free_string(s1);
2792
+ mtex2MML_free_string(row_data);
2793
+ }
2794
+ | BEGINENV MULTLINE tableRowList ENDENV MULTLINE {
2795
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2796
+
2797
+ char * s1 = mtex2MML_copy3("<mrow><mtable displaystyle=\"true\" ", row_data, ">");
2798
+
2799
+ if (encase == TOPENCLOSE) {
2800
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2801
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2802
+ mtex2MML_free_string(t);
2803
+ }
2804
+ else
2805
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2806
+
2807
+ mtex2MML_free_string($3);
2808
+ mtex2MML_free_string(s1);
2809
+ mtex2MML_free_string(row_data);
2810
+ }
2811
+ | BEGINENV MULTLINE_STAR tableRowList ENDENV MULTLINE_STAR {
2812
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2813
+
2814
+ char * s1 = mtex2MML_copy3("<mrow><mtable displaystyle=\"true\" columnwidth=\"100%\" width=\"85%\" ", row_data, ">");
2815
+ if (encase == TOPENCLOSE) {
2816
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2817
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2818
+ mtex2MML_free_string(t);
2819
+ }
2820
+ else
2821
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2822
+
2823
+ mtex2MML_free_string($3);
2824
+ mtex2MML_free_string(s1);
2825
+ mtex2MML_free_string(row_data);
2826
+ }
2827
+ | BEGINENV PMATRIX tableRowList ENDENV PMATRIX {
2828
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2829
+
2830
+ char * s1 = mtex2MML_copy3("<mrow><mo>(</mo><mrow><mtable displaystyle=\"false\" ", row_data, ">");
2831
+
2832
+ if (encase == TOPENCLOSE) {
2833
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow><mo>)</mo></mrow>");
2834
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2835
+ mtex2MML_free_string(t);
2836
+ }
2837
+ else
2838
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow><mo>)</mo></mrow>");
2839
+
2840
+ mtex2MML_free_string($3);
2841
+ mtex2MML_free_string(s1);
2842
+ mtex2MML_free_string(row_data);
2843
+ }
2844
+ | BEGINENV BMATRIX tableRowList ENDENV BMATRIX {
2845
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2846
+
2847
+ char * s1 = mtex2MML_copy3("<mrow><mo>[</mo><mrow><mtable displaystyle=\"false\" ", row_data, ">");
2848
+
2849
+ if (encase == TOPENCLOSE) {
2850
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow><mo>]</mo></mrow>");
2851
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2852
+ mtex2MML_free_string(t);
2853
+ }
2854
+ else
2855
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow><mo>]</mo></mrow>");
2856
+
2857
+ mtex2MML_free_string($3);
2858
+ mtex2MML_free_string(s1);
2859
+ mtex2MML_free_string(row_data);
2860
+ }
2861
+ | BEGINENV VMATRIX tableRowList ENDENV VMATRIX {
2862
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2863
+
2864
+ char * s1 = mtex2MML_copy3("<mrow><mo>&VerticalBar;</mo><mrow><mtable displaystyle=\"false\" ", row_data, ">");
2865
+
2866
+ if (encase == TOPENCLOSE) {
2867
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow><mo>&VerticalBar;</mo></mrow>");
2868
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2869
+ mtex2MML_free_string(t);
2870
+ }
2871
+ else
2872
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow><mo>&VerticalBar;</mo></mrow>");
2873
+
2874
+ mtex2MML_free_string($3);
2875
+ mtex2MML_free_string(s1);
2876
+ mtex2MML_free_string(row_data);
2877
+ }
2878
+ | BEGINENV BBMATRIX tableRowList ENDENV BBMATRIX {
2879
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2880
+
2881
+ char * s1 = mtex2MML_copy3("<mrow><mo>{</mo><mrow><mtable displaystyle=\"false\" ", row_data, ">");
2882
+
2883
+ if (encase == TOPENCLOSE) {
2884
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow><mo>}</mo></mrow>");
2885
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2886
+ mtex2MML_free_string(t);
2887
+ }
2888
+ else
2889
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow><mo>}</mo></mrow>");
2890
+
2891
+ mtex2MML_free_string($3);
2892
+ mtex2MML_free_string(s1);
2893
+ mtex2MML_free_string(row_data);
2894
+ }
2895
+ | BEGINENV VVMATRIX tableRowList ENDENV VVMATRIX {
2896
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2897
+
2898
+ char * s1 = mtex2MML_copy3("<mrow><mo>&DoubleVerticalBar;</mo><mrow><mtable displaystyle=\"false\" ", row_data, ">");
2899
+
2900
+ if (encase == TOPENCLOSE) {
2901
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow><mo>&DoubleVerticalBar;</mo></mrow>");
2902
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2903
+ mtex2MML_free_string(t);
2904
+ }
2905
+ else
2906
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow><mo>&DoubleVerticalBar;</mo></mrow>");
2907
+
2908
+ mtex2MML_free_string($3);
2909
+ mtex2MML_free_string(s1);
2910
+ mtex2MML_free_string(row_data);
2911
+ }
2912
+ | BEGINENV SMALLMATRIX tableRowList ENDENV SMALLMATRIX {
2913
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2914
+
2915
+ char * s1 = mtex2MML_copy3("<mrow><mtable displaystyle=\"false\" columnspacing=\"0.333em\" ", row_data, ">");
2916
+ if (encase == TOPENCLOSE) {
2917
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2918
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2919
+ mtex2MML_free_string(t);
2920
+ }
2921
+ else
2922
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2923
+
2924
+ mtex2MML_free_string($3);
2925
+ mtex2MML_free_string(s1);
2926
+ mtex2MML_free_string(row_data);
2927
+ }
2928
+ | BEGINENV CASES tableRowList ENDENV CASES {
2929
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2930
+
2931
+ char * s1 = mtex2MML_copy3("<mrow><mo>{</mo><mrow><mtable displaystyle=\"false\" columnalign=\"left left\" ", row_data, ">");
2932
+
2933
+ if (encase == TOPENCLOSE) {
2934
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow></mrow>");
2935
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2936
+ mtex2MML_free_string(t);
2937
+ }
2938
+ else
2939
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow></mrow>");
2940
+
2941
+ mtex2MML_free_string($3);
2942
+ mtex2MML_free_string(s1);
2943
+ mtex2MML_free_string(row_data);
2944
+ }
2945
+ | BEGINENV ALIGNED ARRAYALIGN END tableRowList ENDENV ALIGNED {
2946
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2947
+
2948
+ char * s1 = mtex2MML_copy3("<mrow><mtable displaystyle=\"true\" align=\"", $3, "\" columnspacing=\"0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em\" columnalign=\"right left right left right left right left right left\" ");
2949
+ char * s2 = mtex2MML_copy3(s1, row_data, ">");
2950
+
2951
+ if (encase == TOPENCLOSE) {
2952
+ char *t = mtex2MML_copy3(s2, $5, "</mtable></mrow>");
2953
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2954
+ mtex2MML_free_string(t);
2955
+ }
2956
+ else
2957
+ $$ = mtex2MML_copy3(s2, $5, "</mtable></mrow>");
2958
+
2959
+ mtex2MML_free_string($3);
2960
+ mtex2MML_free_string($5);
2961
+ mtex2MML_free_string(s1);
2962
+ mtex2MML_free_string(s2);
2963
+ mtex2MML_free_string(row_data);
2964
+ }
2965
+ | BEGINENV ALIGNED tableRowList ENDENV ALIGNED {
2966
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2967
+
2968
+ char * s1 = mtex2MML_copy3("<mrow><mtable displaystyle=\"true\" columnspacing=\"0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em\" columnalign=\"right left right left right left right left right left\" ", row_data, ">");
2969
+
2970
+ if (encase == TOPENCLOSE) {
2971
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2972
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2973
+ mtex2MML_free_string(t);
2974
+ }
2975
+ else
2976
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2977
+
2978
+ mtex2MML_free_string($3);
2979
+ mtex2MML_free_string(s1);
2980
+ mtex2MML_free_string(row_data);
2981
+ }
2982
+ | BEGINENV ALIGNENV tableRowList ENDENV ALIGNENV {
2983
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
2984
+
2985
+ char * s1 = mtex2MML_copy3("<mrow><mtable displaystyle=\"true\" columnspacing=\"0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em\" columnalign=\"right left right left right left right left right left\" ", row_data, ">");
2986
+
2987
+ if (encase == TOPENCLOSE) {
2988
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2989
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
2990
+ mtex2MML_free_string(t);
2991
+ }
2992
+ else
2993
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
2994
+
2995
+ mtex2MML_free_string($3);
2996
+ mtex2MML_free_string(s1);
2997
+ mtex2MML_free_string(row_data);
2998
+ }
2999
+ | BEGINENV ALIGNENV_STAR tableRowList ENDENV ALIGNENV_STAR {
3000
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
3001
+
3002
+ char * s1 = mtex2MML_copy3("<mrow><mtable displaystyle=\"true\" columnspacing=\"0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em\" columnalign=\"right left right left right left right left right left\" ", row_data, ">");
3003
+
3004
+ if (encase == TOPENCLOSE) {
3005
+ char *t = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
3006
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
3007
+ mtex2MML_free_string(t);
3008
+ }
3009
+ else
3010
+ $$ = mtex2MML_copy3(s1, $3, "</mtable></mrow>");
3011
+
3012
+ mtex2MML_free_string($3);
3013
+ mtex2MML_free_string(s1);
3014
+ mtex2MML_free_string(row_data);
3015
+ }
3016
+ | BEGINENV ALIGNAT ALIGNATVALUE END tableRowList ENDENV ALIGNAT {
3017
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
3018
+
3019
+ char * s1 = mtex2MML_copy3("<mrow><mtable displaystyle=\"true\" columnalign=\"right left\" columnspacing=\"0em\" ", row_data, ">");
3020
+
3021
+ if (encase == TOPENCLOSE) {
3022
+ char *t = mtex2MML_copy3(s1, $5, "</mtable></mrow>");
3023
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
3024
+ mtex2MML_free_string(t);
3025
+ }
3026
+ else
3027
+ $$ = mtex2MML_copy3(s1, $5, "</mtable></mrow>");
3028
+
3029
+ mtex2MML_free_string($3);
3030
+ mtex2MML_free_string($5);
3031
+ mtex2MML_free_string(s1);
3032
+ mtex2MML_free_string(row_data);
3033
+ }
3034
+ | BEGINENV ALIGNAT_STAR ALIGNATVALUE END tableRowList ENDENV ALIGNAT_STAR {
3035
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
3036
+
3037
+ char * s1 = mtex2MML_copy3("<mrow><mtable displaystyle=\"true\" columnalign=\"right left\" columnspacing=\"0em\" ", row_data, ">");
3038
+
3039
+ if (encase == TOPENCLOSE) {
3040
+ char *t = mtex2MML_copy3(s1, $5, "</mtable></mrow>");
3041
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
3042
+ mtex2MML_free_string(t);
3043
+ }
3044
+ else
3045
+ $$ = mtex2MML_copy3(s1, $5, "</mtable></mrow>");
3046
+
3047
+ mtex2MML_free_string($3);
3048
+ mtex2MML_free_string($5);
3049
+ mtex2MML_free_string(s1);
3050
+ mtex2MML_free_string(row_data);
3051
+ }
3052
+ | BEGINENV ALIGNEDAT ALIGNATVALUE END tableRowList ENDENV ALIGNEDAT {
3053
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
3054
+
3055
+ char * s1 = mtex2MML_copy3("<mrow><mtable displaystyle=\"true\" columnalign=\"right left right left right left right left right left\" columnspacing=\"0em\" ", row_data, ">");
3056
+
3057
+ if (encase == TOPENCLOSE) {
3058
+ char *t = mtex2MML_copy3(s1, $5, "</mtable></mrow>");
3059
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
3060
+ mtex2MML_free_string(t);
3061
+ }
3062
+ else
3063
+ $$ = mtex2MML_copy3(s1, $5, "</mtable></mrow>");
3064
+
3065
+ mtex2MML_free_string($3);
3066
+ mtex2MML_free_string($5);
3067
+ mtex2MML_free_string(s1);
3068
+ mtex2MML_free_string(row_data);
3069
+ }
3070
+ | BEGINENV ARRAY ARRAYALIGN ST columnAlignList END tableRowList ENDENV ARRAY {
3071
+ char *pipe_chars = mtex2MML_vertical_pipe_extract($5);
3072
+ char *column_align = mtex2MML_remove_excess_pipe_chars($5);
3073
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
3074
+
3075
+ char * s1 = mtex2MML_copy3("<mtable displaystyle=\"false\" align=\"", $3, "\" ");
3076
+ char * s2 = mtex2MML_copy3(s1, row_data, " columnalign=\"");
3077
+ char * s3 = mtex2MML_copy3(s2, column_align, "\" ");
3078
+ char * s4 = mtex2MML_copy3(s3, pipe_chars, "\">");
3079
+
3080
+ if (encase == TOPENCLOSE) {
3081
+ char *t = mtex2MML_copy3(s4, $7, "</mtable>");
3082
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
3083
+ mtex2MML_free_string(t);
3084
+ }
3085
+ else
3086
+ $$ = mtex2MML_copy3(s4, $7, "</mtable>");
3087
+
3088
+ mtex2MML_free_string(s1);
3089
+ mtex2MML_free_string(s2);
3090
+ mtex2MML_free_string(s3);
3091
+ mtex2MML_free_string(s4);
3092
+ mtex2MML_free_string($3);
3093
+ mtex2MML_free_string($5);
3094
+ mtex2MML_free_string($7);
3095
+ mtex2MML_free_string(pipe_chars);
3096
+ mtex2MML_free_string(column_align);
3097
+ mtex2MML_free_string(row_data);
3098
+ }
3099
+ | BEGINENV ARRAY ST columnAlignList END tableRowList ENDENV ARRAY {
3100
+ char *pipe_chars = mtex2MML_vertical_pipe_extract($4);
3101
+ char *column_align = mtex2MML_remove_excess_pipe_chars($4);
3102
+ char *row_data = mtex2MML_combine_row_data(&environment_data_stack);
3103
+
3104
+ char * s1 = mtex2MML_copy3("<mtable displaystyle=\"false\" ", row_data, " columnalign=\"");
3105
+ char * s2 = mtex2MML_copy3(s1, column_align, "\" ");
3106
+ char * s3 = mtex2MML_copy3(s2, pipe_chars, "\">");
3107
+
3108
+ if (encase == TOPENCLOSE) {
3109
+ char *t = mtex2MML_copy3(s3, $6, "</mtable>");
3110
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
3111
+ mtex2MML_free_string(t);
3112
+ }
3113
+ else
3114
+ $$ = mtex2MML_copy3(s3, $6, "</mtable>");
3115
+
3116
+ mtex2MML_free_string(s1);
3117
+ mtex2MML_free_string(s2);
3118
+ mtex2MML_free_string(s3);
3119
+ mtex2MML_free_string($4);
3120
+ mtex2MML_free_string($6);
3121
+ mtex2MML_free_string(pipe_chars);
3122
+ mtex2MML_free_string(column_align);
3123
+ mtex2MML_free_string(row_data);
3124
+ }
3125
+ | BEGINENV SUBARRAY ST columnAlignList END tableRowList ENDENV SUBARRAY {
3126
+ char *pipe_chars = mtex2MML_vertical_pipe_extract($4);
3127
+ char *column_align = mtex2MML_remove_excess_pipe_chars($4);
3128
+
3129
+ char * s1 = mtex2MML_copy3("<mtable displaystyle=\"false\" columnspacing=\"0em 0em 0em 0em\" rowspacing=\"0.1em\" columnalign=\"", column_align, "\" ");
3130
+ char * s2 = mtex2MML_copy3(s1, pipe_chars, "\">");
3131
+
3132
+ if (encase == TOPENCLOSE) {
3133
+ char *t = mtex2MML_copy3(s2, $6, "</mtable>");
3134
+ $$ = mtex2MML_copy3("<menclose notation=\"top\">", t, "</menclose>");
3135
+ mtex2MML_free_string(t);
3136
+ }
3137
+ else
3138
+ $$ = mtex2MML_copy3(s2, $6, "</mtable>");
3139
+
3140
+ mtex2MML_free_string(s1);
3141
+ mtex2MML_free_string(s2);
3142
+ mtex2MML_free_string($4);
3143
+ mtex2MML_free_string($6);
3144
+ mtex2MML_free_string(pipe_chars);
3145
+ mtex2MML_free_string(column_align);
3146
+ }
3147
+ | BEGINENV SVG XMLSTRING ENDSVG {
3148
+ $$ = mtex2MML_copy3("<semantics><annotation-xml encoding=\"SVG1.1\">", $3, "</annotation-xml></semantics>");
3149
+ mtex2MML_free_string($3);
3150
+ }
3151
+ | BEGINENV SVG ENDSVG {
3152
+ $$ = mtex2MML_copy_string(" ");
3153
+ };
3154
+
3155
+ columnAlignList: columnAlignList COLUMNALIGN {
3156
+ $$ = mtex2MML_copy3($1, " ", $2);
3157
+ mtex2MML_free_string($1);
3158
+ mtex2MML_free_string($2);
3159
+ }
3160
+ | COLUMNALIGN {
3161
+ $$ = mtex2MML_copy_string($1);
3162
+ mtex2MML_free_string($1);
3163
+ };
3164
+
3165
+ substack: SUBSTACK MROWOPEN tableRowList MROWCLOSE {
3166
+ $$ = mtex2MML_copy3("<mrow><mtable columnalign=\"center\" rowspacing=\"0.5ex\">", $3, "</mtable></mrow>");
3167
+ mtex2MML_free_string($3);
3168
+ };
3169
+
3170
+ sideset: SIDESET MROWOPEN SUB closedTerm SUP closedTerm MROWCLOSE MROWOPEN SUB closedTerm SUP closedTerm MROWCLOSE closedTerm {
3171
+ char *s1 = mtex2MML_copy2("<msubsup><mphantom>", "</mphantom><mrow>");
3172
+ char *s2 = mtex2MML_copy3(s1, $4, "</mrow>");
3173
+ char *s3 = mtex2MML_copy3(s2, $6, "</msubsup><mspace width=\"negativethinmathspace\" /><msubsup><mrow>");
3174
+ char *s4 = mtex2MML_copy3(s3, $14, "</mrow>");
3175
+ char *s5 = mtex2MML_copy3(s4, $10, $12);
3176
+ $$ = mtex2MML_copy2(s5, "</msubsup>");
3177
+
3178
+ mtex2MML_free_string(s1);
3179
+ mtex2MML_free_string(s2);
3180
+ mtex2MML_free_string(s3);
3181
+ mtex2MML_free_string(s4);
3182
+ mtex2MML_free_string(s5);
3183
+ mtex2MML_free_string($4);
3184
+ mtex2MML_free_string($6);
3185
+ mtex2MML_free_string($10);
3186
+ mtex2MML_free_string($12);
3187
+ mtex2MML_free_string($14);
3188
+ };
3189
+
3190
+ array: ARRAY MROWOPEN tableRowList MROWCLOSE {
3191
+ $$ = mtex2MML_copy3("<mrow><mtable>", $3, "</mtable></mrow>");
3192
+ mtex2MML_free_string($3);
3193
+ }
3194
+ | ARRAY MROWOPEN ARRAYOPTS MROWOPEN arrayopts MROWCLOSE tableRowList MROWCLOSE {
3195
+ char * s1 = mtex2MML_copy3("<mrow><mtable ", $5, ">");
3196
+ $$ = mtex2MML_copy3(s1, $7, "</mtable></mrow>");
3197
+ mtex2MML_free_string(s1);
3198
+ mtex2MML_free_string($5);
3199
+ mtex2MML_free_string($7);
3200
+ };
3201
+
3202
+ cases: CASES MROWOPEN tableRowList MROWCLOSE {
3203
+ $$ = mtex2MML_copy3("<mrow><mo>{</mo><mrow><mtable displaystyle=\"false\" columnalign=\"left left\">", $3, "</mtable></mrow></mrow>");
3204
+ mtex2MML_free_string($3);
3205
+ };
3206
+
3207
+ eqalign: EQALIGN MROWOPEN tableRowList MROWCLOSE {
3208
+ $$ = mtex2MML_copy3("<mtable columnalign=\"right left\" rowspacing=\".5em\" columnspacing=\"thickmathspace\" displaystyle=\"true\">", $3, "</mtable></mrow></mrow>");
3209
+ mtex2MML_free_string($3);
3210
+ };
3211
+
3212
+ eqalignno: EQALIGNNO MROWOPEN tableRowList MROWCLOSE {
3213
+ $$ = mtex2MML_copy3("<mtable columnalign=\"right left right\" rowspacing=\".5em\" columnspacing=\"thickmathspace 3em\" displaystyle=\"true\">", $3, "</mtable></mrow></mrow>");
3214
+ mtex2MML_free_string($3);
3215
+ };
3216
+
3217
+ arrayopts: anarrayopt {
3218
+ $$ = mtex2MML_copy_string($1);
3219
+ mtex2MML_free_string($1);
3220
+ }
3221
+ | arrayopts anarrayopt {
3222
+ $$ = mtex2MML_copy3($1, " ", $2);
3223
+ mtex2MML_free_string($1);
3224
+ mtex2MML_free_string($2);
3225
+ };
3226
+
3227
+ anarrayopt: collayout {
3228
+ $$ = mtex2MML_copy_string($1);
3229
+ mtex2MML_free_string($1);
3230
+ }
3231
+ | colalign {
3232
+ $$ = mtex2MML_copy_string($1);
3233
+ mtex2MML_free_string($1);
3234
+ }
3235
+ | rowalign {
3236
+ $$ = mtex2MML_copy_string($1);
3237
+ mtex2MML_free_string($1);
3238
+ }
3239
+ | align {
3240
+ $$ = mtex2MML_copy_string($1);
3241
+ mtex2MML_free_string($1);
3242
+ }
3243
+ | eqrows {
3244
+ $$ = mtex2MML_copy_string($1);
3245
+ mtex2MML_free_string($1);
3246
+ }
3247
+ | eqcols {
3248
+ $$ = mtex2MML_copy_string($1);
3249
+ mtex2MML_free_string($1);
3250
+ }
3251
+ | rowlines {
3252
+ $$ = mtex2MML_copy_string($1);
3253
+ mtex2MML_free_string($1);
3254
+ }
3255
+ | collines {
3256
+ $$ = mtex2MML_copy_string($1);
3257
+ mtex2MML_free_string($1);
3258
+ }
3259
+ | frame {
3260
+ $$ = mtex2MML_copy_string($1);
3261
+ mtex2MML_free_string($1);
3262
+ }
3263
+ | padding {
3264
+ $$ = mtex2MML_copy_string($1);
3265
+ mtex2MML_free_string($1);
3266
+ };
3267
+
3268
+ collayout: COLLAYOUT ATTRLIST {
3269
+ $$ = mtex2MML_copy2("columnalign=", $2);
3270
+ mtex2MML_free_string($2);
3271
+ };
3272
+
3273
+ colalign: COLALIGN ATTRLIST {
3274
+ $$ = mtex2MML_copy2("columnalign=", $2);
3275
+ mtex2MML_free_string($2);
3276
+ };
3277
+
3278
+ rowalign: ROWALIGN ATTRLIST {
3279
+ $$ = mtex2MML_copy2("rowalign=", $2);
3280
+ mtex2MML_free_string($2);
3281
+ };
3282
+
3283
+ align: ALIGN ATTRLIST {
3284
+ $$ = mtex2MML_copy2("align=", $2);
3285
+ mtex2MML_free_string($2);
3286
+ };
3287
+
3288
+ eqrows: EQROWS ATTRLIST {
3289
+ $$ = mtex2MML_copy2("equalrows=", $2);
3290
+ mtex2MML_free_string($2);
3291
+ };
3292
+
3293
+ eqcols: EQCOLS ATTRLIST {
3294
+ $$ = mtex2MML_copy2("equalcolumns=", $2);
3295
+ mtex2MML_free_string($2);
3296
+ };
3297
+
3298
+ rowlines: ROWLINES ATTRLIST {
3299
+ $$ = mtex2MML_copy2("rowlines=", $2);
3300
+ mtex2MML_free_string($2);
3301
+ };
3302
+
3303
+ collines: COLLINES ATTRLIST {
3304
+ $$ = mtex2MML_copy2("columnlines=", $2);
3305
+ mtex2MML_free_string($2);
3306
+ };
3307
+
3308
+ frame: FRAME ATTRLIST {
3309
+ $$ = mtex2MML_copy2("frame=", $2);
3310
+ mtex2MML_free_string($2);
3311
+ };
3312
+
3313
+ padding: PADDING ATTRLIST {
3314
+ char * s1 = mtex2MML_copy3("rowspacing=", $2, " columnspacing=");
3315
+ $$ = mtex2MML_copy2(s1, $2);
3316
+ mtex2MML_free_string(s1);
3317
+ mtex2MML_free_string($2);
3318
+ };
3319
+
3320
+ tableRowList: tableRow {
3321
+ $$ = mtex2MML_copy_string($1);
3322
+ mtex2MML_free_string($1);
3323
+ }
3324
+ | tableRowList ROWSEP tableRow {
3325
+ $$ = mtex2MML_copy3($1, " ", $3);
3326
+ mtex2MML_free_string($1);
3327
+ mtex2MML_free_string($3);
3328
+ };
3329
+
3330
+ tableRow: simpleTableRow {
3331
+ int has_eqn_number = mtex2MML_fetch_eqn_number(&environment_data_stack);
3332
+
3333
+ if (has_eqn_number && strcmp($1, "<mtd/>") != 0) {
3334
+ char * n = mtex2MML_global_label();
3335
+
3336
+ char *s1 = mtex2MML_copy3("<mlabeledtr>", n, $1);
3337
+ $$ = mtex2MML_copy2(s1, "</mlabeledtr>");
3338
+
3339
+ mtex2MML_free_string(n);
3340
+ mtex2MML_free_string(s1);
3341
+ }
3342
+ else {
3343
+ $$ = mtex2MML_copy3("<mtr>", $1, "</mtr>");
3344
+ }
3345
+
3346
+ mtex2MML_free_string($1);
3347
+ }
3348
+ | optsTableRow {
3349
+ $$ = mtex2MML_copy_string($1);
3350
+ mtex2MML_free_string($1);
3351
+ };
3352
+
3353
+ simpleTableRow: tableCell {
3354
+ $$ = mtex2MML_copy_string($1);
3355
+ mtex2MML_free_string($1);
3356
+ }
3357
+ | simpleTableRow COLSEP tableCell {
3358
+ $$ = mtex2MML_copy3($1, " ", $3);
3359
+ mtex2MML_free_string($1);
3360
+ mtex2MML_free_string($3);
3361
+ };
3362
+
3363
+ optsTableRow: ROWOPTS MROWOPEN rowopts MROWCLOSE simpleTableRow {
3364
+ char * s1 = mtex2MML_copy3("<mtr ", $3, ">");
3365
+ $$ = mtex2MML_copy3(s1, $5, "</mtr>");
3366
+ mtex2MML_free_string(s1);
3367
+ mtex2MML_free_string($3);
3368
+ mtex2MML_free_string($5);
3369
+ };
3370
+
3371
+ rowopts: arowopt {
3372
+ $$ = mtex2MML_copy_string($1);
3373
+ mtex2MML_free_string($1);
3374
+ }
3375
+ | rowopts arowopt {
3376
+ $$ = mtex2MML_copy3($1, " ", $2);
3377
+ mtex2MML_free_string($1);
3378
+ mtex2MML_free_string($2);
3379
+ };
3380
+
3381
+ arowopt: colalign {
3382
+ $$ = mtex2MML_copy_string($1);
3383
+ mtex2MML_free_string($1);
3384
+ }
3385
+ | rowalign {
3386
+ $$ = mtex2MML_copy_string($1);
3387
+ mtex2MML_free_string($1);
3388
+ };
3389
+
3390
+ newline: NEWLINE {
3391
+ $$ = mtex2MML_copy_string("<mspace linebreak=\"newline\" />");
3392
+ }
3393
+
3394
+ tableCell: {
3395
+ $$ = mtex2MML_copy_string("<mtd></mtd>");
3396
+ }
3397
+ | compoundTermList {
3398
+ if (mtex2MML_current_env_type(&environment_data_stack) != ENV_MULTLINE && mtex2MML_current_env_type(&environment_data_stack) != ENV_MULTLINESTAR) {
3399
+ if (mtex2MML_current_env_type(&environment_data_stack) == ENV_ALIGNAT || mtex2MML_current_env_type(&environment_data_stack) == ENV_ALIGNATSTAR) {
3400
+ $$ = mtex2MML_copy3("<mtd><mi></mi>", $1, "</mtd>");
3401
+ }
3402
+ else {
3403
+ $$ = mtex2MML_copy3("<mtd>", $1, "</mtd>");
3404
+ }
3405
+ }
3406
+ else {
3407
+ int total_lines = mtex2MML_current_env_line_count(&environment_data_stack);
3408
+ if (line_counter == 1) {
3409
+ $$ = mtex2MML_copy3("<mtd columnalign=\"left\">", $1, "</mtd>");
3410
+ line_counter++;
3411
+ }
3412
+ else if (line_counter == total_lines) {
3413
+ $$ = mtex2MML_copy3("<mtd columnalign=\"right\">", $1, "</mtd>");
3414
+ }
3415
+ else {
3416
+ $$ = mtex2MML_copy3("<mtd columnalign=\"center\">", $1, "</mtd>");
3417
+ line_counter++;
3418
+ }
3419
+ }
3420
+
3421
+ mtex2MML_free_string($1);
3422
+ }
3423
+ | CELLOPTS MROWOPEN cellopts MROWCLOSE compoundTermList {
3424
+ char * s1 = mtex2MML_copy3("<mtd ", $3, ">");
3425
+ $$ = mtex2MML_copy3(s1, $5, "</mtd>");
3426
+ mtex2MML_free_string(s1);
3427
+ mtex2MML_free_string($3);
3428
+ mtex2MML_free_string($5);
3429
+ };
3430
+
3431
+ cellopts: acellopt {
3432
+ $$ = mtex2MML_copy_string($1);
3433
+ mtex2MML_free_string($1);
3434
+ }
3435
+ | cellopts acellopt {
3436
+ $$ = mtex2MML_copy3($1, " ", $2);
3437
+ mtex2MML_free_string($1);
3438
+ mtex2MML_free_string($2);
3439
+ };
3440
+
3441
+ acellopt: colalign {
3442
+ $$ = mtex2MML_copy_string($1);
3443
+ mtex2MML_free_string($1);
3444
+ }
3445
+ | rowalign {
3446
+ $$ = mtex2MML_copy_string($1);
3447
+ mtex2MML_free_string($1);
3448
+ }
3449
+ | rowspan {
3450
+ $$ = mtex2MML_copy_string($1);
3451
+ mtex2MML_free_string($1);
3452
+ }
3453
+ | colspan {
3454
+ $$ = mtex2MML_copy_string($1);
3455
+ mtex2MML_free_string($1);
3456
+ };
3457
+
3458
+ rowspan: ROWSPAN ATTRLIST {
3459
+ $$ = mtex2MML_copy2("rowspan=", $2);
3460
+ mtex2MML_free_string($2);
3461
+ };
3462
+
3463
+ colspan: COLSPAN ATTRLIST {
3464
+ $$ = mtex2MML_copy2("columnspan=", $2);
3465
+ mtex2MML_free_string($2);
3466
+ };
3467
+
3468
+ %%
3469
+
3470
+ /* see http://git.io/vk8Sz */
3471
+ void envdata_copy(void *_dst, const void *_src)
3472
+ {
3473
+ envdata_t *dst = (envdata_t*)_dst, *src = (envdata_t*)_src;
3474
+ dst->rowspacing = src->rowspacing ? string_dup(src->rowspacing) : NULL;
3475
+ dst->rowlines = src->rowlines ? string_dup(src->rowlines) : NULL;
3476
+ dst->environment_type = src->environment_type;
3477
+ utarray_new(dst->eqn_numbers, &ut_int_icd);
3478
+ utarray_concat(dst->eqn_numbers, src->eqn_numbers);
3479
+ dst->line_count = src->line_count;
3480
+ }
3481
+
3482
+ void envdata_dtor(void *_elt)
3483
+ {
3484
+ envdata_t *elt = (envdata_t*)_elt;
3485
+ if (elt->rowspacing) { free(elt->rowspacing); }
3486
+ if (elt->rowlines) { free(elt->rowlines); }
3487
+ if (elt->eqn_numbers) { utarray_free(elt->eqn_numbers); }
3488
+ }
3489
+
3490
+ UT_icd envdata_icd = {sizeof(envdata_t), NULL, envdata_copy, envdata_dtor};
3491
+
3492
+ void format_additions(const char *buffer, const int options)
3493
+ {
3494
+ utarray_new(environment_data_stack, &envdata_icd);
3495
+
3496
+ if (colors == NULL)
3497
+ mtex2MML_create_css_colors(&colors);
3498
+
3499
+ if (options)
3500
+ delimiter_options = options;
3501
+ else
3502
+ delimiter_options = MTEX2MML_DELIMITER_DEFAULT;
3503
+
3504
+ encaseType *encase_pointer = (encaseType *)NONE;
3505
+ line_counter = 1;
3506
+ mtex2MML_env_replacements(&environment_data_stack, &encase_pointer, buffer);
3507
+ encase = (encaseType) encase_pointer;
3508
+ }
3509
+
3510
+ void free_additions(void)
3511
+ {
3512
+ utarray_free(environment_data_stack);
3513
+
3514
+ struct css_colors *c = NULL, *tmp;
3515
+
3516
+ HASH_ITER(hh, colors, c, tmp) {
3517
+ HASH_DEL(colors, c);
3518
+ free(c);
3519
+ }
3520
+ }
3521
+
3522
+ char * mtex2MML_global_parse (const char * buffer, unsigned long length, const int options, const int global_start)
3523
+ {
3524
+ global_label = global_start;
3525
+ return mtex2MML_parse(buffer, length, options);
3526
+ }
3527
+
3528
+ char * mtex2MML_parse (const char * buffer, unsigned long length, const int options)
3529
+ {
3530
+ char * mathml = 0;
3531
+
3532
+ int result;
3533
+
3534
+ format_additions(buffer, options);
3535
+
3536
+ mtex2MML_setup (buffer, length);
3537
+ mtex2MML_restart ();
3538
+
3539
+ result = mtex2MML_yyparse (&mathml);
3540
+
3541
+ free_additions();
3542
+
3543
+ /* See Bison documentation/maliciousness test: http://bit.ly/1IbpOja
3544
+ 1 if parse error, 2 if memory exhuastion, etc. */
3545
+ if (result > 0) {
3546
+ if (mathml) {
3547
+ mtex2MML_free_string (mathml);
3548
+ mathml = 0;
3549
+ }
3550
+ return NULL;
3551
+ }
3552
+
3553
+ return mathml;
3554
+ }
3555
+
3556
+ UT_array ** mtex2MML_get_environment_data_stack(void)
3557
+ {
3558
+ return &environment_data_stack;
3559
+ }
3560
+
3561
+ int mtex2MML_filter (const char * buffer, unsigned long length, const int options)
3562
+ {
3563
+ return mtex2MML_do_filter (buffer, length, 0, 0, options);
3564
+ }
3565
+
3566
+ int mtex2MML_text_filter (const char * buffer, unsigned long length, const int options)
3567
+ {
3568
+ return mtex2MML_do_filter (buffer, length, 0, 1, options);
3569
+ }
3570
+
3571
+ int mtex2MML_strict_filter (const char * buffer, unsigned long length, const int options)
3572
+ {
3573
+ return mtex2MML_do_filter (buffer, length, 1, 1, options);
3574
+ }
3575
+
3576
+ static char * mtex2MML_last_error = 0;
3577
+
3578
+ static void mtex2MML_keep_error (const char * msg)
3579
+ {
3580
+ if (mtex2MML_last_error) {
3581
+ mtex2MML_free_string (mtex2MML_last_error);
3582
+ mtex2MML_last_error = 0;
3583
+ }
3584
+ mtex2MML_last_error = mtex2MML_copy_escaped (msg);
3585
+ }
3586
+
3587
+ int mtex2MML_delimiter_type(const int type)
3588
+ {
3589
+ if (delimiter_options == MTEX2MML_DELIMITER_DEFAULT) {
3590
+ return type & (MTEX2MML_DELIMITER_DOLLAR | MTEX2MML_DELIMITER_DOUBLE);
3591
+ } else {
3592
+ return delimiter_options & type;
3593
+ }
3594
+ }
3595
+
3596
+ int mtex2MML_do_filter (const char * buffer, unsigned long length, const int forbid_markup, const int write, const int options)
3597
+ {
3598
+ global_label = 1;
3599
+
3600
+ format_additions(buffer, options);
3601
+
3602
+ int result = 0;
3603
+ int type = 0;
3604
+ int skip = 0;
3605
+ int match = 0;
3606
+
3607
+ const char * ptr1 = buffer;
3608
+ const char * ptr2 = 0;
3609
+
3610
+ const char * end = buffer + length;
3611
+
3612
+ char * mathml = 0;
3613
+
3614
+ void (*save_error_fn) (const char * msg) = mtex2MML_error;
3615
+
3616
+ mtex2MML_error = mtex2MML_keep_error;
3617
+
3618
+ _until_math:
3619
+ ptr2 = ptr1;
3620
+
3621
+ /* Search for the first math part */
3622
+ while (ptr2 < end) {
3623
+ if (*ptr2 == '$' && (mtex2MML_delimiter_type(MTEX2MML_DELIMITER_DOLLAR) || mtex2MML_delimiter_type(MTEX2MML_DELIMITER_DOUBLE))) { break; }
3624
+ if ((*ptr2 == '\\') && (ptr2 + 5 < end) && mtex2MML_delimiter_type(MTEX2MML_DELIMITER_ENVIRONMENTS)) {
3625
+ if (*(ptr2+1) == 'b' && *(ptr2+2) == 'e' && *(ptr2+3) == 'g' && *(ptr2+4) == 'i' && *(ptr2+5) == 'n') {
3626
+ break;
3627
+ }
3628
+ }
3629
+ if ((*ptr2 == '\\') && (ptr2 + 1 < end)) {
3630
+ if (*(ptr2+1) == '[' && mtex2MML_delimiter_type(MTEX2MML_DELIMITER_BRACKETS)) { break; }
3631
+ if (*(ptr2+1) == '(' && mtex2MML_delimiter_type(MTEX2MML_DELIMITER_PARENS)) { break; }
3632
+ if (*(ptr2+1) == '$' && mtex2MML_delimiter_type(MTEX2MML_DELIMITER_DOLLAR)) { ptr2++; }
3633
+ }
3634
+ ++ptr2;
3635
+ }
3636
+ if (mtex2MML_write && ptr2 > ptr1 && write) {
3637
+ (*mtex2MML_write) (ptr1, ptr2 - ptr1);
3638
+ }
3639
+
3640
+ if (ptr2 == end) { goto _finish; }
3641
+
3642
+ /*_until_html:*/
3643
+ ptr1 = ptr2;
3644
+
3645
+ if (ptr2 + 5 < end && (*ptr2 == '\\') && (*(ptr2+1) == 'b') && (*(ptr2+2) == 'e') && (*(ptr2+3) == 'g') && (*(ptr2+4) == 'i') && (*(ptr2+5) == 'n') && mtex2MML_delimiter_type(MTEX2MML_DELIMITER_ENVIRONMENTS)) {
3646
+ type = MTEX2MML_DELIMITER_ENVIRONMENTS;
3647
+ ptr2 += 6;
3648
+ }
3649
+ else if (ptr2 + 1 < end) {
3650
+ if ((*ptr2 == '\\') && (*(ptr2+1) == '[' && *(ptr2 - 1) != '\\') && mtex2MML_delimiter_type(MTEX2MML_DELIMITER_BRACKETS)) {
3651
+ type = MTEX2MML_DELIMITER_BRACKETS;
3652
+ ptr2 += 2;
3653
+ } else if ((*ptr2 == '$') && (*(ptr2+1) == '$') && mtex2MML_delimiter_type(MTEX2MML_DELIMITER_DOUBLE)) {
3654
+ type = MTEX2MML_DELIMITER_DOUBLE;
3655
+ ptr2 += 2;
3656
+ } else if ((*ptr2 == '\\') && (*(ptr2+1) == '(' && *(ptr2 - 1) != '\\') && mtex2MML_delimiter_type(MTEX2MML_DELIMITER_PARENS)) {
3657
+ type = MTEX2MML_DELIMITER_PARENS;
3658
+ ptr2 += 2;
3659
+ } else if ((*ptr2 == '$') && !isspace(*(ptr2+1)) && mtex2MML_delimiter_type(MTEX2MML_DELIMITER_DOLLAR)) {
3660
+ type = MTEX2MML_DELIMITER_DOLLAR;
3661
+ ptr2++;
3662
+ }
3663
+ } else { goto _finish; }
3664
+
3665
+ skip = 0;
3666
+ match = 0;
3667
+
3668
+ while (ptr2 < end) {
3669
+ switch (*ptr2) {
3670
+ case '<':
3671
+ case '>':
3672
+ if (forbid_markup == 1) { skip = 1; }
3673
+ break;
3674
+
3675
+ case '\\':
3676
+ if (ptr2 + 1 < end) {
3677
+ if (*(ptr2 + 1) == '[' && type == MTEX2MML_DELIMITER_BRACKETS) {
3678
+ skip = 1;
3679
+ } else if (*(ptr2 + 1) == ']') {
3680
+ if (type == MTEX2MML_DELIMITER_BRACKETS) {
3681
+ ptr2 += 2;
3682
+ match = 1;
3683
+ } else {
3684
+ skip = 1;
3685
+ }
3686
+ } else if (*(ptr2 + 1) == '(' && type == MTEX2MML_DELIMITER_PARENS) {
3687
+ skip = 1;
3688
+ } else if (*(ptr2 + 1) == ')') {
3689
+ if (type == MTEX2MML_DELIMITER_PARENS) {
3690
+ ptr2 += 2;
3691
+ match = 1;
3692
+ } else {
3693
+ skip = 1;
3694
+ }
3695
+ }
3696
+ else if (ptr2 + 3 < end && type == MTEX2MML_DELIMITER_ENVIRONMENTS) {
3697
+ if (*(ptr2 + 1) == 'e' && *(ptr2 + 2) == 'n' && *(ptr2 + 3) == 'd') {
3698
+ ptr2 += 3;
3699
+ // {env} can be many things, so consider it closed when we find the first } after \end
3700
+ while (ptr2 < end && *ptr2 != '}') { ptr2++; }
3701
+ ptr2++; // include final }
3702
+ match = 1;
3703
+ }
3704
+ } else {
3705
+ ptr2++;
3706
+ }
3707
+ }
3708
+ break;
3709
+
3710
+ case '\n':
3711
+ /* we hit a newline in an unclosed inline equation -- skip this string */
3712
+ if (type == MTEX2MML_DELIMITER_DOLLAR || type == MTEX2MML_DELIMITER_PARENS) {
3713
+ skip = 1;
3714
+ }
3715
+ break;
3716
+
3717
+ case '$':
3718
+ if (type == MTEX2MML_DELIMITER_BRACKETS || type == MTEX2MML_DELIMITER_PARENS || type == MTEX2MML_DELIMITER_ENVIRONMENTS) {
3719
+ // no op
3720
+ } else if (ptr2 + 1 < end) {
3721
+ if (*(ptr2 + 1) == '$') {
3722
+ if (type == MTEX2MML_DELIMITER_DOLLAR) {
3723
+ ptr2++;
3724
+ match = 1;
3725
+ } else {
3726
+ ptr2 += 2;
3727
+ match = 1;
3728
+ }
3729
+ } else {
3730
+ if (type == MTEX2MML_DELIMITER_DOLLAR) {
3731
+ if (isspace(*(ptr2 - 1))) {
3732
+ skip = 1;
3733
+ } else if (isdigit(*(ptr2 + 1))) {
3734
+ if (write) {
3735
+ (*mtex2MML_write) (ptr1, ptr2 - ptr1 + 2);
3736
+ }
3737
+ skip = 1;
3738
+ ptr2 += 2;
3739
+ ptr1 = ptr2;
3740
+ } else {
3741
+ ptr2++;
3742
+ match = 1;
3743
+ }
3744
+ } else {
3745
+ if (*(ptr2 - 1) != '\\') {
3746
+ skip = 1;
3747
+ }
3748
+ }
3749
+ }
3750
+ } else {
3751
+ if (type == MTEX2MML_DELIMITER_DOLLAR) {
3752
+ ptr2++;
3753
+ match = 1;
3754
+ } else {
3755
+ skip = 1;
3756
+ }
3757
+ }
3758
+ break;
3759
+
3760
+ default:
3761
+ break;
3762
+ }
3763
+ if (skip || match) { break; }
3764
+
3765
+ ++ptr2;
3766
+ }
3767
+ if (skip) {
3768
+ if (type == MTEX2MML_DELIMITER_DOLLAR) {
3769
+ if (mtex2MML_write && write) {
3770
+ (*mtex2MML_write) (ptr1, 1);
3771
+ }
3772
+ ptr1++;
3773
+ } else {
3774
+ if (mtex2MML_write && write) {
3775
+ (*mtex2MML_write) (ptr1, 2);
3776
+ }
3777
+ ptr1 += 2;
3778
+ }
3779
+ goto _until_math;
3780
+ }
3781
+ if (match) {
3782
+ mtex2MML_setup (ptr1, ptr2 - ptr1);
3783
+ mtex2MML_restart ();
3784
+
3785
+ mtex2MML_yyparse (&mathml);
3786
+
3787
+ if (mathml) {
3788
+ if (mtex2MML_write_mathml) {
3789
+ (*mtex2MML_write_mathml) (mathml);
3790
+ }
3791
+ mtex2MML_free_string (mathml);
3792
+ mathml = 0;
3793
+ } else {
3794
+ ++result;
3795
+ if (mtex2MML_write && write) {
3796
+ /* A problematic error? Just leave the text alone. */
3797
+ (*mtex2MML_write) (ptr1, ptr2 - ptr1);
3798
+ }
3799
+ }
3800
+ ptr1 = ptr2;
3801
+
3802
+ goto _until_math;
3803
+ }
3804
+ if (mtex2MML_write) {
3805
+ (*mtex2MML_write) (ptr1, ptr2 - ptr1);
3806
+ }
3807
+
3808
+ _finish:
3809
+ if (mtex2MML_last_error) {
3810
+ mtex2MML_free_string (mtex2MML_last_error);
3811
+ mtex2MML_last_error = 0;
3812
+ }
3813
+ mtex2MML_error = save_error_fn;
3814
+
3815
+ free_additions();
3816
+ return result;
3817
+ }