temml 0.11.2 → 0.11.3

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.
package/dist/temml.mjs CHANGED
@@ -1181,9 +1181,6 @@ defineSymbol(math, textord, "\u29eb", "\\blacklozenge");
1181
1181
  defineSymbol(math, textord, "\u2605", "\\bigstar");
1182
1182
  defineSymbol(math, textord, "\u2222", "\\sphericalangle", true);
1183
1183
  defineSymbol(math, textord, "\u2201", "\\complement", true);
1184
- // unicode-math maps U+F0 to \matheth. We map to AMS function \eth
1185
- defineSymbol(math, textord, "\u00f0", "\\eth", true);
1186
- defineSymbol(text, textord, "\u00f0", "\u00f0");
1187
1184
  defineSymbol(math, textord, "\u2571", "\\diagup");
1188
1185
  defineSymbol(math, textord, "\u2572", "\\diagdown");
1189
1186
  defineSymbol(math, textord, "\u25a1", "\\square");
@@ -1543,6 +1540,46 @@ defineSymbol(math, mathord, "\u03e1", "\\sampi", true);
1543
1540
  defineSymbol(math, mathord, "\u03da", "\\Stigma", true);
1544
1541
  defineSymbol(math, mathord, "\u03db", "\\stigma", true);
1545
1542
  defineSymbol(math, mathord, "\u2aeb", "\\Bot");
1543
+
1544
+ // unicode-math maps U+F0 to \matheth. We map to AMS function \eth
1545
+ defineSymbol(math, textord, "\u00f0", "\\eth", true); // ð
1546
+ defineSymbol(text, textord, "\u00f0", "\u00f0");
1547
+ // Extended ASCII and non-ASCII Letters
1548
+ defineSymbol(math, textord, "\u00C5", "\\AA"); // Å
1549
+ defineSymbol(text, textord, "\u00C5", "\\AA", true);
1550
+ defineSymbol(math, textord, "\u00C6", "\\AE", true); // Æ
1551
+ defineSymbol(text, textord, "\u00C6", "\\AE", true);
1552
+ defineSymbol(math, textord, "\u00D0", "\\DH", true); // Ð
1553
+ defineSymbol(text, textord, "\u00D0", "\\DH", true);
1554
+ defineSymbol(math, textord, "\u00DE", "\\TH", true); // Þ
1555
+ defineSymbol(text, textord, "\u00DE", "\\TH", true);
1556
+ defineSymbol(math, textord, "\u00DF", "\\ss", true); // ß
1557
+ defineSymbol(text, textord, "\u00DF", "\\ss", true);
1558
+ defineSymbol(math, textord, "\u00E5", "\\aa"); // å
1559
+ defineSymbol(text, textord, "\u00E5", "\\aa", true);
1560
+ defineSymbol(math, textord, "\u00E6", "\\ae", true); // æ
1561
+ defineSymbol(text, textord, "\u00E6", "\\ae", true);
1562
+ defineSymbol(math, textord, "\u00F0", "\\dh"); // ð
1563
+ defineSymbol(text, textord, "\u00F0", "\\dh", true);
1564
+ defineSymbol(math, textord, "\u00FE", "\\th", true); // þ
1565
+ defineSymbol(text, textord, "\u00FE", "\\th", true);
1566
+ defineSymbol(math, textord, "\u0110", "\\DJ", true); // Đ
1567
+ defineSymbol(text, textord, "\u0110", "\\DJ", true);
1568
+ defineSymbol(math, textord, "\u0111", "\\dj", true); // đ
1569
+ defineSymbol(text, textord, "\u0111", "\\dj", true);
1570
+ defineSymbol(math, textord, "\u0141", "\\L", true); // Ł
1571
+ defineSymbol(text, textord, "\u0141", "\\L", true);
1572
+ defineSymbol(math, textord, "\u0141", "\\l", true); // ł
1573
+ defineSymbol(text, textord, "\u0141", "\\l", true);
1574
+ defineSymbol(math, textord, "\u014A", "\\NG", true); // Ŋ
1575
+ defineSymbol(text, textord, "\u014A", "\\NG", true);
1576
+ defineSymbol(math, textord, "\u014B", "\\ng", true); // ŋ
1577
+ defineSymbol(text, textord, "\u014B", "\\ng", true);
1578
+ defineSymbol(math, textord, "\u0152", "\\OE", true); // Œ
1579
+ defineSymbol(text, textord, "\u0152", "\\OE", true);
1580
+ defineSymbol(math, textord, "\u0153", "\\oe", true); // œ
1581
+ defineSymbol(text, textord, "\u0153", "\\oe", true);
1582
+
1546
1583
  defineSymbol(math, bin, "\u2217", "\u2217", true);
