math-core 0.6.0__tar.gz → 0.6.2__tar.gz
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.
- {math_core-0.6.0 → math_core-0.6.2}/Cargo.lock +66 -85
- {math_core-0.6.0 → math_core-0.6.2}/Cargo.toml +3 -2
- {math_core-0.6.0 → math_core-0.6.2}/PKG-INFO +1 -1
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/Cargo.toml +4 -4
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/README.md +35 -54
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/examples/browser_test.rs +3 -3
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/examples/equations.rs +3 -3
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/examples/minijinja.rs +1 -1
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/src/character_class.rs +6 -6
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/src/commands.rs +295 -251
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/src/environments.rs +20 -29
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/src/error.rs +13 -0
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/src/lexer.rs +27 -9
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/src/lib.rs +8 -3
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/src/parser.rs +407 -223
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/src/predefined.rs +0 -45
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/src/specifications.rs +2 -2
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/src/text_parser.rs +40 -33
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/src/token.rs +63 -38
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/src/token_queue.rs +12 -6
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/tests/conversion_test.rs +56 -4
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/tests/error_test.rs +5 -0
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/tests/wiki_test.rs +262 -226
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core-python/Cargo.toml +4 -1
- {math_core-0.6.0 → math_core-0.6.2}/crates/mathml-renderer/Cargo.toml +2 -2
- {math_core-0.6.0 → math_core-0.6.2}/crates/mathml-renderer/src/arena.rs +23 -2
- {math_core-0.6.0 → math_core-0.6.2}/crates/mathml-renderer/src/ast.rs +113 -69
- math_core-0.6.2/crates/mathml-renderer/src/attribute.rs +444 -0
- {math_core-0.6.0 → math_core-0.6.2}/crates/mathml-renderer/src/lib.rs +3 -2
- math_core-0.6.2/crates/mathml-renderer/src/super_char.rs +674 -0
- {math_core-0.6.0 → math_core-0.6.2}/crates/mathml-renderer/src/symbol.rs +152 -78
- {math_core-0.6.0 → math_core-0.6.2}/crates/mathml-renderer/src/table.rs +13 -0
- {math_core-0.6.0 → math_core-0.6.2}/pyproject.toml +8 -0
- math_core-0.6.0/crates/mathml-renderer/src/attribute.rs +0 -388
- {math_core-0.6.0 → math_core-0.6.2}/LICENSE +0 -0
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/src/atof.rs +0 -0
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/src/color_defs.rs +0 -0
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/src/html_utils.rs +0 -0
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core/tests/custom_cmd_test.rs +0 -0
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core-python/README.md +0 -0
- {math_core-0.6.0 → math_core-0.6.2}/crates/math-core-python/src/lib.rs +0 -0
- {math_core-0.6.0 → math_core-0.6.2}/crates/mathml-renderer/README.md +0 -0
- {math_core-0.6.0 → math_core-0.6.2}/crates/mathml-renderer/src/fmt.rs +0 -0
- {math_core-0.6.0 → math_core-0.6.2}/crates/mathml-renderer/src/itoa.rs +0 -0
- {math_core-0.6.0 → math_core-0.6.2}/crates/mathml-renderer/src/length.rs +0 -0
- {math_core-0.6.0 → math_core-0.6.2}/python/math_core/__init__.py +0 -0
- {math_core-0.6.0 → math_core-0.6.2}/python/math_core/_math_core_rust.pyi +0 -0
- {math_core-0.6.0 → math_core-0.6.2}/python/math_core/py.typed +0 -0
|
@@ -90,9 +90,9 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
|
|
|
90
90
|
|
|
91
91
|
[[package]]
|
|
92
92
|
name = "bitflags"
|
|
93
|
-
version = "2.11.
|
|
93
|
+
version = "2.11.1"
|
|
94
94
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
95
|
-
checksum = "
|
|
95
|
+
checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3"
|
|
96
96
|
dependencies = [
|
|
97
97
|
"serde_core",
|
|
98
98
|
]
|
|
@@ -127,9 +127,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|
|
127
127
|
|
|
128
128
|
[[package]]
|
|
129
129
|
name = "clap"
|
|
130
|
-
version = "4.6.
|
|
130
|
+
version = "4.6.1"
|
|
131
131
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
132
|
-
checksum = "
|
|
132
|
+
checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51"
|
|
133
133
|
dependencies = [
|
|
134
134
|
"clap_builder",
|
|
135
135
|
"clap_derive",
|
|
@@ -149,9 +149,9 @@ dependencies = [
|
|
|
149
149
|
|
|
150
150
|
[[package]]
|
|
151
151
|
name = "clap_derive"
|
|
152
|
-
version = "4.6.
|
|
152
|
+
version = "4.6.1"
|
|
153
153
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
154
|
-
checksum = "
|
|
154
|
+
checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9"
|
|
155
155
|
dependencies = [
|
|
156
156
|
"heck",
|
|
157
157
|
"proc-macro2",
|
|
@@ -173,14 +173,13 @@ checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0"
|
|
|
173
173
|
|
|
174
174
|
[[package]]
|
|
175
175
|
name = "console"
|
|
176
|
-
version = "0.
|
|
176
|
+
version = "0.16.3"
|
|
177
177
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
178
|
-
checksum = "
|
|
178
|
+
checksum = "d64e8af5551369d19cf50138de61f1c42074ab970f74e99be916646777f8fc87"
|
|
179
179
|
dependencies = [
|
|
180
180
|
"encode_unicode",
|
|
181
|
-
"lazy_static",
|
|
182
181
|
"libc",
|
|
183
|
-
"windows-sys 0.
|
|
182
|
+
"windows-sys 0.61.2",
|
|
184
183
|
]
|
|
185
184
|
|
|
186
185
|
[[package]]
|
|
@@ -191,9 +190,9 @@ checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590"
|
|
|
191
190
|
|
|
192
191
|
[[package]]
|
|
193
192
|
name = "encode_unicode"
|
|
194
|
-
version = "0.
|
|
193
|
+
version = "1.0.0"
|
|
195
194
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
196
|
-
checksum = "
|
|
195
|
+
checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0"
|
|
197
196
|
|
|
198
197
|
[[package]]
|
|
199
198
|
name = "equivalent"
|
|
@@ -262,9 +261,9 @@ dependencies = [
|
|
|
262
261
|
|
|
263
262
|
[[package]]
|
|
264
263
|
name = "hashbrown"
|
|
265
|
-
version = "0.
|
|
264
|
+
version = "0.16.1"
|
|
266
265
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
267
|
-
checksum = "
|
|
266
|
+
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
|
|
268
267
|
|
|
269
268
|
[[package]]
|
|
270
269
|
name = "heck"
|
|
@@ -274,9 +273,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
|
274
273
|
|
|
275
274
|
[[package]]
|
|
276
275
|
name = "indexmap"
|
|
277
|
-
version = "2.
|
|
276
|
+
version = "2.13.1"
|
|
278
277
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
279
|
-
checksum = "
|
|
278
|
+
checksum = "45a8a2b9cb3e0b0c1803dbb0758ffac5de2f425b23c28f518faabd9d805342ff"
|
|
280
279
|
dependencies = [
|
|
281
280
|
"equivalent",
|
|
282
281
|
"hashbrown",
|
|
@@ -284,9 +283,9 @@ dependencies = [
|
|
|
284
283
|
|
|
285
284
|
[[package]]
|
|
286
285
|
name = "insta"
|
|
287
|
-
version = "1.
|
|
286
|
+
version = "1.47.2"
|
|
288
287
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
289
|
-
checksum = "
|
|
288
|
+
checksum = "7b4a6248eb93a4401ed2f37dfe8ea592d3cf05b7cf4f8efa867b6895af7e094e"
|
|
290
289
|
dependencies = [
|
|
291
290
|
"console",
|
|
292
291
|
"once_cell",
|
|
@@ -310,20 +309,16 @@ checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
|
|
|
310
309
|
|
|
311
310
|
[[package]]
|
|
312
311
|
name = "js-sys"
|
|
313
|
-
version = "0.3.
|
|
312
|
+
version = "0.3.99"
|
|
314
313
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
315
|
-
checksum = "
|
|
314
|
+
checksum = "142bc4740e452c1e57ade0cbc129f139c9093e354346f0872ef985f4f5cf5f11"
|
|
316
315
|
dependencies = [
|
|
316
|
+
"cfg-if",
|
|
317
|
+
"futures-util",
|
|
317
318
|
"once_cell",
|
|
318
319
|
"wasm-bindgen",
|
|
319
320
|
]
|
|
320
321
|
|
|
321
|
-
[[package]]
|
|
322
|
-
name = "lazy_static"
|
|
323
|
-
version = "1.5.0"
|
|
324
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
325
|
-
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
|
326
|
-
|
|
327
322
|
[[package]]
|
|
328
323
|
name = "libc"
|
|
329
324
|
version = "0.2.178"
|
|
@@ -363,7 +358,7 @@ dependencies = [
|
|
|
363
358
|
|
|
364
359
|
[[package]]
|
|
365
360
|
name = "math-core"
|
|
366
|
-
version = "0.6.
|
|
361
|
+
version = "0.6.2"
|
|
367
362
|
dependencies = [
|
|
368
363
|
"ariadne",
|
|
369
364
|
"insta",
|
|
@@ -383,7 +378,7 @@ dependencies = [
|
|
|
383
378
|
|
|
384
379
|
[[package]]
|
|
385
380
|
name = "math-core-cli"
|
|
386
|
-
version = "0.6.
|
|
381
|
+
version = "0.6.2"
|
|
387
382
|
dependencies = [
|
|
388
383
|
"ariadne",
|
|
389
384
|
"clap",
|
|
@@ -396,7 +391,7 @@ dependencies = [
|
|
|
396
391
|
|
|
397
392
|
[[package]]
|
|
398
393
|
name = "math-core-python"
|
|
399
|
-
version = "0.6.
|
|
394
|
+
version = "0.6.2"
|
|
400
395
|
dependencies = [
|
|
401
396
|
"ariadne",
|
|
402
397
|
"math-core",
|
|
@@ -406,7 +401,7 @@ dependencies = [
|
|
|
406
401
|
|
|
407
402
|
[[package]]
|
|
408
403
|
name = "math-core-renderer-internal"
|
|
409
|
-
version = "0.6.
|
|
404
|
+
version = "0.6.2"
|
|
410
405
|
dependencies = [
|
|
411
406
|
"bitflags",
|
|
412
407
|
"dtoa",
|
|
@@ -419,7 +414,7 @@ dependencies = [
|
|
|
419
414
|
|
|
420
415
|
[[package]]
|
|
421
416
|
name = "math-core-wasm"
|
|
422
|
-
version = "0.6.
|
|
417
|
+
version = "0.6.2"
|
|
423
418
|
dependencies = [
|
|
424
419
|
"ariadne",
|
|
425
420
|
"js-sys",
|
|
@@ -454,9 +449,9 @@ dependencies = [
|
|
|
454
449
|
|
|
455
450
|
[[package]]
|
|
456
451
|
name = "minijinja"
|
|
457
|
-
version = "2.
|
|
452
|
+
version = "2.20.0"
|
|
458
453
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
459
|
-
checksum = "
|
|
454
|
+
checksum = "2929e494b2280e1e18959bb2e121da03347ae896896fdfaceaab43c88a02803f"
|
|
460
455
|
dependencies = [
|
|
461
456
|
"memo-map",
|
|
462
457
|
"serde",
|
|
@@ -571,9 +566,9 @@ dependencies = [
|
|
|
571
566
|
|
|
572
567
|
[[package]]
|
|
573
568
|
name = "pyo3"
|
|
574
|
-
version = "0.28.
|
|
569
|
+
version = "0.28.3"
|
|
575
570
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
576
|
-
checksum = "
|
|
571
|
+
checksum = "91fd8e38a3b50ed1167fb981cd6fd60147e091784c427b8f7183a7ee32c31c12"
|
|
577
572
|
dependencies = [
|
|
578
573
|
"libc",
|
|
579
574
|
"once_cell",
|
|
@@ -585,18 +580,18 @@ dependencies = [
|
|
|
585
580
|
|
|
586
581
|
[[package]]
|
|
587
582
|
name = "pyo3-build-config"
|
|
588
|
-
version = "0.28.
|
|
583
|
+
version = "0.28.3"
|
|
589
584
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
590
|
-
checksum = "
|
|
585
|
+
checksum = "e368e7ddfdeb98c9bca7f8383be1648fd84ab466bf2bc015e94008db6d35611e"
|
|
591
586
|
dependencies = [
|
|
592
587
|
"target-lexicon",
|
|
593
588
|
]
|
|
594
589
|
|
|
595
590
|
[[package]]
|
|
596
591
|
name = "pyo3-ffi"
|
|
597
|
-
version = "0.28.
|
|
592
|
+
version = "0.28.3"
|
|
598
593
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
599
|
-
checksum = "
|
|
594
|
+
checksum = "7f29e10af80b1f7ccaf7f69eace800a03ecd13e883acfacc1e5d0988605f651e"
|
|
600
595
|
dependencies = [
|
|
601
596
|
"libc",
|
|
602
597
|
"pyo3-build-config",
|
|
@@ -604,9 +599,9 @@ dependencies = [
|
|
|
604
599
|
|
|
605
600
|
[[package]]
|
|
606
601
|
name = "pyo3-macros"
|
|
607
|
-
version = "0.28.
|
|
602
|
+
version = "0.28.3"
|
|
608
603
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
609
|
-
checksum = "
|
|
604
|
+
checksum = "df6e520eff47c45997d2fc7dd8214b25dd1310918bbb2642156ef66a67f29813"
|
|
610
605
|
dependencies = [
|
|
611
606
|
"proc-macro2",
|
|
612
607
|
"pyo3-macros-backend",
|
|
@@ -616,9 +611,9 @@ dependencies = [
|
|
|
616
611
|
|
|
617
612
|
[[package]]
|
|
618
613
|
name = "pyo3-macros-backend"
|
|
619
|
-
version = "0.28.
|
|
614
|
+
version = "0.28.3"
|
|
620
615
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
621
|
-
checksum = "
|
|
616
|
+
checksum = "c4cdc218d835738f81c2338f822078af45b4afdf8b2e33cbb5916f108b813acb"
|
|
622
617
|
dependencies = [
|
|
623
618
|
"heck",
|
|
624
619
|
"proc-macro2",
|
|
@@ -687,9 +682,9 @@ dependencies = [
|
|
|
687
682
|
|
|
688
683
|
[[package]]
|
|
689
684
|
name = "rustc-hash"
|
|
690
|
-
version = "2.1.
|
|
685
|
+
version = "2.1.2"
|
|
691
686
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
692
|
-
checksum = "
|
|
687
|
+
checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe"
|
|
693
688
|
|
|
694
689
|
[[package]]
|
|
695
690
|
name = "rustix"
|
|
@@ -779,9 +774,9 @@ dependencies = [
|
|
|
779
774
|
|
|
780
775
|
[[package]]
|
|
781
776
|
name = "serde_spanned"
|
|
782
|
-
version = "1.
|
|
777
|
+
version = "1.1.1"
|
|
783
778
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
784
|
-
checksum = "
|
|
779
|
+
checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26"
|
|
785
780
|
dependencies = [
|
|
786
781
|
"serde_core",
|
|
787
782
|
]
|
|
@@ -887,9 +882,9 @@ dependencies = [
|
|
|
887
882
|
|
|
888
883
|
[[package]]
|
|
889
884
|
name = "toml"
|
|
890
|
-
version = "1.
|
|
885
|
+
version = "1.1.2+spec-1.1.0"
|
|
891
886
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
892
|
-
checksum = "
|
|
887
|
+
checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee"
|
|
893
888
|
dependencies = [
|
|
894
889
|
"indexmap",
|
|
895
890
|
"serde_core",
|
|
@@ -902,27 +897,27 @@ dependencies = [
|
|
|
902
897
|
|
|
903
898
|
[[package]]
|
|
904
899
|
name = "toml_datetime"
|
|
905
|
-
version = "1.
|
|
900
|
+
version = "1.1.1+spec-1.1.0"
|
|
906
901
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
907
|
-
checksum = "
|
|
902
|
+
checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7"
|
|
908
903
|
dependencies = [
|
|
909
904
|
"serde_core",
|
|
910
905
|
]
|
|
911
906
|
|
|
912
907
|
[[package]]
|
|
913
908
|
name = "toml_parser"
|
|
914
|
-
version = "1.
|
|
909
|
+
version = "1.1.2+spec-1.1.0"
|
|
915
910
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
916
|
-
checksum = "
|
|
911
|
+
checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526"
|
|
917
912
|
dependencies = [
|
|
918
913
|
"winnow",
|
|
919
914
|
]
|
|
920
915
|
|
|
921
916
|
[[package]]
|
|
922
917
|
name = "toml_writer"
|
|
923
|
-
version = "1.
|
|
918
|
+
version = "1.1.1+spec-1.1.0"
|
|
924
919
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
925
|
-
checksum = "
|
|
920
|
+
checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db"
|
|
926
921
|
|
|
927
922
|
[[package]]
|
|
928
923
|
name = "typeid"
|
|
@@ -969,9 +964,9 @@ dependencies = [
|
|
|
969
964
|
|
|
970
965
|
[[package]]
|
|
971
966
|
name = "wasm-bindgen"
|
|
972
|
-
version = "0.2.
|
|
967
|
+
version = "0.2.122"
|
|
973
968
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
974
|
-
checksum = "
|
|
969
|
+
checksum = "3ed04576f974d2b2fba0f38c51dbc5518011e38c36bf1143164be765528fd409"
|
|
975
970
|
dependencies = [
|
|
976
971
|
"cfg-if",
|
|
977
972
|
"once_cell",
|
|
@@ -982,23 +977,19 @@ dependencies = [
|
|
|
982
977
|
|
|
983
978
|
[[package]]
|
|
984
979
|
name = "wasm-bindgen-futures"
|
|
985
|
-
version = "0.4.
|
|
980
|
+
version = "0.4.72"
|
|
986
981
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
987
|
-
checksum = "
|
|
982
|
+
checksum = "9473dbd2991ae90b6291c3c32c30c6187ac49aa32f9905d1cce280ec1e110b0f"
|
|
988
983
|
dependencies = [
|
|
989
|
-
"cfg-if",
|
|
990
|
-
"futures-util",
|
|
991
984
|
"js-sys",
|
|
992
|
-
"once_cell",
|
|
993
985
|
"wasm-bindgen",
|
|
994
|
-
"web-sys",
|
|
995
986
|
]
|
|
996
987
|
|
|
997
988
|
[[package]]
|
|
998
989
|
name = "wasm-bindgen-macro"
|
|
999
|
-
version = "0.2.
|
|
990
|
+
version = "0.2.122"
|
|
1000
991
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1001
|
-
checksum = "
|
|
992
|
+
checksum = "916151b09da36bd82f6615cbf3a419e2f0ba23a03c6160e8e92eb6bd4aa1dec6"
|
|
1002
993
|
dependencies = [
|
|
1003
994
|
"quote",
|
|
1004
995
|
"wasm-bindgen-macro-support",
|
|
@@ -1006,9 +997,9 @@ dependencies = [
|
|
|
1006
997
|
|
|
1007
998
|
[[package]]
|
|
1008
999
|
name = "wasm-bindgen-macro-support"
|
|
1009
|
-
version = "0.2.
|
|
1000
|
+
version = "0.2.122"
|
|
1010
1001
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1011
|
-
checksum = "
|
|
1002
|
+
checksum = "299047362ccbfce148b67ab7e73349f77748e00c8296f9542adfad2ad82c5c5e"
|
|
1012
1003
|
dependencies = [
|
|
1013
1004
|
"bumpalo",
|
|
1014
1005
|
"proc-macro2",
|
|
@@ -1019,18 +1010,18 @@ dependencies = [
|
|
|
1019
1010
|
|
|
1020
1011
|
[[package]]
|
|
1021
1012
|
name = "wasm-bindgen-shared"
|
|
1022
|
-
version = "0.2.
|
|
1013
|
+
version = "0.2.122"
|
|
1023
1014
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1024
|
-
checksum = "
|
|
1015
|
+
checksum = "9a929b2c61f11ba3e9bc35b50c1f25cb38e0e892c0c231ae2b8cf78d5dad4437"
|
|
1025
1016
|
dependencies = [
|
|
1026
1017
|
"unicode-ident",
|
|
1027
1018
|
]
|
|
1028
1019
|
|
|
1029
1020
|
[[package]]
|
|
1030
1021
|
name = "wasm-bindgen-test"
|
|
1031
|
-
version = "0.3.
|
|
1022
|
+
version = "0.3.72"
|
|
1032
1023
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1033
|
-
checksum = "
|
|
1024
|
+
checksum = "74fde991ccdc895cb7fbaa14b137d62af74d9011be67b71c694bfc40edd3119c"
|
|
1034
1025
|
dependencies = [
|
|
1035
1026
|
"async-trait",
|
|
1036
1027
|
"cast",
|
|
@@ -1050,9 +1041,9 @@ dependencies = [
|
|
|
1050
1041
|
|
|
1051
1042
|
[[package]]
|
|
1052
1043
|
name = "wasm-bindgen-test-macro"
|
|
1053
|
-
version = "0.3.
|
|
1044
|
+
version = "0.3.72"
|
|
1054
1045
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1055
|
-
checksum = "
|
|
1046
|
+
checksum = "e925354648d2a4d1bf205412e36d520a800280622eef4719678d268e5d40e978"
|
|
1056
1047
|
dependencies = [
|
|
1057
1048
|
"proc-macro2",
|
|
1058
1049
|
"quote",
|
|
@@ -1061,19 +1052,9 @@ dependencies = [
|
|
|
1061
1052
|
|
|
1062
1053
|
[[package]]
|
|
1063
1054
|
name = "wasm-bindgen-test-shared"
|
|
1064
|
-
version = "0.2.
|
|
1055
|
+
version = "0.2.122"
|
|
1065
1056
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1066
|
-
checksum = "
|
|
1067
|
-
|
|
1068
|
-
[[package]]
|
|
1069
|
-
name = "web-sys"
|
|
1070
|
-
version = "0.3.85"
|
|
1071
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1072
|
-
checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598"
|
|
1073
|
-
dependencies = [
|
|
1074
|
-
"js-sys",
|
|
1075
|
-
"wasm-bindgen",
|
|
1076
|
-
]
|
|
1057
|
+
checksum = "684365b586a9a6256c1cc3544eee8680de48d6041142f581776ec7b139622ae9"
|
|
1077
1058
|
|
|
1078
1059
|
[[package]]
|
|
1079
1060
|
name = "winapi-util"
|
|
@@ -7,11 +7,11 @@ resolver = "2"
|
|
|
7
7
|
edition = "2024"
|
|
8
8
|
rust-version = "1.91"
|
|
9
9
|
license = "MIT"
|
|
10
|
-
version = "0.6.
|
|
10
|
+
version = "0.6.2"
|
|
11
11
|
repository = "https://github.com/tmke8/math-core"
|
|
12
12
|
|
|
13
13
|
[workspace.dependencies]
|
|
14
|
-
rustc-hash = "2.1.
|
|
14
|
+
rustc-hash = "2.1.2"
|
|
15
15
|
serde = { version = "1.0.228", features = ["derive"] }
|
|
16
16
|
memchr = "2.8.0"
|
|
17
17
|
strum = "0.28.0"
|
|
@@ -28,6 +28,7 @@ elidable_lifetime_names = "warn"
|
|
|
28
28
|
trivially_copy_pass_by_ref = "warn"
|
|
29
29
|
needless_pass_by_value = "warn"
|
|
30
30
|
redundant_closure_for_method_calls = "warn"
|
|
31
|
+
too_many_arguments = "allow"
|
|
31
32
|
|
|
32
33
|
[profile.dev.package]
|
|
33
34
|
insta.opt-level = 3
|
|
@@ -19,7 +19,7 @@ categories = ["science"]
|
|
|
19
19
|
exclude = ["/src/snapshots", "/tests/snapshots"]
|
|
20
20
|
|
|
21
21
|
[dependencies]
|
|
22
|
-
mathml-renderer = { path = "../mathml-renderer", package = "math-core-renderer-internal", version = "0.6.
|
|
22
|
+
mathml-renderer = { path = "../mathml-renderer", package = "math-core-renderer-internal", version = "0.6.2" }
|
|
23
23
|
serde = { workspace = true, optional = true }
|
|
24
24
|
serde-tuple-vec-map = { version = "1.0.1", optional = true }
|
|
25
25
|
phf = { version = "0.13.1", features = ["macros"] }
|
|
@@ -32,10 +32,10 @@ ariadne = { workspace = true, optional = true }
|
|
|
32
32
|
|
|
33
33
|
[dev-dependencies]
|
|
34
34
|
math-core = { path = ".", features = ["serde", "ariadne"] }
|
|
35
|
-
mathml-renderer = { path = "../mathml-renderer", package = "math-core-renderer-internal", version = "0.6.
|
|
36
|
-
insta = { version = "1.
|
|
35
|
+
mathml-renderer = { path = "../mathml-renderer", package = "math-core-renderer-internal", version = "0.6.2", features = ["serde"] }
|
|
36
|
+
insta = { version = "1.47.2", features = ["default", "ron"] }
|
|
37
37
|
regex = "1.12.3"
|
|
38
|
-
minijinja = "2.
|
|
38
|
+
minijinja = "2.20.0"
|
|
39
39
|
|
|
40
40
|
[features]
|
|
41
41
|
serde = ["dep:serde", "dep:serde-tuple-vec-map"]
|
|
@@ -120,10 +120,8 @@ One problem is that Chromium does not look at `ssty` variants when deciding on a
|
|
|
120
120
|
|
|
121
121
|
The fixes applied to the font files do not change the shape of any glyphs; they merely rearrange some glyphs or position them differently within glyph space.
|
|
122
122
|
|
|
123
|
-
The patching of these fonts is tracked in a separate repository: [math-core-fonts](https://github.com/tmke8/math-core-fonts). To use them on your
|
|
123
|
+
The patching of these fonts is tracked in a separate repository: [math-core-fonts](https://github.com/tmke8/math-core-fonts). To use them on your webpages, download them from there.
|
|
124
124
|
|
|
125
|
-
#### Font subsetting
|
|
126
|
-
The math fonts all have quite large font files. Especially *New Computer Modern Math Book* is enormous with an almost 700kB `.woff2` file. Therefore, if possible, you should use *font subsetting* where the font file only includes those glyphs that are actually used on your website. Existing tools should work fine for this.
|
|
127
125
|
|
|
128
126
|
### CSS for text-mode fonts
|
|
129
127
|
In LaTeX, the text within `\text` commands is typically meant to be displayed with the document font and *not* with the math font.
|
|
@@ -157,55 +155,45 @@ mtext span.math-core-sans-serif-font {
|
|
|
157
155
|
```
|
|
158
156
|
or, if you use a sans-serif math font, you should set a font for `\textrm`. Otherwise those commands won’t have an effect.
|
|
159
157
|
|
|
160
|
-
### CSS for polyfills
|
|
161
|
-
Chromium does not support the `<menclose>` element, which is used for `\sout{...}`, `\cancel{...}`, etc. Therefore, if you want to use these commands, you need to include the following CSS:
|
|
158
|
+
### CSS for rendering fixes and polyfills
|
|
162
159
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
mrow.menclose-downdiagonalstrike {
|
|
185
|
-
clip-path: polygon(0em 0.05em, 0.05em 0em, 100% calc(100% - 0.05em), calc(100% - 0.05em) 100%);
|
|
186
|
-
}
|
|
187
|
-
mrow.menclose-horizontalstrike {
|
|
188
|
-
clip-path: polygon(0em calc(55% + 0.0333em), 0em calc(55% - 0.0333em), 100% calc(55% - 0.0333em), 100% calc(55% + 0.0333em));
|
|
189
|
-
}
|
|
190
|
-
}
|
|
160
|
+
The MathML produced by this library relies on the style sheet [`css/mathmlfixes.css`](css/mathmlfixes.css) for proper rendering. **Include its contents on any page that displays math-core output.** It covers:
|
|
161
|
+
|
|
162
|
+
1. Reset `<mtd>` padding to what the spec says (this affects Firefox’s rendering) and make edge cells unpadded, so matrices and arrays render correctly.
|
|
163
|
+
2. A polyfill for `<menclose>` on Chromium, which does not implement the element natively. Without this, `\sout{...}`, `\cancel{...}`, and related commands will not render.
|
|
164
|
+
3. A small `margin-bottom` on accents in Chromium and Safari to match the accent gap Firefox produces. The risk is that if Chromium or Safari ever match Firefox, the gap will become too large — but the present-day benefit outweighs the future risk.
|
|
165
|
+
|
|
166
|
+
The first two CSS rules are quite future-proof in the sense that I don’t expect them to conflict with future improvements in browsers’ MathML implementations, but for the third rule, there is the risk that if Chromium or Safari ever match Firefox, the gap will become too large. However, it's currently not clear that this will ever happen and we think the present-day benefits of this CSS rule outweigh the future risks.
|
|
167
|
+
|
|
168
|
+
#### Other rendering problems
|
|
169
|
+
`mathmlfixes.css` does not fix every rendering bug in current browsers. Other known bugs are tracked at https://github.com/tmke8/math-core/issues/209 . There is also a good overview of browser problems [here](https://temml.org/docs/en/mathml-status).
|
|
170
|
+
|
|
171
|
+
## Font subsetting
|
|
172
|
+
Math fonts often have quite large font files. For example, upstream *New Computer Modern Math Book* is almost 700kB as a `.woff2` file. However, you likely don’t actually need all the glyphs in the font. Therefore, if possible, you should use *font subsetting* where the font file only includes those glyphs that are actually used on your webpages.
|
|
173
|
+
|
|
174
|
+
Even if you don’t know ahead-of-time which glyphs your math will use, we can still use font subsetting, because the set of symbols that `math-core` can ever output is smaller than the set of symbols in *New Computer Modern Math Book* (unless you have very unusual Unicode characters in your LaTeX input).
|
|
175
|
+
|
|
176
|
+
For this use-case, there is a Python script, `scripts/generate_symbol_document.py`, which generates a text file with all the symbols that `math-core` can output. Run it with (minimum required Python version is 3.6)
|
|
177
|
+
|
|
178
|
+
```sh
|
|
179
|
+
python3 scripts/generate_symbol_document.py
|
|
191
180
|
```
|
|
192
181
|
|
|
193
|
-
|
|
194
|
-
We also recommend (though it is not necessary) to add the following CSS:
|
|
182
|
+
The next step is to subset the font file with `hb-subset`, a command from the [HarfBuzz](https://harfbuzz.github.io/) project. (Alternatively, you could use [fonttools](https://pypi.org/project/fonttools/).) You can install `hb-subset` on most Linux distributions from the default repositories. We don’t require an especially up-to-date version. You’ll also need `woff2_compress`, which can likewise be installed via package manager. Run:
|
|
195
183
|
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
184
|
+
```sh
|
|
185
|
+
hb-subset \
|
|
186
|
+
--output-file=NewCMMath-Book-subset.otf \
|
|
187
|
+
--text-file=scripts/all_symbols.txt \
|
|
188
|
+
--layout-features=ssty,kern,aalt \
|
|
189
|
+
--desubroutinize \
|
|
190
|
+
playground/fonts/NewCMMath-Book.otf
|
|
191
|
+
woff2_compress NewCMMath-Book-subset.otf
|
|
203
192
|
```
|
|
204
193
|
|
|
205
|
-
|
|
194
|
+
where `script/all_symbols.txt` is the file generated by the Python script, `--layout-features=ssty,kern,aalt` keeps all font features, and `--desubroutinize` removes any use of CFF subroutines, because it’s better to leave compression entirely to WOFF2. (You can get the OTF file from [math-core-fonts](https://github.com/tmke8/math-core-fonts).) The resulting WOFF2 file should be about 450kB for *New Computer Modern Math Book*.
|
|
206
195
|
|
|
207
|
-
|
|
208
|
-
The above CSS unfortunately does not fix all rendering bugs found in the current versions of browsers. There is a tracking issue for other known rendering bugs: https://github.com/tmke8/math-core/issues/209
|
|
196
|
+
To get an even smaller file, one could remove the `ssty` font feature, because currently only Firefox makes use of it anyway. This results in a font file of about 200kB for *New Computer Modern Math Book*, at the price of worse rendering in Firefox.
|
|
209
197
|
|
|
210
198
|
## Development status
|
|
211
199
|
There are two tracking issues for development:
|
|
@@ -220,11 +208,6 @@ Other things that haven’t been implemented yet:
|
|
|
220
208
|
## Features that are not planned
|
|
221
209
|
There are some things we will (most likely) never support.
|
|
222
210
|
|
|
223
|
-
### Infix commands like `\over` and `\above`
|
|
224
|
-
Supporting these would make the parser much more complicated. This does not seem worth it, given that these commands are very rarely used and considered somewhat deprecated.
|
|
225
|
-
|
|
226
|
-
Other commands in this category: `\choose`, `\brace`, `\brack`, `\atop`
|
|
227
|
-
|
|
228
211
|
### Definition commands like `\def`, `\newcommand`, `\definecolor`
|
|
229
212
|
Again, supporting these would make the code much more complicated and anyway, these commands need to be repeated in every document. It seems more convenient to users and to the development of this project if new commands can only be defined in the config file.
|
|
230
213
|
|
|
@@ -233,7 +216,7 @@ There is no Unicode range for this, so the only way to implement this would be w
|
|
|
233
216
|
|
|
234
217
|
## Tips for writing LaTeX intended to be converted with this library
|
|
235
218
|
|
|
236
|
-
- Don’t use infix commands like `\over`, `\above`, `\choose`, `\brace`, `\brack`, `\atop`.
|
|
219
|
+
- Don’t use infix commands like `\over`, `\above`, `\choose`, `\brace`, `\brack`, `\atop`. We do mostly support them, but there are some edge cases that won’t render exactly as in LaTeX.
|
|
237
220
|
- Don’t try to create your own symbols by overlapping or stacking existing symbols; instead, try to find a Unicode symbol that looks like what you want: https://ftp.tu-chemnitz.de/pub/tex/fonts/newcomputermodern/doc/newcm-unimath-symbols.pdf
|
|
238
221
|
- This also applies to things like `:=`. Consider using `\coloneqq` instead, which will result in the semantically correct Unicode symbol.
|
|
239
222
|
- Don’t worry about having unnecessary curly braces, like, say, `x_{2}` vs `x_2`. Both result in the same MathML because unnecessary groups are stripped away by this library.
|
|
@@ -246,13 +229,11 @@ Note: at the time of this writing (June 2025), none of the following libraries r
|
|
|
246
229
|
|
|
247
230
|
- [pulldown-latex](https://github.com/carloskiki/pulldown-latex): The project most similar to this one. It is a Rust library for converting LaTeX math to MathML Core. The differences are:
|
|
248
231
|
- *pulldown-latex* only provides a Rust library; no Python package, no CLI
|
|
249
|
-
- *pulldown-latex* requires a CSS style sheet
|
|
250
232
|
- *pulldown-latex* can’t do certain simplifications of the MathML AST due to its architecture; for example, it can’t strip away the unnecessary grouping in `x_{2}`, resulting in an unnecessary `<mrow>` in the output
|
|
251
233
|
- At the time of this writing (June 2025), *pulldown-latex* doesn’t distinguish between `\mathcal` and `\mathscr`.
|
|
252
234
|
- [Temml](https://github.com/ronkok/Temml): a fork of [KaTeX](https://katex.org/) which removed the HTML output of KaTeX and kept only on the MathML output. *Temml* produces much higher quality MathML output than KaTeX. The differences to this library are:
|
|
253
235
|
- *Temml* is written in JavaScript, with all the pros and cons that result from that
|
|
254
|
-
- *Temml*
|
|
255
|
-
- *Temml* is much more willing to work around browser bugs to get consistent rendering, with specific CSS hacks for each browser; *math-core* doesn’t do that yet and it’s not clear we’ll ever do that
|
|
236
|
+
- *Temml* is much more willing to work around browser bugs to get consistent rendering, with specific CSS hacks for each browser; *math-core* does this to a much lesser degree. Even if you don’t include the CSS from `mathfixes.css`, math-core’s output will look mostly good.
|
|
256
237
|
|
|
257
238
|
## Acknowledgments
|
|
258
239
|
This code was originally forked from https://github.com/osanshouo/latex2mathml. The basic architecture of a lexer and a parser remains, but all the details have drastically changed and the supported portion of LaTeX commands has drastically increased.
|
|
@@ -47,17 +47,17 @@ fn main() {
|
|
|
47
47
|
<style>
|
|
48
48
|
@font-face {{
|
|
49
49
|
font-family: "NewComputerModernMath Book";
|
|
50
|
-
src: url('./NewCMMath-Book-prime-roundhand-vec.woff2') format('woff2');
|
|
50
|
+
src: url('./fonts/NewCMMath-Book-prime-roundhand-vec-subset.woff2') format('woff2');
|
|
51
51
|
font-display: swap;
|
|
52
52
|
}}
|
|
53
53
|
@font-face {{
|
|
54
54
|
font-family: "NewComputerModern Book";
|
|
55
|
-
src: url("./NewCM10-Book.woff2") format("woff2");
|
|
55
|
+
src: url("./fonts/NewCM10-Book.woff2") format("woff2");
|
|
56
56
|
font-display: swap;
|
|
57
57
|
}}
|
|
58
58
|
@font-face {{
|
|
59
59
|
font-family: "NewComputerModern Mono";
|
|
60
|
-
src: url("./NewCMMono10-Book.woff2") format("woff2");
|
|
60
|
+
src: url("./fonts/NewCMMono10-Book.woff2") format("woff2");
|
|
61
61
|
font-display: swap;
|
|
62
62
|
}}
|
|
63
63
|
math {{
|
|
@@ -89,17 +89,17 @@ fn main() {
|
|
|
89
89
|
<style>
|
|
90
90
|
@font-face {{
|
|
91
91
|
font-family: "NewComputerModernMath Book";
|
|
92
|
-
src: url('./NewCMMath-Book-prime-roundhand-vec.woff2') format('woff2');
|
|
92
|
+
src: url('./fonts/NewCMMath-Book-prime-roundhand-vec-subset.woff2') format('woff2');
|
|
93
93
|
font-display: swap;
|
|
94
94
|
}}
|
|
95
95
|
@font-face {{
|
|
96
96
|
font-family: "NewComputerModern Book";
|
|
97
|
-
src: url("./NewCM10-Book.woff2") format("woff2");
|
|
97
|
+
src: url("./fonts/NewCM10-Book.woff2") format("woff2");
|
|
98
98
|
font-display: swap;
|
|
99
99
|
}}
|
|
100
100
|
@font-face {{
|
|
101
101
|
font-family: "NewComputerModern Mono";
|
|
102
|
-
src: url("./NewCMMono10-Book.woff2") format("woff2");
|
|
102
|
+
src: url("./fonts/NewCMMono10-Book.woff2") format("woff2");
|
|
103
103
|
font-display: swap;
|
|
104
104
|
}}
|
|
105
105
|
math {{
|