@simonklee/opentui-tex-native-source 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (529) hide show
  1. package/LICENSE +674 -0
  2. package/LICENSE-PROJECT +21 -0
  3. package/README.md +7 -0
  4. package/build.zig +112 -0
  5. package/build.zig.zon +12 -0
  6. package/native/lib.zig +280 -0
  7. package/native/nanosvg.c +4 -0
  8. package/native/vendor/.bootstrap-v5 +1 -0
  9. package/native/vendor/LICENSE-NANOSVG +18 -0
  10. package/native/vendor/microtex/.clang-format +26 -0
  11. package/native/vendor/microtex/.github/workflows/ubuntu.yml +92 -0
  12. package/native/vendor/microtex/.github/workflows/windows-gdi.yml +34 -0
  13. package/native/vendor/microtex/.github/workflows/windows-qt.yml +52 -0
  14. package/native/vendor/microtex/CMakeLists.txt +110 -0
  15. package/native/vendor/microtex/LICENSE +21 -0
  16. package/native/vendor/microtex/MicroTeXInstall.cmake +42 -0
  17. package/native/vendor/microtex/README.md +600 -0
  18. package/native/vendor/microtex/build.zig +209 -0
  19. package/native/vendor/microtex/clatexmath.wrap +6 -0
  20. package/native/vendor/microtex/doc/meson.build +38 -0
  21. package/native/vendor/microtex/doc/microtex-doc.toml.in +47 -0
  22. package/native/vendor/microtex/doc/microtex.svg +39 -0
  23. package/native/vendor/microtex/doc/urlmap.js +6 -0
  24. package/native/vendor/microtex/example/gtk/CMakeLists.txt +68 -0
  25. package/native/vendor/microtex/example/gtk/gtk_main.c +170 -0
  26. package/native/vendor/microtex/example/gtk/isamples.cpp +21 -0
  27. package/native/vendor/microtex/example/gtk/isamples.h +15 -0
  28. package/native/vendor/microtex/example/gtk/meson.build +27 -0
  29. package/native/vendor/microtex/example/gtk/microtex-gtk.gresource.xml +6 -0
  30. package/native/vendor/microtex/example/gtk/microtex-gtk.ui +117 -0
  31. package/native/vendor/microtex/example/gtkmm/CMakeLists.txt +19 -0
  32. package/native/vendor/microtex/example/gtkmm/gtkmm_main.cpp +531 -0
  33. package/native/vendor/microtex/example/gtkmm/meson.build +19 -0
  34. package/native/vendor/microtex/example/memcheck/CMakeLists.txt +12 -0
  35. package/native/vendor/microtex/example/memcheck/mem_check_main.cpp +154 -0
  36. package/native/vendor/microtex/example/qt/CMakeLists.txt +37 -0
  37. package/native/vendor/microtex/example/qt/meson.build +25 -0
  38. package/native/vendor/microtex/example/qt/qt_main.cpp +70 -0
  39. package/native/vendor/microtex/example/qt/qt_mainwindow.cpp +107 -0
  40. package/native/vendor/microtex/example/qt/qt_mainwindow.h +40 -0
  41. package/native/vendor/microtex/example/qt/qt_skiatexwidget.cpp +149 -0
  42. package/native/vendor/microtex/example/qt/qt_skiatexwidget.h +48 -0
  43. package/native/vendor/microtex/example/qt/qt_tex_render.h +15 -0
  44. package/native/vendor/microtex/example/qt/qt_texqmlitem.cpp +56 -0
  45. package/native/vendor/microtex/example/qt/qt_texqmlitem.h +31 -0
  46. package/native/vendor/microtex/example/qt/qt_texwidget.cpp +62 -0
  47. package/native/vendor/microtex/example/qt/qt_texwidget.h +31 -0
  48. package/native/vendor/microtex/example/qtpng/CMakeLists.txt +11 -0
  49. package/native/vendor/microtex/example/qtpng/latex2png.cpp +115 -0
  50. package/native/vendor/microtex/example/samples/samples.cpp +52 -0
  51. package/native/vendor/microtex/example/samples/samples.h +32 -0
  52. package/native/vendor/microtex/example/win32/CMakeLists.txt +15 -0
  53. package/native/vendor/microtex/example/win32/meson.build +18 -0
  54. package/native/vendor/microtex/example/win32/win32_main.cpp +375 -0
  55. package/native/vendor/microtex/githooks/pre-commit +19 -0
  56. package/native/vendor/microtex/githooks/pre-push +103 -0
  57. package/native/vendor/microtex/lib/CMakeLists.txt +234 -0
  58. package/native/vendor/microtex/lib/atom/atom.cpp +14 -0
  59. package/native/vendor/microtex/lib/atom/atom.h +96 -0
  60. package/native/vendor/microtex/lib/atom/atom_accent.cpp +115 -0
  61. package/native/vendor/microtex/lib/atom/atom_accent.h +53 -0
  62. package/native/vendor/microtex/lib/atom/atom_basic.cpp +146 -0
  63. package/native/vendor/microtex/lib/atom/atom_basic.h +273 -0
  64. package/native/vendor/microtex/lib/atom/atom_box.cpp +41 -0
  65. package/native/vendor/microtex/lib/atom/atom_box.h +70 -0
  66. package/native/vendor/microtex/lib/atom/atom_char.cpp +99 -0
  67. package/native/vendor/microtex/lib/atom/atom_char.h +147 -0
  68. package/native/vendor/microtex/lib/atom/atom_delim.cpp +65 -0
  69. package/native/vendor/microtex/lib/atom/atom_delim.h +58 -0
  70. package/native/vendor/microtex/lib/atom/atom_fence.cpp +65 -0
  71. package/native/vendor/microtex/lib/atom/atom_fence.h +56 -0
  72. package/native/vendor/microtex/lib/atom/atom_font.cpp +20 -0
  73. package/native/vendor/microtex/lib/atom/atom_font.h +49 -0
  74. package/native/vendor/microtex/lib/atom/atom_frac.cpp +101 -0
  75. package/native/vendor/microtex/lib/atom/atom_frac.h +42 -0
  76. package/native/vendor/microtex/lib/atom/atom_matrix.cpp +756 -0
  77. package/native/vendor/microtex/lib/atom/atom_matrix.h +268 -0
  78. package/native/vendor/microtex/lib/atom/atom_misc.cpp +230 -0
  79. package/native/vendor/microtex/lib/atom/atom_misc.h +200 -0
  80. package/native/vendor/microtex/lib/atom/atom_operator.cpp +51 -0
  81. package/native/vendor/microtex/lib/atom/atom_operator.h +41 -0
  82. package/native/vendor/microtex/lib/atom/atom_root.cpp +61 -0
  83. package/native/vendor/microtex/lib/atom/atom_root.h +27 -0
  84. package/native/vendor/microtex/lib/atom/atom_row.cpp +334 -0
  85. package/native/vendor/microtex/lib/atom/atom_row.h +176 -0
  86. package/native/vendor/microtex/lib/atom/atom_scripts.cpp +182 -0
  87. package/native/vendor/microtex/lib/atom/atom_scripts.h +52 -0
  88. package/native/vendor/microtex/lib/atom/atom_sideset.cpp +92 -0
  89. package/native/vendor/microtex/lib/atom/atom_sideset.h +24 -0
  90. package/native/vendor/microtex/lib/atom/atom_space.cpp +22 -0
  91. package/native/vendor/microtex/lib/atom/atom_space.h +38 -0
  92. package/native/vendor/microtex/lib/atom/atom_stack.cpp +117 -0
  93. package/native/vendor/microtex/lib/atom/atom_stack.h +103 -0
  94. package/native/vendor/microtex/lib/atom/atom_text.cpp +17 -0
  95. package/native/vendor/microtex/lib/atom/atom_text.h +33 -0
  96. package/native/vendor/microtex/lib/atom/atom_vrow.cpp +96 -0
  97. package/native/vendor/microtex/lib/atom/atom_vrow.h +47 -0
  98. package/native/vendor/microtex/lib/atom/atom_zstack.cpp +66 -0
  99. package/native/vendor/microtex/lib/atom/atom_zstack.h +37 -0
  100. package/native/vendor/microtex/lib/atom/colors_def.cpp +157 -0
  101. package/native/vendor/microtex/lib/atom/meson.build +50 -0
  102. package/native/vendor/microtex/lib/box/box.cpp +49 -0
  103. package/native/vendor/microtex/lib/box/box.h +184 -0
  104. package/native/vendor/microtex/lib/box/box_factory.cpp +162 -0
  105. package/native/vendor/microtex/lib/box/box_factory.h +24 -0
  106. package/native/vendor/microtex/lib/box/box_group.cpp +503 -0
  107. package/native/vendor/microtex/lib/box/box_group.h +285 -0
  108. package/native/vendor/microtex/lib/box/box_single.cpp +179 -0
  109. package/native/vendor/microtex/lib/box/box_single.h +157 -0
  110. package/native/vendor/microtex/lib/box/meson.build +15 -0
  111. package/native/vendor/microtex/lib/core/debug_config.cpp +3 -0
  112. package/native/vendor/microtex/lib/core/debug_config.h +24 -0
  113. package/native/vendor/microtex/lib/core/formula.cpp +180 -0
  114. package/native/vendor/microtex/lib/core/formula.h +137 -0
  115. package/native/vendor/microtex/lib/core/formula_def.cpp +167 -0
  116. package/native/vendor/microtex/lib/core/glue.cpp +108 -0
  117. package/native/vendor/microtex/lib/core/glue.h +55 -0
  118. package/native/vendor/microtex/lib/core/localized_num.cpp +51 -0
  119. package/native/vendor/microtex/lib/core/meson.build +19 -0
  120. package/native/vendor/microtex/lib/core/parser.cpp +874 -0
  121. package/native/vendor/microtex/lib/core/parser.h +306 -0
  122. package/native/vendor/microtex/lib/core/split.cpp +185 -0
  123. package/native/vendor/microtex/lib/core/split.h +40 -0
  124. package/native/vendor/microtex/lib/env/env.cpp +141 -0
  125. package/native/vendor/microtex/lib/env/env.h +221 -0
  126. package/native/vendor/microtex/lib/env/meson.build +11 -0
  127. package/native/vendor/microtex/lib/env/units.cpp +109 -0
  128. package/native/vendor/microtex/lib/env/units.h +61 -0
  129. package/native/vendor/microtex/lib/graphic/font_style.cpp +63 -0
  130. package/native/vendor/microtex/lib/graphic/font_style.h +61 -0
  131. package/native/vendor/microtex/lib/graphic/graphic.cpp +38 -0
  132. package/native/vendor/microtex/lib/graphic/graphic.h +314 -0
  133. package/native/vendor/microtex/lib/graphic/graphic_basic.cpp +44 -0
  134. package/native/vendor/microtex/lib/graphic/graphic_basic.h +131 -0
  135. package/native/vendor/microtex/lib/graphic/meson.build +13 -0
  136. package/native/vendor/microtex/lib/macro/macro.cpp +143 -0
  137. package/native/vendor/microtex/lib/macro/macro.h +155 -0
  138. package/native/vendor/microtex/lib/macro/macro_accent.cpp +50 -0
  139. package/native/vendor/microtex/lib/macro/macro_accent.h +61 -0
  140. package/native/vendor/microtex/lib/macro/macro_boxes.h +68 -0
  141. package/native/vendor/microtex/lib/macro/macro_colors.cpp +42 -0
  142. package/native/vendor/microtex/lib/macro/macro_colors.h +42 -0
  143. package/native/vendor/microtex/lib/macro/macro_decl.h +16 -0
  144. package/native/vendor/microtex/lib/macro/macro_def.cpp +418 -0
  145. package/native/vendor/microtex/lib/macro/macro_delims.cpp +56 -0
  146. package/native/vendor/microtex/lib/macro/macro_delims.h +73 -0
  147. package/native/vendor/microtex/lib/macro/macro_env.h +212 -0
  148. package/native/vendor/microtex/lib/macro/macro_fonts.cpp +53 -0
  149. package/native/vendor/microtex/lib/macro/macro_fonts.h +78 -0
  150. package/native/vendor/microtex/lib/macro/macro_frac.cpp +138 -0
  151. package/native/vendor/microtex/lib/macro/macro_frac.h +50 -0
  152. package/native/vendor/microtex/lib/macro/macro_misc.cpp +211 -0
  153. package/native/vendor/microtex/lib/macro/macro_misc.h +217 -0
  154. package/native/vendor/microtex/lib/macro/macro_scripts.cpp +32 -0
  155. package/native/vendor/microtex/lib/macro/macro_scripts.h +17 -0
  156. package/native/vendor/microtex/lib/macro/macro_sizes.h +110 -0
  157. package/native/vendor/microtex/lib/macro/macro_space.cpp +31 -0
  158. package/native/vendor/microtex/lib/macro/macro_space.h +17 -0
  159. package/native/vendor/microtex/lib/macro/macro_styles.cpp +45 -0
  160. package/native/vendor/microtex/lib/macro/macro_styles.h +22 -0
  161. package/native/vendor/microtex/lib/macro/macro_types.h +48 -0
  162. package/native/vendor/microtex/lib/macro/meson.build +33 -0
  163. package/native/vendor/microtex/lib/meson.build +102 -0
  164. package/native/vendor/microtex/lib/microtex.cpp +208 -0
  165. package/native/vendor/microtex/lib/microtex.h +225 -0
  166. package/native/vendor/microtex/lib/microtexConfig.cmake.in +2 -0
  167. package/native/vendor/microtex/lib/microtexapi.h +22 -0
  168. package/native/vendor/microtex/lib/microtexconfig.h.in +7 -0
  169. package/native/vendor/microtex/lib/microtexexport.h +31 -0
  170. package/native/vendor/microtex/lib/otf/clm.cpp +405 -0
  171. package/native/vendor/microtex/lib/otf/clm.h +61 -0
  172. package/native/vendor/microtex/lib/otf/fontsense.cpp +191 -0
  173. package/native/vendor/microtex/lib/otf/fontsense.h +20 -0
  174. package/native/vendor/microtex/lib/otf/glyph.cpp +53 -0
  175. package/native/vendor/microtex/lib/otf/glyph.h +384 -0
  176. package/native/vendor/microtex/lib/otf/math_consts.h +154 -0
  177. package/native/vendor/microtex/lib/otf/meson.build +18 -0
  178. package/native/vendor/microtex/lib/otf/otf.cpp +84 -0
  179. package/native/vendor/microtex/lib/otf/otf.h +177 -0
  180. package/native/vendor/microtex/lib/otf/otfconfig.h +32 -0
  181. package/native/vendor/microtex/lib/otf/path.cpp +187 -0
  182. package/native/vendor/microtex/lib/otf/path.h +120 -0
  183. package/native/vendor/microtex/lib/render/builder.cpp +68 -0
  184. package/native/vendor/microtex/lib/render/builder.h +73 -0
  185. package/native/vendor/microtex/lib/render/meson.build +11 -0
  186. package/native/vendor/microtex/lib/render/render.cpp +136 -0
  187. package/native/vendor/microtex/lib/render/render.h +59 -0
  188. package/native/vendor/microtex/lib/unimath/font_meta.h +22 -0
  189. package/native/vendor/microtex/lib/unimath/font_src.cpp +21 -0
  190. package/native/vendor/microtex/lib/unimath/font_src.h +61 -0
  191. package/native/vendor/microtex/lib/unimath/math_type.cpp +318 -0
  192. package/native/vendor/microtex/lib/unimath/math_type.h +105 -0
  193. package/native/vendor/microtex/lib/unimath/meson.build +18 -0
  194. package/native/vendor/microtex/lib/unimath/uni_char.cpp +121 -0
  195. package/native/vendor/microtex/lib/unimath/uni_char.h +109 -0
  196. package/native/vendor/microtex/lib/unimath/uni_font.cpp +248 -0
  197. package/native/vendor/microtex/lib/unimath/uni_font.h +139 -0
  198. package/native/vendor/microtex/lib/unimath/uni_symbol.cpp +2929 -0
  199. package/native/vendor/microtex/lib/unimath/uni_symbol.h +31 -0
  200. package/native/vendor/microtex/lib/utils/dict_tree.h +68 -0
  201. package/native/vendor/microtex/lib/utils/exceptions.h +61 -0
  202. package/native/vendor/microtex/lib/utils/log.h +34 -0
  203. package/native/vendor/microtex/lib/utils/meson.build +18 -0
  204. package/native/vendor/microtex/lib/utils/nums.h +24 -0
  205. package/native/vendor/microtex/lib/utils/string_utils.cpp +85 -0
  206. package/native/vendor/microtex/lib/utils/string_utils.h +130 -0
  207. package/native/vendor/microtex/lib/utils/types.h +152 -0
  208. package/native/vendor/microtex/lib/utils/utf.cpp +115 -0
  209. package/native/vendor/microtex/lib/utils/utf.h +58 -0
  210. package/native/vendor/microtex/lib/utils/utils.cpp +40 -0
  211. package/native/vendor/microtex/lib/utils/utils.h +88 -0
  212. package/native/vendor/microtex/lib/wrapper/byte_seq.cpp +46 -0
  213. package/native/vendor/microtex/lib/wrapper/byte_seq.h +70 -0
  214. package/native/vendor/microtex/lib/wrapper/callback.cpp +10 -0
  215. package/native/vendor/microtex/lib/wrapper/callback.h +72 -0
  216. package/native/vendor/microtex/lib/wrapper/cwrapper.cpp +206 -0
  217. package/native/vendor/microtex/lib/wrapper/cwrapper.h +305 -0
  218. package/native/vendor/microtex/lib/wrapper/graphic_wrapper.cpp +211 -0
  219. package/native/vendor/microtex/lib/wrapper/graphic_wrapper.h +159 -0
  220. package/native/vendor/microtex/lib/wrapper/meson.build +22 -0
  221. package/native/vendor/microtex/meson.build +75 -0
  222. package/native/vendor/microtex/meson_options.txt +29 -0
  223. package/native/vendor/microtex/platform/cairo/CMakeLists.txt +36 -0
  224. package/native/vendor/microtex/platform/cairo/graphic_cairo.cpp +384 -0
  225. package/native/vendor/microtex/platform/cairo/graphic_cairo.h +119 -0
  226. package/native/vendor/microtex/platform/cairo/meson.build +47 -0
  227. package/native/vendor/microtex/platform/cairo/microtex-cairoConfig.cmake.in +11 -0
  228. package/native/vendor/microtex/platform/flutter/microtex/.metadata +10 -0
  229. package/native/vendor/microtex/platform/flutter/microtex/CHANGELOG.md +3 -0
  230. package/native/vendor/microtex/platform/flutter/microtex/LICENSE +1 -0
  231. package/native/vendor/microtex/platform/flutter/microtex/README.md +15 -0
  232. package/native/vendor/microtex/platform/flutter/microtex/analysis_options.yaml +4 -0
  233. package/native/vendor/microtex/platform/flutter/microtex/android/build.gradle +56 -0
  234. package/native/vendor/microtex/platform/flutter/microtex/android/settings.gradle +1 -0
  235. package/native/vendor/microtex/platform/flutter/microtex/android/src/main/AndroidManifest.xml +3 -0
  236. package/native/vendor/microtex/platform/flutter/microtex/android/src/main/kotlin/io/nano/microtex/microtex/MicrotexPlugin.kt +35 -0
  237. package/native/vendor/microtex/platform/flutter/microtex/example/.metadata +10 -0
  238. package/native/vendor/microtex/platform/flutter/microtex/example/README.md +16 -0
  239. package/native/vendor/microtex/platform/flutter/microtex/example/analysis_options.yaml +31 -0
  240. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/build.gradle +68 -0
  241. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/debug/AndroidManifest.xml +7 -0
  242. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/AndroidManifest.xml +34 -0
  243. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/kotlin/io/nano/microtex/microtex_example/MainActivity.kt +6 -0
  244. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/drawable/launch_background.xml +12 -0
  245. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/drawable-v21/launch_background.xml +12 -0
  246. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  247. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  248. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  249. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  250. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  251. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/values/styles.xml +18 -0
  252. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/values-night/styles.xml +18 -0
  253. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/profile/AndroidManifest.xml +7 -0
  254. package/native/vendor/microtex/platform/flutter/microtex/example/android/build.gradle +31 -0
  255. package/native/vendor/microtex/platform/flutter/microtex/example/android/gradle/wrapper/gradle-wrapper.properties +6 -0
  256. package/native/vendor/microtex/platform/flutter/microtex/example/android/gradle.properties +3 -0
  257. package/native/vendor/microtex/platform/flutter/microtex/example/android/settings.gradle +11 -0
  258. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Flutter/AppFrameworkInfo.plist +26 -0
  259. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Flutter/Debug.xcconfig +2 -0
  260. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Flutter/Release.xcconfig +2 -0
  261. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Podfile +41 -0
  262. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Podfile.lock +22 -0
  263. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/AppDelegate.swift +13 -0
  264. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +122 -0
  265. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png +0 -0
  266. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png +0 -0
  267. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png +0 -0
  268. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png +0 -0
  269. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png +0 -0
  270. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png +0 -0
  271. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png +0 -0
  272. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png +0 -0
  273. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png +0 -0
  274. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png +0 -0
  275. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png +0 -0
  276. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png +0 -0
  277. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png +0 -0
  278. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png +0 -0
  279. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png +0 -0
  280. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +23 -0
  281. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png +0 -0
  282. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png +0 -0
  283. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png +0 -0
  284. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +5 -0
  285. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +37 -0
  286. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Base.lproj/Main.storyboard +26 -0
  287. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Info.plist +49 -0
  288. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Runner-Bridging-Header.h +1 -0
  289. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/project.pbxproj +549 -0
  290. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  291. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  292. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
  293. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +87 -0
  294. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcworkspace/contents.xcworkspacedata +10 -0
  295. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  296. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
  297. package/native/vendor/microtex/platform/flutter/microtex/example/lib/main.dart +23 -0
  298. package/native/vendor/microtex/platform/flutter/microtex/example/lib/screen/edit_in_one.dart +0 -0
  299. package/native/vendor/microtex/platform/flutter/microtex/example/lib/screen/edit_screen.dart +208 -0
  300. package/native/vendor/microtex/platform/flutter/microtex/example/lib/utils/convert_spans.dart +63 -0
  301. package/native/vendor/microtex/platform/flutter/microtex/example/lib/utils/string_ext.dart +10 -0
  302. package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/cmp.dart +118 -0
  303. package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/draggable.dart +75 -0
  304. package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/rich.dart +23 -0
  305. package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/split.dart +72 -0
  306. package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/tex_highlight_controller.dart +66 -0
  307. package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/tex_input_controller.dart +19 -0
  308. package/native/vendor/microtex/platform/flutter/microtex/example/linux/CMakeLists.txt +116 -0
  309. package/native/vendor/microtex/platform/flutter/microtex/example/linux/flutter/CMakeLists.txt +87 -0
  310. package/native/vendor/microtex/platform/flutter/microtex/example/linux/flutter/generated_plugin_registrant.cc +15 -0
  311. package/native/vendor/microtex/platform/flutter/microtex/example/linux/flutter/generated_plugin_registrant.h +15 -0
  312. package/native/vendor/microtex/platform/flutter/microtex/example/linux/flutter/generated_plugins.cmake +24 -0
  313. package/native/vendor/microtex/platform/flutter/microtex/example/linux/main.cc +6 -0
  314. package/native/vendor/microtex/platform/flutter/microtex/example/linux/my_application.cc +104 -0
  315. package/native/vendor/microtex/platform/flutter/microtex/example/linux/my_application.h +18 -0
  316. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Flutter/Flutter-Debug.xcconfig +2 -0
  317. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Flutter/Flutter-Release.xcconfig +2 -0
  318. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Flutter/GeneratedPluginRegistrant.swift +12 -0
  319. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Podfile +40 -0
  320. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Podfile.lock +22 -0
  321. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/AppDelegate.swift +9 -0
  322. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
  323. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
  324. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png +0 -0
  325. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png +0 -0
  326. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png +0 -0
  327. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png +0 -0
  328. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png +0 -0
  329. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png +0 -0
  330. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Base.lproj/MainMenu.xib +343 -0
  331. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Configs/AppInfo.xcconfig +14 -0
  332. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Configs/Debug.xcconfig +2 -0
  333. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Configs/Release.xcconfig +2 -0
  334. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Configs/Warnings.xcconfig +13 -0
  335. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/DebugProfile.entitlements +12 -0
  336. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Info.plist +32 -0
  337. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/MainFlutterWindow.swift +15 -0
  338. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Release.entitlements +8 -0
  339. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcodeproj/project.pbxproj +633 -0
  340. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  341. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +87 -0
  342. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcworkspace/contents.xcworkspacedata +10 -0
  343. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  344. package/native/vendor/microtex/platform/flutter/microtex/example/pubspec.lock +191 -0
  345. package/native/vendor/microtex/platform/flutter/microtex/example/pubspec.yaml +56 -0
  346. package/native/vendor/microtex/platform/flutter/microtex/example/test/widget_test.dart +26 -0
  347. package/native/vendor/microtex/platform/flutter/microtex/example/windows/CMakeLists.txt +95 -0
  348. package/native/vendor/microtex/platform/flutter/microtex/example/windows/flutter/CMakeLists.txt +103 -0
  349. package/native/vendor/microtex/platform/flutter/microtex/example/windows/flutter/generated_plugin_registrant.cc +14 -0
  350. package/native/vendor/microtex/platform/flutter/microtex/example/windows/flutter/generated_plugin_registrant.h +15 -0
  351. package/native/vendor/microtex/platform/flutter/microtex/example/windows/flutter/generated_plugins.cmake +24 -0
  352. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/CMakeLists.txt +17 -0
  353. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/Runner.rc +121 -0
  354. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/flutter_window.cpp +61 -0
  355. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/flutter_window.h +33 -0
  356. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/main.cpp +43 -0
  357. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/resource.h +16 -0
  358. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/resources/app_icon.ico +0 -0
  359. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/runner.exe.manifest +20 -0
  360. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/utils.cpp +64 -0
  361. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/utils.h +19 -0
  362. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/win32_window.cpp +245 -0
  363. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/win32_window.h +98 -0
  364. package/native/vendor/microtex/platform/flutter/microtex/ios/Assets/.gitkeep +0 -0
  365. package/native/vendor/microtex/platform/flutter/microtex/ios/Classes/MicrotexPlugin.h +4 -0
  366. package/native/vendor/microtex/platform/flutter/microtex/ios/Classes/MicrotexPlugin.m +19 -0
  367. package/native/vendor/microtex/platform/flutter/microtex/ios/Classes/SwiftMicrotexPlugin.swift +14 -0
  368. package/native/vendor/microtex/platform/flutter/microtex/ios/Classes/dummy.h +4 -0
  369. package/native/vendor/microtex/platform/flutter/microtex/ios/microtex.podspec +27 -0
  370. package/native/vendor/microtex/platform/flutter/microtex/lib/microtex.dart +7 -0
  371. package/native/vendor/microtex/platform/flutter/microtex/lib/src/bindings.dart +218 -0
  372. package/native/vendor/microtex/platform/flutter/microtex/lib/src/bounds.dart +10 -0
  373. package/native/vendor/microtex/platform/flutter/microtex/lib/src/context.dart +205 -0
  374. package/native/vendor/microtex/platform/flutter/microtex/lib/src/fontdesc.dart +14 -0
  375. package/native/vendor/microtex/platform/flutter/microtex/lib/src/fontmeta.dart +14 -0
  376. package/native/vendor/microtex/platform/flutter/microtex/lib/src/pathcache.dart +17 -0
  377. package/native/vendor/microtex/platform/flutter/microtex/lib/src/render.dart +291 -0
  378. package/native/vendor/microtex/platform/flutter/microtex/lib/src/texstyle.dart +11 -0
  379. package/native/vendor/microtex/platform/flutter/microtex/lib/src/textlayout.dart +93 -0
  380. package/native/vendor/microtex/platform/flutter/microtex/lib/src/widget.dart +163 -0
  381. package/native/vendor/microtex/platform/flutter/microtex/linux/CMakeLists.txt +33 -0
  382. package/native/vendor/microtex/platform/flutter/microtex/linux/include/microtex/microtex_plugin.h +26 -0
  383. package/native/vendor/microtex/platform/flutter/microtex/linux/microtex_plugin.cc +70 -0
  384. package/native/vendor/microtex/platform/flutter/microtex/macos/Classes/MicrotexPlugin.swift +20 -0
  385. package/native/vendor/microtex/platform/flutter/microtex/macos/Classes/dummy.h +4 -0
  386. package/native/vendor/microtex/platform/flutter/microtex/macos/Classes/microtex-Bridging-Header.h +1 -0
  387. package/native/vendor/microtex/platform/flutter/microtex/macos/microtex.podspec +26 -0
  388. package/native/vendor/microtex/platform/flutter/microtex/nativelib/CMakeLists.txt +44 -0
  389. package/native/vendor/microtex/platform/flutter/microtex/nativelib/builddarwin.sh +108 -0
  390. package/native/vendor/microtex/platform/flutter/microtex/pubspec.yaml +37 -0
  391. package/native/vendor/microtex/platform/flutter/microtex/test/microtex_test.dart +23 -0
  392. package/native/vendor/microtex/platform/flutter/microtex/windows/CMakeLists.txt +32 -0
  393. package/native/vendor/microtex/platform/flutter/microtex/windows/include/microtex/microtex_plugin.h +23 -0
  394. package/native/vendor/microtex/platform/flutter/microtex/windows/microtex_plugin.cpp +82 -0
  395. package/native/vendor/microtex/platform/gdi_win/CMakeLists.txt +20 -0
  396. package/native/vendor/microtex/platform/gdi_win/graphic_win32.cpp +352 -0
  397. package/native/vendor/microtex/platform/gdi_win/graphic_win32.h +137 -0
  398. package/native/vendor/microtex/platform/gdi_win/meson.build +39 -0
  399. package/native/vendor/microtex/platform/gtk/CMakeLists.txt +36 -0
  400. package/native/vendor/microtex/platform/gtk/meson.build +65 -0
  401. package/native/vendor/microtex/platform/gtk/microtex-gtkConfig.cmake.in +11 -0
  402. package/native/vendor/microtex/platform/gtk/microtexequation.cpp +708 -0
  403. package/native/vendor/microtex/platform/gtk/microtexequation.h +72 -0
  404. package/native/vendor/microtex/platform/qt/CMakeLists.txt +37 -0
  405. package/native/vendor/microtex/platform/qt/graphic_qt.cpp +355 -0
  406. package/native/vendor/microtex/platform/qt/graphic_qt.h +116 -0
  407. package/native/vendor/microtex/platform/qt/meson.build +38 -0
  408. package/native/vendor/microtex/platform/qt/microtex-qtConfig.cmake.in +7 -0
  409. package/native/vendor/microtex/platform/skia/CMakeLists.txt +46 -0
  410. package/native/vendor/microtex/platform/skia/graphic_skia.cpp +306 -0
  411. package/native/vendor/microtex/platform/skia/graphic_skia.h +125 -0
  412. package/native/vendor/microtex/platform/skia/microtex-skiaConfig.cmake.in +6 -0
  413. package/native/vendor/microtex/platform/wasm/CMakeLists.txt +38 -0
  414. package/native/vendor/microtex/platform/wasm/emscripten.cross +31 -0
  415. package/native/vendor/microtex/platform/wasm/main.cpp +15 -0
  416. package/native/vendor/microtex/platform/wasm/meson.build +8 -0
  417. package/native/vendor/microtex/platform/wasm/prebuild-example-meson.sh +21 -0
  418. package/native/vendor/microtex/platform/wasm/prebuild-example.sh +21 -0
  419. package/native/vendor/microtex/platform/wasm/prebuild-lib-meson.sh +28 -0
  420. package/native/vendor/microtex/platform/wasm/prebuild-lib.sh +31 -0
  421. package/native/vendor/microtex/platform/wasm/web/.babelrc +10 -0
  422. package/native/vendor/microtex/platform/wasm/web/example/examples.js +43 -0
  423. package/native/vendor/microtex/platform/wasm/web/example/hello.js +31 -0
  424. package/native/vendor/microtex/platform/wasm/web/example/index.html +55 -0
  425. package/native/vendor/microtex/platform/wasm/web/example/index.js +243 -0
  426. package/native/vendor/microtex/platform/wasm/web/example/styles.css +86 -0
  427. package/native/vendor/microtex/platform/wasm/web/example/utils.js +47 -0
  428. package/native/vendor/microtex/platform/wasm/web/lib/context.js +271 -0
  429. package/native/vendor/microtex/platform/wasm/web/lib/index.js +10 -0
  430. package/native/vendor/microtex/platform/wasm/web/lib/render.js +293 -0
  431. package/native/vendor/microtex/platform/wasm/web/lib/runtime.js +14 -0
  432. package/native/vendor/microtex/platform/wasm/web/lib/svg.js +237 -0
  433. package/native/vendor/microtex/platform/wasm/web/lib/textlayout.js +88 -0
  434. package/native/vendor/microtex/platform/wasm/web/package-lock.json +5931 -0
  435. package/native/vendor/microtex/platform/wasm/web/package.json +45 -0
  436. package/native/vendor/microtex/platform/wasm/web/publish-example.sh +17 -0
  437. package/native/vendor/microtex/platform/wasm/web/rollup.config.example.js +24 -0
  438. package/native/vendor/microtex/platform/wasm/web/rollup.config.lib.js +16 -0
  439. package/native/vendor/microtex/prebuilt/otf2clm.py +807 -0
  440. package/native/vendor/microtex/prebuilt/otf2clm.sh +9 -0
  441. package/native/vendor/microtex/prebuilt/preclms.sh +17 -0
  442. package/native/vendor/microtex/readme/example_bw_false.svg +680 -0
  443. package/native/vendor/microtex/readme/example_bw_true.svg +680 -0
  444. package/native/vendor/microtex/readme/example_cjk_trying.svg +54 -0
  445. package/native/vendor/microtex/readme/example_custom_symbols.svg +92 -0
  446. package/native/vendor/microtex/readme/example_debug.svg +764 -0
  447. package/native/vendor/microtex/readme/example_emoji.svg +199 -0
  448. package/native/vendor/microtex/readme/example_have_log.svg +79 -0
  449. package/native/vendor/microtex/readme/example_keep_trying.svg +101 -0
  450. package/native/vendor/microtex/readme/example_logos.svg +50 -0
  451. package/native/vendor/microtex/readme/example_ubuntu.png +0 -0
  452. package/native/vendor/microtex/readme/example_windows.png +0 -0
  453. package/native/vendor/microtex/readme/samples/sample_0.svg +665 -0
  454. package/native/vendor/microtex/readme/samples/sample_1.svg +1259 -0
  455. package/native/vendor/microtex/readme/samples/sample_10.svg +333 -0
  456. package/native/vendor/microtex/readme/samples/sample_11.svg +306 -0
  457. package/native/vendor/microtex/readme/samples/sample_2.svg +2461 -0
  458. package/native/vendor/microtex/readme/samples/sample_3.svg +2653 -0
  459. package/native/vendor/microtex/readme/samples/sample_4.svg +554 -0
  460. package/native/vendor/microtex/readme/samples/sample_5.svg +247 -0
  461. package/native/vendor/microtex/readme/samples/sample_6.svg +1082 -0
  462. package/native/vendor/microtex/readme/samples/sample_7.svg +518 -0
  463. package/native/vendor/microtex/readme/samples/sample_8.svg +529 -0
  464. package/native/vendor/microtex/readme/samples/sample_9.svg +1702 -0
  465. package/native/vendor/microtex/readme/samples.md +301 -0
  466. package/native/vendor/microtex/readme/tex_logo.svg +19 -0
  467. package/native/vendor/microtex/res/EXAMPLE.txt +25 -0
  468. package/native/vendor/microtex/res/SAMPLES.tex +946 -0
  469. package/native/vendor/microtex/res/firamath/FiraMath-Regular.clm1 +0 -0
  470. package/native/vendor/microtex/res/firamath/FiraMath-Regular.clm2 +0 -0
  471. package/native/vendor/microtex/res/firamath/FiraMath-Regular.otf +0 -0
  472. package/native/vendor/microtex/res/firamath/README.md +42 -0
  473. package/native/vendor/microtex/res/lm-math/README +92 -0
  474. package/native/vendor/microtex/res/lm-math/latinmodern-math.clm1 +0 -0
  475. package/native/vendor/microtex/res/lm-math/latinmodern-math.clm2 +0 -0
  476. package/native/vendor/microtex/res/lm-math/latinmodern-math.otf +0 -0
  477. package/native/vendor/microtex/res/tex-gyre/README-TeX-Gyre-DejaVu-Math.txt +82 -0
  478. package/native/vendor/microtex/res/tex-gyre/texgyredejavu-math.clm1 +0 -0
  479. package/native/vendor/microtex/res/tex-gyre/texgyredejavu-math.clm2 +0 -0
  480. package/native/vendor/microtex/res/tex-gyre/texgyredejavu-math.otf +0 -0
  481. package/native/vendor/microtex/res/xits/FONTLOG.txt +246 -0
  482. package/native/vendor/microtex/res/xits/OFL.txt +98 -0
  483. package/native/vendor/microtex/res/xits/README.txt +15 -0
  484. package/native/vendor/microtex/res/xits/XITS-Bold.clm1 +0 -0
  485. package/native/vendor/microtex/res/xits/XITS-Bold.clm2 +0 -0
  486. package/native/vendor/microtex/res/xits/XITS-Bold.otf +0 -0
  487. package/native/vendor/microtex/res/xits/XITS-BoldItalic.clm1 +0 -0
  488. package/native/vendor/microtex/res/xits/XITS-BoldItalic.clm2 +0 -0
  489. package/native/vendor/microtex/res/xits/XITS-BoldItalic.otf +0 -0
  490. package/native/vendor/microtex/res/xits/XITS-Italic.clm1 +0 -0
  491. package/native/vendor/microtex/res/xits/XITS-Italic.clm2 +0 -0
  492. package/native/vendor/microtex/res/xits/XITS-Italic.otf +0 -0
  493. package/native/vendor/microtex/res/xits/XITS-Regular.clm1 +0 -0
  494. package/native/vendor/microtex/res/xits/XITS-Regular.clm2 +0 -0
  495. package/native/vendor/microtex/res/xits/XITS-Regular.otf +0 -0
  496. package/native/vendor/microtex/res/xits/XITSMath-Bold.clm1 +0 -0
  497. package/native/vendor/microtex/res/xits/XITSMath-Bold.clm2 +0 -0
  498. package/native/vendor/microtex/res/xits/XITSMath-Bold.otf +0 -0
  499. package/native/vendor/microtex/res/xits/XITSMath-Regular.clm1 +0 -0
  500. package/native/vendor/microtex/res/xits/XITSMath-Regular.clm2 +0 -0
  501. package/native/vendor/microtex/res/xits/XITSMath-Regular.otf +0 -0
  502. package/native/vendor/microtex/test/clm/meson.build +10 -0
  503. package/native/vendor/microtex/test/clm/test_clm.cpp +140 -0
  504. package/native/vendor/microtex/test/env/meson.build +10 -0
  505. package/native/vendor/microtex/test/env/test_env.cpp +100 -0
  506. package/native/vendor/microtex/test/fuzzer/afl.native +20 -0
  507. package/native/vendor/microtex/test/fuzzer/fuzz.sh +135 -0
  508. package/native/vendor/microtex/test/fuzzer/fuzzer.cpp +61 -0
  509. package/native/vendor/microtex/test/fuzzer/generateSeed.java +33 -0
  510. package/native/vendor/microtex/test/fuzzer/meson.build +9 -0
  511. package/native/vendor/microtex/test/fuzzer/microtex.dict +3708 -0
  512. package/native/vendor/microtex/test/fuzzer/platform_none.cpp +100 -0
  513. package/native/vendor/microtex/test/has_filesystem.cpp +8 -0
  514. package/native/vendor/microtex/test/meson.build +6 -0
  515. package/native/vendor/nanosvg.h +3278 -0
  516. package/native/vendor/nanosvgrast.h +1472 -0
  517. package/native/vendor/zigtex/.github/assets/example.svg +27 -0
  518. package/native/vendor/zigtex/LICENSE +674 -0
  519. package/native/vendor/zigtex/README.md +52 -0
  520. package/native/vendor/zigtex/build.zig +52 -0
  521. package/native/vendor/zigtex/build.zig.zon +16 -0
  522. package/native/vendor/zigtex/fonts/latinmodern-math.clm2 +0 -0
  523. package/native/vendor/zigtex/src/main.zig +22 -0
  524. package/native/vendor/zigtex/src/root.zig +124 -0
  525. package/native/vendor/zigtex/src/svg.zig +273 -0
  526. package/native/vendor/zigtex/src/tex.zig +383 -0
  527. package/native/zigtex-0.16.patch +35 -0
  528. package/package.json +27 -0
  529. package/scripts/bootstrap-native +89 -0
