@alisio/plugin-thesis 0.1.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 (547) hide show
  1. package/.agents/agents/thesis-architect.md +38 -0
  2. package/.agents/agents/thesis-coordinator.md +39 -0
  3. package/.agents/agents/thesis-editor.md +35 -0
  4. package/.agents/agents/thesis-evidence-auditor.md +37 -0
  5. package/.agents/agents/thesis-librarian.md +38 -0
  6. package/.agents/agents/thesis-methodologist.md +39 -0
  7. package/.agents/agents/thesis-reviewer.md +36 -0
  8. package/.agents/agents/thesis-writer.md +38 -0
  9. package/.agents/skills/thesis-build/SKILL.md +48 -0
  10. package/.agents/skills/thesis-citations/SKILL.md +49 -0
  11. package/.agents/skills/thesis-csl-authoring/SKILL.md +48 -0
  12. package/.agents/skills/thesis-editing/SKILL.md +49 -0
  13. package/.agents/skills/thesis-evidence/SKILL.md +48 -0
  14. package/.agents/skills/thesis-figures/SKILL.md +50 -0
  15. package/.agents/skills/thesis-institution-norms/SKILL.md +50 -0
  16. package/.agents/skills/thesis-intake/SKILL.md +48 -0
  17. package/.agents/skills/thesis-math/SKILL.md +48 -0
  18. package/.agents/skills/thesis-methodology/SKILL.md +49 -0
  19. package/.agents/skills/thesis-outline/SKILL.md +48 -0
  20. package/.agents/skills/thesis-policy/SKILL.md +48 -0
  21. package/.agents/skills/thesis-review/SKILL.md +49 -0
  22. package/.agents/skills/thesis-search/SKILL.md +47 -0
  23. package/.agents/skills/thesis-writing/SKILL.md +52 -0
  24. package/LICENSE +21 -0
  25. package/README.es.md +242 -0
  26. package/README.md +235 -0
  27. package/THIRD_PARTY_NOTICES.md +94 -0
  28. package/assets/architecture.svg +1 -0
  29. package/assets/evidence-pipeline.svg +1 -0
  30. package/assets/lifecycle.svg +1 -0
  31. package/assets/policy-resolution.svg +1 -0
  32. package/cover.webp +0 -0
  33. package/dist/authoring.d.ts +30 -0
  34. package/dist/authoring.d.ts.map +1 -0
  35. package/dist/authoring.js +681 -0
  36. package/dist/authoring.js.map +1 -0
  37. package/dist/brief.d.ts +40 -0
  38. package/dist/brief.d.ts.map +1 -0
  39. package/dist/brief.js +566 -0
  40. package/dist/brief.js.map +1 -0
  41. package/dist/cache.d.ts +8 -0
  42. package/dist/cache.d.ts.map +1 -0
  43. package/dist/cache.js +20 -0
  44. package/dist/cache.js.map +1 -0
  45. package/dist/checks/brief.d.ts +5 -0
  46. package/dist/checks/brief.d.ts.map +1 -0
  47. package/dist/checks/brief.js +38 -0
  48. package/dist/checks/brief.js.map +1 -0
  49. package/dist/checks/citations.d.ts +14 -0
  50. package/dist/checks/citations.d.ts.map +1 -0
  51. package/dist/checks/citations.js +87 -0
  52. package/dist/checks/citations.js.map +1 -0
  53. package/dist/checks/claims.d.ts +16 -0
  54. package/dist/checks/claims.d.ts.map +1 -0
  55. package/dist/checks/claims.js +147 -0
  56. package/dist/checks/claims.js.map +1 -0
  57. package/dist/checks/closing.d.ts +20 -0
  58. package/dist/checks/closing.d.ts.map +1 -0
  59. package/dist/checks/closing.js +168 -0
  60. package/dist/checks/closing.js.map +1 -0
  61. package/dist/checks/design.d.ts +5 -0
  62. package/dist/checks/design.d.ts.map +1 -0
  63. package/dist/checks/design.js +107 -0
  64. package/dist/checks/design.js.map +1 -0
  65. package/dist/checks/document.d.ts +17 -0
  66. package/dist/checks/document.d.ts.map +1 -0
  67. package/dist/checks/document.js +213 -0
  68. package/dist/checks/document.js.map +1 -0
  69. package/dist/checks/evidence.d.ts +7 -0
  70. package/dist/checks/evidence.d.ts.map +1 -0
  71. package/dist/checks/evidence.js +133 -0
  72. package/dist/checks/evidence.js.map +1 -0
  73. package/dist/checks/hygiene.d.ts +5 -0
  74. package/dist/checks/hygiene.d.ts.map +1 -0
  75. package/dist/checks/hygiene.js +37 -0
  76. package/dist/checks/hygiene.js.map +1 -0
  77. package/dist/checks/index.d.ts +21 -0
  78. package/dist/checks/index.d.ts.map +1 -0
  79. package/dist/checks/index.js +98 -0
  80. package/dist/checks/index.js.map +1 -0
  81. package/dist/checks/language.d.ts +14 -0
  82. package/dist/checks/language.d.ts.map +1 -0
  83. package/dist/checks/language.js +73 -0
  84. package/dist/checks/language.js.map +1 -0
  85. package/dist/checks/outline.d.ts +25 -0
  86. package/dist/checks/outline.d.ts.map +1 -0
  87. package/dist/checks/outline.js +214 -0
  88. package/dist/checks/outline.js.map +1 -0
  89. package/dist/checks/policy.d.ts +5 -0
  90. package/dist/checks/policy.d.ts.map +1 -0
  91. package/dist/checks/policy.js +129 -0
  92. package/dist/checks/policy.js.map +1 -0
  93. package/dist/checks/project.d.ts +65 -0
  94. package/dist/checks/project.d.ts.map +1 -0
  95. package/dist/checks/project.js +203 -0
  96. package/dist/checks/project.js.map +1 -0
  97. package/dist/checks/styles.d.ts +12 -0
  98. package/dist/checks/styles.d.ts.map +1 -0
  99. package/dist/checks/styles.js +67 -0
  100. package/dist/checks/styles.js.map +1 -0
  101. package/dist/checks/writing.d.ts +6 -0
  102. package/dist/checks/writing.d.ts.map +1 -0
  103. package/dist/checks/writing.js +115 -0
  104. package/dist/checks/writing.js.map +1 -0
  105. package/dist/chrome/detect.d.ts +19 -0
  106. package/dist/chrome/detect.d.ts.map +1 -0
  107. package/dist/chrome/detect.js +116 -0
  108. package/dist/chrome/detect.js.map +1 -0
  109. package/dist/claims.d.ts +19 -0
  110. package/dist/claims.d.ts.map +1 -0
  111. package/dist/claims.js +99 -0
  112. package/dist/claims.js.map +1 -0
  113. package/dist/cli.d.ts +11 -0
  114. package/dist/cli.d.ts.map +1 -0
  115. package/dist/cli.js +262 -0
  116. package/dist/cli.js.map +1 -0
  117. package/dist/context.d.ts +55 -0
  118. package/dist/context.d.ts.map +1 -0
  119. package/dist/context.js +62 -0
  120. package/dist/context.js.map +1 -0
  121. package/dist/coordinator.d.ts +139 -0
  122. package/dist/coordinator.d.ts.map +1 -0
  123. package/dist/coordinator.js +710 -0
  124. package/dist/coordinator.js.map +1 -0
  125. package/dist/delegate.d.ts +34 -0
  126. package/dist/delegate.d.ts.map +1 -0
  127. package/dist/delegate.js +105 -0
  128. package/dist/delegate.js.map +1 -0
  129. package/dist/diffguard.d.ts +24 -0
  130. package/dist/diffguard.d.ts.map +1 -0
  131. package/dist/diffguard.js +92 -0
  132. package/dist/diffguard.js.map +1 -0
  133. package/dist/doctor.d.ts +34 -0
  134. package/dist/doctor.d.ts.map +1 -0
  135. package/dist/doctor.js +155 -0
  136. package/dist/doctor.js.map +1 -0
  137. package/dist/draft.d.ts +64 -0
  138. package/dist/draft.d.ts.map +1 -0
  139. package/dist/draft.js +801 -0
  140. package/dist/draft.js.map +1 -0
  141. package/dist/figure.d.ts +13 -0
  142. package/dist/figure.d.ts.map +1 -0
  143. package/dist/figure.js +143 -0
  144. package/dist/figure.js.map +1 -0
  145. package/dist/finalize.d.ts +29 -0
  146. package/dist/finalize.d.ts.map +1 -0
  147. package/dist/finalize.js +230 -0
  148. package/dist/finalize.js.map +1 -0
  149. package/dist/index.d.ts +33 -0
  150. package/dist/index.d.ts.map +1 -0
  151. package/dist/index.js +206 -0
  152. package/dist/index.js.map +1 -0
  153. package/dist/intake.d.ts +57 -0
  154. package/dist/intake.d.ts.map +1 -0
  155. package/dist/intake.js +772 -0
  156. package/dist/intake.js.map +1 -0
  157. package/dist/labels.d.ts +50 -0
  158. package/dist/labels.d.ts.map +1 -0
  159. package/dist/labels.js +98 -0
  160. package/dist/labels.js.map +1 -0
  161. package/dist/outline.d.ts +45 -0
  162. package/dist/outline.d.ts.map +1 -0
  163. package/dist/outline.js +148 -0
  164. package/dist/outline.js.map +1 -0
  165. package/dist/pack-commands.d.ts +18 -0
  166. package/dist/pack-commands.d.ts.map +1 -0
  167. package/dist/pack-commands.js +397 -0
  168. package/dist/pack-commands.js.map +1 -0
  169. package/dist/package-paths.d.ts +8 -0
  170. package/dist/package-paths.d.ts.map +1 -0
  171. package/dist/package-paths.js +13 -0
  172. package/dist/package-paths.js.map +1 -0
  173. package/dist/policy/context.d.ts +19 -0
  174. package/dist/policy/context.d.ts.map +1 -0
  175. package/dist/policy/context.js +62 -0
  176. package/dist/policy/context.js.map +1 -0
  177. package/dist/policy/ethics.d.ts +59 -0
  178. package/dist/policy/ethics.d.ts.map +1 -0
  179. package/dist/policy/ethics.js +106 -0
  180. package/dist/policy/ethics.js.map +1 -0
  181. package/dist/policy/kinds.d.ts +9 -0
  182. package/dist/policy/kinds.d.ts.map +1 -0
  183. package/dist/policy/kinds.js +68 -0
  184. package/dist/policy/kinds.js.map +1 -0
  185. package/dist/policy/packs.d.ts +53 -0
  186. package/dist/policy/packs.d.ts.map +1 -0
  187. package/dist/policy/packs.js +336 -0
  188. package/dist/policy/packs.js.map +1 -0
  189. package/dist/policy/resolver.d.ts +87 -0
  190. package/dist/policy/resolver.d.ts.map +1 -0
  191. package/dist/policy/resolver.js +337 -0
  192. package/dist/policy/resolver.js.map +1 -0
  193. package/dist/policy/rules.d.ts +65 -0
  194. package/dist/policy/rules.d.ts.map +1 -0
  195. package/dist/policy/rules.js +194 -0
  196. package/dist/policy/rules.js.map +1 -0
  197. package/dist/protocol.d.ts +46 -0
  198. package/dist/protocol.d.ts.map +1 -0
  199. package/dist/protocol.js +86 -0
  200. package/dist/protocol.js.map +1 -0
  201. package/dist/render/adapters/chrome-pdf/cdp.d.ts +36 -0
  202. package/dist/render/adapters/chrome-pdf/cdp.d.ts.map +1 -0
  203. package/dist/render/adapters/chrome-pdf/cdp.js +291 -0
  204. package/dist/render/adapters/chrome-pdf/cdp.js.map +1 -0
  205. package/dist/render/adapters/chrome-pdf/index.d.ts +10 -0
  206. package/dist/render/adapters/chrome-pdf/index.d.ts.map +1 -0
  207. package/dist/render/adapters/chrome-pdf/index.js +139 -0
  208. package/dist/render/adapters/chrome-pdf/index.js.map +1 -0
  209. package/dist/render/adapters/chrome-pdf/network.d.ts +7 -0
  210. package/dist/render/adapters/chrome-pdf/network.d.ts.map +1 -0
  211. package/dist/render/adapters/chrome-pdf/network.js +33 -0
  212. package/dist/render/adapters/chrome-pdf/network.js.map +1 -0
  213. package/dist/render/adapters/html-preview/index.d.ts +8 -0
  214. package/dist/render/adapters/html-preview/index.d.ts.map +1 -0
  215. package/dist/render/adapters/html-preview/index.js +62 -0
  216. package/dist/render/adapters/html-preview/index.js.map +1 -0
  217. package/dist/render/adapters/test-json/index.d.ts +8 -0
  218. package/dist/render/adapters/test-json/index.d.ts.map +1 -0
  219. package/dist/render/adapters/test-json/index.js +62 -0
  220. package/dist/render/adapters/test-json/index.js.map +1 -0
  221. package/dist/render/adapters/typst-pdf/emitter.d.ts +21 -0
  222. package/dist/render/adapters/typst-pdf/emitter.d.ts.map +1 -0
  223. package/dist/render/adapters/typst-pdf/emitter.js +259 -0
  224. package/dist/render/adapters/typst-pdf/emitter.js.map +1 -0
  225. package/dist/render/adapters/typst-pdf/escape.d.ts +14 -0
  226. package/dist/render/adapters/typst-pdf/escape.d.ts.map +1 -0
  227. package/dist/render/adapters/typst-pdf/escape.js +56 -0
  228. package/dist/render/adapters/typst-pdf/escape.js.map +1 -0
  229. package/dist/render/adapters/typst-pdf/index.d.ts +9 -0
  230. package/dist/render/adapters/typst-pdf/index.d.ts.map +1 -0
  231. package/dist/render/adapters/typst-pdf/index.js +154 -0
  232. package/dist/render/adapters/typst-pdf/index.js.map +1 -0
  233. package/dist/render/adapters/typst-pdf/profile.d.ts +3 -0
  234. package/dist/render/adapters/typst-pdf/profile.d.ts.map +1 -0
  235. package/dist/render/adapters/typst-pdf/profile.js +55 -0
  236. package/dist/render/adapters/typst-pdf/profile.js.map +1 -0
  237. package/dist/render/adapters/typst-pdf/runner.d.ts +52 -0
  238. package/dist/render/adapters/typst-pdf/runner.d.ts.map +1 -0
  239. package/dist/render/adapters/typst-pdf/runner.js +209 -0
  240. package/dist/render/adapters/typst-pdf/runner.js.map +1 -0
  241. package/dist/render/adapters/typst-pdf/setup.d.ts +30 -0
  242. package/dist/render/adapters/typst-pdf/setup.d.ts.map +1 -0
  243. package/dist/render/adapters/typst-pdf/setup.js +183 -0
  244. package/dist/render/adapters/typst-pdf/setup.js.map +1 -0
  245. package/dist/render/adapters/typst-pdf/version.d.ts +8 -0
  246. package/dist/render/adapters/typst-pdf/version.d.ts.map +1 -0
  247. package/dist/render/adapters/typst-pdf/version.js +14 -0
  248. package/dist/render/adapters/typst-pdf/version.js.map +1 -0
  249. package/dist/render/assemble.d.ts +28 -0
  250. package/dist/render/assemble.d.ts.map +1 -0
  251. package/dist/render/assemble.js +309 -0
  252. package/dist/render/assemble.js.map +1 -0
  253. package/dist/render/assets.d.ts +27 -0
  254. package/dist/render/assets.d.ts.map +1 -0
  255. package/dist/render/assets.js +232 -0
  256. package/dist/render/assets.js.map +1 -0
  257. package/dist/render/build.d.ts +43 -0
  258. package/dist/render/build.d.ts.map +1 -0
  259. package/dist/render/build.js +187 -0
  260. package/dist/render/build.js.map +1 -0
  261. package/dist/render/charts.d.ts +83 -0
  262. package/dist/render/charts.d.ts.map +1 -0
  263. package/dist/render/charts.js +633 -0
  264. package/dist/render/charts.js.map +1 -0
  265. package/dist/render/default-registry.d.ts +7 -0
  266. package/dist/render/default-registry.d.ts.map +1 -0
  267. package/dist/render/default-registry.js +15 -0
  268. package/dist/render/default-registry.js.map +1 -0
  269. package/dist/render/diagram-theme.d.ts +7 -0
  270. package/dist/render/diagram-theme.d.ts.map +1 -0
  271. package/dist/render/diagram-theme.js +50 -0
  272. package/dist/render/diagram-theme.js.map +1 -0
  273. package/dist/render/dialect.d.ts +23 -0
  274. package/dist/render/dialect.d.ts.map +1 -0
  275. package/dist/render/dialect.js +188 -0
  276. package/dist/render/dialect.js.map +1 -0
  277. package/dist/render/html/citations.d.ts +70 -0
  278. package/dist/render/html/citations.d.ts.map +1 -0
  279. package/dist/render/html/citations.js +371 -0
  280. package/dist/render/html/citations.js.map +1 -0
  281. package/dist/render/html/css.d.ts +14 -0
  282. package/dist/render/html/css.d.ts.map +1 -0
  283. package/dist/render/html/css.js +113 -0
  284. package/dist/render/html/css.js.map +1 -0
  285. package/dist/render/html/emitter.d.ts +20 -0
  286. package/dist/render/html/emitter.d.ts.map +1 -0
  287. package/dist/render/html/emitter.js +652 -0
  288. package/dist/render/html/emitter.js.map +1 -0
  289. package/dist/render/html/escape.d.ts +11 -0
  290. package/dist/render/html/escape.d.ts.map +1 -0
  291. package/dist/render/html/escape.js +32 -0
  292. package/dist/render/html/escape.js.map +1 -0
  293. package/dist/render/html/katex.d.ts +9 -0
  294. package/dist/render/html/katex.d.ts.map +1 -0
  295. package/dist/render/html/katex.js +39 -0
  296. package/dist/render/html/katex.js.map +1 -0
  297. package/dist/render/html/stage.d.ts +12 -0
  298. package/dist/render/html/stage.d.ts.map +1 -0
  299. package/dist/render/html/stage.js +30 -0
  300. package/dist/render/html/stage.js.map +1 -0
  301. package/dist/render/index.d.ts +5 -0
  302. package/dist/render/index.d.ts.map +1 -0
  303. package/dist/render/index.js +5 -0
  304. package/dist/render/index.js.map +1 -0
  305. package/dist/render/math.d.ts +9 -0
  306. package/dist/render/math.d.ts.map +1 -0
  307. package/dist/render/math.js +60 -0
  308. package/dist/render/math.js.map +1 -0
  309. package/dist/render/model.d.ts +233 -0
  310. package/dist/render/model.d.ts.map +1 -0
  311. package/dist/render/model.js +2 -0
  312. package/dist/render/model.js.map +1 -0
  313. package/dist/render/numbering.d.ts +51 -0
  314. package/dist/render/numbering.d.ts.map +1 -0
  315. package/dist/render/numbering.js +155 -0
  316. package/dist/render/numbering.js.map +1 -0
  317. package/dist/render/output-name.d.ts +4 -0
  318. package/dist/render/output-name.d.ts.map +1 -0
  319. package/dist/render/output-name.js +11 -0
  320. package/dist/render/output-name.js.map +1 -0
  321. package/dist/render/palettes.d.ts +22 -0
  322. package/dist/render/palettes.d.ts.map +1 -0
  323. package/dist/render/palettes.js +46 -0
  324. package/dist/render/palettes.js.map +1 -0
  325. package/dist/render/parse.d.ts +15 -0
  326. package/dist/render/parse.d.ts.map +1 -0
  327. package/dist/render/parse.js +637 -0
  328. package/dist/render/parse.js.map +1 -0
  329. package/dist/render/port.d.ts +79 -0
  330. package/dist/render/port.d.ts.map +1 -0
  331. package/dist/render/port.js +2 -0
  332. package/dist/render/port.js.map +1 -0
  333. package/dist/render/registry.d.ts +11 -0
  334. package/dist/render/registry.d.ts.map +1 -0
  335. package/dist/render/registry.js +21 -0
  336. package/dist/render/registry.js.map +1 -0
  337. package/dist/render/text.d.ts +13 -0
  338. package/dist/render/text.d.ts.map +1 -0
  339. package/dist/render/text.js +65 -0
  340. package/dist/render/text.js.map +1 -0
  341. package/dist/render/walk.d.ts +13 -0
  342. package/dist/render/walk.d.ts.map +1 -0
  343. package/dist/render/walk.js +69 -0
  344. package/dist/render/walk.js.map +1 -0
  345. package/dist/research/bibtex.d.ts +12 -0
  346. package/dist/research/bibtex.d.ts.map +1 -0
  347. package/dist/research/bibtex.js +99 -0
  348. package/dist/research/bibtex.js.map +1 -0
  349. package/dist/research/client.d.ts +112 -0
  350. package/dist/research/client.d.ts.map +1 -0
  351. package/dist/research/client.js +661 -0
  352. package/dist/research/client.js.map +1 -0
  353. package/dist/research/dossier.d.ts +31 -0
  354. package/dist/research/dossier.d.ts.map +1 -0
  355. package/dist/research/dossier.js +54 -0
  356. package/dist/research/dossier.js.map +1 -0
  357. package/dist/research/flow.d.ts +31 -0
  358. package/dist/research/flow.d.ts.map +1 -0
  359. package/dist/research/flow.js +635 -0
  360. package/dist/research/flow.js.map +1 -0
  361. package/dist/research/library.d.ts +79 -0
  362. package/dist/research/library.d.ts.map +1 -0
  363. package/dist/research/library.js +319 -0
  364. package/dist/research/library.js.map +1 -0
  365. package/dist/research/verify.d.ts +80 -0
  366. package/dist/research/verify.d.ts.map +1 -0
  367. package/dist/research/verify.js +307 -0
  368. package/dist/research/verify.js.map +1 -0
  369. package/dist/resources.d.ts +15 -0
  370. package/dist/resources.d.ts.map +1 -0
  371. package/dist/resources.js +148 -0
  372. package/dist/resources.js.map +1 -0
  373. package/dist/review.d.ts +22 -0
  374. package/dist/review.d.ts.map +1 -0
  375. package/dist/review.js +355 -0
  376. package/dist/review.js.map +1 -0
  377. package/dist/schemas.d.ts +252 -0
  378. package/dist/schemas.d.ts.map +1 -0
  379. package/dist/schemas.js +1020 -0
  380. package/dist/schemas.js.map +1 -0
  381. package/dist/sections.d.ts +30 -0
  382. package/dist/sections.d.ts.map +1 -0
  383. package/dist/sections.js +62 -0
  384. package/dist/sections.js.map +1 -0
  385. package/dist/storage.d.ts +21 -0
  386. package/dist/storage.d.ts.map +1 -0
  387. package/dist/storage.js +296 -0
  388. package/dist/storage.js.map +1 -0
  389. package/dist/style-commands.d.ts +15 -0
  390. package/dist/style-commands.d.ts.map +1 -0
  391. package/dist/style-commands.js +54 -0
  392. package/dist/style-commands.js.map +1 -0
  393. package/dist/styles/csl.d.ts +58 -0
  394. package/dist/styles/csl.d.ts.map +1 -0
  395. package/dist/styles/csl.js +112 -0
  396. package/dist/styles/csl.js.map +1 -0
  397. package/dist/styles/discovery.d.ts +45 -0
  398. package/dist/styles/discovery.d.ts.map +1 -0
  399. package/dist/styles/discovery.js +99 -0
  400. package/dist/styles/discovery.js.map +1 -0
  401. package/dist/styles/golden.d.ts +52 -0
  402. package/dist/styles/golden.d.ts.map +1 -0
  403. package/dist/styles/golden.js +216 -0
  404. package/dist/styles/golden.js.map +1 -0
  405. package/dist/styles/profile.d.ts +126 -0
  406. package/dist/styles/profile.d.ts.map +1 -0
  407. package/dist/styles/profile.js +582 -0
  408. package/dist/styles/profile.js.map +1 -0
  409. package/dist/styles/xml.d.ts +22 -0
  410. package/dist/styles/xml.d.ts.map +1 -0
  411. package/dist/styles/xml.js +179 -0
  412. package/dist/styles/xml.js.map +1 -0
  413. package/dist/types.d.ts +285 -0
  414. package/dist/types.d.ts.map +1 -0
  415. package/dist/types.js +155 -0
  416. package/dist/types.js.map +1 -0
  417. package/dist/typst-pins.d.ts +16 -0
  418. package/dist/typst-pins.d.ts.map +1 -0
  419. package/dist/typst-pins.js +39 -0
  420. package/dist/typst-pins.js.map +1 -0
  421. package/dist/version.d.ts +2 -0
  422. package/dist/version.d.ts.map +1 -0
  423. package/dist/version.js +3 -0
  424. package/dist/version.js.map +1 -0
  425. package/dist/workflow.d.ts +49 -0
  426. package/dist/workflow.d.ts.map +1 -0
  427. package/dist/workflow.js +722 -0
  428. package/dist/workflow.js.map +1 -0
  429. package/dist/workspace.d.ts +12 -0
  430. package/dist/workspace.d.ts.map +1 -0
  431. package/dist/workspace.js +71 -0
  432. package/dist/workspace.js.map +1 -0
  433. package/package.json +70 -0
  434. package/policy-packs/countries/CO/academic-standards/ntc-1486-2022.yaml +188 -0
  435. package/policy-packs/countries/CO/copyright/decision-andina-351.yaml +61 -0
  436. package/policy-packs/countries/CO/copyright/ley-1915-2018.yaml +25 -0
  437. package/policy-packs/countries/CO/copyright/ley-23-1982.yaml +64 -0
  438. package/policy-packs/countries/CO/domains/health/resolucion-8430-1993.yaml +219 -0
  439. package/policy-packs/countries/CO/higher-education/ley-30-1992.yaml +61 -0
  440. package/policy-packs/countries/CO/manifest.yaml +42 -0
  441. package/policy-packs/countries/CO/official-domains.yaml +90 -0
  442. package/policy-packs/countries/CO/privacy/ley-1581-2012.yaml +197 -0
  443. package/policy-packs/countries/CO/research-integrity/minciencias-res-0314-2018.yaml +64 -0
  444. package/policy-packs/global/academic-integrity.yaml +45 -0
  445. package/policy-packs/global/academic-writing.yaml +70 -0
  446. package/policy-packs/global/evidence-quality.yaml +81 -0
  447. package/policy-packs/global/manifest.yaml +54 -0
  448. package/policy-packs/global/objective-verbs.yaml +245 -0
  449. package/policy-packs/global/reporting-guidelines.yaml +392 -0
  450. package/policy-packs/global/work-types.yaml +195 -0
  451. package/styles/LICENSE-CSL +375 -0
  452. package/styles/apa.csl +2283 -0
  453. package/styles/catalog.json +43 -0
  454. package/styles/fixtures/apa-7.expected.json +25 -0
  455. package/styles/fixtures/icontec-ntc1486-2022.expected.json +25 -0
  456. package/styles/fixtures/ieee.expected.json +25 -0
  457. package/styles/fixtures/references.jsonl +8 -0
  458. package/styles/icontec-ntc1486-2022.csl +388 -0
  459. package/styles/ieee.csl +519 -0
  460. package/templates/html/runtime.js +159 -0
  461. package/templates/html/thesis.css +98 -0
  462. package/templates/html/vendor/katex/LICENSE +21 -0
  463. package/templates/html/vendor/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  464. package/templates/html/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  465. package/templates/html/vendor/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  466. package/templates/html/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  467. package/templates/html/vendor/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  468. package/templates/html/vendor/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  469. package/templates/html/vendor/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  470. package/templates/html/vendor/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  471. package/templates/html/vendor/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  472. package/templates/html/vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  473. package/templates/html/vendor/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  474. package/templates/html/vendor/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  475. package/templates/html/vendor/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  476. package/templates/html/vendor/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  477. package/templates/html/vendor/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  478. package/templates/html/vendor/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  479. package/templates/html/vendor/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  480. package/templates/html/vendor/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  481. package/templates/html/vendor/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  482. package/templates/html/vendor/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  483. package/templates/html/vendor/katex/katex.min.css +1 -0
  484. package/templates/html/vendor/katex/katex.min.js +1 -0
  485. package/templates/html/vendor/mermaid/LICENSE +21 -0
  486. package/templates/html/vendor/mermaid/mermaid.min.js +3587 -0
  487. package/templates/html/vendor/pagedjs/LICENSE +21 -0
  488. package/templates/html/vendor/pagedjs/paged.polyfill.min.js +4 -0
  489. package/templates/palettes.json +57 -0
  490. package/templates/profiles/apa-7.profile.yaml +15 -0
  491. package/templates/profiles/generic.profile.yaml +20 -0
  492. package/templates/profiles/icontec-ntc1486-2022.profile.yaml +36 -0
  493. package/templates/profiles/ieee.profile.yaml +14 -0
  494. package/templates/typst/i18n/en.yaml +31 -0
  495. package/templates/typst/i18n/es.yaml +31 -0
  496. package/templates/typst/i18n/pt.yaml +31 -0
  497. package/templates/typst/thesis.typ +276 -0
  498. package/typst-packages/preview/merman/0.3.0/LICENSE +231 -0
  499. package/typst-packages/preview/merman/0.3.0/README.md +388 -0
  500. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/cose-base-v1/LICENSE +21 -0
  501. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/cose-base-v2/LICENSE +21 -0
  502. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/cytoscape/LICENSE +19 -0
  503. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/cytoscape-cose-bilkent/LICENSE +21 -0
  504. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/cytoscape-fcose/LICENSE +19 -0
  505. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/d3-shape/LICENSE +13 -0
  506. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/dagre/LICENSE +19 -0
  507. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/dompurify/LICENSE +202 -0
  508. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/eclipse-elk/LICENSE.md +264 -0
  509. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/elkjs/LICENSE.md +264 -0
  510. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/fmin/LICENSE +27 -0
  511. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/graphlib/LICENSE +19 -0
  512. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/layout-base-v1/LICENSE +21 -0
  513. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/layout-base-v2/LICENSE +21 -0
  514. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/mermaid/LICENSE +21 -0
  515. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/rough-rs/LICENSE +21 -0
  516. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/roughjs/LICENSE +21 -0
  517. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/sanitize-url/LICENSE +21 -0
  518. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/venn-js/LICENSE +22 -0
  519. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/wasm-minimal-protocol/LICENSE +24 -0
  520. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_LICENSES/zenuml-core/LICENSE +21 -0
  521. package/typst-packages/preview/merman/0.3.0/THIRD_PARTY_NOTICES.md +265 -0
  522. package/typst-packages/preview/merman/0.3.0/lib.typ +1 -0
  523. package/typst-packages/preview/merman/0.3.0/merman_typst_plugin.wasm +0 -0
  524. package/typst-packages/preview/merman/0.3.0/src/capabilities.typ +5 -0
  525. package/typst-packages/preview/merman/0.3.0/src/context.typ +1 -0
  526. package/typst-packages/preview/merman/0.3.0/src/errors.typ +33 -0
  527. package/typst-packages/preview/merman/0.3.0/src/exports.typ +5 -0
  528. package/typst-packages/preview/merman/0.3.0/src/figure.typ +143 -0
  529. package/typst-packages/preview/merman/0.3.0/src/image.typ +50 -0
  530. package/typst-packages/preview/merman/0.3.0/src/options.typ +566 -0
  531. package/typst-packages/preview/merman/0.3.0/src/plugin.typ +1 -0
  532. package/typst-packages/preview/merman/0.3.0/src/raw.typ +22 -0
  533. package/typst-packages/preview/merman/0.3.0/src/render.typ +137 -0
  534. package/typst-packages/preview/merman/0.3.0/src/source.typ +7 -0
  535. package/typst-packages/preview/merman/0.3.0/src/units.typ +51 -0
  536. package/typst-packages/preview/merman/0.3.0/typst.toml +12 -0
  537. package/typst-packages/preview/mitex/0.2.7/CHANGELOG.md +69 -0
  538. package/typst-packages/preview/mitex/0.2.7/LICENSE +176 -0
  539. package/typst-packages/preview/mitex/0.2.7/README.md +154 -0
  540. package/typst-packages/preview/mitex/0.2.7/lib.typ +1 -0
  541. package/typst-packages/preview/mitex/0.2.7/mitex.typ +45 -0
  542. package/typst-packages/preview/mitex/0.2.7/mitex.wasm +0 -0
  543. package/typst-packages/preview/mitex/0.2.7/specs/README.md +250 -0
  544. package/typst-packages/preview/mitex/0.2.7/specs/latex/standard.typ +1187 -0
  545. package/typst-packages/preview/mitex/0.2.7/specs/mod.typ +12 -0
  546. package/typst-packages/preview/mitex/0.2.7/specs/prelude.typ +230 -0
  547. package/typst-packages/preview/mitex/0.2.7/typst.toml +12 -0