1547
1584
  defineSymbol(math, bin, "+", "+");
1548
1585
  defineSymbol(math, bin, "\u2217", "*");
@@ -1751,13 +1788,8 @@ defineSymbol(math, textord, "\u0131", "\u0131");
1751
1788
  defineSymbol(math, textord, "\u0237", "\u0237");
1752
1789
  defineSymbol(text, textord, "\u0131", "\\i", true);
1753
1790
  defineSymbol(text, textord, "\u0237", "\\j", true);
1754
- defineSymbol(text, textord, "\u00df", "\\ss", true);
1755
- defineSymbol(text, textord, "\u00e6", "\\ae", true);
1756
- defineSymbol(text, textord, "\u0153", "\\oe", true);
1757
1791
  defineSymbol(text, textord, "\u00f8", "\\o", true);
1758
1792
  defineSymbol(math, mathord, "\u00f8", "\\o", true);
1759
- defineSymbol(text, textord, "\u00c6", "\\AE", true);
1760
- defineSymbol(text, textord, "\u0152", "\\OE", true);
1761
1793
  defineSymbol(text, textord, "\u00d8", "\\O", true);
1762
1794
  defineSymbol(math, mathord, "\u00d8", "\\O", true);
1763
1795
  defineSymbol(text, accent, "\u02ca", "\\'"); // acute
@@ -3345,7 +3377,7 @@ const bordermatrixParseTree = (matrix, delimiters) => {
3345
3377
  // A vphantom with contents from the pmatrix, to set minimum cell height
3346
3378
  const phantomBody = [];
3347
3379
  for (let j = 0; j < body[i].length; j++) {
3348
- phantomBody.push(structuredClone(body[i][j]));
3380
+ phantomBody.push(body[i][j]);
3349
3381
  }
3350
3382
  leftColumnBody[i - 1].push(phantom(phantomBody, "vphantom"));
3351
3383
  }
