temml 0.10.12 → 0.10.14
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Temml-Asana.css +8 -4
- package/dist/Temml-Latin-Modern.css +8 -4
- package/dist/Temml-Libertinus.css +8 -4
- package/dist/Temml-Local.css +8 -4
- package/dist/Temml-STIX2.css +8 -4
- package/dist/temml.cjs +126 -102
- package/dist/temml.js +126 -102
- package/dist/temml.min.js +1 -1
- package/dist/temml.mjs +126 -102
- package/dist/temmlPostProcess.js +1 -1
- package/package.json +4 -1
- package/src/buildMathML.js +4 -1
- package/src/functions/arrow.js +50 -24
- package/src/functions/delimsizing.js +2 -3
- package/src/functions/enclose.js +13 -13
- 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 +2 -0
package/dist/Temml-Asana.css
CHANGED
@@ -38,6 +38,10 @@ math {
|
|
38
38
|
font-family: Asana Math, math;
|
39
39
|
}
|
40
40
|
|
41
|
+
/* Next line is active in Firefox and Safari.
|
42
|
+
* Not in Chromium, which recognizes display: "block math" written inline. */
|
43
|
+
math.tml-display { display: block; }
|
44
|
+
|
41
45
|
*.mathcal,
|
42
46
|
mo.tml-prime {
|
43
47
|
font-feature-settings: 'salt';
|
@@ -54,7 +58,7 @@ math > mrow {
|
|
54
58
|
}
|
55
59
|
|
56
60
|
/* Avoid flex-wrap in Firefox */
|
57
|
-
|
61
|
+
@-moz-document url-prefix() {
|
58
62
|
math { display: inline; }
|
59
63
|
math > mrow { padding: 0 }
|
60
64
|
}
|
@@ -179,7 +183,7 @@ mtr.tml-hline-dashed > mtd {
|
|
179
183
|
|
180
184
|
/* MathML-Core does not support <menclose> attributes.
|
181
185
|
* So Use background images for \cancel */
|
182
|
-
|
186
|
+
mrow.cancel {
|
183
187
|
background:
|
184
188
|
linear-gradient(to top left,
|
185
189
|
rgba(0,0,0,0) 0%,
|
@@ -189,7 +193,7 @@ menclose.cancel {
|
|
189
193
|
rgba(0,0,0,0) 100%);
|
190
194
|
}
|
191
195
|
|
192
|
-
|
196
|
+
mrow.bcancel {
|
193
197
|
background:
|
194
198
|
linear-gradient(to top right,
|
195
199
|
rgba(0,0,0,0) 0%,
|
@@ -199,7 +203,7 @@ menclose.bcancel {
|
|
199
203
|
rgba(0,0,0,0) 100%);
|
200
204
|
}
|
201
205
|
|
202
|
-
|
206
|
+
mrow.xcancel {
|
203
207
|
background:
|
204
208
|
linear-gradient(to top left,
|
205
209
|
rgba(0,0,0,0) 0%,
|
@@ -44,6 +44,10 @@ math {
|
|
44
44
|
font-family: "Latin Modern Math", "Times New Roman", math;
|
45
45
|
}
|
46
46
|
|
47
|
+
/* Next line is active in Firefox and Safari.
|
48
|
+
* Not in Chromium, which recognizes display: "block math" written inline. */
|
49
|
+
math.tml-display { display: block; }
|
50
|
+
|
47
51
|
*.mathscr {
|
48
52
|
font-family: "Temml";
|
49
53
|
}
|
@@ -63,7 +67,7 @@ math > mrow {
|
|
63
67
|
}
|
64
68
|
|
65
69
|
/* Avoid flex-wrap in Firefox */
|
66
|
-
|
70
|
+
@-moz-document url-prefix() {
|
67
71
|
math { display: inline; }
|
68
72
|
math > mrow { padding: 0 }
|
69
73
|
}
|
@@ -189,7 +193,7 @@ mtr.tml-hline-dashed > mtd {
|
|
189
193
|
|
190
194
|
/* MathML-Core does not support <menclose> attributes.
|
191
195
|
* So Use background images for \cancel */
|
192
|
-
|
196
|
+
mrow.cancel {
|
193
197
|
background:
|
194
198
|
linear-gradient(to top left,
|
195
199
|
rgba(0,0,0,0) 0%,
|
@@ -199,7 +203,7 @@ menclose.cancel {
|
|
199
203
|
rgba(0,0,0,0) 100%);
|
200
204
|
}
|
201
205
|
|
202
|
-
|
206
|
+
mrow.bcancel {
|
203
207
|
background:
|
204
208
|
linear-gradient(to top right,
|
205
209
|
rgba(0,0,0,0) 0%,
|
@@ -209,7 +213,7 @@ menclose.bcancel {
|
|
209
213
|
rgba(0,0,0,0) 100%);
|
210
214
|
}
|
211
215
|
|
212
|
-
|
216
|
+
mrow.xcancel {
|
213
217
|
background:
|
214
218
|
linear-gradient(to top left,
|
215
219
|
rgba(0,0,0,0) 0%,
|
@@ -42,6 +42,10 @@ math {
|
|
42
42
|
font-family: Libertinus Math, math;
|
43
43
|
}
|
44
44
|
|
45
|
+
/* Next line is active in Firefox and Safari.
|
46
|
+
* Not in Chromium, which recognizes display: "block math" written inline. */
|
47
|
+
math.tml-display { display: block; }
|
48
|
+
|
45
49
|
*.mathcal {
|
46
50
|
font-family: "Cambria Math", 'STIXTwoMath-Regular', "Times New Roman", math;
|
47
51
|
}
|
@@ -61,7 +65,7 @@ math > mrow {
|
|
61
65
|
}
|
62
66
|
|
63
67
|
/* Avoid flex-wrap in Firefox */
|
64
|
-
|
68
|
+
@-moz-document url-prefix() {
|
65
69
|
math { display: inline; }
|
66
70
|
math > mrow { padding: 0 }
|
67
71
|
}
|
@@ -187,7 +191,7 @@ mtr.tml-hline-dashed > mtd {
|
|
187
191
|
|
188
192
|
/* MathML-Core does not support <menclose> attributes.
|
189
193
|
* So Use background images for \cancel */
|
190
|
-
|
194
|
+
mrow.cancel {
|
191
195
|
background:
|
192
196
|
linear-gradient(to top left,
|
193
197
|
rgba(0,0,0,0) 0%,
|
@@ -197,7 +201,7 @@ menclose.cancel {
|
|
197
201
|
rgba(0,0,0,0) 100%);
|
198
202
|
}
|
199
203
|
|
200
|
-
|
204
|
+
mrow.bcancel {
|
201
205
|
background:
|
202
206
|
linear-gradient(to top right,
|
203
207
|
rgba(0,0,0,0) 0%,
|
@@ -207,7 +211,7 @@ menclose.bcancel {
|
|
207
211
|
rgba(0,0,0,0) 100%);
|
208
212
|
}
|
209
213
|
|
210
|
-
|
214
|
+
mrow.xcancel {
|
211
215
|
background:
|
212
216
|
linear-gradient(to top left,
|
213
217
|
rgba(0,0,0,0) 0%,
|
package/dist/Temml-Local.css
CHANGED
@@ -28,6 +28,10 @@ math * {
|
|
28
28
|
border-color: currentColor;
|
29
29
|
}
|
30
30
|
|
31
|
+
/* Next line is active in Firefox and Safari.
|
32
|
+
* Not in Chromium, which recognizes display: "block math" written inline. */
|
33
|
+
math.tml-display { display: block; }
|
34
|
+
|
31
35
|
math .mathscr {
|
32
36
|
font-family: "Temml";
|
33
37
|
}
|
@@ -47,7 +51,7 @@ math > mrow {
|
|
47
51
|
}
|
48
52
|
|
49
53
|
/* Avoid flex-wrap in Firefox */
|
50
|
-
|
54
|
+
@-moz-document url-prefix() {
|
51
55
|
math { display: inline; }
|
52
56
|
math > mrow { padding: 0 }
|
53
57
|
}
|
@@ -172,7 +176,7 @@ mtr.tml-hline-dashed > mtd {
|
|
172
176
|
|
173
177
|
/* MathML-Core does not support <menclose> attributes.
|
174
178
|
* So Use background images for \cancel */
|
175
|
-
|
179
|
+
mrow.cancel {
|
176
180
|
background:
|
177
181
|
linear-gradient(to top left,
|
178
182
|
rgba(0,0,0,0) 0%,
|
@@ -182,7 +186,7 @@ menclose.cancel {
|
|
182
186
|
rgba(0,0,0,0) 100%);
|
183
187
|
}
|
184
188
|
|
185
|
-
|
189
|
+
mrow.bcancel {
|
186
190
|
background:
|
187
191
|
linear-gradient(to top right,
|
188
192
|
rgba(0,0,0,0) 0%,
|
@@ -192,7 +196,7 @@ menclose.bcancel {
|
|
192
196
|
rgba(0,0,0,0) 100%);
|
193
197
|
}
|
194
198
|
|
195
|
-
|
199
|
+
mrow.xcancel {
|
196
200
|
background:
|
197
201
|
linear-gradient(to top left,
|
198
202
|
rgba(0,0,0,0) 0%,
|
package/dist/Temml-STIX2.css
CHANGED
@@ -28,6 +28,10 @@ math * {
|
|
28
28
|
border-color: currentColor;
|
29
29
|
}
|
30
30
|
|
31
|
+
/* Next line is active in Firefox and Safari.
|
32
|
+
* Not in Chromium, which recognizes display: "block math" written inline. */
|
33
|
+
math.tml-display { display: block; }
|
34
|
+
|
31
35
|
mtext {
|
32
36
|
font-family: STIX2;
|
33
37
|
}
|
@@ -55,7 +59,7 @@ math > mrow {
|
|
55
59
|
}
|
56
60
|
|
57
61
|
/* Avoid flex-wrap in Firefox */
|
58
|
-
|
62
|
+
@-moz-document url-prefix() {
|
59
63
|
math { display: inline; }
|
60
64
|
math > mrow { padding: 0 }
|
61
65
|
}
|
@@ -180,7 +184,7 @@ mtr.tml-hline-dashed > mtd {
|
|
180
184
|
|
181
185
|
/* MathML-Core does not support <menclose> attributes.
|
182
186
|
* So Use background images for \cancel */
|
183
|
-
|
187
|
+
mrow.cancel {
|
184
188
|
background:
|
185
189
|
linear-gradient(to top left,
|
186
190
|
rgba(0,0,0,0) 0%,
|
@@ -190,7 +194,7 @@ menclose.cancel {
|
|
190
194
|
rgba(0,0,0,0) 100%);
|
191
195
|
}
|
192
196
|
|
193
|
-
|
197
|
+
mrow.bcancel {
|
194
198
|
background:
|
195
199
|
linear-gradient(to top right,
|
196
200
|
rgba(0,0,0,0) 0%,
|
@@ -200,7 +204,7 @@ menclose.bcancel {
|
|
200
204
|
rgba(0,0,0,0) 100%);
|
201
205
|
}
|
202
206
|
|
203
|
-
|
207
|
+
mrow.xcancel {
|
204
208
|
background:
|
205
209
|
linear-gradient(to top left,
|
206
210
|
rgba(0,0,0,0) 0%,
|
package/dist/temml.cjs
CHANGED
@@ -970,6 +970,7 @@ defineSymbol(math, rel, "\u21c1", "\\rightharpoondown", true);
|
|
970
970
|
defineSymbol(math, rel, "\u2196", "\\nwarrow", true);
|
971
971
|
defineSymbol(math, rel, "\u21cc", "\\rightleftharpoons", true);
|
972
972
|
defineSymbol(math, mathord, "\u21af", "\\lightning", true);
|
973
|
+
defineSymbol(math, mathord, "\u220E", "\\QED", true);
|
973
974
|
defineSymbol(math, mathord, "\u2030", "\\permil", true);
|
974
975
|
defineSymbol(text, textord, "\u2030", "\\permil");
|
975
976
|
|
@@ -1116,6 +1117,7 @@ defineSymbol(math, rel, "\u2ab7", "\\precapprox", true);
|
|
1116
1117
|
defineSymbol(math, rel, "\u22b2", "\\vartriangleleft");
|
1117
1118
|
defineSymbol(math, rel, "\u22b4", "\\trianglelefteq");
|
1118
1119
|
defineSymbol(math, rel, "\u22a8", "\\vDash", true);
|
1120
|
+
defineSymbol(math, rel, "\u22ab", "\\VDash", true);
|
1119
1121
|
defineSymbol(math, rel, "\u22aa", "\\Vvdash", true);
|
1120
1122
|
defineSymbol(math, rel, "\u2323", "\\smallsmile");
|
1121
1123
|
defineSymbol(math, rel, "\u2322", "\\smallfrown");
|
@@ -1765,13 +1767,16 @@ for (let i = 0; i < 10; i++) {
|
|
1765
1767
|
* much of this module.
|
1766
1768
|
*/
|
1767
1769
|
|
1770
|
+
const openDelims = "([{⌊⌈⟨⟮⎰⟦⦃";
|
1771
|
+
const closeDelims = ")]}⌋⌉⟩⟯⎱⟦⦄";
|
1772
|
+
|
1768
1773
|
function setLineBreaks(expression, wrapMode, isDisplayMode) {
|
1769
1774
|
const mtrs = [];
|
1770
1775
|
let mrows = [];
|
1771
1776
|
let block = [];
|
1772
1777
|
let numTopLevelEquals = 0;
|
1773
|
-
let canBeBIN = false; // The first node cannot be an infix binary operator.
|
1774
1778
|
let i = 0;
|
1779
|
+
let level = 0;
|
1775
1780
|
while (i < expression.length) {
|
1776
1781
|
while (expression[i] instanceof DocumentFragment) {
|
1777
1782
|
expression.splice(i, 1, ...expression[i].children); // Expand the fragment.
|
@@ -1794,7 +1799,12 @@ function setLineBreaks(expression, wrapMode, isDisplayMode) {
|
|
1794
1799
|
}
|
1795
1800
|
block.push(node);
|
1796
1801
|
if (node.type && node.type === "mo" && node.children.length === 1) {
|
1797
|
-
|
1802
|
+
const ch = node.children[0].text;
|
1803
|
+
if (openDelims.indexOf(ch) > -1) {
|
1804
|
+
level += 1;
|
1805
|
+
} else if (closeDelims.indexOf(ch) > -1) {
|
1806
|
+
level -= 1;
|
1807
|
+
} else if (level === 0 && wrapMode === "=" && ch === "=") {
|
1798
1808
|
numTopLevelEquals += 1;
|
1799
1809
|
if (numTopLevelEquals > 1) {
|
1800
1810
|
block.pop();
|
@@ -1803,59 +1813,48 @@ function setLineBreaks(expression, wrapMode, isDisplayMode) {
|
|
1803
1813
|
mrows.push(element);
|
1804
1814
|
block = [node];
|
1805
1815
|
}
|
1806
|
-
} else if (wrapMode === "tex") {
|
1807
|
-
//
|
1808
|
-
|
1809
|
-
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1816
|
+
} else if (level === 0 && wrapMode === "tex") {
|
1817
|
+
// Check if the following node is a \nobreak text node, e.g. "~""
|
1818
|
+
const next = i < expression.length - 1 ? expression[i + 1] : null;
|
1819
|
+
let glueIsFreeOfNobreak = true;
|
1820
|
+
if (
|
1821
|
+
!(
|
1822
|
+
next &&
|
1823
|
+
next.type === "mtext" &&
|
1824
|
+
next.attributes.linebreak &&
|
1825
|
+
next.attributes.linebreak === "nobreak"
|
1826
|
+
)
|
1827
|
+
) {
|
1828
|
+
// We may need to start a new block.
|
1829
|
+
// First, put any post-operator glue on same line as operator.
|
1830
|
+
for (let j = i + 1; j < expression.length; j++) {
|
1831
|
+
const nd = expression[j];
|
1832
|
+
if (
|
1833
|
+
nd.type &&
|
1834
|
+
nd.type === "mspace" &&
|
1835
|
+
!(nd.attributes.linebreak && nd.attributes.linebreak === "newline")
|
1836
|
+
) {
|
1837
|
+
block.push(nd);
|
1838
|
+
i += 1;
|
1824
1839
|
if (
|
1825
|
-
nd.
|
1826
|
-
nd.
|
1827
|
-
|
1840
|
+
nd.attributes &&
|
1841
|
+
nd.attributes.linebreak &&
|
1842
|
+
nd.attributes.linebreak === "nobreak"
|
1828
1843
|
) {
|
1829
|
-
|
1830
|
-
i += 1;
|
1831
|
-
if (
|
1832
|
-
nd.attributes &&
|
1833
|
-
nd.attributes.linebreak &&
|
1834
|
-
nd.attributes.linebreak === "nobreak"
|
1835
|
-
) {
|
1836
|
-
glueIsFreeOfNobreak = false;
|
1837
|
-
}
|
1838
|
-
} else {
|
1839
|
-
break;
|
1844
|
+
glueIsFreeOfNobreak = false;
|
1840
1845
|
}
|
1846
|
+
} else {
|
1847
|
+
break;
|
1841
1848
|
}
|
1842
1849
|
}
|
1843
|
-
if (glueIsFreeOfNobreak) {
|
1844
|
-
// Start a new block. (Insert a soft linebreak.)
|
1845
|
-
const element = new mathMLTree.MathNode("mrow", block);
|
1846
|
-
mrows.push(element);
|
1847
|
-
block = [];
|
1848
|
-
}
|
1849
|
-
canBeBIN = false;
|
1850
1850
|
}
|
1851
|
-
|
1852
|
-
|
1853
|
-
|
1854
|
-
|
1855
|
-
|
1851
|
+
if (glueIsFreeOfNobreak) {
|
1852
|
+
// Start a new block. (Insert a soft linebreak.)
|
1853
|
+
const element = new mathMLTree.MathNode("mrow", block);
|
1854
|
+
mrows.push(element);
|
1855
|
+
block = [];
|
1856
|
+
}
|
1856
1857
|
}
|
1857
|
-
} else {
|
1858
|
-
canBeBIN = true;
|
1859
1858
|
}
|
1860
1859
|
i += 1;
|
1861
1860
|
}
|
@@ -2134,7 +2133,10 @@ function buildMathML(tree, texExpression, style, settings) {
|
|
2134
2133
|
math.setAttribute("display", "block");
|
2135
2134
|
math.style.display = math.children.length === 1 && math.children[0].type === "mtable"
|
2136
2135
|
? "inline"
|
2137
|
-
: "block math";
|
2136
|
+
: "block math"; // necessary in Chromium.
|
2137
|
+
// Firefox and Safari do not recognize display: "block math".
|
2138
|
+
// Set a class so that the CSS file can set display: block.
|
2139
|
+
math.classes = ["tml-display"];
|
2138
2140
|
}
|
2139
2141
|
return math;
|
2140
2142
|
}
|
@@ -2418,43 +2420,69 @@ const paddedNode = (group, lspace = 0.3, rspace = 0) => {
|
|
2418
2420
|
return new mathMLTree.MathNode("mrow", row)
|
2419
2421
|
};
|
2420
2422
|
|
2421
|
-
const labelSize = (size, scriptLevel) => (size / emScale(scriptLevel)
|
2423
|
+
const labelSize = (size, scriptLevel) => Number(size) / emScale(scriptLevel);
|
2422
2424
|
|
2423
|
-
const munderoverNode = (
|
2424
|
-
const arrowNode = stretchy.mathMLnode(
|
2425
|
+
const munderoverNode = (fName, body, below, style) => {
|
2426
|
+
const arrowNode = stretchy.mathMLnode(fName);
|
2425
2427
|
// Is this the short part of a mhchem equilibrium arrow?
|
2426
|
-
const isEq =
|
2427
|
-
const minWidth =
|
2428
|
-
? "1.75" // mathtools extensible arrows are 1.75em long
|
2429
|
-
:
|
2428
|
+
const isEq = fName.slice(1, 3) === "eq";
|
2429
|
+
const minWidth = fName.charAt(1) === "x"
|
2430
|
+
? "1.75" // mathtools extensible arrows are ≥ 1.75em long
|
2431
|
+
: fName.slice(2, 4) === "cd"
|
2430
2432
|
? "3.0" // cd package arrows
|
2431
2433
|
: isEq
|
2432
2434
|
? "1.0" // The shorter harpoon of a mhchem equilibrium arrow
|
2433
2435
|
: "2.0"; // other mhchem arrows
|
2434
|
-
|
2436
|
+
// TODO: When Firefox supports minsize, use the next line.
|
2437
|
+
//arrowNode.setAttribute("minsize", String(minWidth) + "em")
|
2435
2438
|
arrowNode.setAttribute("lspace", "0");
|
2436
2439
|
arrowNode.setAttribute("rspace", (isEq ? "0.5em" : "0"));
|
2437
2440
|
|
2438
2441
|
// <munderover> upper and lower labels are set to scriptlevel by MathML
|
2439
|
-
// So we have to adjust our dimensions accordingly.
|
2442
|
+
// So we have to adjust our label dimensions accordingly.
|
2440
2443
|
const labelStyle = style.withLevel(style.level < 2 ? 2 : 3);
|
2441
|
-
const
|
2442
|
-
|
2443
|
-
|
2444
|
-
|
2445
|
-
const
|
2444
|
+
const minArrowWidth = labelSize(minWidth, labelStyle.level);
|
2445
|
+
// The dummyNode will be inside a <mover> inside a <mover>
|
2446
|
+
// So it will be at scriptlevel 3
|
2447
|
+
const dummyWidth = labelSize(minWidth, 3);
|
2448
|
+
const emptyLabel = paddedNode(null, minArrowWidth.toFixed(4), 0);
|
2449
|
+
const dummyNode = paddedNode(null, dummyWidth.toFixed(4), 0);
|
2450
|
+
// The arrow is a little longer than the label. Set a spacer length.
|
2451
|
+
const space = labelSize((isEq ? 0 : 0.3), labelStyle.level).toFixed(4);
|
2452
|
+
let upperNode;
|
2453
|
+
let lowerNode;
|
2454
|
+
|
2455
|
+
const gotUpper = (body && body.body &&
|
2446
2456
|
// \hphantom visible content
|
2447
|
-
(body.body.body || body.body.length > 0))
|
2448
|
-
|
2449
|
-
|
2450
|
-
|
2451
|
-
|
2452
|
-
|
2453
|
-
|
2454
|
-
|
2455
|
-
|
2456
|
-
const
|
2457
|
-
|
2457
|
+
(body.body.body || body.body.length > 0));
|
2458
|
+
if (gotUpper) {
|
2459
|
+
let label = buildGroup$1(body, labelStyle);
|
2460
|
+
label = paddedNode(label, space, space);
|
2461
|
+
// Since Firefox does not support minsize, stack a invisible node
|
2462
|
+
// on top of the label. Its width will serve as a min-width.
|
2463
|
+
// TODO: Refactor this after Firefox supports minsize.
|
2464
|
+
upperNode = new mathMLTree.MathNode("mover", [label, dummyNode]);
|
2465
|
+
}
|
2466
|
+
const gotLower = (below && below.body &&
|
2467
|
+
(below.body.body || below.body.length > 0));
|
2468
|
+
if (gotLower) {
|
2469
|
+
let label = buildGroup$1(below, labelStyle);
|
2470
|
+
label = paddedNode(label, space, space);
|
2471
|
+
lowerNode = new mathMLTree.MathNode("munder", [label, dummyNode]);
|
2472
|
+
}
|
2473
|
+
|
2474
|
+
let node;
|
2475
|
+
if (!gotUpper && !gotLower) {
|
2476
|
+
node = new mathMLTree.MathNode("mover", [arrowNode, emptyLabel]);
|
2477
|
+
} else if (gotUpper && gotLower) {
|
2478
|
+
node = new mathMLTree.MathNode("munderover", [arrowNode, lowerNode, upperNode]);
|
2479
|
+
} else if (gotUpper) {
|
2480
|
+
node = new mathMLTree.MathNode("mover", [arrowNode, upperNode]);
|
2481
|
+
} else {
|
2482
|
+
node = new mathMLTree.MathNode("munder", [arrowNode, lowerNode]);
|
2483
|
+
}
|
2484
|
+
if (minWidth === "3.0") { node.style.height = "1em"; } // CD environment
|
2485
|
+
node.setAttribute("accent", "false"); // Necessary for MS Word
|
2458
2486
|
return node
|
2459
2487
|
};
|
2460
2488
|
|
@@ -2533,7 +2561,7 @@ defineFunction({
|
|
2533
2561
|
"\\xleftrightharpoons", // mathtools
|
2534
2562
|
"\\xrightleftharpoons", // mathtools
|
2535
2563
|
"\\yieldsLeftRight", // mhchem
|
2536
|
-
"\\equilibrium",
|
2564
|
+
"\\equilibrium", // mhchem
|
2537
2565
|
"\\equilibriumRight",
|
2538
2566
|
"\\equilibriumLeft"
|
2539
2567
|
],
|
@@ -3637,10 +3665,9 @@ defineFunction({
|
|
3637
3665
|
// so we have to explicitly set stretchy to true.
|
3638
3666
|
node.setAttribute("stretchy", "true");
|
3639
3667
|
}
|
3640
|
-
|
3641
3668
|
node.setAttribute("symmetric", "true"); // Needed for tall arrows in Firefox.
|
3642
3669
|
node.setAttribute("minsize", sizeToMaxHeight[group.size] + "em");
|
3643
|
-
|
3670
|
+
node.setAttribute("maxsize", sizeToMaxHeight[group.size] + "em");
|
3644
3671
|
return node;
|
3645
3672
|
}
|
3646
3673
|
});
|
@@ -3775,33 +3802,31 @@ const padding$1 = _ => {
|
|
3775
3802
|
|
3776
3803
|
const mathmlBuilder$8 = (group, style) => {
|
3777
3804
|
let node;
|
3778
|
-
if (group.label.indexOf("colorbox") > -1) {
|
3779
|
-
//
|
3780
|
-
|
3805
|
+
if (group.label.indexOf("colorbox") > -1 || group.label === "\\boxed") {
|
3806
|
+
// MathML core does not support +width attribute in <mpadded>.
|
3807
|
+
// Firefox does not reliably add side padding.
|
3808
|
+
// Insert <mspace>
|
3809
|
+
node = new mathMLTree.MathNode("mrow", [
|
3781
3810
|
padding$1(),
|
3782
3811
|
buildGroup$1(group.body, style),
|
3783
3812
|
padding$1()
|
3784
3813
|
]);
|
3785
3814
|
} else {
|
3786
|
-
node = new mathMLTree.MathNode("
|
3815
|
+
node = new mathMLTree.MathNode("mrow", [buildGroup$1(group.body, style)]);
|
3787
3816
|
}
|
3788
3817
|
switch (group.label) {
|
3789
3818
|
case "\\overline":
|
3790
|
-
node.setAttribute("notation", "top");
|
3791
3819
|
node.style.padding = "0.1em 0 0 0";
|
3792
3820
|
node.style.borderTop = "0.065em solid";
|
3793
3821
|
break
|
3794
3822
|
case "\\underline":
|
3795
|
-
node.setAttribute("notation", "bottom");
|
3796
3823
|
node.style.padding = "0 0 0.1em 0";
|
3797
3824
|
node.style.borderBottom = "0.065em solid";
|
3798
3825
|
break
|
3799
3826
|
case "\\cancel":
|
3800
|
-
node.setAttribute("notation", "updiagonalstrike");
|
3801
3827
|
node.classes.push("cancel");
|
3802
3828
|
break
|
3803
3829
|
case "\\bcancel":
|
3804
|
-
node.setAttribute("notation", "downdiagonalstrike");
|
3805
3830
|
node.classes.push("bcancel");
|
3806
3831
|
break
|
3807
3832
|
/*
|
@@ -3812,18 +3837,21 @@ const mathmlBuilder$8 = (group, style) => {
|
|
3812
3837
|
node.setAttribute("notation", "phasorangle");
|
3813
3838
|
break */
|
3814
3839
|
case "\\angl":
|
3815
|
-
node.setAttribute("notation", "actuarial");
|
3816
3840
|
node.style.padding = "0.03889em 0.03889em 0 0.03889em";
|
3817
3841
|
node.style.borderTop = "0.049em solid";
|
3818
3842
|
node.style.borderRight = "0.049em solid";
|
3819
3843
|
node.style.marginRight = "0.03889em";
|
3820
3844
|
break
|
3821
3845
|
case "\\sout":
|
3822
|
-
node.setAttribute("notation", "horizontalstrike");
|
3823
3846
|
node.style["text-decoration"] = "line-through 0.08em solid";
|
3824
3847
|
break
|
3848
|
+
case "\\boxed":
|
3849
|
+
// \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}} from amsmath.sty
|
3850
|
+
node.style = { padding: "3pt 0 3pt 0", border: "1px solid" };
|
3851
|
+
node.setAttribute("scriptlevel", "0");
|
3852
|
+
node.setAttribute("displaystyle", "true");
|
3853
|
+
break
|
3825
3854
|
case "\\fbox":
|
3826
|
-
node.setAttribute("notation", "box");
|
3827
3855
|
node.style = { padding: "3pt", border: "1px solid" };
|
3828
3856
|
break
|
3829
3857
|
case "\\fcolorbox":
|
@@ -3843,7 +3871,6 @@ const mathmlBuilder$8 = (group, style) => {
|
|
3843
3871
|
break
|
3844
3872
|
}
|
3845
3873
|
case "\\xcancel":
|
3846
|
-
node.setAttribute("notation", "updiagonalstrike downdiagonalstrike");
|
3847
3874
|
node.classes.push("xcancel");
|
3848
3875
|
break
|
3849
3876
|
}
|
@@ -3938,7 +3965,7 @@ defineFunction({
|
|
3938
3965
|
|
3939
3966
|
defineFunction({
|
3940
3967
|
type: "enclose",
|
3941
|
-
names: ["\\angl", "\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\overline"],
|
3968
|
+
names: ["\\angl", "\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\overline", "\\boxed"],
|
3942
3969
|
// , "\\phase", "\\longdiv"
|
3943
3970
|
props: {
|
3944
3971
|
numArgs: 1
|
@@ -6804,8 +6831,6 @@ defineFunction({
|
|
6804
6831
|
}
|
6805
6832
|
});
|
6806
6833
|
|
6807
|
-
const sign = num => num >= 0 ? "+" : "-";
|
6808
|
-
|
6809
6834
|
// \raise, \lower, and \raisebox
|
6810
6835
|
|
6811
6836
|
const mathmlBuilder = (group, style) => {
|
@@ -6813,11 +6838,13 @@ const mathmlBuilder = (group, style) => {
|
|
6813
6838
|
const node = new mathMLTree.MathNode("mpadded", [buildGroup$1(group.body, newStyle)]);
|
6814
6839
|
const dy = calculateSize(group.dy, style);
|
6815
6840
|
node.setAttribute("voffset", dy.number + dy.unit);
|
6816
|
-
|
6817
|
-
//
|
6818
|
-
|
6819
|
-
|
6820
|
-
|
6841
|
+
// Add padding, which acts to increase height in Chromium.
|
6842
|
+
// TODO: Figure out some way to change height in Firefox w/o breaking Chromium.
|
6843
|
+
if (dy.number > 0) {
|
6844
|
+
node.style.padding = dy.number + dy.unit + " 0 0 0";
|
6845
|
+
} else {
|
6846
|
+
node.style.padding = "0 0 " + Math.abs(dy.number) + dy.unit + " 0";
|
6847
|
+
}
|
6821
6848
|
return node
|
6822
6849
|
};
|
6823
6850
|
|
@@ -8446,9 +8473,6 @@ defineMacro("\u22ee", "\\vdots");
|
|
8446
8473
|
//\newcommand{\substack}[1]{\subarray{c}#1\endsubarray}
|
8447
8474
|
defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}");
|
8448
8475
|
|
8449
|
-
// \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}}
|
8450
|
-
defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}");
|
8451
|
-
|
8452
8476
|
// \def\iff{\DOTSB\;\Longleftrightarrow\;}
|
8453
8477
|
// \def\implies{\DOTSB\;\Longrightarrow\;}
|
8454
8478
|
// \def\impliedby{\DOTSB\;\Longleftarrow\;}
|
@@ -8697,7 +8721,7 @@ defineMacro(
|
|
8697
8721
|
defineMacro(
|
8698
8722
|
"\\Temml",
|
8699
8723
|
// eslint-disable-next-line max-len
|
8700
|
-
"\\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}}"
|
8724
|
+
"\\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}}"
|
8701
8725
|
);
|
8702
8726
|
|
8703
8727
|
// \DeclareRobustCommand\hspace{\@ifstar\@hspacer\@hspace}
|
@@ -12877,7 +12901,7 @@ class Style {
|
|
12877
12901
|
* https://mit-license.org/
|
12878
12902
|
*/
|
12879
12903
|
|
12880
|
-
const version = "0.10.
|
12904
|
+
const version = "0.10.14";
|
12881
12905
|
|
12882
12906
|
function postProcess(block) {
|
12883
12907
|
const labelMap = {};
|