@@ -0,0 +1,418 @@
1
+ #include "macro/macro.h"
2
+ #include "macro/macro_accent.h"
3
+ #include "macro/macro_boxes.h"
4
+ #include "macro/macro_colors.h"
5
+ #include "macro/macro_delims.h"
6
+ #include "macro/macro_env.h"
7
+ #include "macro/macro_fonts.h"
8
+ #include "macro/macro_frac.h"
9
+ #include "macro/macro_misc.h"
10
+ #include "macro/macro_scripts.h"
11
+ #include "macro/macro_sizes.h"
12
+ #include "macro/macro_space.h"
13
+ #include "macro/macro_styles.h"
14
+ #include "macro/macro_types.h"
15
+
16
+ using namespace std;
17
+ using namespace microtex;
18
+
19
+ #define mac3(argc, name, code) defMac(code, argc, name)
20
+
21
+ #define mac4(argc, posOpts, name, code) defMac(code, argc, posOpts, name)
22
+
23
+ namespace microtex {
24
+
25
+ inline auto defMac(const char* code, int argc, int posOpts, MacroDelegate del) {
26
+ return std::make_pair(code, new PreDefMacro(argc, posOpts, del));
27
+ }
28
+
29
+ inline auto defMac(const char* code, int argc, MacroDelegate del) {
30
+ return std::make_pair(code, new PreDefMacro(argc, del));
31
+ }
32
+
33
+ } // namespace microtex
34
+
35
+ map<string, MacroInfo*> MacroInfo::_commands{
36
+ #define mac mac4
37
+ mac(2, 2, macro_newcommand, "newcommand"),
38
+ mac(2, 2, macro_renewcommand, "renewcommand"),
39
+ mac(2, 1, macro_rule, "rule"),
40
+ mac(1, 1, macro_includegraphics, "includegraphics"),
41
+ mac(2, 1, macro_cfrac, "cfrac"),
42
+ // region arrows
43
+ mac(1, 1, macro_xarrow, "xleftarrow"),
44
+ mac(1, 1, macro_xarrow, "xrightarrow"),
45
+ mac(1, 1, macro_xarrow, "xleftrightarrow"),
46
+ mac(1, 1, macro_xarrow, "xRightarrow"),
47
+ mac(1, 1, macro_xarrow, "xLeftarrow"),
48
+ mac(1, 1, macro_xarrow, "xLeftrightarrow"),
49
+ mac(1, 1, macro_xarrow, "xhookleftarrow"),
50
+ mac(1, 1, macro_xarrow, "xhookrightarrow"),
51
+ mac(1, 1, macro_xarrow, "xmapsto"),
52
+ mac(1, 1, macro_xarrow, "xrightharpoondown"),
53
+ mac(1, 1, macro_xarrow, "xrightharpoonup"),
54
+ mac(1, 1, macro_xarrow, "xleftharpoondown"),
55
+ mac(1, 1, macro_xarrow, "xleftharpoonup"),
56
+ mac(1, 1, macro_xarrow, "xrightleftharpoons"),
57
+ mac(1, 1, macro_xarrow, "xleftrightharpoons"),
58
+ // endregion
59
+ mac(1, 1, macro_sqrt, "sqrt"),
60
+ mac(1, 1, macro_smash, "smash"),
61
+ mac(1, 1, macro_hdotsfor, "hdotsfor"),
62
+ mac(2, 1, macro_stackbin, "stackbin"),
63
+ mac(2, 1, macro_stackrel, "stackrel"),
64
+ mac(2, 1, macro_rotatebox, "rotatebox"),
65
+ mac(2, 2, macro_scalebox, "scalebox"),
66
+ mac(2, 2, macro_raisebox, "raisebox"),
67
+ mac(1, 1, macro_mathversion, "mathversion"),
68
+ #undef mac
69
+ #define mac mac3
70
+ mac(1, macro_fatalIfCmdConflict, "fatalIfCmdConflict"),
71
+ mac(1, macro_breakEverywhere, "breakEverywhere"),
72
+ mac(3, macro_newenvironment, "newenvironment"),
73
+ mac(3, macro_renewenvironment, "renewenvironment"),
74
+ mac(0, macro_makeatletter, "makeatletter"),
75
+ mac(0, macro_makeatother, "makeatother"),
76
+ // region array environments
77
+ mac(1, macro_smallmatrixATATenv, "smallmatrix@@env"),
78
+ mac(1, macro_matrixATATenv, "matrix@@env"),
79
+ mac(2, macro_arrayATATenv, "array@@env"),
80
+ mac(2, macro_alignATATenv, "align@@env"),
81
+ mac(2, macro_alignedATATenv, "aligned@@env"),
82
+ mac(2, macro_flalignATATenv, "flalign@@env"),
83
+ mac(2, macro_alignatATATenv, "alignat@@env"),
84
+ mac(2, macro_alignedatATATenv, "alignedat@@env"),
85
+ mac(2, macro_multlineATATenv, "multline@@env"),
86
+ mac(2, macro_gatherATATenv, "gather@@env"),
87
+ mac(2, macro_gatheredATATenv, "gathered@@env"),
88
+ mac(3, macro_multicolumn, "multicolumn"),
89
+ mac(0, macro_hline, "hline"),
90
+ mac(3, macro_multirow, "multirow"),
91
+ mac(1, macro_rowcolor, "rowcolor"),
92
+ mac(1, macro_columnbg, "columncolor"),
93
+ mac(1, macro_arrayrulecolor, "arrayrulecolor"),
94
+ mac(2, macro_newcolumntype, "newcolumntype"),
95
+ mac(1, macro_color, "color"),
96
+ mac(1, macro_cellcolor, "cellcolor"),
97
+ mac(1, macro_shoveright, "shoveright"),
98
+ mac(1, macro_shoveleft, "shoveleft"),
99
+ // endregion
100
+ // region sizes
101
+ mac(4, macro_declaremathsizes, "DeclareMathSizes"),
102
+ mac(1, macro_magnification, "magnification"),
103
+ mac(0, macro_sizes, "tiny"),
104
+ mac(0, macro_sizes, "scriptsize"),
105
+ mac(0, macro_sizes, "footnotesize"),
106
+ mac(0, macro_sizes, "small"),
107
+ mac(0, macro_sizes, "normalsize"),
108
+ mac(0, macro_sizes, "large"),
109
+ mac(0, macro_sizes, "Large"),
110
+ mac(0, macro_sizes, "LARGE"),
111
+ mac(0, macro_sizes, "huge"),
112
+ mac(0, macro_sizes, "Huge"),
113
+ mac(1, macro_big, "big"),
114
+ mac(1, macro_Big, "Big"),
115
+ mac(1, macro_bigg, "bigg"),
116
+ mac(1, macro_Bigg, "Bigg"),
117
+ mac(1, macro_bigl, "bigl"),
118
+ mac(1, macro_Bigl, "Bigl"),
119
+ mac(1, macro_biggl, "biggl"),
120
+ mac(1, macro_Biggl, "Biggl"),
121
+ mac(1, macro_bigr, "bigr"),
122
+ mac(1, macro_Bigr, "Bigr"),
123
+ mac(1, macro_biggr, "biggr"),
124
+ mac(1, macro_Biggr, "Biggr"),
125
+ // endregion
126
+ // region scripts & frac
127
+ mac(2, macro_frac, "frac"),
128
+ mac(6, macro_genfrac, "genfrac"),
129
+ mac(0, macro_above, "above"),
130
+ mac(0, macro_over, "over"),
131
+ mac(0, macro_atop, "atop"),
132
+ mac(2, macro_overwithdelims, "overwithdelims"),
133
+ mac(2, macro_atopwithdelims, "atopwithdelims"),
134
+ mac(2, macro_abovewithdelims, "abovewithdelims"),
135
+ mac(3, macro_sideset, "sideset"),
136
+ mac(3, macro_prescript, "prescript"),
137
+ // endregion
138
+ // region under & over delimiters
139
+ mac(1, macro_overdelim, "overrightarrow"),
140
+ mac(1, macro_overdelim, "overleftarrow"),
141
+ mac(1, macro_overdelim, "overleftrightarrow"),
142
+ mac(1, macro_underdelim, "underrightarrow"),
143
+ mac(1, macro_underdelim, "underleftarrow"),
144
+ mac(1, macro_underdelim, "underleftrightarrow"),
145
+ mac(1, macro_overdelim, "overbrace"),
146
+ mac(1, macro_overdelim, "overbracket"),
147
+ mac(1, macro_overdelim, "overparen"),
148
+ mac(1, macro_underdelim, "underbrace"),
149
+ mac(1, macro_underdelim, "underbracket"),
150
+ mac(1, macro_underdelim, "underparen"),
151
+ mac(1, macro_overline, "overline"),
152
+ mac(1, macro_underline, "underline"),
153
+ mac(1, macro_Braket, "Braket"),
154
+ mac(1, macro_Set, "Set"),
155
+ mac(0, macro_leftparenthesis, "("),
156
+ mac(0, macro_leftbracket, "["),
157
+ mac(0, macro_choose, "choose"),
158
+ mac(0, macro_brace, "brace"),
159
+ mac(0, macro_brack, "brack"),
160
+ mac(0, macro_bangle, "bangle"),
161
+ mac(1, macro_left, "left"),
162
+ mac(1, macro_middle, "middle"),
163
+ // endregion
164
+ // region atom types
165
+ mac(1, macro_mathop, "mathop"),
166
+ mac(1, macro_mathpunct, "mathpunct"),
167
+ mac(1, macro_mathord, "mathord"),
168
+ mac(1, macro_mathrel, "mathrel"),
169
+ mac(1, macro_mathinner, "mathinner"),
170
+ mac(1, macro_mathbin, "mathbin"),
171
+ mac(1, macro_mathopen, "mathopen"),
172
+ mac(1, macro_mathclose, "mathclose"),
173
+ // endregion
174
+ // region math and text styles
175
+ mac(0, macro_textfont, "bf"),
176
+ mac(0, macro_textfont, "it"),
177
+ mac(0, macro_textfont, "rm"),
178
+ mac(0, macro_textfont, "sf"),
179
+ mac(0, macro_textfont, "tt"),
180
+ mac(1, macro_textfont, "cal"),
181
+ mac(1, macro_textfont, "frak"),
182
+ mac(1, macro_textfont, "oldstylenums"),
183
+ mac(1, macro_mathfont, "mathnormal"),
184
+ mac(1, macro_mathfont, "mathrm"),
185
+ mac(1, macro_mathfont, "mathbf"),
186
+ mac(1, macro_mathfont, "mathit"),
187
+ mac(1, macro_mathfont, "mathcal"),
188
+ mac(1, macro_mathfont, "mathscr"),
189
+ mac(1, macro_mathfont, "mathfrak"),
190
+ mac(1, macro_mathfont, "mathbb"),
191
+ mac(1, macro_mathfont, "mathsf"),
192
+ mac(1, macro_mathfont, "mathtt"),
193
+ mac(1, macro_mathfont, "mathbfit"),
194
+ mac(1, macro_mathfont, "mathbfcal"),
195
+ mac(1, macro_mathfont, "mathbffrak"),
196
+ mac(1, macro_mathfont, "mathsfbf"),
197
+ mac(1, macro_mathfont, "mathbfsf"),
198
+ mac(1, macro_mathfont, "mathsfit"),
199
+ mac(1, macro_mathfont, "mathsfbfit"),
200
+ mac(1, macro_mathfont, "mathbfsfit"),
201
+ mac(1, macro_Bbb, "Bbb"),
202
+ mac(1, macro_mathds, "mathds"),
203
+ mac(1, macro_bold, "bold"),
204
+ mac(1, macro_bold, "boldsymbol"),
205
+ mac(2, macro_addfont, "addfont"),
206
+ // endregion
207
+ // region nested styles
208
+ mac(1, macro_text, "mbox"),
209
+ mac(1, macro_text, "text"),
210
+ mac(1, macro_intertext, "intertext"),
211
+ mac(1, macro_textit, "textit"),
212
+ mac(1, macro_textbf, "textbf"),
213
+ mac(1, macro_textsf, "textsf"),
214
+ mac(1, macro_texttt, "texttt"),
215
+ mac(1, macro_textrm, "textrm"),
216
+ // endregion
217
+ // region text accents
218
+ mac(1, macro_accentbiss, "^"),
219
+ mac(1, macro_accentbiss, "\'"),
220
+ mac(1, macro_accentbiss, "\""),
221
+ mac(1, macro_accentbiss, "`"),
222
+ mac(1, macro_accentbiss, "="),
223
+ mac(1, macro_accentbiss, "."),
224
+ mac(1, macro_accentbiss, "~"),
225
+ mac(1, macro_accentbiss, "t"),
226
+ mac(1, macro_accentbiss, "u"),
227
+ mac(1, macro_accentbiss, "v"),
228
+ mac(1, macro_accentbiss, "r"),
229
+ // endregion
230
+ // region math accents
231
+ mac(1, macro_accents, "not"),
232
+ mac(1, macro_accents, "hat"),
233
+ mac(1, macro_accents, "widehat"),
234
+ mac(1, macro_accents, "check"),
235
+ mac(1, macro_accents, "tilde"),
236
+ mac(1, macro_accents, "widetilde"),
237
+ mac(1, macro_accents, "acute"),
238
+ mac(1, macro_accents, "grave"),
239
+ mac(1, macro_accents, "dot"),
240
+ mac(1, macro_accents, "ddot"),
241
+ mac(1, macro_accents, "dddot"),
242
+ mac(1, macro_accents, "ddddot"),
243
+ mac(1, macro_accents, "breve"),
244
+ mac(1, macro_accents, "bar"),
245
+ mac(1, macro_accents, "vec"),
246
+ mac(1, macro_accents, "mathring"),
247
+ mac(2, macro_accentset, "accentset"), // fake accents
248
+ mac(2, macro_overset, "overset"),
249
+ mac(2, macro_underset, "underset"),
250
+ mac(2, macro_underaccent, "underaccent"),
251
+ mac(1, macro_undertilde, "undertilde"),
252
+ // endregion
253
+ // region microtex styles
254
+ mac(0, macro_texstyle, "displaystyle"),
255
+ mac(0, macro_texstyle, "textstyle"),
256
+ mac(0, macro_texstyle, "scriptstyle"),
257
+ mac(0, macro_texstyle, "scriptscriptstyle"),
258
+ mac(1, macro_everymath, "everymath"),
259
+ mac(1, macro_atexstyle, "dnomstyle"),
260
+ mac(1, macro_atexstyle, "numstyle"),
261
+ mac(1, macro_atexstyle, "substyle"),
262
+ mac(1, macro_atexstyle, "supstyle"),
263
+ // endregion
264
+ // region colors
265
+ mac(3, macro_definecolor, "definecolor"),
266
+ mac(2, macro_fgcolor, "fgcolor"),
267
+ mac(2, macro_bgcolor, "bgcolor"),
268
+ mac(2, macro_textcolor, "textcolor"),
269
+ mac(2, macro_colorbox, "colorbox"),
270
+ mac(3, macro_fcolorbox, "fcolorbox"),
271
+ // endregion
272
+ // region spaces
273
+ mac(0, macro_muskips, ","),
274
+ mac(0, macro_muskips, ":"),
275
+ mac(0, macro_muskips, ";"),
276
+ mac(0, macro_muskips, "thinspace"),
277
+ mac(0, macro_muskips, "medspace"),
278
+ mac(0, macro_muskips, "thickspace"),
279
+ mac(0, macro_muskips, "!"),
280
+ mac(0, macro_muskips, "negthinspace"),
281
+ mac(0, macro_muskips, "negmedspace"),
282
+ mac(0, macro_muskips, "negthickspace"),
283
+ mac(0, macro_quad, "quad"),
284
+ // endregion
285
+ // region boxes
286
+ mac(1, macro_reflectbox, "reflectbox"),
287
+ mac(3, macro_resizebox, "resizebox"),
288
+ mac(1, macro_shadowbox, "shadowbox"),
289
+ mac(1, macro_ovalbox, "ovalbox"),
290
+ mac(1, macro_cornersize, "cornersize"),
291
+ mac(1, macro_doublebox, "doublebox"),
292
+ mac(1, macro_fbox, "fbox"),
293
+ mac(1, macro_fbox, "boxed"),
294
+ // endregion
295
+ // region clr lap
296
+ mac(1, macro_clrlap, "llap"),
297
+ mac(1, macro_clrlap, "rlap"),
298
+ mac(1, macro_clrlap, "clap"),
299
+ mac(1, macro_mathclrlap, "mathllap"),
300
+ mac(1, macro_mathclrlap, "mathrlap"),
301
+ mac(1, macro_mathclrlap, "mathclap"),
302
+ // endregion
303
+ // region limits
304
+ mac(0, macro_nolimits, "nolimits"),
305
+ mac(0, macro_limits, "limits"),
306
+ mac(0, macro_normal, "normal"),
307
+ // endregion
308
+
309
+ mac(0, macro_kern, "kern"),
310
+ mac(0, macro_char, "char"),
311
+ mac(1, macro_romannumeral, "roman"),
312
+ mac(1, macro_romannumeral, "Roman"),
313
+ mac(0, macro_surd, "surd"),
314
+ mac(0, macro_lmoustache, "lmoustache"),
315
+ mac(0, macro_rmoustache, "rmoustache"),
316
+ mac(0, macro_breakmark, "-"),
317
+ mac(1, macro_st, "st"),
318
+ mac(2, macro_longdiv, "longdiv"),
319
+ mac(1, macro_cancel, "cancel"),
320
+ mac(1, macro_bcancel, "bcancel"),
321
+ mac(1, macro_xcancel, "xcancel"),
322
+ mac(6, macro_zstack, "stackinset"),
323
+ mac(0, macro_nbsp, "nbsp"),
324
+ mac(1, macro_sqrt, "sqrtsign"),
325
+ mac(0, macro_joinrel, "joinrel"),
326
+ mac(0, macro_cr, "cr"),
327
+ mac(0, macro_backslashcr, "\\"),
328
+ mac(1, macro_hvspace, "hspace"),
329
+ mac(1, macro_hvspace, "vspace"),
330
+ mac(0, macro_underscore, "underscore"),
331
+ mac(2, macro_binom, "binom"),
332
+ mac(1, macro_phantom, "phantom"),
333
+ mac(1, macro_hphantom, "hphantom"),
334
+ mac(1, macro_vphantom, "vphantom"),
335
+ mac(0, macro_spATbreve, "sp@breve"),
336
+ mac(0, macro_nokern, "nokern"),
337
+ #ifdef GRAPHICS_DEBUG
338
+ mac(1, macro_debug, "debug"),
339
+ mac(0, macro_undebug, "undebug"),
340
+ #endif // GRAPHICS_DEBUG
341
+ };
342
+
343
+ map<string, string> NewCommandMacro::_codes;
344
+ map<string, string> NewCommandMacro::_replacements;
345
+ Macro* NewCommandMacro::_instance = new NewCommandMacro();
346
+
347
+ inline static void env(int argc, const string& name, const string& begDef, const string& endDef) {
348
+ NewEnvironmentMacro::addNewEnvironment(name, begDef, endDef, argc);
349
+ }
350
+
351
+ inline static void cmd(int argc, const string& name, const string& code) {
352
+ NewCommandMacro::addNewCommand(name, code, argc);
353
+ }
354
+
355
+ void NewCommandMacro::_init_() {
356
+ // region Predefined environments
357
+ env(1, "array", "\\array@@env{#1}{", "}");
358
+ env(1, "tabular", "\\array@@env{#1}{", "}");
359
+ env(0, "matrix", "\\matrix@@env{", "}");
360
+ env(0, "smallmatrix", "\\smallmatrix@@env{", "}");
361
+ env(0, "pmatrix", "\\left(\\begin{matrix}", "\\end{matrix}\\right)");
362
+ env(0, "bmatrix", "\\left[\\begin{matrix}", "\\end{matrix}\\right]");
363
+ env(0, "Bmatrix", "\\left\\{\\begin{matrix}", "\\end{matrix}\\right\\}");
364
+ env(0, "vmatrix", "\\left|\\begin{matrix}", "\\end{matrix}\\right|");
365
+ env(0, "Vmatrix", "\\left\\|\\begin{matrix}", "\\end{matrix}\\right\\|");
366
+ env(0, "eqnarray", "\\begin{array}{rcl}", "\\end{array}");
367
+ env(0, "align", "\\align@@env{", "}");
368
+ env(0, "flalign", "\\flalign@@env{", "}");
369
+ env(1, "alignat", "\\alignat@@env{#1}{", "}");
370
+ env(0, "aligned", "\\aligned@@env{", "}");
371
+ env(1, "alignedat", "\\alignedat@@env{#1}{", "}");
372
+ env(0, "multline", "\\multline@@env{", "}");
373
+ env(0, "cases", "\\left\\{\\begin{array}{@{}ll@{\\,}}", "\\end{array}\\right.");
374
+ env(0, "rcases", "\\left.\\begin{array}{@{}ll@{\\,}}", "\\end{array}\\right\\}");
375
+ env(0, "split", "\\begin{array}{r@{\\;}l}", "\\end{array}");
376
+ env(0, "gather", "\\gather@@env{", "}");
377
+ env(0, "gathered", "\\gathered@@env{", "}");
378
+ env(0, "math", "\\(", "\\)");
379
+ env(0, "displaymath", "\\[", "\\]");
380
+ env(0, "equation", "\\begin{align}", "\\end{align}");
381
+ // endregion
382
+ // region Predefined commands
383
+ cmd(1, "operatorname", "\\mathop{\\mathrm{#1}}\\nolimits ");
384
+ cmd(2, "DeclareMathOperator", "\\newcommand{#1}{\\mathop{\\mathrm{#2}}\\nolimits}");
385
+ cmd(1, "substack", "{\\scriptstyle\\begin{array}{c}#1\\end{array}}");
386
+ cmd(2, "dfrac", "\\genfrac{}{}{1}{}{#1}{#2}");
387
+ cmd(2, "tfrac", "\\genfrac{}{}{1}{1}{#1}{#2}");
388
+ cmd(2, "dbinom", "\\genfrac{(}{)}{0pt}{}{#1}{#2}");
389
+ cmd(2, "tbinom", "\\genfrac{(}{)}{0pt}{1}{#1}{#2}");
390
+ cmd(1, "pmod", "\\qquad\\mathbin{(\\mathrm{mod}\\ #1)}");
391
+ cmd(1, "mod", "\\qquad\\mathbin{\\mathrm{mod}\\ #1}");
392
+ cmd(1, "pod", "\\qquad\\mathbin{(#1)}");
393
+ cmd(0, "spbreve", "^{\\makeatletter\\sp@breve\\makeatother}");
394
+ cmd(0, "spcheck", "^{\\vee}");
395
+ cmd(0, "spdot", "^{\\displaystyle.}");
396
+ cmd(1, "d", "\\underaccent{\\dot}{#1}");
397
+ cmd(1, "b", "\\underaccent{\\bar}{#1}");
398
+ cmd(1, "Bra", "\\left\\langle{#1}\\right\\vert");
399
+ cmd(1, "Ket", "\\left\\vert{#1}\\right\\rangle");
400
+ cmd(1, "textsuperscript", "{}^{\\text{#1}}");
401
+ cmd(1, "textsubscript", "{}_{\\text{#1}}");
402
+ cmd(1, "overbrack", "\\overbracket{#1}");
403
+ cmd(1, "underbrack", "\\underbracket{#1}");
404
+ cmd(0, "degree", "^\\circ");
405
+ cmd(0, "with", "\\mathbin{\\&}");
406
+ cmd(0, "parr", "\\mathbin{\\rotatebox[origin=c]{180}{\\&}}");
407
+ cmd(
408
+ 2,
409
+ "sfrac",
410
+ "\\scalebox{.8}{"
411
+ "\\raisebox{.5ex}{"
412
+ "\\raisebox{.45ex}{\\numstyle{#1}}"
413
+ "\\kern-.4ex\\nokern\\mathslash\\nokern\\kern-.4ex"
414
+ "\\raisebox{-.45ex}{\\dnomstyle{#2}}"
415
+ "}}"
416
+ );
417
+ // endregion
418
+ }
@@ -0,0 +1,56 @@
1
+ #include "macro/macro_delims.h"
2
+
3
+ #include "atom/atom_stack.h"
4
+ #include "utils/utf.h"
5
+
6
+ namespace microtex {
7
+
8
+ using namespace std;
9
+
10
+ macro(xarrow) {
11
+ const auto& name = args[0].substr(1);
12
+ const auto& over =
13
+ StackArgs::autoSpace(Formula(tp, args[1], false, tp.isMathMode())._root, false);
14
+ const auto& under =
15
+ StackArgs::autoSpace(Formula(tp, args[2], false, tp.isMathMode())._root, false);
16
+ const auto stack = new StackAtom(nullptr, over, under);
17
+ const auto& arrow = sptrOf<ExtensibleAtom>(
18
+ name,
19
+ // capture raw pointer to avoid cycle reference
20
+ [stack](const Env& env) -> float {
21
+ return stack->getMaxWidth() + Units::fsize(UnitType::ex, 1.f, env);
22
+ },
23
+ false
24
+ );
25
+ arrow->_type = AtomType::relation;
26
+ stack->setBaseAtom(arrow);
27
+ return sptr<StackAtom>(stack);
28
+ }
29
+
30
+ macro(left) {
31
+ const string& grep = tp.getGroup("\\left", "\\right");
32
+
33
+ auto left = Formula(tp, args[1], false)._root;
34
+ auto* big = dynamic_cast<BigSymbolAtom*>(left.get());
35
+ if (big != nullptr) left = big->_delim;
36
+
37
+ auto right = tp.getArgument();
38
+ big = dynamic_cast<BigSymbolAtom*>(right.get());
39
+ if (big != nullptr) right = big->_delim;
40
+
41
+ auto sl = dynamic_pointer_cast<CharSymbol>(left);
42
+ auto sr = dynamic_pointer_cast<CharSymbol>(right);
43
+ if (sl != nullptr && sr != nullptr) {
44
+ Formula tf(tp, grep, false);
45
+ return sptrOf<FencedAtom>(tf._root, sl->name(), sr->name(), tf.middle());
46
+ }
47
+
48
+ auto* ra = new RowAtom();
49
+ ra->add(left);
50
+ ra->add(Formula(tp, grep, false)._root);
51
+ ra->add(right);
52
+
53
+ return sptr<Atom>(ra);
54
+ }
55
+
56
+ } // namespace microtex
@@ -0,0 +1,73 @@
1
+ #ifndef MICROTEX_MACRO_DELIMS_H
2
+ #define MICROTEX_MACRO_DELIMS_H
3
+
4
+ #include "atom/atom.h"
5
+ #include "atom/atom_basic.h"
6
+ #include "atom/atom_delim.h"
7
+ #include "atom/atom_fence.h"
8
+ #include "atom/atom_misc.h"
9
+ #include "atom/atom_root.h"
10
+ #include "macro/macro_decl.h"
11
+ #include "utils/string_utils.h"
12
+ #include "utils/utf.h"
13
+
14
+ namespace microtex {
15
+
16
+ inline macro(overdelim) {
17
+ const auto& name = args[0];
18
+ const auto& base = Formula(tp, args[1], false)._root;
19
+ return sptrOf<OverUnderDelimiter>(base, name, true);
20
+ }
21
+
22
+ inline macro(underdelim) {
23
+ const auto& name = args[0];
24
+ const auto& base = Formula(tp, args[1], false)._root;
25
+ return sptrOf<OverUnderDelimiter>(base, name, false);
26
+ }
27
+
28
+ macro(xarrow);
29
+
30
+ inline macro(overline) {
31
+ return sptrOf<OverUnderBar>(Formula(tp, args[1], false)._root, true);
32
+ }
33
+
34
+ inline macro(underline) {
35
+ return sptrOf<OverUnderBar>(Formula(tp, args[1], false)._root, false);
36
+ }
37
+
38
+ inline macro(Braket) {
39
+ std::string str(args[1]);
40
+ replaceAll(str, "\\|", "\\middle\\vert ");
41
+ return Formula(tp, "\\left\\langle " + str + "\\right\\rangle")._root;
42
+ }
43
+
44
+ inline macro(Set) {
45
+ std::string str(args[1]);
46
+ replaceFirst(str, "\\|", "\\middle\\vert ");
47
+ return Formula(tp, "\\left\\{" + str + "\\right\\}")._root;
48
+ }
49
+
50
+ inline macro(leftparenthesis) {
51
+ std::string grp = tp.getGroup("\\(", "\\)");
52
+ return sptrOf<MathAtom>(Formula(tp, grp, false)._root, TexStyle::text);
53
+ }
54
+
55
+ inline macro(leftbracket) {
56
+ std::string grp = tp.getGroup("\\[", "\\]");
57
+ return sptrOf<MathAtom>(Formula(tp, grp, false)._root, TexStyle::display);
58
+ }
59
+
60
+ inline macro(middle) {
61
+ return sptrOf<MiddleAtom>(args[1]);
62
+ }
63
+
64
+ inline macro(sqrt) {
65
+ if (args[2].empty()) return sptrOf<NthRoot>(Formula(tp, args[1], false)._root, nullptr);
66
+ return sptrOf<NthRoot>(Formula(tp, args[1], false)._root, Formula(tp, args[2], false)._root);
67
+ }
68
+
69
+ macro(left);
70
+
71
+ } // namespace microtex
72
+
73
+ #endif // MICROTEX_MACRO_DELIMS_H