@@ -0,0 +1,137 @@
1
+ #import "context.typ": typst-layout
2
+ #import "errors.typ": validate-error-mode
3
+ #import "image.typ": result-image, svg-bytes-or-panic
4
+ #import "options.typ": config-with-context-width, context-host-theme, options-bytes, render-config
5
+ #import "plugin.typ": merman-plugin
6
+ #import "source.typ": source-text-value
7
+ #import "units.typ": context-width-css-px
8
+
9
+ #let render-svg-result-with-config(source, config) = {
10
+ let source-text = source-text-value(source)
11
+ let envelope = json(
12
+ merman-plugin.render_svg_json(bytes(source-text), options-bytes(config.binding_options)),
13
+ )
14
+ if envelope.operation != "render-svg" {
15
+ panic("merman Typst plugin returned an unexpected render operation")
16
+ }
17
+ (
18
+ version: envelope.version,
19
+ operation: envelope.operation,
20
+ ok: envelope.ok,
21
+ code: envelope.code,
22
+ code_name: envelope.code_name,
23
+ kind: envelope.kind,
24
+ capability_id: envelope.capability_id,
25
+ message: envelope.message,
26
+ details: if "details" in envelope { envelope.details } else { none },
27
+ svg: if envelope.ok { envelope.data.svg } else { none },
28
+ )
29
+ }
30
+
31
+ #let render-svg-result(source, ..args) = {
32
+ render-svg-result-with-config(source, render-config(..args))
33
+ }
34
+
35
+ #let render-svg-bytes(..args) = {
36
+ svg-bytes-or-panic(render-svg-result(..args))
37
+ }
38
+
39
+ #let analyze-payload-with-config(source, config) = {
40
+ let source-text = source-text-value(source)
41
+ let envelope = json(
42
+ merman-plugin.analyze_json(bytes(source-text), options-bytes(config.binding_options)),
43
+ )
44
+ if envelope.operation != "analyze" {
45
+ panic("merman Typst plugin returned an unexpected analysis operation")
46
+ }
47
+ if envelope.ok { envelope.data.analysis } else { envelope }
48
+ }
49
+
50
+ #let analyze-payload(source, ..args) = {
51
+ analyze-payload-with-config(source, render-config(..args))
52
+ }
53
+
54
+ #let mermaid-result(source, ..args) = render-svg-result(source, ..args)
55
+
56
+ #let mermaid-svg(source, ..args) = {
57
+ str(render-svg-bytes(source, ..args))
58
+ }
59
+
60
+ #let analyze-mermaid(source, ..args) = analyze-payload(source, ..args)
61
+
62
+ #let render-image(
63
+ source,
64
+ width: auto,
65
+ height: auto,
66
+ fit: "contain",
67
+ scale: none,
68
+ alt: none,
69
+ error-mode: "panic",
70
+ ..args,
71
+ ) = {
72
+ let result = render-svg-result(source, ..args)
73
+ result-image(result, width, height, fit, alt, scale, error-mode)
74
+ }
75
+
76
+ #let render-image-with-document-context(
77
+ source,
78
+ width: auto,
79
+ height: auto,
80
+ fit: "contain",
81
+ scale: none,
82
+ alt: none,
83
+ error-mode: "panic",
84
+ ..args,
85
+ ) = context {
86
+ let inferred-host-theme = context-host-theme(text.font, text.size)
87
+ let base-config = render-config(context-host-theme: inferred-host-theme, ..args)
88
+ if base-config.direct_layout != none or base-config.direct_container_width != none or base-config.direct_options != none or base-config.profile_options != none or base-config.profile_layout_container_width != none {
89
+ let result = render-svg-result-with-config(source, base-config)
90
+ result-image(result, width, height, fit, alt, scale, error-mode)
91
+ } else {
92
+ typst-layout(size => {
93
+ let result = render-svg-result-with-config(
94
+ source,
95
+ config-with-context-width(base-config, context-width-css-px(size.width)),
96
+ )
97
+ result-image(result, width, height, fit, alt, scale, error-mode)
98
+ })
99
+ }
100
+ }
101
+
102
+ #let mermaid(
103
+ source,
104
+ document-context: false,
105
+ width: auto,
106
+ height: auto,
107
+ fit: "contain",
108
+ scale: none,
109
+ alt: none,
110
+ error-mode: "panic",
111
+ ..args,
112
+ ) = {
113
+ let error-mode = validate-error-mode(error-mode)
114
+ if document-context {
115
+ render-image-with-document-context(
116
+ source,
117
+ width: width,
118
+ height: height,
119
+ fit: fit,
120
+ scale: scale,
121
+ alt: alt,
122
+ error-mode: error-mode,
123
+ ..args,
124
+ )
125
+ } else {
126
+ render-image(
127
+ source,
128
+ width: width,
129
+ height: height,
130
+ fit: fit,
131
+ scale: scale,
132
+ alt: alt,
133
+ error-mode: error-mode,
134
+ ..args,
135
+ )
136
+ }
137
+ }
@@ -0,0 +1,7 @@
1
+ #let source-text-value(source) = {
2
+ if type(source) == str {
3
+ source
4
+ } else {
5
+ source.text
6
+ }
7
+ }
@@ -0,0 +1,51 @@
1
+ #let css-pixels-per-point = 96 / 72
2
+
3
+ #let typst-length-to-css-px(value, name: "merman length", allow-infinite: false) = {
4
+ if type(value) != length {
5
+ panic(name + " must be a Typst length")
6
+ }
7
+
8
+ let points = value.pt()
9
+ if float.is-nan(points) {
10
+ panic(name + " must not be NaN")
11
+ } else if float.is-infinite(points) {
12
+ if allow-infinite {
13
+ none
14
+ } else {
15
+ panic(name + " must be finite")
16
+ }
17
+ } else {
18
+ let pixels = points * css-pixels-per-point
19
+ if pixels <= 0 {
20
+ panic(name + " must be positive")
21
+ }
22
+ pixels
23
+ }
24
+ }
25
+
26
+ #let css-px-number-string(value, name: "merman CSS pixel value") = {
27
+ if (type(value) != int and type(value) != float) or float.is-nan(value) or float.is-infinite(value) or value <= 0 {
28
+ panic(name + " must be positive and finite")
29
+ }
30
+ str(value) + "px"
31
+ }
32
+
33
+ #let canonical-css-px-string(value, name: "merman CSS pixel value") = {
34
+ let value = value.trim()
35
+ if not value.ends-with("px") {
36
+ panic(name + " must use CSS px units")
37
+ }
38
+ css-px-number-string(float(value.slice(0, -2).trim()), name: name)
39
+ }
40
+
41
+ #let context-width-css-px(width) = {
42
+ typst-length-to-css-px(
43
+ width,
44
+ name: "merman document context width",
45
+ allow-infinite: true,
46
+ )
47
+ }
48
+
49
+ #let css-px-string(value, name: "merman length") = {
50
+ css-px-number-string(typst-length-to-css-px(value, name: name), name: name)
51
+ }
@@ -0,0 +1,12 @@
1
+ [package]
2
+ name = "merman"
3
+ version = "0.3.0"
4
+ entrypoint = "lib.typ"
5
+ compiler = "0.15.0"
6
+ authors = ["Mingzhen Zhuang <@Latias94>"]
7
+ license = "MIT OR Apache-2.0"
8
+ description = "Render Mermaid diagrams as SVG."
9
+ repository = "https://github.com/Latias94/merman"
10
+ keywords = ["mermaid", "diagrams", "svg", "wasm"]
11
+ categories = ["visualization", "integration"]
12
+ exclude = ["examples/**"]
@@ -0,0 +1,69 @@
1
+ # CHANGELOG
2
+
3
+ ## 0.2.7
4
+
5
+ feat: support color-related optional arguments for commands
6
+ feat: support missing commands
7
+ feat: implement \smash command
8
+
9
+ Thanks to [Shichien](https://github.com/Shichien).
10
+
11
+
12
+
13
+ ## 0.2.6
14
+
15
+ - Fix: fix "kai is deprecated" warning for Typst v0.14.0 (https://github.com/mitex-rs/mitex/pull/201)
16
+
17
+
18
+ ## 0.2.5
19
+
20
+ - Fix: assign correct class for lvert and rvert (https://github.com/mitex-rs/mitex/pull/172)
21
+ - Fix: convert `bf` to `bold(upright(..))` (https://github.com/mitex-rs/mitex/pull/183)
22
+ - Fix: remove xarrow and use stretch in typst v0.12.0 (https://github.com/mitex-rs/mitex/pull/184)
23
+ - Fix: fix some symbols `\not`, `\gtreqqless` and `\gtrapprox` (https://github.com/mitex-rs/mitex/pull/185)
24
+
25
+
26
+ ## 0.2.4
27
+
28
+ - Fix `\boxed` command.
29
+ - Support basic figure and tabular environments.
30
+ - Add escape symbols for plus, minus and percent.
31
+ - Fix `\left` and `\right`: size of lr use em.
32
+
33
+
34
+ ## 0.2.3
35
+
36
+ - Support nesting math equation like `\text{$x$}`.
37
+ - Fix broken `\left` and `\right` commands. #143
38
+ - Correct the symbol mapping for `\varphi`, `phi`, `\epsilon` and `\varepsilon`.
39
+
40
+
41
+ ## 0.2.2
42
+
43
+ ### Text Mode
44
+
45
+ - Add `\(\)` and `\[\]` support.
46
+ - Add `\footnote` and `\cite`.
47
+
48
+ ### Fixes
49
+
50
+ - Remove duplicate keys for error when a dict has duplicate keys in Typst 0.11.
51
+ - Fix bracket/paren group parsing.
52
+ - Remove extra spacing for ceiling symbols.
53
+
54
+
55
+ ## 0.2.1
56
+
57
+ - Remove unnecessary zws.
58
+
59
+
60
+ ## 0.2.0
61
+
62
+ - Add more symbols for equations.
63
+ - Basic macro support.
64
+ - Basic text mode support.
65
+
66
+
67
+ ## 0.1.0
68
+
69
+ - LaTeX support for Typst, powered by Rust and WASM. We can now render LaTeX equations in real-time in Typst.
@@ -0,0 +1,176 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,154 @@
1
+ # [MiTeX](https://github.com/mitex-rs/mitex)
2
+
3
+ **[LaTeX](https://www.latex-project.org/) support for [Typst](https://typst.app/), powered by [Rust](https://www.rust-lang.org/) and [WASM](https://webassembly.org/).**
4
+
5
+ [MiTeX](https://github.com/mitex-rs/mitex) processes LaTeX code into an abstract syntax tree (AST). Then it transforms the AST into Typst code and evaluates code into Typst content by `eval` function.
6
+
7
+ MiTeX has been proved to be practical on a large project. It has already correctly converted 32.5k equations from [OI Wiki](https://github.com/OI-wiki/OI-wiki). Compared to [texmath](https://github.com/jgm/texmath), MiTeX has a better display effect and performance in that wiki project. It is also more easy to use, since importing MiTeX to Typst is just one line of code, while texmath is an external program.
8
+
9
+ In addition, MiTeX is not only **SMALL** but also **FAST**! MiTeX has a size of just about 185 KB, comparing that texmath has a size of 17 MB. A not strict but intuitive comparison is shown below. To convert 32.5k equations from OI Wiki, texmath takes about 109s, while MiTeX WASM takes only 2.28s and MiTeX x86 takes merely 0.085s.
10
+
11
+ Thanks to [@Myriad-Dreamin](https://github.com/Myriad-Dreamin), he completed the most complex development work: developing the parser for generating AST.
12
+
13
+ ## MiTeX as a Typst Package
14
+
15
+ - Use `mitex-convert` to convert LaTeX code into Typst code in string.
16
+ - Use `mi` to render an inline LaTeX equation in Typst.
17
+ - Use `mitex(numbering: none, supplement: auto, ..)` or `mimath` to render a block LaTeX equation in Typst.
18
+ - Use `mitext` to render a LaTeX text in Typst.
19
+
20
+ PS: `#set math.equation(numbering: "(1)")` is also valid for MiTeX.
21
+
22
+ Following is [a simple example](examples/example.typ) of using MiTeX in Typst:
23
+
24
+ ```typst
25
+ #import "@preview/mitex:0.2.7": *
26
+
27
+ #assert.eq(mitex-convert("\alpha x"), "alpha x ")
28
+
29
+ Write inline equations like #mi("x") or #mi[y].
30
+
31
+ Also block equations (this case is from #text(blue.lighten(20%), link("https://katex.org/")[katex.org])):
32
+
33
+ #mitex(`
34
+ \newcommand{\f}[2]{#1f(#2)}
35
+ \f\relax{x} = \int_{-\infty}^\infty
36
+ \f\hat\xi\,e^{2 \pi i \xi x}
37
+ \,d\xi
38
+ `)
39
+
40
+ We also support text mode (in development):
41
+
42
+ #mitext(`
43
+ \iftypst
44
+ #set math.equation(numbering: "(1)", supplement: "equation")
45
+ \fi
46
+
47
+ \section{Title}
48
+
49
+ A \textbf{strong} text, a \emph{emph} text and inline equation $x + y$.
50
+
51
+ Also block \eqref{eq:pythagoras}.
52
+
53
+ \begin{equation}
54
+ a^2 + b^2 = c^2 \label{eq:pythagoras}
55
+ \end{equation}
56
+ `)
57
+ ```
58
+
59
+ ![MiTeX example showing LaTeX equations rendered in Typst](examples/example.png)
60
+
61
+ ## MiTeX as a CLI Tool
62
+
63
+ ### Installation
64
+
65
+ Install latest nightly version by `cargo install --git https://github.com/mitex-rs/mitex mitex-cli`.
66
+
67
+ ### Usage
68
+
69
+ ```bash
70
+ mitex compile main.tex
71
+ # or (same as above)
72
+ mitex compile main.tex mitex.typ
73
+ ```
74
+
75
+ ## MiTeX as a Web App
76
+
77
+ ### MiTeX Online Math Converter
78
+
79
+ We can convert LaTeX equations to Typst equations in web by wasm. https://mitex-rs.github.io/mitex/
80
+
81
+ ### Underleaf
82
+
83
+ We made a proof of concept online tex editor to show our conversion speed in text mode. The PoC loads files from a git repository and then runs typst compile in browser. As you see, each keystroking get response in preview quickly.
84
+
85
+ https://mitex-rs.github.io/mitex/tools/underleaf.html
86
+
87
+ https://github.com/mitex-rs/mitex/assets/34951714/0ce77a2c-0a7d-445f-b26d-e139f3038f83
88
+
89
+ ## Implemented Features
90
+
91
+ - [x] User-defined TeX (macro) commands, such as `\newcommand{\mysym}{\alpha}`.
92
+ - [x] LaTeX equations support.
93
+ - [x] Coloring commands (`\color{red} text`, `\textcolor{red}{text}`).
94
+ - [x] Support for various environments, such as aligned, matrix, cases.
95
+ - [x] Basic text mode support, you can use it to write LaTeX drafts.
96
+ - [x] `\section`, `\textbf`, `\emph`.
97
+ - [x] Inline and block math equations.
98
+ - [x] `\ref`, `\eqref` and `\label`.
99
+ - [x] `itemize` and `enumerate` environments.
100
+
101
+ ## Features to Implement
102
+
103
+ - [ ] Pass command specification to MiTeX plugin dynamically. With that you can define a typst function `let myop(it) = op(upright(it))` and then use it by `\myop{it}`.
104
+ - [ ] Package support, which means that you can change set of commands by telling MiTeX to use a list of packages.
105
+ - [ ] Better text mode support, such as figure, algorithm and description environments.
106
+
107
+ To achieve the latter two goals, we need a well-structured architecture for the text mode, along with intricate work. Currently, we don't have very clear ideas yet. If you are willing to contribute by discussing in the issues or even submitting pull requests, your contribution is highly welcome.
108
+
109
+ ## Differences between MiTeX and other solutions
110
+
111
+ MiTeX has different objectives compared to [texmath](https://github.com/jgm/texmath) (a.k.a. [pandoc](https://pandoc.org/)):
112
+
113
+ - MiTeX focuses on rendering LaTeX content correctly within Typst, leveraging the powerful programming capabilities of WASM and typst to achieve results that are essentially consistent with LaTeX display.
114
+ - texmath aims to be general-purpose converters and generate strings that are more human-readable.
115
+
116
+ For example, MiTeX transforms `\frac{1}{2}_3` into `frac(1, 2)_3`, while texmath converts it into `1 / 2_3`. The latter's display is not entirely correct, whereas the former ensures consistency in display.
117
+
118
+ Another example is that MiTeX transforms `(\frac{1}{2})` into `\(frac(1, 2)\)` instead of `(frac(1, 2))`, avoiding the use of automatic Left/Right to achieve consistency with LaTeX rendering.
119
+
120
+ **Certainly, the greatest advantage is that you can directly write LaTeX content in Typst without the need for manual conversion!**
121
+
122
+ ## Submitting Issues
123
+
124
+ If you find missing commands or bugs of MiTeX, please feel free to submit an issue [here](https://github.com/mitex-rs/mitex/issues).
125
+
126
+ ## Contributing to MiTeX
127
+
128
+ Currently, MiTeX maintains following three parts of code:
129
+
130
+ - A TeX parser library written in **Rust**, see [mitex-lexer](https://github.com/mitex-rs/mitex/tree/main/crates/mitex-lexer) and [mitex-parser](https://github.com/mitex-rs/mitex/tree/main/crates/mitex-parser).
131
+ - A TeX to Typst converter library written in **Rust**, see [mitex](https://github.com/mitex-rs/mitex/tree/main/crates/mitex).
132
+ - A list of TeX packages and comamnds written in **Typst**, which then used by the typst package, see [MiTeX Command Specification](https://github.com/mitex-rs/mitex/tree/main/packages/mitex/specs).
133
+
134
+ For a translation process, for example, we have:
135
+
136
+ ```
137
+ \frac{1}{2}
138
+
139
+ ===[parser]===> AST ===[converter]===>
140
+
141
+ #eval("$frac(1, 2)$", scope: (frac: (num, den) => $(num)/(den)$))
142
+ ```
143
+
144
+ You can use the `#mitex-convert()` function to get the Typst Code generated from LaTeX Code.
145
+
146
+ ### Add missing TeX commands
147
+
148
+ Even if you don't know Rust at all, you can still add missing TeX commands to MiTeX by modifying [specification files](https://github.com/mitex-rs/mitex/tree/main/packages/mitex/specs), since they are written in typst! You can open an issue to acquire the commands you want to add, or you can edit the files and submit a pull request.
149
+
150
+ In the future, we will provide the ability to customize TeX commands, which will make it easier for you to use the commands you create for yourself.
151
+
152
+ ### Develop the parser and the converter
153
+
154
+ See [CONTRIBUTING.md](https://github.com/mitex-rs/mitex/blob/main/CONTRIBUTING.md).
@@ -0,0 +1 @@
1
+ #import "mitex.typ": mitex-wasm, mitex-convert, mitex-scope, mitex, mitext, mimath, mi
@@ -0,0 +1,45 @@
1
+ #import "specs/mod.typ": mitex-scope
2
+ #let mitex-wasm = plugin("./mitex.wasm")
3
+
4
+ #let get-elem-text(it) = {
5
+ {
6
+ if type(it) == str {
7
+ it
8
+ } else if type(it) == content and it.has("text") {
9
+ it.text
10
+ } else {
11
+ panic("Unsupported type: " + str(type(it)))
12
+ }
13
+ }
14
+ }
15
+
16
+ #let mitex-convert(it, mode: "math", spec: bytes(())) = {
17
+ if mode == "math" {
18
+ str(mitex-wasm.convert_math(bytes(get-elem-text(it)), spec))
19
+ } else {
20
+ str(mitex-wasm.convert_text(bytes(get-elem-text(it)), spec))
21
+ }
22
+ }
23
+
24
+ // Math Mode
25
+ #let mimath(it, block: true, ..args) = {
26
+ let res = mitex-convert(mode: "math", it)
27
+ let eval-res = eval("$" + res + "$", scope: mitex-scope)
28
+ math.equation(block: block, eval-res, ..args)
29
+ }
30
+
31
+ // Text Mode
32
+ #let mitext(it) = {
33
+ let res = mitex-convert(mode: "text", it)
34
+ eval(res, mode: "markup", scope: mitex-scope)
35
+ }
36
+
37
+ #let mitex(it, mode: "math", ..args) = {
38
+ if mode == "math" {
39
+ mimath(it, ..args)
40
+ } else {
41
+ mitext(it, ..args)
42
+ }
43
+ }
44
+
45
+ #let mi = mimath.with(block: false)