temml 0.11.1 → 0.11.2
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-Local.css +6 -1
- package/dist/{Temml-Fira.css → Temml-NotoSans.css} +13 -20
- package/dist/temml.cjs +53 -38
- package/dist/temml.js +53 -38
- package/dist/temml.min.js +1 -1
- package/dist/temml.mjs +53 -38
- package/dist/temmlPostProcess.js +1 -1
- package/package.json +1 -1
- package/src/Parser.js +7 -1
- package/src/functions/arrow.js +1 -1
- package/src/functions/mclass.js +15 -15
- package/src/functions/operatorname.js +1 -1
- package/src/functions/supsub.js +1 -1
- package/src/functions/symbolsOp.js +9 -0
- package/src/functions/symbolsOrd.js +3 -1
- package/src/postProcess.js +1 -1
- package/src/symbols.js +2 -2
package/README.md
CHANGED
package/dist/Temml-Local.css
CHANGED
@@ -12,7 +12,7 @@ Unicode range 1D49C to 1D4B5.
|
|
12
12
|
}
|
13
13
|
|
14
14
|
math {
|
15
|
-
font-family: "Cambria Math", 'STIXTwoMath-Regular', math;
|
15
|
+
font-family: "Cambria Math", 'STIXTwoMath-Regular', 'NotoSansMath-Regular', math;
|
16
16
|
font-style: normal;
|
17
17
|
font-weight: normal;
|
18
18
|
line-height: normal;
|
@@ -34,6 +34,11 @@ math * {
|
|
34
34
|
* Not in Chromium, which recognizes display: "block math" written inline. */
|
35
35
|
math.tml-display { display: block; }
|
36
36
|
|
37
|
+
*.mathcal {
|
38
|
+
/* NotoSans */
|
39
|
+
font-feature-settings: 'ss01';
|
40
|
+
}
|
41
|
+
|
37
42
|
math .mathscr {
|
38
43
|
font-family: "Temml";
|
39
44
|
}
|
@@ -1,24 +1,13 @@
|
|
1
1
|
/*
|
2
|
-
|
2
|
+
Noto Math fonts are released under the SIL OPEN FONT LICENSE Version 1.1.
|
3
3
|
|
4
|
-
The
|
5
|
-
|
6
|
-
|
7
|
-
The Temml.woff2 is a clone of KaTeX_Script-Regular, except that the code points
|
8
|
-
have been changed from ASCII to Unicode Mathematical Alphanumeric Symbols Script capitals,
|
9
|
-
Unicode range 1D49C to 1D4B5.
|
4
|
+
The NotoMath font has been obtained from
|
5
|
+
https://gwfh.mranftl.com/fonts/noto-sans-math?subsets=math
|
10
6
|
*/
|
11
7
|
|
12
8
|
@font-face {
|
13
|
-
font-family:
|
14
|
-
src: url('
|
15
|
-
font-weight: normal;
|
16
|
-
font-style: normal;
|
17
|
-
}
|
18
|
-
|
19
|
-
@font-face {
|
20
|
-
font-family: Fira Math;
|
21
|
-
src: url('FiraMath-Regular.woff2');
|
9
|
+
font-family: NotoSans Math;
|
10
|
+
src: url('noto-sans-math-v15-math-regular.woff2');
|
22
11
|
}
|
23
12
|
|
24
13
|
math {
|
@@ -40,20 +29,24 @@ math * {
|
|
40
29
|
}
|
41
30
|
|
42
31
|
math {
|
43
|
-
font-family: "
|
32
|
+
font-family: "NotoSans Math", math;
|
44
33
|
}
|
45
34
|
|
46
35
|
/* Next line is active in Firefox and Safari.
|
47
36
|
* Not in Chromium, which recognizes display: "block math" written inline. */
|
48
37
|
math.tml-display { display: block; }
|
49
38
|
|
50
|
-
|
51
|
-
font-family: "
|
39
|
+
math .mathscr {
|
40
|
+
font-family: "ssty1";
|
41
|
+
}
|
42
|
+
|
43
|
+
*.mathcal {
|
44
|
+
font-feature-settings: 'ss01';
|
52
45
|
}
|
53
46
|
|
54
47
|
/* Chromium prime alignment */
|
55
48
|
mo.tml-prime {
|
56
|
-
font-
|
49
|
+
font-feature-settings: 'ssty';
|
57
50
|
}
|
58
51
|
|
59
52
|
/* Prevent f' from overlapping in Chromium */
|
package/dist/temml.cjs
CHANGED
@@ -1772,7 +1772,7 @@ defineSymbol(text, accent, "\u02d9", "\\."); // dot above
|
|
1772
1772
|
defineSymbol(text, accent, "\u00b8", "\\c"); // cedilla
|
1773
1773
|
defineSymbol(text, accent, "\u02da", "\\r"); // ring above
|
1774
1774
|
defineSymbol(text, accent, "\u02c7", "\\v"); // caron
|
1775
|
-
defineSymbol(text, accent, "\u00a8", '\\"'); //
|
1775
|
+
defineSymbol(text, accent, "\u00a8", '\\"'); // diaeresis
|
1776
1776
|
defineSymbol(text, accent, "\u02dd", "\\H"); // double acute
|
1777
1777
|
defineSymbol(math, accent, "\u02ca", "\\'"); // acute
|
1778
1778
|
defineSymbol(math, accent, "\u02cb", "\\`"); // grave
|
@@ -1784,7 +1784,7 @@ defineSymbol(math, accent, "\u02d9", "\\."); // dot above
|
|
1784
1784
|
defineSymbol(math, accent, "\u00b8", "\\c"); // cedilla
|
1785
1785
|
defineSymbol(math, accent, "\u02da", "\\r"); // ring above
|
1786
1786
|
defineSymbol(math, accent, "\u02c7", "\\v"); // caron
|
1787
|
-
defineSymbol(math, accent, "\u00a8", '\\"'); //
|
1787
|
+
defineSymbol(math, accent, "\u00a8", '\\"'); // diaeresis
|
1788
1788
|
defineSymbol(math, accent, "\u02dd", "\\H"); // double acute
|
1789
1789
|
|
1790
1790
|
// These ligatures are detected and created in Parser.js's `formLigatures`.
|
@@ -2752,17 +2752,17 @@ const calculateSize = function(sizeValue, style) {
|
|
2752
2752
|
|
2753
2753
|
// Helper functions
|
2754
2754
|
|
2755
|
-
const padding$
|
2755
|
+
const padding$1 = width => {
|
2756
2756
|
const node = new mathMLTree.MathNode("mspace");
|
2757
2757
|
node.setAttribute("width", width + "em");
|
2758
2758
|
return node
|
2759
2759
|
};
|
2760
2760
|
|
2761
2761
|
const paddedNode = (group, lspace = 0.3, rspace = 0, mustSmash = false) => {
|
2762
|
-
if (group == null && rspace === 0) { return padding$
|
2762
|
+
if (group == null && rspace === 0) { return padding$1(lspace) }
|
2763
2763
|
const row = group ? [group] : [];
|
2764
|
-
if (lspace !== 0) { row.unshift(padding$
|
2765
|
-
if (rspace > 0) { row.push(padding$
|
2764
|
+
if (lspace !== 0) { row.unshift(padding$1(lspace)); }
|
2765
|
+
if (rspace > 0) { row.push(padding$1(rspace)); }
|
2766
2766
|
if (mustSmash) {
|
2767
2767
|
// Used for the bottom arrow in a {CD} environment
|
2768
2768
|
const mpadded = new mathMLTree.MathNode("mpadded", row);
|
@@ -2889,8 +2889,8 @@ defineFunction({
|
|
2889
2889
|
const node = munderoverNode(group.name, group.body, group.below, style);
|
2890
2890
|
// Create operator spacing for a relation.
|
2891
2891
|
const row = [node];
|
2892
|
-
row.unshift(padding$
|
2893
|
-
row.push(padding$
|
2892
|
+
row.unshift(padding$1(0.2778));
|
2893
|
+
row.push(padding$1(0.2778));
|
2894
2894
|
return new mathMLTree.MathNode("mrow", row)
|
2895
2895
|
}
|
2896
2896
|
});
|
@@ -2965,13 +2965,13 @@ defineFunction({
|
|
2965
2965
|
botNode.setAttribute("width", "0.5em");
|
2966
2966
|
wrapper = new mathMLTree.MathNode(
|
2967
2967
|
"mpadded",
|
2968
|
-
[padding$
|
2968
|
+
[padding$1(0.2778), botNode, raiseNode, padding$1(0.2778)]
|
2969
2969
|
);
|
2970
2970
|
} else {
|
2971
2971
|
raiseNode.setAttribute("width", (group.name === "\\equilibriumRight" ? "0.5em" : "0"));
|
2972
2972
|
wrapper = new mathMLTree.MathNode(
|
2973
2973
|
"mpadded",
|
2974
|
-
[padding$
|
2974
|
+
[padding$1(0.2778), raiseNode, botArrow, padding$1(0.2778)]
|
2975
2975
|
);
|
2976
2976
|
}
|
2977
2977
|
|
@@ -8083,7 +8083,7 @@ defineFunction({
|
|
8083
8083
|
}
|
8084
8084
|
});
|
8085
8085
|
|
8086
|
-
const padding
|
8086
|
+
const padding = _ => {
|
8087
8087
|
const node = new mathMLTree.MathNode("mspace");
|
8088
8088
|
node.setAttribute("width", "3pt");
|
8089
8089
|
return node
|
@@ -8096,9 +8096,9 @@ const mathmlBuilder$7 = (group, style) => {
|
|
8096
8096
|
// Firefox does not reliably add side padding.
|
8097
8097
|
// Insert <mspace>
|
8098
8098
|
node = new mathMLTree.MathNode("mrow", [
|
8099
|
-
padding
|
8099
|
+
padding(),
|
8100
8100
|
buildGroup$1(group.body, style),
|
8101
|
-
padding
|
8101
|
+
padding()
|
8102
8102
|
]);
|
8103
8103
|
} else {
|
8104
8104
|
node = new mathMLTree.MathNode("menclose", [buildGroup$1(group.body, style)]);
|
@@ -9498,12 +9498,6 @@ defineFunction({
|
|
9498
9498
|
|
9499
9499
|
const textAtomTypes = ["text", "textord", "mathord", "atom"];
|
9500
9500
|
|
9501
|
-
const padding = width => {
|
9502
|
-
const node = new mathMLTree.MathNode("mspace");
|
9503
|
-
node.setAttribute("width", width + "em");
|
9504
|
-
return node
|
9505
|
-
};
|
9506
|
-
|
9507
9501
|
function mathmlBuilder$3(group, style) {
|
9508
9502
|
let node;
|
9509
9503
|
const inner = buildExpression(group.body, style);
|
@@ -9539,17 +9533,17 @@ function mathmlBuilder$3(group, style) {
|
|
9539
9533
|
if (doSpacing ) {
|
9540
9534
|
if (group.mclass === "mbin") {
|
9541
9535
|
// medium space
|
9542
|
-
node.children.unshift(padding(0.2222));
|
9543
|
-
node.children.push(padding(0.2222));
|
9536
|
+
node.children.unshift(padding$1(0.2222));
|
9537
|
+
node.children.push(padding$1(0.2222));
|
9544
9538
|
} else if (group.mclass === "mrel") {
|
9545
9539
|
// thickspace
|
9546
|
-
node.children.unshift(padding(0.2778));
|
9547
|
-
node.children.push(padding(0.2778));
|
9540
|
+
node.children.unshift(padding$1(0.2778));
|
9541
|
+
node.children.push(padding$1(0.2778));
|
9548
9542
|
} else if (group.mclass === "mpunct") {
|
9549
|
-
node.children.push(padding(0.1667));
|
9543
|
+
node.children.push(padding$1(0.1667));
|
9550
9544
|
} else if (group.mclass === "minner") {
|
9551
|
-
node.children.unshift(padding(0.0556)); // 1 mu is the most likely option
|
9552
|
-
node.children.push(padding(0.0556));
|
9545
|
+
node.children.unshift(padding$1(0.0556)); // 1 mu is the most likely option
|
9546
|
+
node.children.push(padding$1(0.0556));
|
9553
9547
|
}
|
9554
9548
|
}
|
9555
9549
|
} else {
|
@@ -9619,14 +9613,19 @@ defineFunction({
|
|
9619
9613
|
break
|
9620
9614
|
}
|
9621
9615
|
}
|
9622
|
-
|
9623
|
-
|
9624
|
-
|
9625
|
-
|
9626
|
-
|
9627
|
-
|
9628
|
-
|
9629
|
-
|
9616
|
+
if (mustPromote && funcName === "\\mathord" && mord.type === "mathord"
|
9617
|
+
&& mord.text.length > 1) {
|
9618
|
+
return mord
|
9619
|
+
} else {
|
9620
|
+
return {
|
9621
|
+
type: "mclass",
|
9622
|
+
mode: parser.mode,
|
9623
|
+
mclass: "m" + funcName.slice(5),
|
9624
|
+
body: ordargument(mustPromote ? mord : body),
|
9625
|
+
isCharacterBox,
|
9626
|
+
mustPromote
|
9627
|
+
};
|
9628
|
+
}
|
9630
9629
|
},
|
9631
9630
|
mathmlBuilder: mathmlBuilder$3
|
9632
9631
|
});
|
@@ -10188,7 +10187,7 @@ const mathmlBuilder$1 = (group, style) => {
|
|
10188
10187
|
for (let i = 0; i < expression.length; i++) {
|
10189
10188
|
let node = expression[i];
|
10190
10189
|
if (node instanceof mathMLTree.MathNode) {
|
10191
|
-
if (node.type === "mrow" && node.children.length === 1 &&
|
10190
|
+
if ((node.type === "mrow" || node.type === "mpadded") && node.children.length === 1 &&
|
10192
10191
|
node.children[0] instanceof mathMLTree.MathNode) {
|
10193
10192
|
node = node.children[0];
|
10194
10193
|
}
|
@@ -10806,7 +10805,7 @@ const symbolRegEx = /^m(over|under|underover)$/;
|
|
10806
10805
|
defineFunctionBuilders({
|
10807
10806
|
type: "supsub",
|
10808
10807
|
mathmlBuilder(group, style) {
|
10809
|
-
// Is the inner group a relevant
|
10808
|
+
// Is the inner group a relevant horizontal brace?
|
10810
10809
|
let isBrace = false;
|
10811
10810
|
let isOver;
|
10812
10811
|
let isSup;
|
@@ -10989,6 +10988,14 @@ defineFunctionBuilders({
|
|
10989
10988
|
// ":" is not in the MathML operator dictionary. Give it BIN spacing.
|
10990
10989
|
node.attributes.lspace = "0.2222em";
|
10991
10990
|
node.attributes.rspace = "0.2222em";
|
10991
|
+
} else if (group.needsSpacing) {
|
10992
|
+
// Fix a MathML bug that occurs when a <mo> is between two <mtext> elements.
|
10993
|
+
if (group.family === "bin") {
|
10994
|
+
return new mathMLTree.MathNode("mrow", [padding$1(0.222), node, padding$1(0.222)])
|
10995
|
+
} else {
|
10996
|
+
// REL spacing
|
10997
|
+
return new mathMLTree.MathNode("mrow", [padding$1(0.2778), node, padding$1(0.2778)])
|
10998
|
+
}
|
10992
10999
|
}
|
10993
11000
|
return node;
|
10994
11001
|
}
|
@@ -11356,7 +11363,9 @@ defineFunctionBuilders({
|
|
11356
11363
|
node.setAttribute("mathvariant", "normal");
|
11357
11364
|
if (text.text.length === 1) {
|
11358
11365
|
// A Firefox bug will apply spacing here, but there should be none. Fix it.
|
11359
|
-
node = new mathMLTree.MathNode("
|
11366
|
+
node = new mathMLTree.MathNode("mpadded", [node]);
|
11367
|
+
node.setAttribute("lspace", "0");
|
11368
|
+
node.setAttribute("rspace", "0");
|
11360
11369
|
}
|
11361
11370
|
}
|
11362
11371
|
return node
|
@@ -12735,6 +12744,7 @@ var unicodeSymbols = {
|
|
12735
12744
|
|
12736
12745
|
const binLeftCancellers = ["bin", "op", "open", "punct", "rel"];
|
12737
12746
|
const sizeRegEx = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/;
|
12747
|
+
const textRegEx = /^ *\\text/;
|
12738
12748
|
|
12739
12749
|
/**
|
12740
12750
|
* This file contains the parser used to parse out a TeX expression from the
|
@@ -13645,6 +13655,11 @@ class Parser {
|
|
13645
13655
|
loc,
|
13646
13656
|
text
|
13647
13657
|
};
|
13658
|
+
if ((family === "rel" || family === "bin") && this.prevAtomType === "text") {
|
13659
|
+
if (textRegEx.test(loc.lexer.input.slice(loc.end))) {
|
13660
|
+
s.needsSpacing = true; // Fix a MathML bug.
|
13661
|
+
}
|
13662
|
+
}
|
13648
13663
|
} else {
|
13649
13664
|
if (asciiFromScript[text]) {
|
13650
13665
|
// Unicode 14 disambiguates chancery from roundhand.
|
@@ -13902,7 +13917,7 @@ class Style {
|
|
13902
13917
|
* https://mit-license.org/
|
13903
13918
|
*/
|
13904
13919
|
|
13905
|
-
const version = "0.11.
|
13920
|
+
const version = "0.11.02";
|
13906
13921
|
|
13907
13922
|
function postProcess(block) {
|
13908
13923
|
const labelMap = {};
|
package/dist/temml.js
CHANGED
@@ -1773,7 +1773,7 @@ var temml = (function () {
|
|
1773
1773
|
defineSymbol(text, accent, "\u00b8", "\\c"); // cedilla
|
1774
1774
|
defineSymbol(text, accent, "\u02da", "\\r"); // ring above
|
1775
1775
|
defineSymbol(text, accent, "\u02c7", "\\v"); // caron
|
1776
|
-
defineSymbol(text, accent, "\u00a8", '\\"'); //
|
1776
|
+
defineSymbol(text, accent, "\u00a8", '\\"'); // diaeresis
|
1777
1777
|
defineSymbol(text, accent, "\u02dd", "\\H"); // double acute
|
1778
1778
|
defineSymbol(math, accent, "\u02ca", "\\'"); // acute
|
1779
1779
|
defineSymbol(math, accent, "\u02cb", "\\`"); // grave
|
@@ -1785,7 +1785,7 @@ var temml = (function () {
|
|
1785
1785
|
defineSymbol(math, accent, "\u00b8", "\\c"); // cedilla
|
1786
1786
|
defineSymbol(math, accent, "\u02da", "\\r"); // ring above
|
1787
1787
|
defineSymbol(math, accent, "\u02c7", "\\v"); // caron
|
1788
|
-
defineSymbol(math, accent, "\u00a8", '\\"'); //
|
1788
|
+
defineSymbol(math, accent, "\u00a8", '\\"'); // diaeresis
|
1789
1789
|
defineSymbol(math, accent, "\u02dd", "\\H"); // double acute
|
1790
1790
|
|
1791
1791
|
// These ligatures are detected and created in Parser.js's `formLigatures`.
|
@@ -2753,17 +2753,17 @@ var temml = (function () {
|
|
2753
2753
|
|
2754
2754
|
// Helper functions
|
2755
2755
|
|
2756
|
-
const padding$
|
2756
|
+
const padding$1 = width => {
|
2757
2757
|
const node = new mathMLTree.MathNode("mspace");
|
2758
2758
|
node.setAttribute("width", width + "em");
|
2759
2759
|
return node
|
2760
2760
|
};
|
2761
2761
|
|
2762
2762
|
const paddedNode = (group, lspace = 0.3, rspace = 0, mustSmash = false) => {
|
2763
|
-
if (group == null && rspace === 0) { return padding$
|
2763
|
+
if (group == null && rspace === 0) { return padding$1(lspace) }
|
2764
2764
|
const row = group ? [group] : [];
|
2765
|
-
if (lspace !== 0) { row.unshift(padding$
|
2766
|
-
if (rspace > 0) { row.push(padding$
|
2765
|
+
if (lspace !== 0) { row.unshift(padding$1(lspace)); }
|
2766
|
+
if (rspace > 0) { row.push(padding$1(rspace)); }
|
2767
2767
|
if (mustSmash) {
|
2768
2768
|
// Used for the bottom arrow in a {CD} environment
|
2769
2769
|
const mpadded = new mathMLTree.MathNode("mpadded", row);
|
@@ -2890,8 +2890,8 @@ var temml = (function () {
|
|
2890
2890
|
const node = munderoverNode(group.name, group.body, group.below, style);
|
2891
2891
|
// Create operator spacing for a relation.
|
2892
2892
|
const row = [node];
|
2893
|
-
row.unshift(padding$
|
2894
|
-
row.push(padding$
|
2893
|
+
row.unshift(padding$1(0.2778));
|
2894
|
+
row.push(padding$1(0.2778));
|
2895
2895
|
return new mathMLTree.MathNode("mrow", row)
|
2896
2896
|
}
|
2897
2897
|
});
|
@@ -2966,13 +2966,13 @@ var temml = (function () {
|
|
2966
2966
|
botNode.setAttribute("width", "0.5em");
|
2967
2967
|
wrapper = new mathMLTree.MathNode(
|
2968
2968
|
"mpadded",
|
2969
|
-
[padding$
|
2969
|
+
[padding$1(0.2778), botNode, raiseNode, padding$1(0.2778)]
|
2970
2970
|
);
|
2971
2971
|
} else {
|
2972
2972
|
raiseNode.setAttribute("width", (group.name === "\\equilibriumRight" ? "0.5em" : "0"));
|
2973
2973
|
wrapper = new mathMLTree.MathNode(
|
2974
2974
|
"mpadded",
|
2975
|
-
[padding$
|
2975
|
+
[padding$1(0.2778), raiseNode, botArrow, padding$1(0.2778)]
|
2976
2976
|
);
|
2977
2977
|
}
|
2978
2978
|
|
@@ -6170,7 +6170,7 @@ var temml = (function () {
|
|
6170
6170
|
}
|
6171
6171
|
});
|
6172
6172
|
|
6173
|
-
const padding
|
6173
|
+
const padding = _ => {
|
6174
6174
|
const node = new mathMLTree.MathNode("mspace");
|
6175
6175
|
node.setAttribute("width", "3pt");
|
6176
6176
|
return node
|
@@ -6183,9 +6183,9 @@ var temml = (function () {
|
|
6183
6183
|
// Firefox does not reliably add side padding.
|
6184
6184
|
// Insert <mspace>
|
6185
6185
|
node = new mathMLTree.MathNode("mrow", [
|
6186
|
-
padding
|
6186
|
+
padding(),
|
6187
6187
|
buildGroup$1(group.body, style),
|
6188
|
-
padding
|
6188
|
+
padding()
|
6189
6189
|
]);
|
6190
6190
|
} else {
|
6191
6191
|
node = new mathMLTree.MathNode("menclose", [buildGroup$1(group.body, style)]);
|
@@ -7585,12 +7585,6 @@ var temml = (function () {
|
|
7585
7585
|
|
7586
7586
|
const textAtomTypes = ["text", "textord", "mathord", "atom"];
|
7587
7587
|
|
7588
|
-
const padding = width => {
|
7589
|
-
const node = new mathMLTree.MathNode("mspace");
|
7590
|
-
node.setAttribute("width", width + "em");
|
7591
|
-
return node
|
7592
|
-
};
|
7593
|
-
|
7594
7588
|
function mathmlBuilder$3(group, style) {
|
7595
7589
|
let node;
|
7596
7590
|
const inner = buildExpression(group.body, style);
|
@@ -7626,17 +7620,17 @@ var temml = (function () {
|
|
7626
7620
|
if (doSpacing ) {
|
7627
7621
|
if (group.mclass === "mbin") {
|
7628
7622
|
// medium space
|
7629
|
-
node.children.unshift(padding(0.2222));
|
7630
|
-
node.children.push(padding(0.2222));
|
7623
|
+
node.children.unshift(padding$1(0.2222));
|
7624
|
+
node.children.push(padding$1(0.2222));
|
7631
7625
|
} else if (group.mclass === "mrel") {
|
7632
7626
|
// thickspace
|
7633
|
-
node.children.unshift(padding(0.2778));
|
7634
|
-
node.children.push(padding(0.2778));
|
7627
|
+
node.children.unshift(padding$1(0.2778));
|
7628
|
+
node.children.push(padding$1(0.2778));
|
7635
7629
|
} else if (group.mclass === "mpunct") {
|
7636
|
-
node.children.push(padding(0.1667));
|
7630
|
+
node.children.push(padding$1(0.1667));
|
7637
7631
|
} else if (group.mclass === "minner") {
|
7638
|
-
node.children.unshift(padding(0.0556)); // 1 mu is the most likely option
|
7639
|
-
node.children.push(padding(0.0556));
|
7632
|
+
node.children.unshift(padding$1(0.0556)); // 1 mu is the most likely option
|
7633
|
+
node.children.push(padding$1(0.0556));
|
7640
7634
|
}
|
7641
7635
|
}
|
7642
7636
|
} else {
|
@@ -7706,14 +7700,19 @@ var temml = (function () {
|
|
7706
7700
|
break
|
7707
7701
|
}
|
7708
7702
|
}
|
7709
|
-
|
7710
|
-
|
7711
|
-
|
7712
|
-
|
7713
|
-
|
7714
|
-
|
7715
|
-
|
7716
|
-
|
7703
|
+
if (mustPromote && funcName === "\\mathord" && mord.type === "mathord"
|
7704
|
+
&& mord.text.length > 1) {
|
7705
|
+
return mord
|
7706
|
+
} else {
|
7707
|
+
return {
|
7708
|
+
type: "mclass",
|
7709
|
+
mode: parser.mode,
|
7710
|
+
mclass: "m" + funcName.slice(5),
|
7711
|
+
body: ordargument(mustPromote ? mord : body),
|
7712
|
+
isCharacterBox,
|
7713
|
+
mustPromote
|
7714
|
+
};
|
7715
|
+
}
|
7717
7716
|
},
|
7718
7717
|
mathmlBuilder: mathmlBuilder$3
|
7719
7718
|
});
|
@@ -8275,7 +8274,7 @@ var temml = (function () {
|
|
8275
8274
|
for (let i = 0; i < expression.length; i++) {
|
8276
8275
|
let node = expression[i];
|
8277
8276
|
if (node instanceof mathMLTree.MathNode) {
|
8278
|
-
if (node.type === "mrow" && node.children.length === 1 &&
|
8277
|
+
if ((node.type === "mrow" || node.type === "mpadded") && node.children.length === 1 &&
|
8279
8278
|
node.children[0] instanceof mathMLTree.MathNode) {
|
8280
8279
|
node = node.children[0];
|
8281
8280
|
}
|
@@ -8893,7 +8892,7 @@ var temml = (function () {
|
|
8893
8892
|
defineFunctionBuilders({
|
8894
8893
|
type: "supsub",
|
8895
8894
|
mathmlBuilder(group, style) {
|
8896
|
-
// Is the inner group a relevant
|
8895
|
+
// Is the inner group a relevant horizontal brace?
|
8897
8896
|
let isBrace = false;
|
8898
8897
|
let isOver;
|
8899
8898
|
let isSup;
|
@@ -9076,6 +9075,14 @@ var temml = (function () {
|
|
9076
9075
|
// ":" is not in the MathML operator dictionary. Give it BIN spacing.
|
9077
9076
|
node.attributes.lspace = "0.2222em";
|
9078
9077
|
node.attributes.rspace = "0.2222em";
|
9078
|
+
} else if (group.needsSpacing) {
|
9079
|
+
// Fix a MathML bug that occurs when a <mo> is between two <mtext> elements.
|
9080
|
+
if (group.family === "bin") {
|
9081
|
+
return new mathMLTree.MathNode("mrow", [padding$1(0.222), node, padding$1(0.222)])
|
9082
|
+
} else {
|
9083
|
+
// REL spacing
|
9084
|
+
return new mathMLTree.MathNode("mrow", [padding$1(0.2778), node, padding$1(0.2778)])
|
9085
|
+
}
|
9079
9086
|
}
|
9080
9087
|
return node;
|
9081
9088
|
}
|
@@ -9443,7 +9450,9 @@ var temml = (function () {
|
|
9443
9450
|
node.setAttribute("mathvariant", "normal");
|
9444
9451
|
if (text.text.length === 1) {
|
9445
9452
|
// A Firefox bug will apply spacing here, but there should be none. Fix it.
|
9446
|
-
node = new mathMLTree.MathNode("
|
9453
|
+
node = new mathMLTree.MathNode("mpadded", [node]);
|
9454
|
+
node.setAttribute("lspace", "0");
|
9455
|
+
node.setAttribute("rspace", "0");
|
9447
9456
|
}
|
9448
9457
|
}
|
9449
9458
|
return node
|
@@ -10822,6 +10831,7 @@ var temml = (function () {
|
|
10822
10831
|
|
10823
10832
|
const binLeftCancellers = ["bin", "op", "open", "punct", "rel"];
|
10824
10833
|
const sizeRegEx = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/;
|
10834
|
+
const textRegEx = /^ *\\text/;
|
10825
10835
|
|
10826
10836
|
/**
|
10827
10837
|
* This file contains the parser used to parse out a TeX expression from the
|
@@ -11732,6 +11742,11 @@ var temml = (function () {
|
|
11732
11742
|
loc,
|
11733
11743
|
text
|
11734
11744
|
};
|
11745
|
+
if ((family === "rel" || family === "bin") && this.prevAtomType === "text") {
|
11746
|
+
if (textRegEx.test(loc.lexer.input.slice(loc.end))) {
|
11747
|
+
s.needsSpacing = true; // Fix a MathML bug.
|
11748
|
+
}
|
11749
|
+
}
|
11735
11750
|
} else {
|
11736
11751
|
if (asciiFromScript[text]) {
|
11737
11752
|
// Unicode 14 disambiguates chancery from roundhand.
|
@@ -11989,7 +12004,7 @@ var temml = (function () {
|
|
11989
12004
|
* https://mit-license.org/
|
11990
12005
|
*/
|
11991
12006
|
|
11992
|
-
const version = "0.11.
|
12007
|
+
const version = "0.11.02";
|
11993
12008
|
|
11994
12009
|
function postProcess(block) {
|
11995
12010
|
const labelMap = {};
|