temml 0.10.14 → 0.10.16
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/dist/Temml-Asana.css +18 -146
- package/dist/Temml-Latin-Modern.css +20 -148
- package/dist/Temml-Libertinus.css +18 -147
- package/dist/Temml-Local.css +19 -147
- package/dist/Temml-STIX2.css +18 -146
- package/dist/Temml.woff2 +0 -0
- package/dist/temml.cjs +221 -55
- package/dist/temml.d.ts +60 -0
- package/dist/temml.js +221 -55
- package/dist/temml.min.js +1 -1
- package/dist/temml.mjs +221 -55
- package/dist/temmlPostProcess.js +1 -1
- package/package.json +4 -2
- package/src/Parser.js +0 -1
- package/src/buildMathML.js +1 -3
- package/src/domTree.js +2 -2
- package/src/environments/array.js +99 -23
- package/src/functions/accent.js +17 -22
- package/src/functions/accentunder.js +1 -1
- package/src/functions/enclose.js +24 -3
- package/src/functions/supsub.js +8 -1
- package/src/functions/symbolsOrd.js +3 -1
- package/src/macros.js +3 -0
- package/src/postProcess.js +1 -1
- package/src/stretchy.js +48 -1
- package/src/symbols.js +13 -1
- package/temml.js +6 -0
package/dist/temml.js
CHANGED
@@ -479,7 +479,7 @@ var temml = (function () {
|
|
479
479
|
}
|
480
480
|
}
|
481
481
|
|
482
|
-
|
482
|
+
/*
|
483
483
|
* This node represents an image embed (<img>) element.
|
484
484
|
*/
|
485
485
|
class Img {
|
@@ -524,7 +524,7 @@ var temml = (function () {
|
|
524
524
|
markup += ` style="${utils.escape(styles)}"`;
|
525
525
|
}
|
526
526
|
|
527
|
-
markup += "
|
527
|
+
markup += ">";
|
528
528
|
return markup;
|
529
529
|
}
|
530
530
|
}
|
@@ -700,6 +700,34 @@ var temml = (function () {
|
|
700
700
|
* This file provides support for building horizontal stretchy elements.
|
701
701
|
*/
|
702
702
|
|
703
|
+
// TODO: Remove when Chromium stretches \widetilde & \widehat
|
704
|
+
const estimatedWidth = node => {
|
705
|
+
let width = 0;
|
706
|
+
if (node.body) {
|
707
|
+
for (const item of node.body) {
|
708
|
+
width += estimatedWidth(item);
|
709
|
+
}
|
710
|
+
} else if (node.type === "supsub") {
|
711
|
+
width += estimatedWidth(node.base);
|
712
|
+
if (node.sub) { width += 0.7 * estimatedWidth(node.sub); }
|
713
|
+
if (node.sup) { width += 0.7 * estimatedWidth(node.sup); }
|
714
|
+
} else if (node.type === "mathord" || node.type === "textord") {
|
715
|
+
for (const ch of node.text.split('')) {
|
716
|
+
const codePoint = ch.codePointAt(0);
|
717
|
+
if ((0x60 < codePoint && codePoint < 0x7B) || (0x03B0 < codePoint && codePoint < 0x3CA)) {
|
718
|
+
width += 0.56; // lower case latin or greek. Use advance width of letter n
|
719
|
+
} else if (0x2F < codePoint && codePoint < 0x3A) {
|
720
|
+
width += 0.50; // numerals.
|
721
|
+
} else {
|
722
|
+
width += 0.92; // advance width of letter M
|
723
|
+
}
|
724
|
+
}
|
725
|
+
} else {
|
726
|
+
width += 1.0;
|
727
|
+
}
|
728
|
+
return width
|
729
|
+
};
|
730
|
+
|
703
731
|
const stretchyCodePoint = {
|
704
732
|
widehat: "^",
|
705
733
|
widecheck: "ˇ",
|
@@ -757,8 +785,27 @@ var temml = (function () {
|
|
757
785
|
return node
|
758
786
|
};
|
759
787
|
|
788
|
+
const crookedWides = ["\\widetilde", "\\widehat", "\\widecheck", "\\utilde"];
|
789
|
+
|
790
|
+
// TODO: Remove when Chromium stretches \widetilde & \widehat
|
791
|
+
const accentNode = (group) => {
|
792
|
+
const mo = mathMLnode(group.label);
|
793
|
+
if (crookedWides.includes(group.label)) {
|
794
|
+
const width = estimatedWidth(group.base);
|
795
|
+
if (1 < width && width < 1.6) {
|
796
|
+
mo.classes.push("tml-crooked-2");
|
797
|
+
} else if (1.6 <= width && width < 2.5) {
|
798
|
+
mo.classes.push("tml-crooked-3");
|
799
|
+
} else if (2.5 <= width) {
|
800
|
+
mo.classes.push("tml-crooked-4");
|
801
|
+
}
|
802
|
+
}
|
803
|
+
return mo
|
804
|
+
};
|
805
|
+
|
760
806
|
var stretchy = {
|
761
|
-
mathMLnode
|
807
|
+
mathMLnode,
|
808
|
+
accentNode
|
762
809
|
};
|
763
810
|
|
764
811
|
/**
|
@@ -974,6 +1021,10 @@ var temml = (function () {
|
|
974
1021
|
defineSymbol(math, mathord, "\u220E", "\\QED", true);
|
975
1022
|
defineSymbol(math, mathord, "\u2030", "\\permil", true);
|
976
1023
|
defineSymbol(text, textord, "\u2030", "\\permil");
|
1024
|
+
defineSymbol(math, mathord, "\u2609", "\\astrosun", true);
|
1025
|
+
defineSymbol(math, mathord, "\u263c", "\\sun", true);
|
1026
|
+
defineSymbol(math, mathord, "\u263e", "\\leftmoon", true);
|
1027
|
+
defineSymbol(math, mathord, "\u263d", "\\rightmoon", true);
|
977
1028
|
|
978
1029
|
// AMS Negated Binary Relations
|
979
1030
|
defineSymbol(math, rel, "\u226e", "\\nless", true);
|
@@ -1052,6 +1103,8 @@ var temml = (function () {
|
|
1052
1103
|
defineSymbol(math, textord, "\u2132", "\\Finv", true);
|
1053
1104
|
defineSymbol(math, textord, "\u2141", "\\Game", true);
|
1054
1105
|
defineSymbol(math, textord, "\u2035", "\\backprime");
|
1106
|
+
defineSymbol(math, textord, "\u2036", "\\backdprime");
|
1107
|
+
defineSymbol(math, textord, "\u2037", "\\backtrprime");
|
1055
1108
|
defineSymbol(math, textord, "\u25b2", "\\blacktriangle");
|
1056
1109
|
defineSymbol(math, textord, "\u25bc", "\\blacktriangledown");
|
1057
1110
|
defineSymbol(math, textord, "\u25a0", "\\blacksquare");
|
@@ -1255,6 +1308,9 @@ var temml = (function () {
|
|
1255
1308
|
defineSymbol(math, textord, "\u2220", "\\angle", true);
|
1256
1309
|
defineSymbol(math, textord, "\u221e", "\\infty", true);
|
1257
1310
|
defineSymbol(math, textord, "\u2032", "\\prime");
|
1311
|
+
defineSymbol(math, textord, "\u2033", "\\dprime");
|
1312
|
+
defineSymbol(math, textord, "\u2034", "\\trprime");
|
1313
|
+
defineSymbol(math, textord, "\u2057", "\\qprime");
|
1258
1314
|
defineSymbol(math, textord, "\u25b3", "\\triangle");
|
1259
1315
|
defineSymbol(text, textord, "\u0391", "\\Alpha", true);
|
1260
1316
|
defineSymbol(text, textord, "\u0392", "\\Beta", true);
|
@@ -1434,7 +1490,8 @@ var temml = (function () {
|
|
1434
1490
|
defineSymbol(math, bin, "\u22bc", "\\barwedge", true);
|
1435
1491
|
defineSymbol(math, bin, "\u22bb", "\\veebar", true);
|
1436
1492
|
defineSymbol(math, bin, "\u2299", "\\odot", true);
|
1437
|
-
|
1493
|
+
// Firefox turns ⊕ into an emoji. So append \uFE0E. Define Unicode character in macros, not here.
|
1494
|
+
defineSymbol(math, bin, "\u2295\uFE0E", "\\oplus");
|
1438
1495
|
defineSymbol(math, bin, "\u2297", "\\otimes", true);
|
1439
1496
|
defineSymbol(math, textord, "\u2202", "\\partial", true);
|
1440
1497
|
defineSymbol(math, bin, "\u2298", "\\oslash", true);
|
@@ -1665,6 +1722,8 @@ var temml = (function () {
|
|
1665
1722
|
defineSymbol(math, mathord, ch, ch);
|
1666
1723
|
defineSymbol(text, textord, ch, ch);
|
1667
1724
|
}
|
1725
|
+
// Prevent Firefox from using a dotless i.
|
1726
|
+
defineSymbol(text, textord, "i\uFE0E", "i");
|
1668
1727
|
|
1669
1728
|
// Some more letters in Unicode Basic Multilingual Plane.
|
1670
1729
|
const narrow = "ÇÐÞçþℂℍℕℙℚℝℤℎℏℊℋℌℐℑℒℓ℘ℛℜℬℰℱℳℭℨ";
|
@@ -2132,9 +2191,7 @@ var temml = (function () {
|
|
2132
2191
|
}
|
2133
2192
|
if (settings.displayMode) {
|
2134
2193
|
math.setAttribute("display", "block");
|
2135
|
-
math.style.display = math
|
2136
|
-
? "inline"
|
2137
|
-
: "block math"; // necessary in Chromium.
|
2194
|
+
math.style.display = "block math"; // necessary in Chromium.
|
2138
2195
|
// Firefox and Safari do not recognize display: "block math".
|
2139
2196
|
// Set a class so that the CSS file can set display: block.
|
2140
2197
|
math.classes = ["tml-display"];
|
@@ -2144,7 +2201,7 @@ var temml = (function () {
|
|
2144
2201
|
|
2145
2202
|
const mathmlBuilder$a = (group, style) => {
|
2146
2203
|
const accentNode = group.isStretchy
|
2147
|
-
? stretchy.
|
2204
|
+
? stretchy.accentNode(group)
|
2148
2205
|
: new mathMLTree.MathNode("mo", [makeText(group.label, group.mode)]);
|
2149
2206
|
|
2150
2207
|
if (group.label === "\\vec") {
|
@@ -2164,25 +2221,21 @@ var temml = (function () {
|
|
2164
2221
|
return node;
|
2165
2222
|
};
|
2166
2223
|
|
2167
|
-
const
|
2168
|
-
|
2169
|
-
|
2170
|
-
|
2171
|
-
|
2172
|
-
|
2173
|
-
|
2174
|
-
|
2175
|
-
|
2176
|
-
|
2177
|
-
|
2178
|
-
|
2179
|
-
|
2180
|
-
|
2181
|
-
|
2182
|
-
]
|
2183
|
-
.map((accent) => `\\${accent}`)
|
2184
|
-
.join("|")
|
2185
|
-
);
|
2224
|
+
const nonStretchyAccents = new Set([
|
2225
|
+
"\\acute",
|
2226
|
+
"\\grave",
|
2227
|
+
"\\ddot",
|
2228
|
+
"\\dddot",
|
2229
|
+
"\\ddddot",
|
2230
|
+
"\\tilde",
|
2231
|
+
"\\bar",
|
2232
|
+
"\\breve",
|
2233
|
+
"\\check",
|
2234
|
+
"\\hat",
|
2235
|
+
"\\vec",
|
2236
|
+
"\\dot",
|
2237
|
+
"\\mathring"
|
2238
|
+
]);
|
2186
2239
|
|
2187
2240
|
// Accents
|
2188
2241
|
defineFunction({
|
@@ -2220,7 +2273,7 @@ var temml = (function () {
|
|
2220
2273
|
handler: (context, args) => {
|
2221
2274
|
const base = normalizeArgument(args[0]);
|
2222
2275
|
|
2223
|
-
const isStretchy = !
|
2276
|
+
const isStretchy = !nonStretchyAccents.has(context.funcName);
|
2224
2277
|
|
2225
2278
|
return {
|
2226
2279
|
type: "accent",
|
@@ -2258,7 +2311,6 @@ var temml = (function () {
|
|
2258
2311
|
mode: mode,
|
2259
2312
|
label: context.funcName,
|
2260
2313
|
isStretchy: false,
|
2261
|
-
isShifty: true,
|
2262
2314
|
base: base
|
2263
2315
|
};
|
2264
2316
|
},
|
@@ -2288,7 +2340,7 @@ var temml = (function () {
|
|
2288
2340
|
};
|
2289
2341
|
},
|
2290
2342
|
mathmlBuilder: (group, style) => {
|
2291
|
-
const accentNode = stretchy.
|
2343
|
+
const accentNode = stretchy.accentNode(group);
|
2292
2344
|
accentNode.style["math-depth"] = 0;
|
2293
2345
|
const node = new mathMLTree.MathNode("munder", [
|
2294
2346
|
buildGroup$1(group.base, style),
|
@@ -3825,10 +3877,20 @@ var temml = (function () {
|
|
3825
3877
|
node.style.borderBottom = "0.065em solid";
|
3826
3878
|
break
|
3827
3879
|
case "\\cancel":
|
3828
|
-
node.
|
3880
|
+
node.style.background = `linear-gradient(to top left,
|
3881
|
+
rgba(0,0,0,0) 0%,
|
3882
|
+
rgba(0,0,0,0) calc(50% - 0.06em),
|
3883
|
+
rgba(0,0,0,1) 50%,
|
3884
|
+
rgba(0,0,0,0) calc(50% + 0.06em),
|
3885
|
+
rgba(0,0,0,0) 100%);`;
|
3829
3886
|
break
|
3830
3887
|
case "\\bcancel":
|
3831
|
-
node.
|
3888
|
+
node.style.background = `linear-gradient(to top right,
|
3889
|
+
rgba(0,0,0,0) 0%,
|
3890
|
+
rgba(0,0,0,0) calc(50% - 0.06em),
|
3891
|
+
rgba(0,0,0,1) 50%,
|
3892
|
+
rgba(0,0,0,0) calc(50% + 0.06em),
|
3893
|
+
rgba(0,0,0,0) 100%);`;
|
3832
3894
|
break
|
3833
3895
|
/*
|
3834
3896
|
case "\\longdiv":
|
@@ -3872,7 +3934,18 @@ var temml = (function () {
|
|
3872
3934
|
break
|
3873
3935
|
}
|
3874
3936
|
case "\\xcancel":
|
3875
|
-
node.
|
3937
|
+
node.style.background = `linear-gradient(to top left,
|
3938
|
+
rgba(0,0,0,0) 0%,
|
3939
|
+
rgba(0,0,0,0) calc(50% - 0.06em),
|
3940
|
+
rgba(0,0,0,1) 50%,
|
3941
|
+
rgba(0,0,0,0) calc(50% + 0.06em),
|
3942
|
+
rgba(0,0,0,0) 100%),
|
3943
|
+
linear-gradient(to top right,
|
3944
|
+
rgba(0,0,0,0) 0%,
|
3945
|
+
rgba(0,0,0,0) calc(50% - 0.06em),
|
3946
|
+
rgba(0,0,0,1) 50%,
|
3947
|
+
rgba(0,0,0,0) calc(50% + 0.06em),
|
3948
|
+
rgba(0,0,0,0) 100%);`;
|
3876
3949
|
break
|
3877
3950
|
}
|
3878
3951
|
if (group.backgroundColor) {
|
@@ -4303,24 +4376,98 @@ var temml = (function () {
|
|
4303
4376
|
// Write horizontal rules
|
4304
4377
|
if (i === 0 && hlines[0].length > 0) {
|
4305
4378
|
if (hlines[0].length === 2) {
|
4306
|
-
mtr.
|
4379
|
+
mtr.children.forEach(cell => { cell.style.borderTop = "0.15em double"; });
|
4307
4380
|
} else {
|
4308
|
-
mtr.
|
4381
|
+
mtr.children.forEach(cell => {
|
4382
|
+
cell.style.borderTop = hlines[0][0] ? "0.06em dashed" : "0.06em solid";
|
4383
|
+
});
|
4309
4384
|
}
|
4310
4385
|
}
|
4311
4386
|
if (hlines[i + 1].length > 0) {
|
4312
4387
|
if (hlines[i + 1].length === 2) {
|
4313
|
-
mtr.
|
4388
|
+
mtr.children.forEach(cell => { cell.style.borderBottom = "0.15em double"; });
|
4314
4389
|
} else {
|
4315
|
-
mtr.
|
4390
|
+
mtr.children.forEach(cell => {
|
4391
|
+
cell.style.borderBottom = hlines[i + 1][0] ? "0.06em dashed" : "0.06em solid";
|
4392
|
+
});
|
4316
4393
|
}
|
4317
4394
|
}
|
4318
4395
|
tbl.push(mtr);
|
4319
4396
|
}
|
4320
|
-
|
4397
|
+
|
4321
4398
|
if (group.envClasses.length > 0) {
|
4322
|
-
|
4399
|
+
const pad = group.envClasses.includes("jot")
|
4400
|
+
? "0.7" // 0.5ex + 0.09em top & bot padding
|
4401
|
+
: group.envClasses.includes("small")
|
4402
|
+
? "0.35"
|
4403
|
+
: "0.5"; // 0.5ex default top & bot padding
|
4404
|
+
const sidePadding = group.envClasses.includes("abut")
|
4405
|
+
? "0"
|
4406
|
+
: group.envClasses.includes("cases")
|
4407
|
+
? "0"
|
4408
|
+
: group.envClasses.includes("small")
|
4409
|
+
? "0.1389"
|
4410
|
+
: group.envClasses.includes("cd")
|
4411
|
+
? "0.25"
|
4412
|
+
: "0.4"; // default side padding
|
4413
|
+
|
4414
|
+
const numCols = tbl.length === 0 ? 0 : tbl[0].children.length;
|
4415
|
+
|
4416
|
+
const sidePad = (j, hand) => {
|
4417
|
+
if (j === 0 && hand === 0) { return "0" }
|
4418
|
+
if (j === numCols - 1 && hand === 1) { return "0" }
|
4419
|
+
if (group.envClasses[0] !== "align") { return sidePadding }
|
4420
|
+
if (hand === 1) { return "0" }
|
4421
|
+
if (group.addEqnNum) {
|
4422
|
+
return (j % 2) ? "1" : "0"
|
4423
|
+
} else {
|
4424
|
+
return (j % 2) ? "0" : "1"
|
4425
|
+
}
|
4426
|
+
};
|
4427
|
+
|
4428
|
+
// Padding
|
4429
|
+
for (let i = 0; i < tbl.length; i++) {
|
4430
|
+
for (let j = 0; j < tbl[i].children.length; j++) {
|
4431
|
+
tbl[i].children[j].style.padding = `${pad}ex ${sidePad(j, 1)}em ${pad}ex ${sidePad(j, 0)}em`;
|
4432
|
+
}
|
4433
|
+
}
|
4434
|
+
|
4435
|
+
// Justification
|
4436
|
+
const align = group.envClasses.includes("align") || group.envClasses.includes("alignat");
|
4437
|
+
for (let i = 0; i < tbl.length; i++) {
|
4438
|
+
const row = tbl[i];
|
4439
|
+
if (align) {
|
4440
|
+
for (let j = 0; j < row.children.length; j++) {
|
4441
|
+
// Chromium does not recognize text-align: left. Use -webkit-
|
4442
|
+
// TODO: Remove -webkit- when Chromium no longer needs it.
|
4443
|
+
row.children[j].style.textAlign = "-webkit-" + (j % 2 ? "left" : "right");
|
4444
|
+
}
|
4445
|
+
if (group.addEqnNum) {
|
4446
|
+
const k = group.leqno ? 0 : row.children.length - 1;
|
4447
|
+
row.children[k].style.textAlign = "-webkit-" + (group.leqno ? "left" : "right");
|
4448
|
+
}
|
4449
|
+
}
|
4450
|
+
if (row.children.length > 1 && group.envClasses.includes("cases")) {
|
4451
|
+
row.children[1].style.padding = row.children[1].style.padding.replace(/0em$/, "1em");
|
4452
|
+
}
|
4453
|
+
|
4454
|
+
if (group.envClasses.includes("cases") || group.envClasses.includes("subarray")) {
|
4455
|
+
for (const cell of row.children) {
|
4456
|
+
cell.style.textAlign = "-webkit-" + "left";
|
4457
|
+
}
|
4458
|
+
}
|
4459
|
+
}
|
4460
|
+
} else {
|
4461
|
+
// Set zero padding on side of the matrix
|
4462
|
+
for (let i = 0; i < tbl.length; i++) {
|
4463
|
+
tbl[i].children[0].style.paddingLeft = "0em";
|
4464
|
+
if (tbl[i].children.length === tbl[0].children.length) {
|
4465
|
+
tbl[i].children[tbl[i].children.length - 1].style.paddingRight = "0em";
|
4466
|
+
}
|
4467
|
+
}
|
4323
4468
|
}
|
4469
|
+
|
4470
|
+
let table = new mathMLTree.MathNode("mtable", tbl);
|
4324
4471
|
if (group.scriptLevel === "display") { table.setAttribute("displaystyle", "true"); }
|
4325
4472
|
|
4326
4473
|
if (group.addEqnNum || group.envClasses.includes("multline")) {
|
@@ -4400,6 +4547,8 @@ var temml = (function () {
|
|
4400
4547
|
align = "left " + (align.length > 0 ? align : "center ") + "right ";
|
4401
4548
|
}
|
4402
4549
|
if (align) {
|
4550
|
+
// Firefox reads this attribute, not the -webkit-left|right written above.
|
4551
|
+
// TODO: When Chrome no longer needs "-webkit-", use CSS and delete the next line.
|
4403
4552
|
table.setAttribute("columnalign", align.trim());
|
4404
4553
|
}
|
4405
4554
|
|
@@ -4424,7 +4573,7 @@ var temml = (function () {
|
|
4424
4573
|
cols,
|
4425
4574
|
addEqnNum: context.envName === "align" || context.envName === "alignat",
|
4426
4575
|
emptySingleRow: true,
|
4427
|
-
envClasses: ["
|
4576
|
+
envClasses: ["abut", "jot"], // set row spacing & provisional column spacing
|
4428
4577
|
maxNumCols: context.envName === "split" ? 2 : undefined,
|
4429
4578
|
leqno: context.parser.settings.leqno
|
4430
4579
|
},
|
@@ -4442,18 +4591,22 @@ var temml = (function () {
|
|
4442
4591
|
// binary. This behavior is implemented in amsmath's \start@aligned.
|
4443
4592
|
let numMaths;
|
4444
4593
|
let numCols = 0;
|
4445
|
-
|
4594
|
+
const isAlignedAt = context.envName.indexOf("at") > -1;
|
4595
|
+
if (args[0] && isAlignedAt) {
|
4596
|
+
// alignat environment takes an argument w/ number of columns
|
4446
4597
|
let arg0 = "";
|
4447
4598
|
for (let i = 0; i < args[0].body.length; i++) {
|
4448
4599
|
const textord = assertNodeType(args[0].body[i], "textord");
|
4449
4600
|
arg0 += textord.text;
|
4450
4601
|
}
|
4602
|
+
if (isNaN(arg0)) {
|
4603
|
+
throw new ParseError("The alignat enviroment requires a numeric first argument.")
|
4604
|
+
}
|
4451
4605
|
numMaths = Number(arg0);
|
4452
4606
|
numCols = numMaths * 2;
|
4453
4607
|
}
|
4454
|
-
const isAligned = !numCols;
|
4455
4608
|
res.body.forEach(function(row) {
|
4456
|
-
if (
|
4609
|
+
if (isAlignedAt) {
|
4457
4610
|
// Case 1
|
4458
4611
|
const curMaths = row.length / 2;
|
4459
4612
|
if (numMaths < curMaths) {
|
@@ -4481,14 +4634,10 @@ var temml = (function () {
|
|
4481
4634
|
align: align
|
4482
4635
|
};
|
4483
4636
|
}
|
4484
|
-
if (context.envName === "split") ; else if (
|
4485
|
-
res.envClasses.push("
|
4486
|
-
} else if (isAligned) {
|
4487
|
-
res.envClasses[1] = context.envName === "align*"
|
4488
|
-
? "align-star"
|
4489
|
-
: "align"; // Sets column spacing & justification
|
4637
|
+
if (context.envName === "split") ; else if (isAlignedAt) {
|
4638
|
+
res.envClasses.push("alignat"); // Sets justification
|
4490
4639
|
} else {
|
4491
|
-
res.envClasses
|
4640
|
+
res.envClasses[0] = "align"; // Sets column spacing & justification
|
4492
4641
|
}
|
4493
4642
|
return res;
|
4494
4643
|
};
|
@@ -4738,7 +4887,7 @@ var temml = (function () {
|
|
4738
4887
|
}
|
4739
4888
|
const res = {
|
4740
4889
|
cols: [],
|
4741
|
-
envClasses: ["
|
4890
|
+
envClasses: ["abut", "jot"],
|
4742
4891
|
addEqnNum: context.envName === "gather",
|
4743
4892
|
emptySingleRow: true,
|
4744
4893
|
leqno: context.parser.settings.leqno
|
@@ -7237,7 +7386,14 @@ var temml = (function () {
|
|
7237
7386
|
}
|
7238
7387
|
|
7239
7388
|
if (group.sup) {
|
7240
|
-
|
7389
|
+
const sup = buildGroup$1(group.sup, childStyle);
|
7390
|
+
const testNode = sup.type === "mrow" ? sup.children[0] : sup;
|
7391
|
+
if ((testNode.type === "mo" && testNode.classes.includes("tml-prime"))
|
7392
|
+
&& group.base && group.base.text && group.base.text === "f") {
|
7393
|
+
// Chromium does not address italic correction on prime. Prevent f′ from overlapping.
|
7394
|
+
testNode.classes.push("prime-pad");
|
7395
|
+
}
|
7396
|
+
children.push(sup);
|
7241
7397
|
}
|
7242
7398
|
|
7243
7399
|
let nodeType;
|
@@ -7703,6 +7859,8 @@ var temml = (function () {
|
|
7703
7859
|
|
7704
7860
|
const numberRegEx = /^\d(?:[\d,.]*\d)?$/;
|
7705
7861
|
const latinRegEx = /[A-Ba-z]/;
|
7862
|
+
const primes = new Set(["\\prime", "\\dprime", "\\trprime", "\\qprime",
|
7863
|
+
"\\backprime", "\\backdprime", "\\backtrprime"]);
|
7706
7864
|
|
7707
7865
|
const italicNumber = (text, variant, tag) => {
|
7708
7866
|
const mn = new mathMLTree.MathNode(tag, [text]);
|
@@ -7770,7 +7928,7 @@ var temml = (function () {
|
|
7770
7928
|
text.text = variantChar(text.text, variant);
|
7771
7929
|
}
|
7772
7930
|
node = new mathMLTree.MathNode("mtext", [text]);
|
7773
|
-
} else if (group.text
|
7931
|
+
} else if (primes.has(group.text)) {
|
7774
7932
|
node = new mathMLTree.MathNode("mo", [text]);
|
7775
7933
|
// TODO: If/when Chromium uses ssty variant for prime, remove the next line.
|
7776
7934
|
node.classes.push("tml-prime");
|
@@ -8424,6 +8582,9 @@ var temml = (function () {
|
|
8424
8582
|
// This macro provides a better rendering.
|
8425
8583
|
defineMacro("\\surd", '\\sqrt{\\vphantom{|}}');
|
8426
8584
|
|
8585
|
+
// See comment for \oplus in symbols.js.
|
8586
|
+
defineMacro("\u2295", "\\oplus");
|
8587
|
+
|
8427
8588
|
defineMacro("\\hbox", "\\text{#1}");
|
8428
8589
|
|
8429
8590
|
// Per TeXbook p.122, "/" gets zero operator spacing.
|
@@ -10804,7 +10965,6 @@ var temml = (function () {
|
|
10804
10965
|
loc: SourceLocation.range(nucleus),
|
10805
10966
|
label: command,
|
10806
10967
|
isStretchy: false,
|
10807
|
-
isShifty: true,
|
10808
10968
|
base: symbol
|
10809
10969
|
};
|
10810
10970
|
}
|
@@ -11002,7 +11162,7 @@ var temml = (function () {
|
|
11002
11162
|
* https://mit-license.org/
|
11003
11163
|
*/
|
11004
11164
|
|
11005
|
-
const version = "0.10.
|
11165
|
+
const version = "0.10.16";
|
11006
11166
|
|
11007
11167
|
function postProcess(block) {
|
11008
11168
|
const labelMap = {};
|
@@ -11053,6 +11213,7 @@ var temml = (function () {
|
|
11053
11213
|
/* eslint no-console:0 */
|
11054
11214
|
|
11055
11215
|
/**
|
11216
|
+
* @type {import('./temml').render}
|
11056
11217
|
* Parse and build an expression, and place that expression in the DOM node
|
11057
11218
|
* given.
|
11058
11219
|
*/
|
@@ -11090,6 +11251,7 @@ var temml = (function () {
|
|
11090
11251
|
}
|
11091
11252
|
|
11092
11253
|
/**
|
11254
|
+
* @type {import('./temml').renderToString}
|
11093
11255
|
* Parse and build an expression, and return the markup for that.
|
11094
11256
|
*/
|
11095
11257
|
const renderToString = function(expression, options) {
|
@@ -11098,6 +11260,7 @@ var temml = (function () {
|
|
11098
11260
|
};
|
11099
11261
|
|
11100
11262
|
/**
|
11263
|
+
* @type {import('./temml').generateParseTree}
|
11101
11264
|
* Parse an expression and return the parse tree.
|
11102
11265
|
*/
|
11103
11266
|
const generateParseTree = function(expression, options) {
|
@@ -11106,6 +11269,7 @@ var temml = (function () {
|
|
11106
11269
|
};
|
11107
11270
|
|
11108
11271
|
/**
|
11272
|
+
* @type {import('./temml').definePreamble}
|
11109
11273
|
* Take an expression which contains a preamble.
|
11110
11274
|
* Parse it and return the macros.
|
11111
11275
|
*/
|
@@ -11138,6 +11302,7 @@ var temml = (function () {
|
|
11138
11302
|
};
|
11139
11303
|
|
11140
11304
|
/**
|
11305
|
+
* @type {import('./temml').renderToMathMLTree}
|
11141
11306
|
* Generates and returns the Temml build tree. This is used for advanced
|
11142
11307
|
* use cases (like rendering to custom output).
|
11143
11308
|
*/
|
@@ -11155,6 +11320,7 @@ var temml = (function () {
|
|
11155
11320
|
}
|
11156
11321
|
};
|
11157
11322
|
|
11323
|
+
/** @type {import('./temml').default} */
|
11158
11324
|
var temml = {
|
11159
11325
|
/**
|
11160
11326
|
* Current Temml version
|