temml 0.11.9 → 0.11.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/Temml-Asana.css +7 -0
- package/dist/Temml-Latin-Modern.css +7 -0
- package/dist/Temml-Libertinus.css +7 -0
- package/dist/Temml-Local.css +7 -0
- package/dist/Temml-NotoSans.css +7 -0
- package/dist/Temml-STIX2.css +7 -0
- package/dist/temml.cjs +35 -29
- package/dist/temml.js +35 -29
- package/dist/temml.min.js +1 -1
- package/dist/temml.mjs +35 -29
- package/dist/temmlPostProcess.js +1 -1
- package/package.json +1 -1
- package/src/buildMathML.js +3 -4
- package/src/environments/array.js +4 -16
- package/src/environments/cd.js +6 -6
- package/src/functions/arrow.js +1 -1
- package/src/functions/lap.js +2 -2
- package/src/functions/sqrt.js +19 -0
- package/src/postProcess.js +1 -1
package/README.md
CHANGED
package/dist/Temml-Asana.css
CHANGED
@@ -117,6 +117,9 @@ menclose {
|
|
117
117
|
text-align: left;
|
118
118
|
}
|
119
119
|
|
120
|
+
/* For CD labels that grow to the left in Firefox and WebKit */
|
121
|
+
.tml-shift-left { margin-left:-200% }
|
122
|
+
|
120
123
|
/* Styles for Chromium only */
|
121
124
|
@supports (not (-webkit-backdrop-filter: blur(1px))) and (not (-moz-appearance: none)) {
|
122
125
|
/* Italic correction on accents */
|
@@ -138,6 +141,10 @@ menclose {
|
|
138
141
|
.chr-lrg-vec {
|
139
142
|
transform: scale(0.75) translate(0.21em, 0)
|
140
143
|
}
|
144
|
+
|
145
|
+
/* For CD labels that grow to the left */
|
146
|
+
.tml-shift-left { margin-left:-100% }
|
147
|
+
|
141
148
|
/* MathML Core & Chromium do not support the MathML 3.0 element <menclose> attributes. */
|
142
149
|
/* So use styles. */
|
143
150
|
menclose {
|
@@ -131,6 +131,9 @@ menclose {
|
|
131
131
|
text-align: left;
|
132
132
|
}
|
133
133
|
|
134
|
+
/* For CD labels that grow to the left in Firefox and WebKit */
|
135
|
+
.tml-shift-left { margin-left:-200% }
|
136
|
+
|
134
137
|
/* Styles for Chromium only */
|
135
138
|
@supports (not (-webkit-backdrop-filter: blur(1px))) and (not (-moz-appearance: none)) {
|
136
139
|
/* Italic correction on accents */
|
@@ -152,6 +155,10 @@ menclose {
|
|
152
155
|
.chr-lrg-vec {
|
153
156
|
transform: scale(0.75) translate(0.21em, 0)
|
154
157
|
}
|
158
|
+
|
159
|
+
/* For CD labels that grow to the left */
|
160
|
+
.tml-shift-left { margin-left:-100% }
|
161
|
+
|
155
162
|
/* MathML Core & Chromium do not support the MathML 3.0 element <menclose> attributes. */
|
156
163
|
/* So use styles. */
|
157
164
|
menclose {
|
@@ -133,6 +133,9 @@ menclose {
|
|
133
133
|
text-align: left;
|
134
134
|
}
|
135
135
|
|
136
|
+
/* For CD labels that grow to the left in Firefox and WebKit */
|
137
|
+
.tml-shift-left { margin-left:-200% }
|
138
|
+
|
136
139
|
/* Styles for Chromium only */
|
137
140
|
@supports (not (-webkit-backdrop-filter: blur(1px))) and (not (-moz-appearance: none)) {
|
138
141
|
/* Italic correction on accents */
|
@@ -154,6 +157,10 @@ menclose {
|
|
154
157
|
.chr-lrg-vec {
|
155
158
|
transform: scale(0.75) translate(0.21em, 0)
|
156
159
|
}
|
160
|
+
|
161
|
+
/* For CD labels that grow to the left */
|
162
|
+
.tml-shift-left { margin-left:-100% }
|
163
|
+
|
157
164
|
/* MathML Core & Chromium do not support the MathML 3.0 element <menclose> attributes. */
|
158
165
|
/* So use styles. */
|
159
166
|
menclose {
|
package/dist/Temml-Local.css
CHANGED
@@ -124,6 +124,9 @@ menclose {
|
|
124
124
|
text-align: left;
|
125
125
|
}
|
126
126
|
|
127
|
+
/* For CD labels that grow to the left in Firefox and WebKit */
|
128
|
+
.tml-shift-left { margin-left:-200% }
|
129
|
+
|
127
130
|
/* Styles for Chromium only */
|
128
131
|
@supports (not (-webkit-backdrop-filter: blur(1px))) and (not (-moz-appearance: none)) {
|
129
132
|
/* Italic correction on accents */
|
@@ -145,6 +148,10 @@ menclose {
|
|
145
148
|
.chr-lrg-vec {
|
146
149
|
transform: scale(0.75) translate(0.21em, 0)
|
147
150
|
}
|
151
|
+
|
152
|
+
/* For CD labels that grow to the left */
|
153
|
+
.tml-shift-left { margin-left:-100% }
|
154
|
+
|
148
155
|
/* MathML Core & Chromium do not support the MathML 3.0 element <menclose> attributes. */
|
149
156
|
/* So use styles. */
|
150
157
|
menclose {
|
package/dist/Temml-NotoSans.css
CHANGED
@@ -126,6 +126,9 @@ menclose {
|
|
126
126
|
text-align: left;
|
127
127
|
}
|
128
128
|
|
129
|
+
/* For CD labels that grow to the left in Firefox and WebKit */
|
130
|
+
.tml-shift-left { margin-left:-200% }
|
131
|
+
|
129
132
|
/* Styles for Chromium only */
|
130
133
|
@supports (not (-webkit-backdrop-filter: blur(1px))) and (not (-moz-appearance: none)) {
|
131
134
|
/* Italic correction on accents */
|
@@ -147,6 +150,10 @@ menclose {
|
|
147
150
|
.chr-lrg-vec {
|
148
151
|
transform: scale(0.75) translate(0.21em, 0)
|
149
152
|
}
|
153
|
+
|
154
|
+
/* For CD labels that grow to the left */
|
155
|
+
.tml-shift-left { margin-left:-100% }
|
156
|
+
|
150
157
|
/* MathML Core & Chromium do not support the MathML 3.0 element <menclose> attributes. */
|
151
158
|
/* So use styles. */
|
152
159
|
menclose {
|
package/dist/Temml-STIX2.css
CHANGED
@@ -123,6 +123,9 @@ menclose {
|
|
123
123
|
text-align: left;
|
124
124
|
}
|
125
125
|
|
126
|
+
/* For CD labels that grow to the left in Firefox and WebKit */
|
127
|
+
.tml-shift-left { margin-left:-200% }
|
128
|
+
|
126
129
|
/* Styles for Chromium only */
|
127
130
|
@supports (not (-webkit-backdrop-filter: blur(1px))) and (not (-moz-appearance: none)) {
|
128
131
|
/* Italic correction on accents */
|
@@ -144,6 +147,10 @@ menclose {
|
|
144
147
|
.chr-lrg-vec {
|
145
148
|
transform: scale(0.75) translate(0.21em, 0)
|
146
149
|
}
|
150
|
+
|
151
|
+
/* For CD labels that grow to the left */
|
152
|
+
.tml-shift-left { margin-left:-100% }
|
153
|
+
|
147
154
|
/* MathML Core & Chromium do not support the MathML 3.0 element <menclose> attributes. */
|
148
155
|
/* So use styles. */
|
149
156
|
menclose {
|
package/dist/temml.cjs
CHANGED
@@ -2405,13 +2405,12 @@ const getLabel = parent => {
|
|
2405
2405
|
|
2406
2406
|
const taggedExpression = (expression, tag, style, leqno) => {
|
2407
2407
|
tag = buildExpressionRow(tag[0].body, style);
|
2408
|
-
tag = consolidateText(tag);
|
2409
|
-
tag.classes.push("tml-tag");
|
2408
|
+
tag = consolidateText(tag); // tag is now an <mtext> element
|
2409
|
+
tag.classes.push("tml-tag"); // to be available for \ref
|
2410
2410
|
|
2411
2411
|
const label = getLabel(expression); // from a \label{} function.
|
2412
2412
|
expression = new mathMLTree.MathNode("mtd", [expression]);
|
2413
2413
|
const rowArray = [glue$1(), expression, glue$1()];
|
2414
|
-
rowArray[leqno ? 0 : 2].classes.push(leqno ? "tml-left" : "tml-right");
|
2415
2414
|
rowArray[leqno ? 0 : 2].children.push(tag);
|
2416
2415
|
const mtr = new mathMLTree.MathNode("mtr", rowArray, ["tml-tageqn"]);
|
2417
2416
|
if (label) { mtr.setAttribute("id", label); }
|
@@ -2822,7 +2821,7 @@ const paddedNode = (group, lspace = 0.3, rspace = 0, mustSmash = false) => {
|
|
2822
2821
|
if (mustSmash) {
|
2823
2822
|
// Used for the bottom arrow in a {CD} environment
|
2824
2823
|
const mpadded = new mathMLTree.MathNode("mpadded", row);
|
2825
|
-
mpadded.setAttribute("height", "0");
|
2824
|
+
mpadded.setAttribute("height", "0.1px"); // Don't use 0. WebKit would hide it.
|
2826
2825
|
return mpadded
|
2827
2826
|
} else {
|
2828
2827
|
return new mathMLTree.MathNode("mrow", row)
|
@@ -3314,19 +3313,19 @@ defineFunction({
|
|
3314
3313
|
return new mathMLTree.MathNode("mrow", style) // empty label
|
3315
3314
|
}
|
3316
3315
|
// Abuse an <mtable> to create vertically centered content.
|
3317
|
-
const
|
3316
|
+
const mrow = buildGroup$1(group.label, style);
|
3317
|
+
if (group.side === "left") {
|
3318
|
+
mrow.classes.push("tml-shift-left");
|
3319
|
+
}
|
3320
|
+
const mtd = new mathMLTree.MathNode("mtd", [mrow]);
|
3318
3321
|
mtd.style.padding = "0";
|
3319
3322
|
const mtr = new mathMLTree.MathNode("mtr", [mtd]);
|
3320
3323
|
const mtable = new mathMLTree.MathNode("mtable", [mtr]);
|
3321
3324
|
const label = new mathMLTree.MathNode("mpadded", [mtable]);
|
3322
3325
|
// Set the label width to zero so that the arrow will be centered under the corner cell.
|
3323
|
-
label.setAttribute("width", "0");
|
3326
|
+
label.setAttribute("width", "0.1px"); // Don't use 0. WebKit would hide it.
|
3324
3327
|
label.setAttribute("displaystyle", "false");
|
3325
3328
|
label.setAttribute("scriptlevel", "1");
|
3326
|
-
if (group.side === "left") {
|
3327
|
-
label.style.display = "flex";
|
3328
|
-
label.style.justifyContent = "flex-end";
|
3329
|
-
}
|
3330
3329
|
return label;
|
3331
3330
|
}
|
3332
3331
|
});
|
@@ -6474,7 +6473,6 @@ const mathmlBuilder$9 = function(group, style) {
|
|
6474
6473
|
|
6475
6474
|
if (group.envClasses.includes("multline")) {
|
6476
6475
|
const align = i === 0 ? "left" : i === numRows - 1 ? "right" : "center";
|
6477
|
-
mtd.setAttribute("columnalign", align);
|
6478
6476
|
if (align !== "center") {
|
6479
6477
|
mtd.classes.push("tml-" + align);
|
6480
6478
|
}
|
@@ -6504,10 +6502,8 @@ const mathmlBuilder$9 = function(group, style) {
|
|
6504
6502
|
row.push(glue(group));
|
6505
6503
|
if (group.leqno) {
|
6506
6504
|
row[0].children.push(tagElement);
|
6507
|
-
row[0].classes.push("tml-left");
|
6508
6505
|
} else {
|
6509
6506
|
row[row.length - 1].children.push(tagElement);
|
6510
|
-
row[row.length - 1].classes.push("tml-right");
|
6511
6507
|
}
|
6512
6508
|
}
|
6513
6509
|
}
|
@@ -6548,8 +6544,10 @@ const mathmlBuilder$9 = function(group, style) {
|
|
6548
6544
|
}
|
6549
6545
|
}
|
6550
6546
|
if (mustSquashRow) {
|
6551
|
-
// All the cell contents are \hphantom. Squash the
|
6547
|
+
// All the cell contents are \hphantom. Squash the cell.
|
6552
6548
|
for (let j = 0; j < mtr.children.length; j++) {
|
6549
|
+
mtr.children[j].style.display = "block"; // necessary in Firefox only
|
6550
|
+
mtr.children[j].style.height = "0"; // necessary in Firefox only
|
6553
6551
|
mtr.children[j].style.paddingTop = "0";
|
6554
6552
|
mtr.children[j].style.paddingBottom = "0";
|
6555
6553
|
}
|
@@ -6636,7 +6634,7 @@ const mathmlBuilder$9 = function(group, style) {
|
|
6636
6634
|
}
|
6637
6635
|
if (group.autoTag) {
|
6638
6636
|
const k = group.leqno ? 0 : row.children.length - 1;
|
6639
|
-
row.children[k].classes = [
|
6637
|
+
row.children[k].classes = []; // Default is center.
|
6640
6638
|
}
|
6641
6639
|
}
|
6642
6640
|
if (row.children.length > 1 && group.envClasses.includes("cases")) {
|
@@ -6667,7 +6665,6 @@ const mathmlBuilder$9 = function(group, style) {
|
|
6667
6665
|
}
|
6668
6666
|
|
6669
6667
|
// Column separator lines and column alignment
|
6670
|
-
let align = "";
|
6671
6668
|
|
6672
6669
|
if (group.cols && group.cols.length > 0) {
|
6673
6670
|
const cols = group.cols;
|
@@ -6696,7 +6693,6 @@ const mathmlBuilder$9 = function(group, style) {
|
|
6696
6693
|
for (let i = iStart; i < iEnd; i++) {
|
6697
6694
|
if (cols[i].type === "align") {
|
6698
6695
|
const colAlign = alignMap[cols[i].align];
|
6699
|
-
align += colAlign;
|
6700
6696
|
iCol += 1;
|
6701
6697
|
for (const row of table.children) {
|
6702
6698
|
if (colAlign.trim() !== "center" && iCol < row.children.length) {
|
@@ -6734,15 +6730,6 @@ const mathmlBuilder$9 = function(group, style) {
|
|
6734
6730
|
}
|
6735
6731
|
}
|
6736
6732
|
}
|
6737
|
-
if (group.autoTag) {
|
6738
|
-
// allow for glue cells on each side
|
6739
|
-
align = "left " + (align.length > 0 ? align : "center ") + "right ";
|
6740
|
-
}
|
6741
|
-
if (align) {
|
6742
|
-
// Firefox reads this attribute, not the -webkit-left|right written above.
|
6743
|
-
// TODO: When Chrome no longer needs "-webkit-", use CSS and delete the next line.
|
6744
|
-
table.setAttribute("columnalign", align.trim());
|
6745
|
-
}
|
6746
6733
|
|
6747
6734
|
if (group.envClasses.includes("small")) {
|
6748
6735
|
// A small array. Wrap in scriptstyle.
|
@@ -9384,7 +9371,7 @@ defineFunction({
|
|
9384
9371
|
const phantomInner = buildExpression(ordargument(group.body), style);
|
9385
9372
|
const phantom = new mathMLTree.MathNode("mphantom", phantomInner);
|
9386
9373
|
strut = new mathMLTree.MathNode("mpadded", [phantom]);
|
9387
|
-
strut.setAttribute("width", "
|
9374
|
+
strut.setAttribute("width", "0.1px"); // Don't use 0. WebKit would hide it.
|
9388
9375
|
}
|
9389
9376
|
|
9390
9377
|
const inner = buildGroup$1(group.body, style);
|
@@ -9413,7 +9400,7 @@ defineFunction({
|
|
9413
9400
|
node.style.justifyContent = "center";
|
9414
9401
|
}
|
9415
9402
|
}
|
9416
|
-
node.setAttribute("width", "
|
9403
|
+
node.setAttribute("width", "0.1px"); // Don't use 0. WebKit would hide it.
|
9417
9404
|
return node
|
9418
9405
|
}
|
9419
9406
|
});
|
@@ -10789,6 +10776,11 @@ defineFunction({
|
|
10789
10776
|
}
|
10790
10777
|
});
|
10791
10778
|
|
10779
|
+
// Letters that are x-height w/o a descender.
|
10780
|
+
const xHeights = ['a', 'c', 'e', 'ı', 'm', 'n', 'o', 'r', 's', 'u', 'v', 'w', 'x', 'z', 'α',
|
10781
|
+
'ε', 'ι', 'κ', 'ν', 'ο', 'π', 'σ', 'τ', 'υ', 'ω', '\\alpha', '\\epsilon', "\\iota",
|
10782
|
+
'\\kappa', '\\nu', '\\omega', '\\pi', '\\tau', '\\omega'];
|
10783
|
+
|
10792
10784
|
defineFunction({
|
10793
10785
|
type: "sqrt",
|
10794
10786
|
names: ["\\sqrt"],
|
@@ -10799,6 +10791,20 @@ defineFunction({
|
|
10799
10791
|
handler({ parser }, args, optArgs) {
|
10800
10792
|
const index = optArgs[0];
|
10801
10793
|
const body = args[0];
|
10794
|
+
// Check if the body consists entirely of an x-height letter.
|
10795
|
+
// TODO: Remove this check after Chromium is fixed.
|
10796
|
+
if (body.body && body.body.length === 1 && body.body[0].text &&
|
10797
|
+
xHeights.includes(body.body[0].text)) {
|
10798
|
+
// Chromium does not put enough space above an x-height letter.
|
10799
|
+
// Insert a strut.
|
10800
|
+
body.body.push({
|
10801
|
+
"type": "rule",
|
10802
|
+
"mode": "math",
|
10803
|
+
"shift": null,
|
10804
|
+
"width": { "number": 0, "unit": "pt" },
|
10805
|
+
"height": { "number": 0.5, "unit": "em" }
|
10806
|
+
});
|
10807
|
+
}
|
10802
10808
|
return {
|
10803
10809
|
type: "sqrt",
|
10804
10810
|
mode: parser.mode,
|
@@ -14022,7 +14028,7 @@ class Style {
|
|
14022
14028
|
* https://mit-license.org/
|
14023
14029
|
*/
|
14024
14030
|
|
14025
|
-
const version = "0.11.
|
14031
|
+
const version = "0.11.10";
|
14026
14032
|
|
14027
14033
|
function postProcess(block) {
|
14028
14034
|
const labelMap = {};
|
package/dist/temml.js
CHANGED
@@ -2406,13 +2406,12 @@ var temml = (function () {
|
|
2406
2406
|
|
2407
2407
|
const taggedExpression = (expression, tag, style, leqno) => {
|
2408
2408
|
tag = buildExpressionRow(tag[0].body, style);
|
2409
|
-
tag = consolidateText(tag);
|
2410
|
-
tag.classes.push("tml-tag");
|
2409
|
+
tag = consolidateText(tag); // tag is now an <mtext> element
|
2410
|
+
tag.classes.push("tml-tag"); // to be available for \ref
|
2411
2411
|
|
2412
2412
|
const label = getLabel(expression); // from a \label{} function.
|
2413
2413
|
expression = new mathMLTree.MathNode("mtd", [expression]);
|
2414
2414
|
const rowArray = [glue$1(), expression, glue$1()];
|
2415
|
-
rowArray[leqno ? 0 : 2].classes.push(leqno ? "tml-left" : "tml-right");
|
2416
2415
|
rowArray[leqno ? 0 : 2].children.push(tag);
|
2417
2416
|
const mtr = new mathMLTree.MathNode("mtr", rowArray, ["tml-tageqn"]);
|
2418
2417
|
if (label) { mtr.setAttribute("id", label); }
|
@@ -2823,7 +2822,7 @@ var temml = (function () {
|
|
2823
2822
|
if (mustSmash) {
|
2824
2823
|
// Used for the bottom arrow in a {CD} environment
|
2825
2824
|
const mpadded = new mathMLTree.MathNode("mpadded", row);
|
2826
|
-
mpadded.setAttribute("height", "0");
|
2825
|
+
mpadded.setAttribute("height", "0.1px"); // Don't use 0. WebKit would hide it.
|
2827
2826
|
return mpadded
|
2828
2827
|
} else {
|
2829
2828
|
return new mathMLTree.MathNode("mrow", row)
|
@@ -3315,19 +3314,19 @@ var temml = (function () {
|
|
3315
3314
|
return new mathMLTree.MathNode("mrow", style) // empty label
|
3316
3315
|
}
|
3317
3316
|
// Abuse an <mtable> to create vertically centered content.
|
3318
|
-
const
|
3317
|
+
const mrow = buildGroup$1(group.label, style);
|
3318
|
+
if (group.side === "left") {
|
3319
|
+
mrow.classes.push("tml-shift-left");
|
3320
|
+
}
|
3321
|
+
const mtd = new mathMLTree.MathNode("mtd", [mrow]);
|
3319
3322
|
mtd.style.padding = "0";
|
3320
3323
|
const mtr = new mathMLTree.MathNode("mtr", [mtd]);
|
3321
3324
|
const mtable = new mathMLTree.MathNode("mtable", [mtr]);
|
3322
3325
|
const label = new mathMLTree.MathNode("mpadded", [mtable]);
|
3323
3326
|
// Set the label width to zero so that the arrow will be centered under the corner cell.
|
3324
|
-
label.setAttribute("width", "0");
|
3327
|
+
label.setAttribute("width", "0.1px"); // Don't use 0. WebKit would hide it.
|
3325
3328
|
label.setAttribute("displaystyle", "false");
|
3326
3329
|
label.setAttribute("scriptlevel", "1");
|
3327
|
-
if (group.side === "left") {
|
3328
|
-
label.style.display = "flex";
|
3329
|
-
label.style.justifyContent = "flex-end";
|
3330
|
-
}
|
3331
3330
|
return label;
|
3332
3331
|
}
|
3333
3332
|
});
|
@@ -4561,7 +4560,6 @@ var temml = (function () {
|
|
4561
4560
|
|
4562
4561
|
if (group.envClasses.includes("multline")) {
|
4563
4562
|
const align = i === 0 ? "left" : i === numRows - 1 ? "right" : "center";
|
4564
|
-
mtd.setAttribute("columnalign", align);
|
4565
4563
|
if (align !== "center") {
|
4566
4564
|
mtd.classes.push("tml-" + align);
|
4567
4565
|
}
|
@@ -4591,10 +4589,8 @@ var temml = (function () {
|
|
4591
4589
|
row.push(glue(group));
|
4592
4590
|
if (group.leqno) {
|
4593
4591
|
row[0].children.push(tagElement);
|
4594
|
-
row[0].classes.push("tml-left");
|
4595
4592
|
} else {
|
4596
4593
|
row[row.length - 1].children.push(tagElement);
|
4597
|
-
row[row.length - 1].classes.push("tml-right");
|
4598
4594
|
}
|
4599
4595
|
}
|
4600
4596
|
}
|
@@ -4635,8 +4631,10 @@ var temml = (function () {
|
|
4635
4631
|
}
|
4636
4632
|
}
|
4637
4633
|
if (mustSquashRow) {
|
4638
|
-
// All the cell contents are \hphantom. Squash the
|
4634
|
+
// All the cell contents are \hphantom. Squash the cell.
|
4639
4635
|
for (let j = 0; j < mtr.children.length; j++) {
|
4636
|
+
mtr.children[j].style.display = "block"; // necessary in Firefox only
|
4637
|
+
mtr.children[j].style.height = "0"; // necessary in Firefox only
|
4640
4638
|
mtr.children[j].style.paddingTop = "0";
|
4641
4639
|
mtr.children[j].style.paddingBottom = "0";
|
4642
4640
|
}
|
@@ -4723,7 +4721,7 @@ var temml = (function () {
|
|
4723
4721
|
}
|
4724
4722
|
if (group.autoTag) {
|
4725
4723
|
const k = group.leqno ? 0 : row.children.length - 1;
|
4726
|
-
row.children[k].classes = [
|
4724
|
+
row.children[k].classes = []; // Default is center.
|
4727
4725
|
}
|
4728
4726
|
}
|
4729
4727
|
if (row.children.length > 1 && group.envClasses.includes("cases")) {
|
@@ -4754,7 +4752,6 @@ var temml = (function () {
|
|
4754
4752
|
}
|
4755
4753
|
|
4756
4754
|
// Column separator lines and column alignment
|
4757
|
-
let align = "";
|
4758
4755
|
|
4759
4756
|
if (group.cols && group.cols.length > 0) {
|
4760
4757
|
const cols = group.cols;
|
@@ -4783,7 +4780,6 @@ var temml = (function () {
|
|
4783
4780
|
for (let i = iStart; i < iEnd; i++) {
|
4784
4781
|
if (cols[i].type === "align") {
|
4785
4782
|
const colAlign = alignMap[cols[i].align];
|
4786
|
-
align += colAlign;
|
4787
4783
|
iCol += 1;
|
4788
4784
|
for (const row of table.children) {
|
4789
4785
|
if (colAlign.trim() !== "center" && iCol < row.children.length) {
|
@@ -4821,15 +4817,6 @@ var temml = (function () {
|
|
4821
4817
|
}
|
4822
4818
|
}
|
4823
4819
|
}
|
4824
|
-
if (group.autoTag) {
|
4825
|
-
// allow for glue cells on each side
|
4826
|
-
align = "left " + (align.length > 0 ? align : "center ") + "right ";
|
4827
|
-
}
|
4828
|
-
if (align) {
|
4829
|
-
// Firefox reads this attribute, not the -webkit-left|right written above.
|
4830
|
-
// TODO: When Chrome no longer needs "-webkit-", use CSS and delete the next line.
|
4831
|
-
table.setAttribute("columnalign", align.trim());
|
4832
|
-
}
|
4833
4820
|
|
4834
4821
|
if (group.envClasses.includes("small")) {
|
4835
4822
|
// A small array. Wrap in scriptstyle.
|
@@ -7471,7 +7458,7 @@ var temml = (function () {
|
|
7471
7458
|
const phantomInner = buildExpression(ordargument(group.body), style);
|
7472
7459
|
const phantom = new mathMLTree.MathNode("mphantom", phantomInner);
|
7473
7460
|
strut = new mathMLTree.MathNode("mpadded", [phantom]);
|
7474
|
-
strut.setAttribute("width", "
|
7461
|
+
strut.setAttribute("width", "0.1px"); // Don't use 0. WebKit would hide it.
|
7475
7462
|
}
|
7476
7463
|
|
7477
7464
|
const inner = buildGroup$1(group.body, style);
|
@@ -7500,7 +7487,7 @@ var temml = (function () {
|
|
7500
7487
|
node.style.justifyContent = "center";
|
7501
7488
|
}
|
7502
7489
|
}
|
7503
|
-
node.setAttribute("width", "
|
7490
|
+
node.setAttribute("width", "0.1px"); // Don't use 0. WebKit would hide it.
|
7504
7491
|
return node
|
7505
7492
|
}
|
7506
7493
|
});
|
@@ -8876,6 +8863,11 @@ var temml = (function () {
|
|
8876
8863
|
}
|
8877
8864
|
});
|
8878
8865
|
|
8866
|
+
// Letters that are x-height w/o a descender.
|
8867
|
+
const xHeights = ['a', 'c', 'e', 'ı', 'm', 'n', 'o', 'r', 's', 'u', 'v', 'w', 'x', 'z', 'α',
|
8868
|
+
'ε', 'ι', 'κ', 'ν', 'ο', 'π', 'σ', 'τ', 'υ', 'ω', '\\alpha', '\\epsilon', "\\iota",
|
8869
|
+
'\\kappa', '\\nu', '\\omega', '\\pi', '\\tau', '\\omega'];
|
8870
|
+
|
8879
8871
|
defineFunction({
|
8880
8872
|
type: "sqrt",
|
8881
8873
|
names: ["\\sqrt"],
|
@@ -8886,6 +8878,20 @@ var temml = (function () {
|
|
8886
8878
|
handler({ parser }, args, optArgs) {
|
8887
8879
|
const index = optArgs[0];
|
8888
8880
|
const body = args[0];
|
8881
|
+
// Check if the body consists entirely of an x-height letter.
|
8882
|
+
// TODO: Remove this check after Chromium is fixed.
|
8883
|
+
if (body.body && body.body.length === 1 && body.body[0].text &&
|
8884
|
+
xHeights.includes(body.body[0].text)) {
|
8885
|
+
// Chromium does not put enough space above an x-height letter.
|
8886
|
+
// Insert a strut.
|
8887
|
+
body.body.push({
|
8888
|
+
"type": "rule",
|
8889
|
+
"mode": "math",
|
8890
|
+
"shift": null,
|
8891
|
+
"width": { "number": 0, "unit": "pt" },
|
8892
|
+
"height": { "number": 0.5, "unit": "em" }
|
8893
|
+
});
|
8894
|
+
}
|
8889
8895
|
return {
|
8890
8896
|
type: "sqrt",
|
8891
8897
|
mode: parser.mode,
|
@@ -12109,7 +12115,7 @@ var temml = (function () {
|
|
12109
12115
|
* https://mit-license.org/
|
12110
12116
|
*/
|
12111
12117
|
|
12112
|
-
const version = "0.11.
|
12118
|
+
const version = "0.11.10";
|
12113
12119
|
|
12114
12120
|
function postProcess(block) {
|
12115
12121
|
const labelMap = {};
|