temml 0.11.2 → 0.11.4
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-NotoSans.css +2 -2
- package/dist/Temml-STIX2.css +2 -2
- package/dist/temml.cjs +72 -26
- package/dist/temml.d.ts +2 -2
- package/dist/temml.js +72 -26
- package/dist/temml.min.js +1 -1
- package/dist/temml.mjs +72 -26
- package/dist/temmlPostProcess.js +1 -1
- package/package.json +1 -1
- package/src/environments/array.js +7 -3
- package/src/environments/borderTree.js +4 -4
- package/src/functions/color.js +3 -0
- package/src/functions/font.js +11 -8
- package/src/functions/op.js +6 -1
- package/src/functions/symbolsOrd.js +0 -1
- package/src/postProcess.js +1 -1
- package/src/symbols.js +40 -8
package/dist/Temml-NotoSans.css
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
Noto Math fonts are released under the SIL OPEN FONT LICENSE Version 1.1.
|
3
3
|
|
4
4
|
The NotoMath font has been obtained from
|
5
|
-
https://
|
5
|
+
https://github.com/notofonts/math
|
6
6
|
*/
|
7
7
|
|
8
8
|
@font-face {
|
9
9
|
font-family: NotoSans Math;
|
10
|
-
src: url('
|
10
|
+
src: url('NotoSansMath-Regular.ttf');
|
11
11
|
}
|
12
12
|
|
13
13
|
math {
|
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
|
@@ -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.
|
@@ -6434,7 +6466,7 @@ const mathmlBuilder$9 = function(group, style) {
|
|
6434
6466
|
const numColumns = group.body[0].length;
|
6435
6467
|
// Fill out a short row with empty <mtd> elements.
|
6436
6468
|
for (let k = 0; k < numColumns - rw.length; k++) {
|
6437
|
-
row.push(new mathMLTree.MathNode("mtd", [], style));
|
6469
|
+
row.push(new mathMLTree.MathNode("mtd", [], [], style));
|
6438
6470
|
}
|
6439
6471
|
if (group.autoTag) {
|
6440
6472
|
const tag = group.tags[i];
|
@@ -6894,7 +6926,9 @@ defineEnvironment({
|
|
6894
6926
|
}
|
6895
6927
|
}
|
6896
6928
|
const res = parseArray(context.parser, payload, "text");
|
6897
|
-
res.cols =
|
6929
|
+
res.cols = res.body.length > 0
|
6930
|
+
? new Array(res.body[0].length).fill({ type: "align", align: colAlign })
|
6931
|
+
: [];
|
6898
6932
|
const [arraystretch, arraycolsep] = arrayGaps(context.parser.gullet.macros);
|
6899
6933
|
res.arraystretch = arraystretch;
|
6900
6934
|
if (arraycolsep && !(arraycolsep === 6 && arraycolsep === "pt")) {
|
@@ -6923,7 +6957,9 @@ defineEnvironment({
|
|
6923
6957
|
handler(context) {
|
6924
6958
|
const payload = { cols: [], envClasses: ["bordermatrix"] };
|
6925
6959
|
const res = parseArray(context.parser, payload, "text");
|
6926
|
-
res.cols =
|
6960
|
+
res.cols = res.body.length > 0
|
6961
|
+
? new Array(res.body[0].length).fill({ type: "align", align: "c" })
|
6962
|
+
: [];
|
6927
6963
|
res.envClasses = [];
|
6928
6964
|
res.arraystretch = 1;
|
6929
6965
|
if (context.envName === "matrix") { return res}
|
@@ -7357,6 +7393,9 @@ const mathmlBuilder$8 = (group, style) => {
|
|
7357
7393
|
// So instead of wrapping the group in an <mstyle>, we apply
|
7358
7394
|
// the color individually to each node and return a document fragment.
|
7359
7395
|
let expr = buildExpression(group.body, style.withColor(group.color));
|
7396
|
+
if (expr.length === 0) {
|
7397
|
+
expr.push(new mathMLTree.MathNode("mrow"));
|
7398
|
+
}
|
7360
7399
|
expr = expr.map(e => {
|
7361
7400
|
e.style.color = group.color;
|
7362
7401
|
return e
|
@@ -8443,17 +8482,20 @@ const mathmlBuilder$6 = (group, style) => {
|
|
8443
8482
|
// Check if it is possible to consolidate elements into a single <mi> element.
|
8444
8483
|
if (isLongVariableName(group, font)) {
|
8445
8484
|
// This is a \mathrm{…} group. It gets special treatment because symbolsOrd.js
|
8446
|
-
// wraps <mi> elements with <
|
8447
|
-
const mi = mathGroup.children[0].children[0]
|
8485
|
+
// wraps <mi> elements with <mpadded>s to work around a Firefox bug.
|
8486
|
+
const mi = mathGroup.children[0].children[0].children
|
8487
|
+
? mathGroup.children[0].children[0]
|
8488
|
+
: mathGroup.children[0];
|
8448
8489
|
delete mi.attributes.mathvariant;
|
8449
8490
|
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].
|
8491
|
+
mi.children[0].text += mathGroup.children[i].children[0].children
|
8492
|
+
? mathGroup.children[i].children[0].children[0].text
|
8493
|
+
: mathGroup.children[i].children[0].text;
|
8453
8494
|
}
|
8454
|
-
// Wrap in a <
|
8455
|
-
const
|
8456
|
-
|
8495
|
+
// Wrap in a <mpadded> to prevent the same Firefox bug.
|
8496
|
+
const mpadded = new mathMLTree.MathNode("mpadded", [mi]);
|
8497
|
+
mpadded.setAttribute("lspace", "0");
|
8498
|
+
return mpadded
|
8457
8499
|
}
|
8458
8500
|
let canConsolidate = mathGroup.children[0].type === "mo";
|
8459
8501
|
for (let i = 1; i < mathGroup.children.length; i++) {
|
@@ -9943,8 +9985,13 @@ defineFunction({
|
|
9943
9985
|
"\u2a00",
|
9944
9986
|
"\u2a01",
|
9945
9987
|
"\u2a02",
|
9988
|
+
"\u2a03",
|
9946
9989
|
"\u2a04",
|
9947
|
-
"\
|
9990
|
+
"\u2a05",
|
9991
|
+
"\u2a06",
|
9992
|
+
"\u2a07",
|
9993
|
+
"\u2a08",
|
9994
|
+
"\u2a09"
|
9948
9995
|
],
|
9949
9996
|
props: {
|
9950
9997
|
numArgs: 0
|
@@ -11365,7 +11412,6 @@ defineFunctionBuilders({
|
|
11365
11412
|
// A Firefox bug will apply spacing here, but there should be none. Fix it.
|
11366
11413
|
node = new mathMLTree.MathNode("mpadded", [node]);
|
11367
11414
|
node.setAttribute("lspace", "0");
|
11368
|
-
node.setAttribute("rspace", "0");
|
11369
11415
|
}
|
11370
11416
|
}
|
11371
11417
|
return node
|
@@ -13917,7 +13963,7 @@ class Style {
|
|
13917
13963
|
* https://mit-license.org/
|
13918
13964
|
*/
|
13919
13965
|
|
13920
|
-
const version = "0.11.
|
13966
|
+
const version = "0.11.04";
|
13921
13967
|
|
13922
13968
|
function postProcess(block) {
|
13923
13969
|
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
|
|
package/dist/temml.js
CHANGED
@@ -1184,9 +1184,6 @@ var temml = (function () {
|
|
1184
1184
|
defineSymbol(math, textord, "\u2605", "\\bigstar");
|
1185
1185
|
defineSymbol(math, textord, "\u2222", "\\sphericalangle", true);
|
1186
1186
|
defineSymbol(math, textord, "\u2201", "\\complement", true);
|
1187
|
-
// unicode-math maps U+F0 to \matheth. We map to AMS function \eth
|
1188
|
-
defineSymbol(math, textord, "\u00f0", "\\eth", true);
|
1189
|
-
defineSymbol(text, textord, "\u00f0", "\u00f0");
|
1190
1187
|
defineSymbol(math, textord, "\u2571", "\\diagup");
|
1191
1188
|
defineSymbol(math, textord, "\u2572", "\\diagdown");
|
1192
1189
|
defineSymbol(math, textord, "\u25a1", "\\square");
|
@@ -1546,6 +1543,46 @@ var temml = (function () {
|
|
1546
1543
|
defineSymbol(math, mathord, "\u03da", "\\Stigma", true);
|
1547
1544
|
defineSymbol(math, mathord, "\u03db", "\\stigma", true);
|
1548
1545
|
defineSymbol(math, mathord, "\u2aeb", "\\Bot");
|
1546
|
+
|
1547
|
+
// unicode-math maps U+F0 to \matheth. We map to AMS function \eth
|
1548
|
+
defineSymbol(math, textord, "\u00f0", "\\eth", true); // ð
|
1549
|
+
defineSymbol(text, textord, "\u00f0", "\u00f0");
|
1550
|
+
// Extended ASCII and non-ASCII Letters
|
1551
|
+
defineSymbol(math, textord, "\u00C5", "\\AA"); // Å
|
1552
|
+
defineSymbol(text, textord, "\u00C5", "\\AA", true);
|
1553
|
+
defineSymbol(math, textord, "\u00C6", "\\AE", true); // Æ
|
1554
|
+
defineSymbol(text, textord, "\u00C6", "\\AE", true);
|
1555
|
+
defineSymbol(math, textord, "\u00D0", "\\DH", true); // Ð
|
1556
|
+
defineSymbol(text, textord, "\u00D0", "\\DH", true);
|
1557
|
+
defineSymbol(math, textord, "\u00DE", "\\TH", true); // Þ
|
1558
|
+
defineSymbol(text, textord, "\u00DE", "\\TH", true);
|
1559
|
+
defineSymbol(math, textord, "\u00DF", "\\ss", true); // ß
|
1560
|
+
defineSymbol(text, textord, "\u00DF", "\\ss", true);
|
1561
|
+
defineSymbol(math, textord, "\u00E5", "\\aa"); // å
|
1562
|
+
defineSymbol(text, textord, "\u00E5", "\\aa", true);
|
1563
|
+
defineSymbol(math, textord, "\u00E6", "\\ae", true); // æ
|
1564
|
+
defineSymbol(text, textord, "\u00E6", "\\ae", true);
|
1565
|
+
defineSymbol(math, textord, "\u00F0", "\\dh"); // ð
|
1566
|
+
defineSymbol(text, textord, "\u00F0", "\\dh", true);
|
1567
|
+
defineSymbol(math, textord, "\u00FE", "\\th", true); // þ
|
1568
|
+
defineSymbol(text, textord, "\u00FE", "\\th", true);
|
1569
|
+
defineSymbol(math, textord, "\u0110", "\\DJ", true); // Đ
|
1570
|
+
defineSymbol(text, textord, "\u0110", "\\DJ", true);
|
1571
|
+
defineSymbol(math, textord, "\u0111", "\\dj", true); // đ
|
1572
|
+
defineSymbol(text, textord, "\u0111", "\\dj", true);
|
1573
|
+
defineSymbol(math, textord, "\u0141", "\\L", true); // Ł
|
1574
|
+
defineSymbol(text, textord, "\u0141", "\\L", true);
|
1575
|
+
defineSymbol(math, textord, "\u0141", "\\l", true); // ł
|
1576
|
+
defineSymbol(text, textord, "\u0141", "\\l", true);
|
1577
|
+
defineSymbol(math, textord, "\u014A", "\\NG", true); // Ŋ
|
1578
|
+
defineSymbol(text, textord, "\u014A", "\\NG", true);
|
1579
|
+
defineSymbol(math, textord, "\u014B", "\\ng", true); // ŋ
|
1580
|
+
defineSymbol(text, textord, "\u014B", "\\ng", true);
|
1581
|
+
defineSymbol(math, textord, "\u0152", "\\OE", true); // Œ
|
1582
|
+
defineSymbol(text, textord, "\u0152", "\\OE", true);
|
1583
|
+
defineSymbol(math, textord, "\u0153", "\\oe", true); // œ
|
1584
|
+
defineSymbol(text, textord, "\u0153", "\\oe", true);
|
1585
|
+
|
1549
1586
|
defineSymbol(math, bin, "\u2217", "\u2217", true);
|
1550
1587
|
defineSymbol(math, bin, "+", "+");
|
1551
1588
|
defineSymbol(math, bin, "\u2217", "*");
|
@@ -1754,13 +1791,8 @@ var temml = (function () {
|
|
1754
1791
|
defineSymbol(math, textord, "\u0237", "\u0237");
|
1755
1792
|
defineSymbol(text, textord, "\u0131", "\\i", true);
|
1756
1793
|
defineSymbol(text, textord, "\u0237", "\\j", true);
|
1757
|
-
defineSymbol(text, textord, "\u00df", "\\ss", true);
|
1758
|
-
defineSymbol(text, textord, "\u00e6", "\\ae", true);
|
1759
|
-
defineSymbol(text, textord, "\u0153", "\\oe", true);
|
1760
1794
|
defineSymbol(text, textord, "\u00f8", "\\o", true);
|
1761
1795
|
defineSymbol(math, mathord, "\u00f8", "\\o", true);
|
1762
|
-
defineSymbol(text, textord, "\u00c6", "\\AE", true);
|
1763
|
-
defineSymbol(text, textord, "\u0152", "\\OE", true);
|
1764
1796
|
defineSymbol(text, textord, "\u00d8", "\\O", true);
|
1765
1797
|
defineSymbol(math, mathord, "\u00d8", "\\O", true);
|
1766
1798
|
defineSymbol(text, accent, "\u02ca", "\\'"); // acute
|
@@ -3348,7 +3380,7 @@ var temml = (function () {
|
|
3348
3380
|
// A vphantom with contents from the pmatrix, to set minimum cell height
|
3349
3381
|
const phantomBody = [];
|
3350
3382
|
for (let j = 0; j < body[i].length; j++) {
|
3351
|
-
phantomBody.push(
|
3383
|
+
phantomBody.push(body[i][j]);
|
3352
3384
|
}
|
3353
3385
|
leftColumnBody[i - 1].push(phantom(phantomBody, "vphantom"));
|
3354
3386
|
}
|
@@ -3356,18 +3388,18 @@ var temml = (function () {
|
|
3356
3388
|
// Create an array for the top row
|
3357
3389
|
const topRowBody = new Array(body.length).fill().map(() => []);
|
3358
3390
|
for (let j = 0; j < body[0].length; j++) {
|
3359
|
-
topRowBody[0].push(
|
3391
|
+
topRowBody[0].push(body[0][j]);
|
3360
3392
|
}
|
3361
3393
|
// Copy the rest of the pmatrix, but squashed via \hphantom
|
3362
3394
|
for (let i = 1; i < body.length; i++) {
|
3363
3395
|
for (let j = 0; j < body[0].length; j++) {
|
3364
|
-
topRowBody[i].push(phantom(
|
3396
|
+
topRowBody[i].push(phantom(body[i][j].body, "hphantom"));
|
3365
3397
|
}
|
3366
3398
|
}
|
3367
3399
|
|
3368
3400
|
// Squash the top row of the main {pmatrix}
|
3369
3401
|
for (let j = 0; j < body[0].length; j++) {
|
3370
|
-
body[0][j] = phantom(
|
3402
|
+
body[0][j] = phantom(body[0][j].body, "hphantom");
|
3371
3403
|
}
|
3372
3404
|
|
3373
3405
|
// Now wrap the arrays in the proper parse nodes.
|
@@ -4521,7 +4553,7 @@ var temml = (function () {
|
|
4521
4553
|
const numColumns = group.body[0].length;
|
4522
4554
|
// Fill out a short row with empty <mtd> elements.
|
4523
4555
|
for (let k = 0; k < numColumns - rw.length; k++) {
|
4524
|
-
row.push(new mathMLTree.MathNode("mtd", [], style));
|
4556
|
+
row.push(new mathMLTree.MathNode("mtd", [], [], style));
|
4525
4557
|
}
|
4526
4558
|
if (group.autoTag) {
|
4527
4559
|
const tag = group.tags[i];
|
@@ -4981,7 +5013,9 @@ var temml = (function () {
|
|
4981
5013
|
}
|
4982
5014
|
}
|
4983
5015
|
const res = parseArray(context.parser, payload, "text");
|
4984
|
-
res.cols =
|
5016
|
+
res.cols = res.body.length > 0
|
5017
|
+
? new Array(res.body[0].length).fill({ type: "align", align: colAlign })
|
5018
|
+
: [];
|
4985
5019
|
const [arraystretch, arraycolsep] = arrayGaps(context.parser.gullet.macros);
|
4986
5020
|
res.arraystretch = arraystretch;
|
4987
5021
|
if (arraycolsep && !(arraycolsep === 6 && arraycolsep === "pt")) {
|
@@ -5010,7 +5044,9 @@ var temml = (function () {
|
|
5010
5044
|
handler(context) {
|
5011
5045
|
const payload = { cols: [], envClasses: ["bordermatrix"] };
|
5012
5046
|
const res = parseArray(context.parser, payload, "text");
|
5013
|
-
res.cols =
|
5047
|
+
res.cols = res.body.length > 0
|
5048
|
+
? new Array(res.body[0].length).fill({ type: "align", align: "c" })
|
5049
|
+
: [];
|
5014
5050
|
res.envClasses = [];
|
5015
5051
|
res.arraystretch = 1;
|
5016
5052
|
if (context.envName === "matrix") { return res}
|
@@ -5444,6 +5480,9 @@ var temml = (function () {
|
|
5444
5480
|
// So instead of wrapping the group in an <mstyle>, we apply
|
5445
5481
|
// the color individually to each node and return a document fragment.
|
5446
5482
|
let expr = buildExpression(group.body, style.withColor(group.color));
|
5483
|
+
if (expr.length === 0) {
|
5484
|
+
expr.push(new mathMLTree.MathNode("mrow"));
|
5485
|
+
}
|
5447
5486
|
expr = expr.map(e => {
|
5448
5487
|
e.style.color = group.color;
|
5449
5488
|
return e
|
@@ -6530,17 +6569,20 @@ var temml = (function () {
|
|
6530
6569
|
// Check if it is possible to consolidate elements into a single <mi> element.
|
6531
6570
|
if (isLongVariableName(group, font)) {
|
6532
6571
|
// This is a \mathrm{…} group. It gets special treatment because symbolsOrd.js
|
6533
|
-
// wraps <mi> elements with <
|
6534
|
-
const mi = mathGroup.children[0].children[0]
|
6572
|
+
// wraps <mi> elements with <mpadded>s to work around a Firefox bug.
|
6573
|
+
const mi = mathGroup.children[0].children[0].children
|
6574
|
+
? mathGroup.children[0].children[0]
|
6575
|
+
: mathGroup.children[0];
|
6535
6576
|
delete mi.attributes.mathvariant;
|
6536
6577
|
for (let i = 1; i < mathGroup.children.length; i++) {
|
6537
|
-
mi.children[0].text += mathGroup.children[i].
|
6538
|
-
? mathGroup.children[i].children[0].text
|
6539
|
-
: mathGroup.children[i].children[0].
|
6578
|
+
mi.children[0].text += mathGroup.children[i].children[0].children
|
6579
|
+
? mathGroup.children[i].children[0].children[0].text
|
6580
|
+
: mathGroup.children[i].children[0].text;
|
6540
6581
|
}
|
6541
|
-
// Wrap in a <
|
6542
|
-
const
|
6543
|
-
|
6582
|
+
// Wrap in a <mpadded> to prevent the same Firefox bug.
|
6583
|
+
const mpadded = new mathMLTree.MathNode("mpadded", [mi]);
|
6584
|
+
mpadded.setAttribute("lspace", "0");
|
6585
|
+
return mpadded
|
6544
6586
|
}
|
6545
6587
|
let canConsolidate = mathGroup.children[0].type === "mo";
|
6546
6588
|
for (let i = 1; i < mathGroup.children.length; i++) {
|
@@ -8030,8 +8072,13 @@ var temml = (function () {
|
|
8030
8072
|
"\u2a00",
|
8031
8073
|
"\u2a01",
|
8032
8074
|
"\u2a02",
|
8075
|
+
"\u2a03",
|
8033
8076
|
"\u2a04",
|
8034
|
-
"\
|
8077
|
+
"\u2a05",
|
8078
|
+
"\u2a06",
|
8079
|
+
"\u2a07",
|
8080
|
+
"\u2a08",
|
8081
|
+
"\u2a09"
|
8035
8082
|
],
|
8036
8083
|
props: {
|
8037
8084
|
numArgs: 0
|
@@ -9452,7 +9499,6 @@ var temml = (function () {
|
|
9452
9499
|
// A Firefox bug will apply spacing here, but there should be none. Fix it.
|
9453
9500
|
node = new mathMLTree.MathNode("mpadded", [node]);
|
9454
9501
|
node.setAttribute("lspace", "0");
|
9455
|
-
node.setAttribute("rspace", "0");
|
9456
9502
|
}
|
9457
9503
|
}
|
9458
9504
|
return node
|
@@ -12004,7 +12050,7 @@ var temml = (function () {
|
|
12004
12050
|
* https://mit-license.org/
|
12005
12051
|
*/
|
12006
12052
|
|
12007
|
-
const version = "0.11.
|
12053
|
+
const version = "0.11.04";
|
12008
12054
|
|
12009
12055
|
function postProcess(block) {
|
12010
12056
|
const labelMap = {};
|