temml 0.11.1 → 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/README.md +1 -1
- package/dist/Temml-Local.css +6 -1
- package/dist/{Temml-Fira.css → Temml-NotoSans.css} +13 -20
- package/dist/Temml-STIX2.css +2 -2
- package/dist/temml.cjs +105 -54
- package/dist/temml.d.ts +2 -2
- package/dist/temml.js +105 -54
- package/dist/temml.min.js +1 -1
- package/dist/temml.mjs +105 -54
- package/dist/temmlPostProcess.js +1 -1
- package/package.json +1 -1
- package/src/Parser.js +7 -1
- package/src/environments/borderTree.js +4 -4
- package/src/functions/arrow.js +1 -1
- package/src/functions/font.js +3 -3
- package/src/functions/mclass.js +15 -15
- package/src/functions/op.js +6 -1
- package/src/functions/operatorname.js +1 -1
- package/src/functions/supsub.js +1 -1
- package/src/functions/symbolsOp.js +9 -0
- package/src/functions/symbolsOrd.js +2 -1
- package/src/postProcess.js +1 -1
- package/src/symbols.js +42 -10
package/README.md
CHANGED
package/dist/Temml-Local.css
CHANGED
@@ -12,7 +12,7 @@ Unicode range 1D49C to 1D4B5.
|
|
12
12
|
}
|
13
13
|
|
14
14
|
math {
|
15
|
-
font-family: "Cambria Math", 'STIXTwoMath-Regular', math;
|
15
|
+
font-family: "Cambria Math", 'STIXTwoMath-Regular', 'NotoSansMath-Regular', math;
|
16
16
|
font-style: normal;
|
17
17
|
font-weight: normal;
|
18
18
|
line-height: normal;
|
@@ -34,6 +34,11 @@ math * {
|
|
34
34
|
* Not in Chromium, which recognizes display: "block math" written inline. */
|
35
35
|
math.tml-display { display: block; }
|
36
36
|
|
37
|
+
*.mathcal {
|
38
|
+
/* NotoSans */
|
39
|
+
font-feature-settings: 'ss01';
|
40
|
+
}
|
41
|
+
|
37
42
|
math .mathscr {
|
38
43
|
font-family: "Temml";
|
39
44
|
}
|
@@ -1,24 +1,13 @@
|
|
1
1
|
/*
|
2
|
-
|
2
|
+
Noto Math fonts are released under the SIL OPEN FONT LICENSE Version 1.1.
|
3
3
|
|
4
|
-
The
|
5
|
-
|
6
|
-
|
7
|
-
The Temml.woff2 is a clone of KaTeX_Script-Regular, except that the code points
|
8
|
-
have been changed from ASCII to Unicode Mathematical Alphanumeric Symbols Script capitals,
|
9
|
-
Unicode range 1D49C to 1D4B5.
|
4
|
+
The NotoMath font has been obtained from
|
5
|
+
https://github.com/notofonts/math
|
10
6
|
*/
|
11
7
|
|
12
8
|
@font-face {
|
13
|
-
font-family:
|
14
|
-
src: url('
|
15
|
-
font-weight: normal;
|
16
|
-
font-style: normal;
|
17
|
-
}
|
18
|
-
|
19
|
-
@font-face {
|
20
|
-
font-family: Fira Math;
|
21
|
-
src: url('FiraMath-Regular.woff2');
|
9
|
+
font-family: NotoSans Math;
|
10
|
+
src: url('NotoSansMath-Regular.ttf');
|
22
11
|
}
|
23
12
|
|
24
13
|
math {
|
@@ -40,20 +29,24 @@ math * {
|
|
40
29
|
}
|
41
30
|
|
42
31
|
math {
|
43
|
-
font-family: "
|
32
|
+
font-family: "NotoSans Math", math;
|
44
33
|
}
|
45
34
|
|
46
35
|
/* Next line is active in Firefox and Safari.
|
47
36
|
* Not in Chromium, which recognizes display: "block math" written inline. */
|
48
37
|
math.tml-display { display: block; }
|
49
38
|
|
50
|
-
|
51
|
-
font-family: "
|
39
|
+
math .mathscr {
|
40
|
+
font-family: "ssty1";
|
41
|
+
}
|
42
|
+
|
43
|
+
*.mathcal {
|
44
|
+
font-feature-settings: 'ss01';
|
52
45
|
}
|
53
46
|
|
54
47
|
/* Chromium prime alignment */
|
55
48
|
mo.tml-prime {
|
56
|
-
font-
|
49
|
+
font-feature-settings: 'ssty';
|
57
50
|
}
|
58
51
|
|
59
52
|
/* Prevent f' from overlapping in Chromium */
|
package/dist/Temml-STIX2.css
CHANGED
package/dist/temml.cjs
CHANGED
@@ -1183,9 +1183,6 @@ defineSymbol(math, textord, "\u29eb", "\\blacklozenge");
|
|
1183
1183
|
defineSymbol(math, textord, "\u2605", "\\bigstar");
|
1184
1184
|
defineSymbol(math, textord, "\u2222", "\\sphericalangle", true);
|
1185
1185
|
defineSymbol(math, textord, "\u2201", "\\complement", true);
|
1186
|
-
// unicode-math maps U+F0 to \matheth. We map to AMS function \eth
|
1187
|
-
defineSymbol(math, textord, "\u00f0", "\\eth", true);
|
1188
|
-
defineSymbol(text, textord, "\u00f0", "\u00f0");
|
1189
1186
|
defineSymbol(math, textord, "\u2571", "\\diagup");
|
1190
1187
|
defineSymbol(math, textord, "\u2572", "\\diagdown");
|
1191
1188
|
defineSymbol(math, textord, "\u25a1", "\\square");
|
@@ -1545,6 +1542,46 @@ defineSymbol(math, mathord, "\u03e1", "\\sampi", true);
|
|
1545
1542
|
defineSymbol(math, mathord, "\u03da", "\\Stigma", true);
|
1546
1543
|
defineSymbol(math, mathord, "\u03db", "\\stigma", true);
|
1547
1544
|
defineSymbol(math, mathord, "\u2aeb", "\\Bot");
|
1545
|
+
|
1546
|
+
// unicode-math maps U+F0 to \matheth. We map to AMS function \eth
|
1547
|
+
defineSymbol(math, textord, "\u00f0", "\\eth", true); // ð
|
1548
|
+
defineSymbol(text, textord, "\u00f0", "\u00f0");
|
1549
|
+
// Extended ASCII and non-ASCII Letters
|
1550
|
+
defineSymbol(math, textord, "\u00C5", "\\AA"); // Å
|
1551
|
+
defineSymbol(text, textord, "\u00C5", "\\AA", true);
|
1552
|
+
defineSymbol(math, textord, "\u00C6", "\\AE", true); // Æ
|
1553
|
+
defineSymbol(text, textord, "\u00C6", "\\AE", true);
|
1554
|
+
defineSymbol(math, textord, "\u00D0", "\\DH", true); // Ð
|
1555
|
+
defineSymbol(text, textord, "\u00D0", "\\DH", true);
|
1556
|
+
defineSymbol(math, textord, "\u00DE", "\\TH", true); // Þ
|
1557
|
+
defineSymbol(text, textord, "\u00DE", "\\TH", true);
|
1558
|
+
defineSymbol(math, textord, "\u00DF", "\\ss", true); // ß
|
1559
|
+
defineSymbol(text, textord, "\u00DF", "\\ss", true);
|
1560
|
+
defineSymbol(math, textord, "\u00E5", "\\aa"); // å
|
1561
|
+
defineSymbol(text, textord, "\u00E5", "\\aa", true);
|
1562
|
+
defineSymbol(math, textord, "\u00E6", "\\ae", true); // æ
|
1563
|
+
defineSymbol(text, textord, "\u00E6", "\\ae", true);
|
1564
|
+
defineSymbol(math, textord, "\u00F0", "\\dh"); // ð
|
1565
|
+
defineSymbol(text, textord, "\u00F0", "\\dh", true);
|
1566
|
+
defineSymbol(math, textord, "\u00FE", "\\th", true); // þ
|
1567
|
+
defineSymbol(text, textord, "\u00FE", "\\th", true);
|
1568
|
+
defineSymbol(math, textord, "\u0110", "\\DJ", true); // Đ
|
1569
|
+
defineSymbol(text, textord, "\u0110", "\\DJ", true);
|
1570
|
+
defineSymbol(math, textord, "\u0111", "\\dj", true); // đ
|
1571
|
+
defineSymbol(text, textord, "\u0111", "\\dj", true);
|
1572
|
+
defineSymbol(math, textord, "\u0141", "\\L", true); // Ł
|
1573
|
+
defineSymbol(text, textord, "\u0141", "\\L", true);
|
1574
|
+
defineSymbol(math, textord, "\u0141", "\\l", true); // ł
|
1575
|
+
defineSymbol(text, textord, "\u0141", "\\l", true);
|
1576
|
+
defineSymbol(math, textord, "\u014A", "\\NG", true); // Ŋ
|
1577
|
+
defineSymbol(text, textord, "\u014A", "\\NG", true);
|
1578
|
+
defineSymbol(math, textord, "\u014B", "\\ng", true); // ŋ
|
1579
|
+
defineSymbol(text, textord, "\u014B", "\\ng", true);
|
1580
|
+
defineSymbol(math, textord, "\u0152", "\\OE", true); // Œ
|
1581
|
+
defineSymbol(text, textord, "\u0152", "\\OE", true);
|
1582
|
+
defineSymbol(math, textord, "\u0153", "\\oe", true); // œ
|
1583
|
+
defineSymbol(text, textord, "\u0153", "\\oe", true);
|
1584
|
+
|
1548
1585
|
defineSymbol(math, bin, "\u2217", "\u2217", true);
|
1549
1586
|
defineSymbol(math, bin, "+", "+");
|
1550
1587
|
defineSymbol(math, bin, "\u2217", "*");
|
@@ -1753,13 +1790,8 @@ defineSymbol(math, textord, "\u0131", "\u0131");
|
|
1753
1790
|
defineSymbol(math, textord, "\u0237", "\u0237");
|
1754
1791
|
defineSymbol(text, textord, "\u0131", "\\i", true);
|
1755
1792
|
defineSymbol(text, textord, "\u0237", "\\j", true);
|
1756
|
-
defineSymbol(text, textord, "\u00df", "\\ss", true);
|
1757
|
-
defineSymbol(text, textord, "\u00e6", "\\ae", true);
|
1758
|
-
defineSymbol(text, textord, "\u0153", "\\oe", true);
|
1759
1793
|
defineSymbol(text, textord, "\u00f8", "\\o", true);
|
1760
1794
|
defineSymbol(math, mathord, "\u00f8", "\\o", true);
|
1761
|
-
defineSymbol(text, textord, "\u00c6", "\\AE", true);
|
1762
|
-
defineSymbol(text, textord, "\u0152", "\\OE", true);
|
1763
1795
|
defineSymbol(text, textord, "\u00d8", "\\O", true);
|
1764
1796
|
defineSymbol(math, mathord, "\u00d8", "\\O", true);
|
1765
1797
|
defineSymbol(text, accent, "\u02ca", "\\'"); // acute
|
@@ -1772,7 +1804,7 @@ defineSymbol(text, accent, "\u02d9", "\\."); // dot above
|
|
1772
1804
|
defineSymbol(text, accent, "\u00b8", "\\c"); // cedilla
|
1773
1805
|
defineSymbol(text, accent, "\u02da", "\\r"); // ring above
|
1774
1806
|
defineSymbol(text, accent, "\u02c7", "\\v"); // caron
|
1775
|
-
defineSymbol(text, accent, "\u00a8", '\\"'); //
|
1807
|
+
defineSymbol(text, accent, "\u00a8", '\\"'); // diaeresis
|
1776
1808
|
defineSymbol(text, accent, "\u02dd", "\\H"); // double acute
|
1777
1809
|
defineSymbol(math, accent, "\u02ca", "\\'"); // acute
|
1778
1810
|
defineSymbol(math, accent, "\u02cb", "\\`"); // grave
|
@@ -1784,7 +1816,7 @@ defineSymbol(math, accent, "\u02d9", "\\."); // dot above
|
|
1784
1816
|
defineSymbol(math, accent, "\u00b8", "\\c"); // cedilla
|
1785
1817
|
defineSymbol(math, accent, "\u02da", "\\r"); // ring above
|
1786
1818
|
defineSymbol(math, accent, "\u02c7", "\\v"); // caron
|
1787
|
-
defineSymbol(math, accent, "\u00a8", '\\"'); //
|
1819
|
+
defineSymbol(math, accent, "\u00a8", '\\"'); // diaeresis
|
1788
1820
|
defineSymbol(math, accent, "\u02dd", "\\H"); // double acute
|
1789
1821
|
|
1790
1822
|
// These ligatures are detected and created in Parser.js's `formLigatures`.
|
@@ -2752,17 +2784,17 @@ const calculateSize = function(sizeValue, style) {
|
|
2752
2784
|
|
2753
2785
|
// Helper functions
|
2754
2786
|
|
2755
|
-
const padding$
|
2787
|
+
const padding$1 = width => {
|
2756
2788
|
const node = new mathMLTree.MathNode("mspace");
|
2757
2789
|
node.setAttribute("width", width + "em");
|
2758
2790
|
return node
|
2759
2791
|
};
|
2760
2792
|
|
2761
2793
|
const paddedNode = (group, lspace = 0.3, rspace = 0, mustSmash = false) => {
|
2762
|
-
if (group == null && rspace === 0) { return padding$
|
2794
|
+
if (group == null && rspace === 0) { return padding$1(lspace) }
|
2763
2795
|
const row = group ? [group] : [];
|
2764
|
-
if (lspace !== 0) { row.unshift(padding$
|
2765
|
-
if (rspace > 0) { row.push(padding$
|
2796
|
+
if (lspace !== 0) { row.unshift(padding$1(lspace)); }
|
2797
|
+
if (rspace > 0) { row.push(padding$1(rspace)); }
|
2766
2798
|
if (mustSmash) {
|
2767
2799
|
// Used for the bottom arrow in a {CD} environment
|
2768
2800
|
const mpadded = new mathMLTree.MathNode("mpadded", row);
|
@@ -2889,8 +2921,8 @@ defineFunction({
|
|
2889
2921
|
const node = munderoverNode(group.name, group.body, group.below, style);
|
2890
2922
|
// Create operator spacing for a relation.
|
2891
2923
|
const row = [node];
|
2892
|
-
row.unshift(padding$
|
2893
|
-
row.push(padding$
|
2924
|
+
row.unshift(padding$1(0.2778));
|
2925
|
+
row.push(padding$1(0.2778));
|
2894
2926
|
return new mathMLTree.MathNode("mrow", row)
|
2895
2927
|
}
|
2896
2928
|
});
|
@@ -2965,13 +2997,13 @@ defineFunction({
|
|
2965
2997
|
botNode.setAttribute("width", "0.5em");
|
2966
2998
|
wrapper = new mathMLTree.MathNode(
|
2967
2999
|
"mpadded",
|
2968
|
-
[padding$
|
3000
|
+
[padding$1(0.2778), botNode, raiseNode, padding$1(0.2778)]
|
2969
3001
|
);
|
2970
3002
|
} else {
|
2971
3003
|
raiseNode.setAttribute("width", (group.name === "\\equilibriumRight" ? "0.5em" : "0"));
|
2972
3004
|
wrapper = new mathMLTree.MathNode(
|
2973
3005
|
"mpadded",
|
2974
|
-
[padding$
|
3006
|
+
[padding$1(0.2778), raiseNode, botArrow, padding$1(0.2778)]
|
2975
3007
|
);
|
2976
3008
|
}
|
2977
3009
|
|
@@ -3347,7 +3379,7 @@ const bordermatrixParseTree = (matrix, delimiters) => {
|
|
3347
3379
|
// A vphantom with contents from the pmatrix, to set minimum cell height
|
3348
3380
|
const phantomBody = [];
|
3349
3381
|
for (let j = 0; j < body[i].length; j++) {
|
3350
|
-
phantomBody.push(
|
3382
|
+
phantomBody.push(body[i][j]);
|
3351
3383
|
}
|
3352
3384
|
leftColumnBody[i - 1].push(phantom(phantomBody, "vphantom"));
|
3353
3385
|
}
|
@@ -3355,18 +3387,18 @@ const bordermatrixParseTree = (matrix, delimiters) => {
|
|
3355
3387
|
// Create an array for the top row
|
3356
3388
|
const topRowBody = new Array(body.length).fill().map(() => []);
|
3357
3389
|
for (let j = 0; j < body[0].length; j++) {
|
3358
|
-
topRowBody[0].push(
|
3390
|
+
topRowBody[0].push(body[0][j]);
|
3359
3391
|
}
|
3360
3392
|
// Copy the rest of the pmatrix, but squashed via \hphantom
|
3361
3393
|
for (let i = 1; i < body.length; i++) {
|
3362
3394
|
for (let j = 0; j < body[0].length; j++) {
|
3363
|
-
topRowBody[i].push(phantom(
|
3395
|
+
topRowBody[i].push(phantom(body[i][j].body, "hphantom"));
|
3364
3396
|
}
|
3365
3397
|
}
|
3366
3398
|
|
3367
3399
|
// Squash the top row of the main {pmatrix}
|
3368
3400
|
for (let j = 0; j < body[0].length; j++) {
|
3369
|
-
body[0][j] = phantom(
|
3401
|
+
body[0][j] = phantom(body[0][j].body, "hphantom");
|
3370
3402
|
}
|
3371
3403
|
|
3372
3404
|
// Now wrap the arrays in the proper parse nodes.
|
@@ -8083,7 +8115,7 @@ defineFunction({
|
|
8083
8115
|
}
|
8084
8116
|
});
|
8085
8117
|
|
8086
|
-
const padding
|
8118
|
+
const padding = _ => {
|
8087
8119
|
const node = new mathMLTree.MathNode("mspace");
|
8088
8120
|
node.setAttribute("width", "3pt");
|
8089
8121
|
return node
|
@@ -8096,9 +8128,9 @@ const mathmlBuilder$7 = (group, style) => {
|
|
8096
8128
|
// Firefox does not reliably add side padding.
|
8097
8129
|
// Insert <mspace>
|
8098
8130
|
node = new mathMLTree.MathNode("mrow", [
|
8099
|
-
padding
|
8131
|
+
padding(),
|
8100
8132
|
buildGroup$1(group.body, style),
|
8101
|
-
padding
|
8133
|
+
padding()
|
8102
8134
|
]);
|
8103
8135
|
} else {
|
8104
8136
|
node = new mathMLTree.MathNode("menclose", [buildGroup$1(group.body, style)]);
|
@@ -8447,9 +8479,9 @@ const mathmlBuilder$6 = (group, style) => {
|
|
8447
8479
|
const mi = mathGroup.children[0].children[0];
|
8448
8480
|
delete mi.attributes.mathvariant;
|
8449
8481
|
for (let i = 1; i < mathGroup.children.length; i++) {
|
8450
|
-
mi.children[0].text += mathGroup.children[i].
|
8451
|
-
? mathGroup.children[i].children[0].text
|
8452
|
-
: mathGroup.children[i].children[0].
|
8482
|
+
mi.children[0].text += mathGroup.children[i].children[0].children
|
8483
|
+
? mathGroup.children[i].children[0].children[0].text
|
8484
|
+
: mathGroup.children[i].children[0].text;
|
8453
8485
|
}
|
8454
8486
|
// Wrap in a <mrow> to prevent the same Firefox bug.
|
8455
8487
|
const bogus = new mathMLTree.MathNode("mtext", new mathMLTree.TextNode("\u200b"));
|
@@ -9498,12 +9530,6 @@ defineFunction({
|
|
9498
9530
|
|
9499
9531
|
const textAtomTypes = ["text", "textord", "mathord", "atom"];
|
9500
9532
|
|
9501
|
-
const padding = width => {
|
9502
|
-
const node = new mathMLTree.MathNode("mspace");
|
9503
|
-
node.setAttribute("width", width + "em");
|
9504
|
-
return node
|
9505
|
-
};
|
9506
|
-
|
9507
9533
|
function mathmlBuilder$3(group, style) {
|
9508
9534
|
let node;
|
9509
9535
|
const inner = buildExpression(group.body, style);
|
@@ -9539,17 +9565,17 @@ function mathmlBuilder$3(group, style) {
|
|
9539
9565
|
if (doSpacing ) {
|
9540
9566
|
if (group.mclass === "mbin") {
|
9541
9567
|
// medium space
|
9542
|
-
node.children.unshift(padding(0.2222));
|
9543
|
-
node.children.push(padding(0.2222));
|
9568
|
+
node.children.unshift(padding$1(0.2222));
|
9569
|
+
node.children.push(padding$1(0.2222));
|
9544
9570
|
} else if (group.mclass === "mrel") {
|
9545
9571
|
// thickspace
|
9546
|
-
node.children.unshift(padding(0.2778));
|
9547
|
-
node.children.push(padding(0.2778));
|
9572
|
+
node.children.unshift(padding$1(0.2778));
|
9573
|
+
node.children.push(padding$1(0.2778));
|
9548
9574
|
} else if (group.mclass === "mpunct") {
|
9549
|
-
node.children.push(padding(0.1667));
|
9575
|
+
node.children.push(padding$1(0.1667));
|
9550
9576
|
} else if (group.mclass === "minner") {
|
9551
|
-
node.children.unshift(padding(0.0556)); // 1 mu is the most likely option
|
9552
|
-
node.children.push(padding(0.0556));
|
9577
|
+
node.children.unshift(padding$1(0.0556)); // 1 mu is the most likely option
|
9578
|
+
node.children.push(padding$1(0.0556));
|
9553
9579
|
}
|
9554
9580
|
}
|
9555
9581
|
} else {
|
@@ -9619,14 +9645,19 @@ defineFunction({
|
|
9619
9645
|
break
|
9620
9646
|
}
|
9621
9647
|
}
|
9622
|
-
|
9623
|
-
|
9624
|
-
|
9625
|
-
|
9626
|
-
|
9627
|
-
|
9628
|
-
|
9629
|
-
|
9648
|
+
if (mustPromote && funcName === "\\mathord" && mord.type === "mathord"
|
9649
|
+
&& mord.text.length > 1) {
|
9650
|
+
return mord
|
9651
|
+
} else {
|
9652
|
+
return {
|
9653
|
+
type: "mclass",
|
9654
|
+
mode: parser.mode,
|
9655
|
+
mclass: "m" + funcName.slice(5),
|
9656
|
+
body: ordargument(mustPromote ? mord : body),
|
9657
|
+
isCharacterBox,
|
9658
|
+
mustPromote
|
9659
|
+
};
|
9660
|
+
}
|
9630
9661
|
},
|
9631
9662
|
mathmlBuilder: mathmlBuilder$3
|
9632
9663
|
});
|
@@ -9944,8 +9975,13 @@ defineFunction({
|
|
9944
9975
|
"\u2a00",
|
9945
9976
|
"\u2a01",
|
9946
9977
|
"\u2a02",
|
9978
|
+
"\u2a03",
|
9947
9979
|
"\u2a04",
|
9948
|
-
"\
|
9980
|
+
"\u2a05",
|
9981
|
+
"\u2a06",
|
9982
|
+
"\u2a07",
|
9983
|
+
"\u2a08",
|
9984
|
+
"\u2a09"
|
9949
9985
|
],
|
9950
9986
|
props: {
|
9951
9987
|
numArgs: 0
|
@@ -10188,7 +10224,7 @@ const mathmlBuilder$1 = (group, style) => {
|
|
10188
10224
|
for (let i = 0; i < expression.length; i++) {
|
10189
10225
|
let node = expression[i];
|
10190
10226
|
if (node instanceof mathMLTree.MathNode) {
|
10191
|
-
if (node.type === "mrow" && node.children.length === 1 &&
|
10227
|
+
if ((node.type === "mrow" || node.type === "mpadded") && node.children.length === 1 &&
|
10192
10228
|
node.children[0] instanceof mathMLTree.MathNode) {
|
10193
10229
|
node = node.children[0];
|
10194
10230
|
}
|
@@ -10806,7 +10842,7 @@ const symbolRegEx = /^m(over|under|underover)$/;
|
|
10806
10842
|
defineFunctionBuilders({
|
10807
10843
|
type: "supsub",
|
10808
10844
|
mathmlBuilder(group, style) {
|
10809
|
-
// Is the inner group a relevant
|
10845
|
+
// Is the inner group a relevant horizontal brace?
|
10810
10846
|
let isBrace = false;
|
10811
10847
|
let isOver;
|
10812
10848
|
let isSup;
|
@@ -10989,6 +11025,14 @@ defineFunctionBuilders({
|
|
10989
11025
|
// ":" is not in the MathML operator dictionary. Give it BIN spacing.
|
10990
11026
|
node.attributes.lspace = "0.2222em";
|
10991
11027
|
node.attributes.rspace = "0.2222em";
|
11028
|
+
} else if (group.needsSpacing) {
|
11029
|
+
// Fix a MathML bug that occurs when a <mo> is between two <mtext> elements.
|
11030
|
+
if (group.family === "bin") {
|
11031
|
+
return new mathMLTree.MathNode("mrow", [padding$1(0.222), node, padding$1(0.222)])
|
11032
|
+
} else {
|
11033
|
+
// REL spacing
|
11034
|
+
return new mathMLTree.MathNode("mrow", [padding$1(0.2778), node, padding$1(0.2778)])
|
11035
|
+
}
|
10992
11036
|
}
|
10993
11037
|
return node;
|
10994
11038
|
}
|
@@ -11356,7 +11400,8 @@ defineFunctionBuilders({
|
|
11356
11400
|
node.setAttribute("mathvariant", "normal");
|
11357
11401
|
if (text.text.length === 1) {
|
11358
11402
|
// A Firefox bug will apply spacing here, but there should be none. Fix it.
|
11359
|
-
node = new mathMLTree.MathNode("
|
11403
|
+
node = new mathMLTree.MathNode("mpadded", [node]);
|
11404
|
+
node.setAttribute("lspace", "0");
|
11360
11405
|
}
|
11361
11406
|
}
|
11362
11407
|
return node
|
@@ -12735,6 +12780,7 @@ var unicodeSymbols = {
|
|
12735
12780
|
|
12736
12781
|
const binLeftCancellers = ["bin", "op", "open", "punct", "rel"];
|
12737
12782
|
const sizeRegEx = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/;
|
12783
|
+
const textRegEx = /^ *\\text/;
|
12738
12784
|
|
12739
12785
|
/**
|
12740
12786
|
* This file contains the parser used to parse out a TeX expression from the
|
@@ -13645,6 +13691,11 @@ class Parser {
|
|
13645
13691
|
loc,
|
13646
13692
|
text
|
13647
13693
|
};
|
13694
|
+
if ((family === "rel" || family === "bin") && this.prevAtomType === "text") {
|
13695
|
+
if (textRegEx.test(loc.lexer.input.slice(loc.end))) {
|
13696
|
+
s.needsSpacing = true; // Fix a MathML bug.
|
13697
|
+
}
|
13698
|
+
}
|
13648
13699
|
} else {
|
13649
13700
|
if (asciiFromScript[text]) {
|
13650
13701
|
// Unicode 14 disambiguates chancery from roundhand.
|
@@ -13902,7 +13953,7 @@ class Style {
|
|
13902
13953
|
* https://mit-license.org/
|
13903
13954
|
*/
|
13904
13955
|
|
13905
|
-
const version = "0.11.
|
13956
|
+
const version = "0.11.03";
|
13906
13957
|
|
13907
13958
|
function postProcess(block) {
|
13908
13959
|
const labelMap = {};
|
package/dist/temml.d.ts
CHANGED
@@ -4,7 +4,7 @@ export interface Options {
|
|
4
4
|
leqno?: boolean;
|
5
5
|
throwOnError?: boolean;
|
6
6
|
errorColor?: string;
|
7
|
-
macros?: Record<string,
|
7
|
+
macros?: Record<string, any>;
|
8
8
|
wrap?: "tex" | "=" | "none";
|
9
9
|
xml?: boolean;
|
10
10
|
colorIsTextColor?: boolean;
|
@@ -16,7 +16,7 @@ export interface Options {
|
|
16
16
|
|
17
17
|
export function render(
|
18
18
|
expression: string,
|
19
|
-
baseNode: HTMLElement,
|
19
|
+
baseNode: HTMLElement | MathMLElement,
|
20
20
|
options?: Options,
|
21
21
|
): void;
|
22
22
|
|