temml 0.10.13 → 0.10.15
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 +5 -147
- package/dist/Temml-Latin-Modern.css +5 -148
- package/dist/Temml-Libertinus.css +5 -148
- package/dist/Temml-Local.css +5 -147
- package/dist/Temml-STIX2.css +5 -147
- package/dist/temml.cjs +197 -99
- package/dist/temml.d.ts +60 -0
- package/dist/temml.js +197 -99
- package/dist/temml.min.js +1 -1
- package/dist/temml.mjs +197 -99
- package/dist/temmlPostProcess.js +1 -1
- package/package.json +4 -2
- package/src/buildMathML.js +4 -3
- package/src/environments/array.js +95 -23
- package/src/functions/delimsizing.js +2 -3
- package/src/functions/enclose.js +37 -16
- package/src/functions/raise.js +7 -7
- package/src/linebreaking.js +45 -48
- package/src/macros.js +1 -4
- package/src/postProcess.js +1 -1
- package/src/symbols.js +5 -0
- package/temml.js +6 -0
package/dist/temml.js
CHANGED
@@ -974,6 +974,10 @@ var temml = (function () {
|
|
974
974
|
defineSymbol(math, mathord, "\u220E", "\\QED", true);
|
975
975
|
defineSymbol(math, mathord, "\u2030", "\\permil", true);
|
976
976
|
defineSymbol(text, textord, "\u2030", "\\permil");
|
977
|
+
defineSymbol(math, mathord, "\u2609", "\\astrosun", true);
|
978
|
+
defineSymbol(math, mathord, "\u263c", "\\sun", true);
|
979
|
+
defineSymbol(math, mathord, "\u263e", "\\leftmoon", true);
|
980
|
+
defineSymbol(math, mathord, "\u263d", "\\rightmoon", true);
|
977
981
|
|
978
982
|
// AMS Negated Binary Relations
|
979
983
|
defineSymbol(math, rel, "\u226e", "\\nless", true);
|
@@ -1118,6 +1122,7 @@ var temml = (function () {
|
|
1118
1122
|
defineSymbol(math, rel, "\u22b2", "\\vartriangleleft");
|
1119
1123
|
defineSymbol(math, rel, "\u22b4", "\\trianglelefteq");
|
1120
1124
|
defineSymbol(math, rel, "\u22a8", "\\vDash", true);
|
1125
|
+
defineSymbol(math, rel, "\u22ab", "\\VDash", true);
|
1121
1126
|
defineSymbol(math, rel, "\u22aa", "\\Vvdash", true);
|
1122
1127
|
defineSymbol(math, rel, "\u2323", "\\smallsmile");
|
1123
1128
|
defineSymbol(math, rel, "\u2322", "\\smallfrown");
|
@@ -1767,13 +1772,16 @@ var temml = (function () {
|
|
1767
1772
|
* much of this module.
|
1768
1773
|
*/
|
1769
1774
|
|
1775
|
+
const openDelims = "([{⌊⌈⟨⟮⎰⟦⦃";
|
1776
|
+
const closeDelims = ")]}⌋⌉⟩⟯⎱⟦⦄";
|
1777
|
+
|
1770
1778
|
function setLineBreaks(expression, wrapMode, isDisplayMode) {
|
1771
1779
|
const mtrs = [];
|
1772
1780
|
let mrows = [];
|
1773
1781
|
let block = [];
|
1774
1782
|
let numTopLevelEquals = 0;
|
1775
|
-
let canBeBIN = false; // The first node cannot be an infix binary operator.
|
1776
1783
|
let i = 0;
|
1784
|
+
let level = 0;
|
1777
1785
|
while (i < expression.length) {
|
1778
1786
|
while (expression[i] instanceof DocumentFragment) {
|
1779
1787
|
expression.splice(i, 1, ...expression[i].children); // Expand the fragment.
|
@@ -1796,7 +1804,12 @@ var temml = (function () {
|
|
1796
1804
|
}
|
1797
1805
|
block.push(node);
|
1798
1806
|
if (node.type && node.type === "mo" && node.children.length === 1) {
|
1799
|
-
|
1807
|
+
const ch = node.children[0].text;
|
1808
|
+
if (openDelims.indexOf(ch) > -1) {
|
1809
|
+
level += 1;
|
1810
|
+
} else if (closeDelims.indexOf(ch) > -1) {
|
1811
|
+
level -= 1;
|
1812
|
+
} else if (level === 0 && wrapMode === "=" && ch === "=") {
|
1800
1813
|
numTopLevelEquals += 1;
|
1801
1814
|
if (numTopLevelEquals > 1) {
|
1802
1815
|
block.pop();
|
@@ -1805,59 +1818,48 @@ var temml = (function () {
|
|
1805
1818
|
mrows.push(element);
|
1806
1819
|
block = [node];
|
1807
1820
|
}
|
1808
|
-
} else if (wrapMode === "tex") {
|
1809
|
-
//
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1821
|
+
} else if (level === 0 && wrapMode === "tex") {
|
1822
|
+
// Check if the following node is a \nobreak text node, e.g. "~""
|
1823
|
+
const next = i < expression.length - 1 ? expression[i + 1] : null;
|
1824
|
+
let glueIsFreeOfNobreak = true;
|
1825
|
+
if (
|
1826
|
+
!(
|
1827
|
+
next &&
|
1828
|
+
next.type === "mtext" &&
|
1829
|
+
next.attributes.linebreak &&
|
1830
|
+
next.attributes.linebreak === "nobreak"
|
1831
|
+
)
|
1832
|
+
) {
|
1833
|
+
// We may need to start a new block.
|
1834
|
+
// First, put any post-operator glue on same line as operator.
|
1835
|
+
for (let j = i + 1; j < expression.length; j++) {
|
1836
|
+
const nd = expression[j];
|
1837
|
+
if (
|
1838
|
+
nd.type &&
|
1839
|
+
nd.type === "mspace" &&
|
1840
|
+
!(nd.attributes.linebreak && nd.attributes.linebreak === "newline")
|
1841
|
+
) {
|
1842
|
+
block.push(nd);
|
1843
|
+
i += 1;
|
1826
1844
|
if (
|
1827
|
-
nd.
|
1828
|
-
nd.
|
1829
|
-
|
1845
|
+
nd.attributes &&
|
1846
|
+
nd.attributes.linebreak &&
|
1847
|
+
nd.attributes.linebreak === "nobreak"
|
1830
1848
|
) {
|
1831
|
-
|
1832
|
-
i += 1;
|
1833
|
-
if (
|
1834
|
-
nd.attributes &&
|
1835
|
-
nd.attributes.linebreak &&
|
1836
|
-
nd.attributes.linebreak === "nobreak"
|
1837
|
-
) {
|
1838
|
-
glueIsFreeOfNobreak = false;
|
1839
|
-
}
|
1840
|
-
} else {
|
1841
|
-
break;
|
1849
|
+
glueIsFreeOfNobreak = false;
|
1842
1850
|
}
|
1851
|
+
} else {
|
1852
|
+
break;
|
1843
1853
|
}
|
1844
1854
|
}
|
1845
|
-
if (glueIsFreeOfNobreak) {
|
1846
|
-
// Start a new block. (Insert a soft linebreak.)
|
1847
|
-
const element = new mathMLTree.MathNode("mrow", block);
|
1848
|
-
mrows.push(element);
|
1849
|
-
block = [];
|
1850
|
-
}
|
1851
|
-
canBeBIN = false;
|
1852
1855
|
}
|
1853
|
-
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1856
|
+
if (glueIsFreeOfNobreak) {
|
1857
|
+
// Start a new block. (Insert a soft linebreak.)
|
1858
|
+
const element = new mathMLTree.MathNode("mrow", block);
|
1859
|
+
mrows.push(element);
|
1860
|
+
block = [];
|
1861
|
+
}
|
1858
1862
|
}
|
1859
|
-
} else {
|
1860
|
-
canBeBIN = true;
|
1861
1863
|
}
|
1862
1864
|
i += 1;
|
1863
1865
|
}
|
@@ -2134,9 +2136,10 @@ var temml = (function () {
|
|
2134
2136
|
}
|
2135
2137
|
if (settings.displayMode) {
|
2136
2138
|
math.setAttribute("display", "block");
|
2137
|
-
math.style.display = math
|
2138
|
-
|
2139
|
-
|
2139
|
+
math.style.display = "block math"; // necessary in Chromium.
|
2140
|
+
// Firefox and Safari do not recognize display: "block math".
|
2141
|
+
// Set a class so that the CSS file can set display: block.
|
2142
|
+
math.classes = ["tml-display"];
|
2140
2143
|
}
|
2141
2144
|
return math;
|
2142
2145
|
}
|
@@ -3665,10 +3668,9 @@ var temml = (function () {
|
|
3665
3668
|
// so we have to explicitly set stretchy to true.
|
3666
3669
|
node.setAttribute("stretchy", "true");
|
3667
3670
|
}
|
3668
|
-
|
3669
3671
|
node.setAttribute("symmetric", "true"); // Needed for tall arrows in Firefox.
|
3670
3672
|
node.setAttribute("minsize", sizeToMaxHeight[group.size] + "em");
|
3671
|
-
|
3673
|
+
node.setAttribute("maxsize", sizeToMaxHeight[group.size] + "em");
|
3672
3674
|
return node;
|
3673
3675
|
}
|
3674
3676
|
});
|
@@ -3803,34 +3805,42 @@ var temml = (function () {
|
|
3803
3805
|
|
3804
3806
|
const mathmlBuilder$8 = (group, style) => {
|
3805
3807
|
let node;
|
3806
|
-
if (group.label.indexOf("colorbox") > -1) {
|
3807
|
-
//
|
3808
|
-
|
3808
|
+
if (group.label.indexOf("colorbox") > -1 || group.label === "\\boxed") {
|
3809
|
+
// MathML core does not support +width attribute in <mpadded>.
|
3810
|
+
// Firefox does not reliably add side padding.
|
3811
|
+
// Insert <mspace>
|
3812
|
+
node = new mathMLTree.MathNode("mrow", [
|
3809
3813
|
padding$1(),
|
3810
3814
|
buildGroup$1(group.body, style),
|
3811
3815
|
padding$1()
|
3812
3816
|
]);
|
3813
3817
|
} else {
|
3814
|
-
node = new mathMLTree.MathNode("
|
3818
|
+
node = new mathMLTree.MathNode("mrow", [buildGroup$1(group.body, style)]);
|
3815
3819
|
}
|
3816
3820
|
switch (group.label) {
|
3817
3821
|
case "\\overline":
|
3818
|
-
node.setAttribute("notation", "top");
|
3819
3822
|
node.style.padding = "0.1em 0 0 0";
|
3820
3823
|
node.style.borderTop = "0.065em solid";
|
3821
3824
|
break
|
3822
3825
|
case "\\underline":
|
3823
|
-
node.setAttribute("notation", "bottom");
|
3824
3826
|
node.style.padding = "0 0 0.1em 0";
|
3825
3827
|
node.style.borderBottom = "0.065em solid";
|
3826
3828
|
break
|
3827
3829
|
case "\\cancel":
|
3828
|
-
node.
|
3829
|
-
|
3830
|
+
node.style.background = `linear-gradient(to top left,
|
3831
|
+
rgba(0,0,0,0) 0%,
|
3832
|
+
rgba(0,0,0,0) calc(50% - 0.06em),
|
3833
|
+
rgba(0,0,0,1) 50%,
|
3834
|
+
rgba(0,0,0,0) calc(50% + 0.06em),
|
3835
|
+
rgba(0,0,0,0) 100%);`;
|
3830
3836
|
break
|
3831
3837
|
case "\\bcancel":
|
3832
|
-
node.
|
3833
|
-
|
3838
|
+
node.style.background = `linear-gradient(to top right,
|
3839
|
+
rgba(0,0,0,0) 0%,
|
3840
|
+
rgba(0,0,0,0) calc(50% - 0.06em),
|
3841
|
+
rgba(0,0,0,1) 50%,
|
3842
|
+
rgba(0,0,0,0) calc(50% + 0.06em),
|
3843
|
+
rgba(0,0,0,0) 100%);`;
|
3834
3844
|
break
|
3835
3845
|
/*
|
3836
3846
|
case "\\longdiv":
|
@@ -3840,18 +3850,21 @@ var temml = (function () {
|
|
3840
3850
|
node.setAttribute("notation", "phasorangle");
|
3841
3851
|
break */
|
3842
3852
|
case "\\angl":
|
3843
|
-
node.setAttribute("notation", "actuarial");
|
3844
3853
|
node.style.padding = "0.03889em 0.03889em 0 0.03889em";
|
3845
3854
|
node.style.borderTop = "0.049em solid";
|
3846
3855
|
node.style.borderRight = "0.049em solid";
|
3847
3856
|
node.style.marginRight = "0.03889em";
|
3848
3857
|
break
|
3849
3858
|
case "\\sout":
|
3850
|
-
node.setAttribute("notation", "horizontalstrike");
|
3851
3859
|
node.style["text-decoration"] = "line-through 0.08em solid";
|
3852
3860
|
break
|
3861
|
+
case "\\boxed":
|
3862
|
+
// \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}} from amsmath.sty
|
3863
|
+
node.style = { padding: "3pt 0 3pt 0", border: "1px solid" };
|
3864
|
+
node.setAttribute("scriptlevel", "0");
|
3865
|
+
node.setAttribute("displaystyle", "true");
|
3866
|
+
break
|
3853
3867
|
case "\\fbox":
|
3854
|
-
node.setAttribute("notation", "box");
|
3855
3868
|
node.style = { padding: "3pt", border: "1px solid" };
|
3856
3869
|
break
|
3857
3870
|
case "\\fcolorbox":
|
@@ -3871,8 +3884,18 @@ var temml = (function () {
|
|
3871
3884
|
break
|
3872
3885
|
}
|
3873
3886
|
case "\\xcancel":
|
3874
|
-
node.
|
3875
|
-
|
3887
|
+
node.style.background = `linear-gradient(to top left,
|
3888
|
+
rgba(0,0,0,0) 0%,
|
3889
|
+
rgba(0,0,0,0) calc(50% - 0.06em),
|
3890
|
+
rgba(0,0,0,1) 50%,
|
3891
|
+
rgba(0,0,0,0) calc(50% + 0.06em),
|
3892
|
+
rgba(0,0,0,0) 100%),
|
3893
|
+
linear-gradient(to top right,
|
3894
|
+
rgba(0,0,0,0) 0%,
|
3895
|
+
rgba(0,0,0,0) calc(50% - 0.06em),
|
3896
|
+
rgba(0,0,0,1) 50%,
|
3897
|
+
rgba(0,0,0,0) calc(50% + 0.06em),
|
3898
|
+
rgba(0,0,0,0) 100%);`;
|
3876
3899
|
break
|
3877
3900
|
}
|
3878
3901
|
if (group.backgroundColor) {
|
@@ -3966,7 +3989,7 @@ var temml = (function () {
|
|
3966
3989
|
|
3967
3990
|
defineFunction({
|
3968
3991
|
type: "enclose",
|
3969
|
-
names: ["\\angl", "\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\overline"],
|
3992
|
+
names: ["\\angl", "\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\overline", "\\boxed"],
|
3970
3993
|
// , "\\phase", "\\longdiv"
|
3971
3994
|
props: {
|
3972
3995
|
numArgs: 1
|
@@ -4303,24 +4326,94 @@ var temml = (function () {
|
|
4303
4326
|
// Write horizontal rules
|
4304
4327
|
if (i === 0 && hlines[0].length > 0) {
|
4305
4328
|
if (hlines[0].length === 2) {
|
4306
|
-
mtr.
|
4329
|
+
mtr.children.forEach(cell => { cell.style.borderTop = "0.15em double"; });
|
4307
4330
|
} else {
|
4308
|
-
mtr.
|
4331
|
+
mtr.children.forEach(cell => {
|
4332
|
+
cell.style.borderTop = hlines[0][0] ? "0.06em dashed" : "0.06em solid";
|
4333
|
+
});
|
4309
4334
|
}
|
4310
4335
|
}
|
4311
4336
|
if (hlines[i + 1].length > 0) {
|
4312
4337
|
if (hlines[i + 1].length === 2) {
|
4313
|
-
mtr.
|
4338
|
+
mtr.children.forEach(cell => { cell.style.borderBottom = "0.15em double"; });
|
4314
4339
|
} else {
|
4315
|
-
mtr.
|
4340
|
+
mtr.children.forEach(cell => {
|
4341
|
+
cell.style.borderBottom = hlines[i + 1][0] ? "0.06em dashed" : "0.06em solid";
|
4342
|
+
});
|
4316
4343
|
}
|
4317
4344
|
}
|
4318
4345
|
tbl.push(mtr);
|
4319
4346
|
}
|
4320
|
-
|
4347
|
+
|
4321
4348
|
if (group.envClasses.length > 0) {
|
4322
|
-
|
4349
|
+
const pad = group.envClasses.includes("jot")
|
4350
|
+
? "0.7" // 0.5ex + 0.09em top & bot padding
|
4351
|
+
: group.envClasses.includes("small")
|
4352
|
+
? "0.35"
|
4353
|
+
: "0.5"; // 0.5ex default top & bot padding
|
4354
|
+
const sidePadding = group.envClasses.includes("abut")
|
4355
|
+
? "0"
|
4356
|
+
: group.envClasses.includes("cases")
|
4357
|
+
? "0"
|
4358
|
+
: group.envClasses.includes("small")
|
4359
|
+
? "0.1389"
|
4360
|
+
: group.envClasses.includes("cd")
|
4361
|
+
? "0.25"
|
4362
|
+
: "0.4"; // default side padding
|
4363
|
+
|
4364
|
+
const numCols = tbl.length === 0 ? 0 : tbl[0].children.length;
|
4365
|
+
|
4366
|
+
const sidePad = (j, hand) => {
|
4367
|
+
if (j === 0 && hand === 0) { return "0" }
|
4368
|
+
if (j === numCols - 1 && hand === 1) { return "0" }
|
4369
|
+
if (group.envClasses[0] !== "align") { return sidePadding }
|
4370
|
+
if (hand === 1) { return "0" }
|
4371
|
+
if (group.addEqnNum) {
|
4372
|
+
return (j % 2) ? "1" : "0"
|
4373
|
+
} else {
|
4374
|
+
return (j % 2) ? "0" : "1"
|
4375
|
+
}
|
4376
|
+
};
|
4377
|
+
|
4378
|
+
// Padding
|
4379
|
+
for (let i = 0; i < tbl.length; i++) {
|
4380
|
+
for (let j = 0; j < tbl[i].children.length; j++) {
|
4381
|
+
tbl[i].children[j].style.padding = `${pad}ex ${sidePad(j, 1)}em ${pad}ex ${sidePad(j, 0)}em`;
|
4382
|
+
}
|
4383
|
+
}
|
4384
|
+
|
4385
|
+
// Justification
|
4386
|
+
const align = group.envClasses.includes("align") || group.envClasses.includes("alignat");
|
4387
|
+
for (let i = 0; i < tbl.length; i++) {
|
4388
|
+
const row = tbl[i];
|
4389
|
+
if (align) {
|
4390
|
+
for (let j = 0; j < row.children.length; j++) {
|
4391
|
+
// Chromium does not recognize text-align: left. Use -webkit-
|
4392
|
+
// TODO: Remove -webkit- when Chromium no longer needs it.
|
4393
|
+
row.children[j].style.textAlign = "-webkit-" + (j % 2 ? "left" : "right");
|
4394
|
+
}
|
4395
|
+
}
|
4396
|
+
if (row.children.length > 1 && group.envClasses.includes("cases")) {
|
4397
|
+
row.children[1].style.padding = row.children[1].style.padding.replace(/0em$/, "1em");
|
4398
|
+
}
|
4399
|
+
|
4400
|
+
if (group.envClasses.includes("cases") || group.envClasses.includes("subarray")) {
|
4401
|
+
for (const cell of row.children) {
|
4402
|
+
cell.style.textAlign = "-webkit-" + "left";
|
4403
|
+
}
|
4404
|
+
}
|
4405
|
+
}
|
4406
|
+
} else {
|
4407
|
+
// Set zero padding on side of the matrix
|
4408
|
+
for (let i = 0; i < tbl.length; i++) {
|
4409
|
+
tbl[i].children[0].style.paddingLeft = "0em";
|
4410
|
+
if (tbl[i].children.length === tbl[0].children.length) {
|
4411
|
+
tbl[i].children[tbl[i].children.length - 1].style.paddingRight = "0em";
|
4412
|
+
}
|
4413
|
+
}
|
4323
4414
|
}
|
4415
|
+
|
4416
|
+
let table = new mathMLTree.MathNode("mtable", tbl);
|
4324
4417
|
if (group.scriptLevel === "display") { table.setAttribute("displaystyle", "true"); }
|
4325
4418
|
|
4326
4419
|
if (group.addEqnNum || group.envClasses.includes("multline")) {
|
@@ -4400,6 +4493,8 @@ var temml = (function () {
|
|
4400
4493
|
align = "left " + (align.length > 0 ? align : "center ") + "right ";
|
4401
4494
|
}
|
4402
4495
|
if (align) {
|
4496
|
+
// Firefox reads this attribute, not the -webkit-left|right written above.
|
4497
|
+
// TODO: When Chrome no longer needs "-webkit-", use CSS and delete the next line.
|
4403
4498
|
table.setAttribute("columnalign", align.trim());
|
4404
4499
|
}
|
4405
4500
|
|
@@ -4424,7 +4519,7 @@ var temml = (function () {
|
|
4424
4519
|
cols,
|
4425
4520
|
addEqnNum: context.envName === "align" || context.envName === "alignat",
|
4426
4521
|
emptySingleRow: true,
|
4427
|
-
envClasses: ["
|
4522
|
+
envClasses: ["abut", "jot"], // set row spacing & provisional column spacing
|
4428
4523
|
maxNumCols: context.envName === "split" ? 2 : undefined,
|
4429
4524
|
leqno: context.parser.settings.leqno
|
4430
4525
|
},
|
@@ -4442,18 +4537,22 @@ var temml = (function () {
|
|
4442
4537
|
// binary. This behavior is implemented in amsmath's \start@aligned.
|
4443
4538
|
let numMaths;
|
4444
4539
|
let numCols = 0;
|
4445
|
-
|
4540
|
+
const isAlignedAt = context.envName.indexOf("at") > -1;
|
4541
|
+
if (args[0] && isAlignedAt) {
|
4542
|
+
// alignat environment takes an argument w/ number of columns
|
4446
4543
|
let arg0 = "";
|
4447
4544
|
for (let i = 0; i < args[0].body.length; i++) {
|
4448
4545
|
const textord = assertNodeType(args[0].body[i], "textord");
|
4449
4546
|
arg0 += textord.text;
|
4450
4547
|
}
|
4548
|
+
if (isNaN(arg0)) {
|
4549
|
+
throw new ParseError("The alignat enviroment requires a numeric first argument.")
|
4550
|
+
}
|
4451
4551
|
numMaths = Number(arg0);
|
4452
4552
|
numCols = numMaths * 2;
|
4453
4553
|
}
|
4454
|
-
const isAligned = !numCols;
|
4455
4554
|
res.body.forEach(function(row) {
|
4456
|
-
if (
|
4555
|
+
if (isAlignedAt) {
|
4457
4556
|
// Case 1
|
4458
4557
|
const curMaths = row.length / 2;
|
4459
4558
|
if (numMaths < curMaths) {
|
@@ -4481,14 +4580,10 @@ var temml = (function () {
|
|
4481
4580
|
align: align
|
4482
4581
|
};
|
4483
4582
|
}
|
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
|
4583
|
+
if (context.envName === "split") ; else if (isAlignedAt) {
|
4584
|
+
res.envClasses.push("alignat"); // Sets justification
|
4490
4585
|
} else {
|
4491
|
-
res.envClasses
|
4586
|
+
res.envClasses[0] = "align"; // Sets column spacing & justification
|
4492
4587
|
}
|
4493
4588
|
return res;
|
4494
4589
|
};
|
@@ -4738,7 +4833,7 @@ var temml = (function () {
|
|
4738
4833
|
}
|
4739
4834
|
const res = {
|
4740
4835
|
cols: [],
|
4741
|
-
envClasses: ["
|
4836
|
+
envClasses: ["abut", "jot"],
|
4742
4837
|
addEqnNum: context.envName === "gather",
|
4743
4838
|
emptySingleRow: true,
|
4744
4839
|
leqno: context.parser.settings.leqno
|
@@ -6832,8 +6927,6 @@ var temml = (function () {
|
|
6832
6927
|
}
|
6833
6928
|
});
|
6834
6929
|
|
6835
|
-
const sign = num => num >= 0 ? "+" : "-";
|
6836
|
-
|
6837
6930
|
// \raise, \lower, and \raisebox
|
6838
6931
|
|
6839
6932
|
const mathmlBuilder = (group, style) => {
|
@@ -6841,11 +6934,13 @@ var temml = (function () {
|
|
6841
6934
|
const node = new mathMLTree.MathNode("mpadded", [buildGroup$1(group.body, newStyle)]);
|
6842
6935
|
const dy = calculateSize(group.dy, style);
|
6843
6936
|
node.setAttribute("voffset", dy.number + dy.unit);
|
6844
|
-
|
6845
|
-
//
|
6846
|
-
|
6847
|
-
|
6848
|
-
|
6937
|
+
// Add padding, which acts to increase height in Chromium.
|
6938
|
+
// TODO: Figure out some way to change height in Firefox w/o breaking Chromium.
|
6939
|
+
if (dy.number > 0) {
|
6940
|
+
node.style.padding = dy.number + dy.unit + " 0 0 0";
|
6941
|
+
} else {
|
6942
|
+
node.style.padding = "0 0 " + Math.abs(dy.number) + dy.unit + " 0";
|
6943
|
+
}
|
6849
6944
|
return node
|
6850
6945
|
};
|
6851
6946
|
|
@@ -8474,9 +8569,6 @@ var temml = (function () {
|
|
8474
8569
|
//\newcommand{\substack}[1]{\subarray{c}#1\endsubarray}
|
8475
8570
|
defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}");
|
8476
8571
|
|
8477
|
-
// \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}}
|
8478
|
-
defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}");
|
8479
|
-
|
8480
8572
|
// \def\iff{\DOTSB\;\Longleftrightarrow\;}
|
8481
8573
|
// \def\implies{\DOTSB\;\Longrightarrow\;}
|
8482
8574
|
// \def\impliedby{\DOTSB\;\Longleftarrow\;}
|
@@ -8725,7 +8817,7 @@ var temml = (function () {
|
|
8725
8817
|
defineMacro(
|
8726
8818
|
"\\Temml",
|
8727
8819
|
// eslint-disable-next-line max-len
|
8728
|
-
"\\textrm{T}\\kern-0.2em\\lower{0.2em}\\textrm{E}\\kern-0.08em{\\textrm{M}\\kern-0.08em\\raise{0.2em}\\textrm{M}\\kern-0.08em\\textrm{L}}"
|
8820
|
+
"\\textrm{T}\\kern-0.2em\\lower{0.2em}{\\textrm{E}}\\kern-0.08em{\\textrm{M}\\kern-0.08em\\raise{0.2em}\\textrm{M}\\kern-0.08em\\textrm{L}}"
|
8729
8821
|
);
|
8730
8822
|
|
8731
8823
|
// \DeclareRobustCommand\hspace{\@ifstar\@hspacer\@hspace}
|
@@ -11005,7 +11097,7 @@ var temml = (function () {
|
|
11005
11097
|
* https://mit-license.org/
|
11006
11098
|
*/
|
11007
11099
|
|
11008
|
-
const version = "0.10.
|
11100
|
+
const version = "0.10.15";
|
11009
11101
|
|
11010
11102
|
function postProcess(block) {
|
11011
11103
|
const labelMap = {};
|
@@ -11056,6 +11148,7 @@ var temml = (function () {
|
|
11056
11148
|
/* eslint no-console:0 */
|
11057
11149
|
|
11058
11150
|
/**
|
11151
|
+
* @type {import('./temml').render}
|
11059
11152
|
* Parse and build an expression, and place that expression in the DOM node
|
11060
11153
|
* given.
|
11061
11154
|
*/
|
@@ -11093,6 +11186,7 @@ var temml = (function () {
|
|
11093
11186
|
}
|
11094
11187
|
|
11095
11188
|
/**
|
11189
|
+
* @type {import('./temml').renderToString}
|
11096
11190
|
* Parse and build an expression, and return the markup for that.
|
11097
11191
|
*/
|
11098
11192
|
const renderToString = function(expression, options) {
|
@@ -11101,6 +11195,7 @@ var temml = (function () {
|
|
11101
11195
|
};
|
11102
11196
|
|
11103
11197
|
/**
|
11198
|
+
* @type {import('./temml').generateParseTree}
|
11104
11199
|
* Parse an expression and return the parse tree.
|
11105
11200
|
*/
|
11106
11201
|
const generateParseTree = function(expression, options) {
|
@@ -11109,6 +11204,7 @@ var temml = (function () {
|
|
11109
11204
|
};
|
11110
11205
|
|
11111
11206
|
/**
|
11207
|
+
* @type {import('./temml').definePreamble}
|
11112
11208
|
* Take an expression which contains a preamble.
|
11113
11209
|
* Parse it and return the macros.
|
11114
11210
|
*/
|
@@ -11141,6 +11237,7 @@ var temml = (function () {
|
|
11141
11237
|
};
|
11142
11238
|
|
11143
11239
|
/**
|
11240
|
+
* @type {import('./temml').renderToMathMLTree}
|
11144
11241
|
* Generates and returns the Temml build tree. This is used for advanced
|
11145
11242
|
* use cases (like rendering to custom output).
|
11146
11243
|
*/
|
@@ -11158,6 +11255,7 @@ var temml = (function () {
|
|
11158
11255
|
}
|
11159
11256
|
};
|
11160
11257
|
|
11258
|
+
/** @type {import('./temml').default} */
|
11161
11259
|
var temml = {
|
11162
11260
|
/**
|
11163
11261
|
* Current Temml version
|