@@ -3353,18 +3385,18 @@ const bordermatrixParseTree = (matrix, delimiters) => {
3353
3385
  // Create an array for the top row
3354
3386
  const topRowBody = new Array(body.length).fill().map(() => []);
3355
3387
  for (let j = 0; j < body[0].length; j++) {
3356
- topRowBody[0].push(structuredClone(body[0][j]));
3388
+ topRowBody[0].push(body[0][j]);
3357
3389
  }
3358
3390
  // Copy the rest of the pmatrix, but squashed via \hphantom
3359
3391
  for (let i = 1; i < body.length; i++) {
3360
3392
  for (let j = 0; j < body[0].length; j++) {
3361
- topRowBody[i].push(phantom(structuredClone(body[i][j]).body, "hphantom"));
3393
+ topRowBody[i].push(phantom(body[i][j].body, "hphantom"));
3362
3394
  }
3363
3395
  }
3364
3396
 
3365
3397
  // Squash the top row of the main {pmatrix}
3366
3398
  for (let j = 0; j < body[0].length; j++) {
3367
- body[0][j] = phantom(structuredClone(body[0][j]).body, "hphantom");
3399
+ body[0][j] = phantom(body[0][j].body, "hphantom");
3368
3400
  }
3369
3401
 
3370
3402
  // Now wrap the arrays in the proper parse nodes.
@@ -8445,9 +8477,9 @@ const mathmlBuilder$6 = (group, style) => {
8445
8477
  const mi = mathGroup.children[0].children[0];
8446
8478
  delete mi.attributes.mathvariant;
8447
8479
  for (let i = 1; i < mathGroup.children.length; i++) {
8448
- mi.children[0].text += mathGroup.children[i].type === "mn"
8449
- ? mathGroup.children[i].children[0].text
8450
- : mathGroup.children[i].children[0].children[0].text;
8480
+ mi.children[0].text += mathGroup.children[i].children[0].children
8481
+ ? mathGroup.children[i].children[0].children[0].text
8482
+ : mathGroup.children[i].children[0].text;
8451
8483
  }
8452
8484
  // Wrap in a <mrow> to prevent the same Firefox bug.
8453
8485
  const bogus = new mathMLTree.MathNode("mtext", new mathMLTree.TextNode("\u200b"));
@@ -9941,8 +9973,13 @@ defineFunction({
9941
9973
  "\u2a00",
9942
9974
  "\u2a01",
9943
9975
  "\u2a02",
9976
+ "\u2a03",
9944
9977
  "\u2a04",
9945
- "\u2a06"
9978
+ "\u2a05",
9979
+ "\u2a06",
9980
+ "\u2a07",
9981
+ "\u2a08",
9982
+ "\u2a09"
9946
9983
  ],
9947
9984
  props: {
9948
9985
  numArgs: 0
@@ -11363,7 +11400,6 @@ defineFunctionBuilders({
11363
11400
  // A Firefox bug will apply spacing here, but there should be none. Fix it.
11364
11401
  node = new mathMLTree.MathNode("mpadded", [node]);
11365
11402
  node.setAttribute("lspace", "0");
11366
- node.setAttribute("rspace", "0");
11367
11403
  }
11368
11404
  }
11369
11405
  return node
@@ -13915,7 +13951,7 @@ class Style {
13915
13951
  * https://mit-license.org/
13916
13952
  */
13917
13953
 
13918
- const version = "0.11.02";
13954
+ const version = "0.11.03";
13919
13955
 
13920
13956
  function postProcess(block) {
13921
13957
  const labelMap = {};
@@ -11,7 +11,7 @@
11
11
  * https://mit-license.org/
12
12
  */
13
13
 
14
- const version = "0.11.02";
14
+ const version = "0.11.03";
15
15
 
16
16
  function postProcess(block) {
17
17
  const labelMap = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "temml",
3
- "version": "0.11.02",
3
+ "version": "0.11.03",
4
4
  "description": "TeX to MathML conversion in JavaScript.",
5
5
  "main": "dist/temml.js",
6
6
  "engines": {
@@ -47,7 +47,7 @@ export const bordermatrixParseTree = (matrix, delimiters) => {
47
47
  // A vphantom with contents from the pmatrix, to set minimum cell height
48
48
  const phantomBody = [];
49
49
  for (let j = 0; j < body[i].length; j++) {
50
- phantomBody.push(structuredClone(body[i][j]))
50
+ phantomBody.push(body[i][j])
51
51
  }
52
52
  leftColumnBody[i - 1].push(phantom(phantomBody, "vphantom"))
53
53
  }
@@ -55,18 +55,18 @@ export const bordermatrixParseTree = (matrix, delimiters) => {
55
55
  // Create an array for the top row
56
56
  const topRowBody = new Array(body.length).fill().map(() => [])
57
57
  for (let j = 0; j < body[0].length; j++) {
58
- topRowBody[0].push(structuredClone(body[0][j]))
58
+ topRowBody[0].push(body[0][j])
59
59
  }
60
60
  // Copy the rest of the pmatrix, but squashed via \hphantom
61
61
  for (let i = 1; i < body.length; i++) {
62
62
  for (let j = 0; j < body[0].length; j++) {
63
- topRowBody[i].push(phantom(structuredClone(body[i][j]).body, "hphantom"))
63
+ topRowBody[i].push(phantom(body[i][j].body, "hphantom"))
64
64
  }
65
65
  }
66
66
 
67
67
  // Squash the top row of the main {pmatrix}
68
68
  for (let j = 0; j < body[0].length; j++) {
69
- body[0][j] = phantom(structuredClone(body[0][j]).body, "hphantom")
69
+ body[0][j] = phantom(body[0][j].body, "hphantom")
70
70
  }
71
71
 
72
72
  // Now wrap the arrays in the proper parse nodes.
@@ -34,9 +34,9 @@ const mathmlBuilder = (group, style) => {
34
34
  const mi = mathGroup.children[0].children[0];
35
35
  delete mi.attributes.mathvariant
36
36
  for (let i = 1; i < mathGroup.children.length; i++) {
37
- mi.children[0].text += mathGroup.children[i].type === "mn"
38
- ? mathGroup.children[i].children[0].text
39
- : mathGroup.children[i].children[0].children[0].text
37
+ mi.children[0].text += mathGroup.children[i].children[0].children
38
+ ? mathGroup.children[i].children[0].children[0].text
39
+ : mathGroup.children[i].children[0].text
40
40
  }
41
41
  // Wrap in a <mrow> to prevent the same Firefox bug.
42
42
  const bogus = new mathMLTree.MathNode("mtext", new mathMLTree.TextNode("\u200b"))
@@ -120,8 +120,13 @@ defineFunction({
120
120
  "\u2a00",
121
121
  "\u2a01",
122
122
  "\u2a02",
123
+ "\u2a03",
123
124
  "\u2a04",
124
- "\u2a06"
125
+ "\u2a05",
126
+ "\u2a06",
127
+ "\u2a07",
128
+ "\u2a08",
129
+ "\u2a09"
125
130
  ],
126
131
  props: {
127
132
  numArgs: 0
@@ -43,7 +43,6 @@ defineFunctionBuilders({
43
43
  // A Firefox bug will apply spacing here, but there should be none. Fix it.
44
44
  node = new mathMLTree.MathNode("mpadded", [node])
45
45
  node.setAttribute("lspace", "0")
46
- node.setAttribute("rspace", "0")
47
46
  }
48
47
  }
49
48
  return node
@@ -5,7 +5,7 @@
5
5
  * https://mit-license.org/
6
6
  */
7
7
 
8
- export const version = "0.11.02";
8
+ export const version = "0.11.03";
9
9
 
10
10
  export function postProcess(block) {
11
11
  const labelMap = {}
package/src/symbols.js CHANGED
@@ -306,9 +306,6 @@ defineSymbol(math, textord, "\u29eb", "\\blacklozenge");
306
306
  defineSymbol(math, textord, "\u2605", "\\bigstar");
307
307
  defineSymbol(math, textord, "\u2222", "\\sphericalangle", true);
308
308
  defineSymbol(math, textord, "\u2201", "\\complement", true);
309
- // unicode-math maps U+F0 to \matheth. We map to AMS function \eth
310
- defineSymbol(math, textord, "\u00f0", "\\eth", true);
311
- defineSymbol(text, textord, "\u00f0", "\u00f0");
312
309
  defineSymbol(math, textord, "\u2571", "\\diagup");
313
310
  defineSymbol(math, textord, "\u2572", "\\diagdown");
314
311
  defineSymbol(math, textord, "\u25a1", "\\square");
@@ -668,6 +665,46 @@ defineSymbol(math, mathord, "\u03e1", "\\sampi", true);
668
665
  defineSymbol(math, mathord, "\u03da", "\\Stigma", true);
669
666
  defineSymbol(math, mathord, "\u03db", "\\stigma", true);
670
667
  defineSymbol(math, mathord, "\u2aeb", "\\Bot");
668
+
669
+ // unicode-math maps U+F0 to \matheth. We map to AMS function \eth
670
+ defineSymbol(math, textord, "\u00f0", "\\eth", true); // ð
671
+ defineSymbol(text, textord, "\u00f0", "\u00f0");
672
+ // Extended ASCII and non-ASCII Letters
673
+ defineSymbol(math, textord, "\u00C5", "\\AA") // Å
674
+ defineSymbol(text, textord, "\u00C5", "\\AA", true)
675
+ defineSymbol(math, textord, "\u00C6", "\\AE", true) // Æ
676
+ defineSymbol(text, textord, "\u00C6", "\\AE", true)
677
+ defineSymbol(math, textord, "\u00D0", "\\DH", true) // Ð
678
+ defineSymbol(text, textord, "\u00D0", "\\DH", true)
679
+ defineSymbol(math, textord, "\u00DE", "\\TH", true) // Þ
680
+ defineSymbol(text, textord, "\u00DE", "\\TH", true)
681
+ defineSymbol(math, textord, "\u00DF", "\\ss", true) // ß
682
+ defineSymbol(text, textord, "\u00DF", "\\ss", true)
683
+ defineSymbol(math, textord, "\u00E5", "\\aa") // å
684
+ defineSymbol(text, textord, "\u00E5", "\\aa", true)
685
+ defineSymbol(math, textord, "\u00E6", "\\ae", true) // æ
686
+ defineSymbol(text, textord, "\u00E6", "\\ae", true)
687
+ defineSymbol(math, textord, "\u00F0", "\\dh") // ð
688
+ defineSymbol(text, textord, "\u00F0", "\\dh", true)
689
+ defineSymbol(math, textord, "\u00FE", "\\th", true) // þ
690
+ defineSymbol(text, textord, "\u00FE", "\\th", true)
691
+ defineSymbol(math, textord, "\u0110", "\\DJ", true) // Đ
692
+ defineSymbol(text, textord, "\u0110", "\\DJ", true)
693
+ defineSymbol(math, textord, "\u0111", "\\dj", true) // đ
694
+ defineSymbol(text, textord, "\u0111", "\\dj", true)
695
+ defineSymbol(math, textord, "\u0141", "\\L", true) // Ł
696
+ defineSymbol(text, textord, "\u0141", "\\L", true)
697
+ defineSymbol(math, textord, "\u0141", "\\l", true) // ł
698
+ defineSymbol(text, textord, "\u0141", "\\l", true)
699
+ defineSymbol(math, textord, "\u014A", "\\NG", true) // Ŋ
700
+ defineSymbol(text, textord, "\u014A", "\\NG", true)
701
+ defineSymbol(math, textord, "\u014B", "\\ng", true) // ŋ
702
+ defineSymbol(text, textord, "\u014B", "\\ng", true)
703
+ defineSymbol(math, textord, "\u0152", "\\OE", true) // Œ
704
+ defineSymbol(text, textord, "\u0152", "\\OE", true)
705
+ defineSymbol(math, textord, "\u0153", "\\oe", true) // œ
706
+ defineSymbol(text, textord, "\u0153", "\\oe", true)
707
+
671
708
  defineSymbol(math, bin, "\u2217", "\u2217", true);
672
709
  defineSymbol(math, bin, "+", "+");
673
710
  defineSymbol(math, bin, "\u2217", "*");
@@ -876,13 +913,8 @@ defineSymbol(math, textord, "\u0131", "\u0131");
876
913
  defineSymbol(math, textord, "\u0237", "\u0237");
877
914
  defineSymbol(text, textord, "\u0131", "\\i", true);
878
915
  defineSymbol(text, textord, "\u0237", "\\j", true);
879
- defineSymbol(text, textord, "\u00df", "\\ss", true);
880
- defineSymbol(text, textord, "\u00e6", "\\ae", true);
881
- defineSymbol(text, textord, "\u0153", "\\oe", true);
882
916
  defineSymbol(text, textord, "\u00f8", "\\o", true);
883
917
  defineSymbol(math, mathord, "\u00f8", "\\o", true);
884
- defineSymbol(text, textord, "\u00c6", "\\AE", true);
885
- defineSymbol(text, textord, "\u0152", "\\OE", true);
886
918
  defineSymbol(text, textord, "\u00d8", "\\O", true);
887
919
  defineSymbol(math, mathord, "\u00d8", "\\O", true);
888
920
  defineSymbol(text, accent, "\u02ca", "\\'"); // acute