temml 0.10.24 → 0.10.30
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 +2 -2
- package/contrib/auto-render/dist/auto-render.js +4 -7
- package/contrib/auto-render/dist/auto-render.min.js +1 -1
- package/contrib/auto-render/test/auto-render.js +4 -7
- package/contrib/mhchem/mhchem.js +19 -5
- package/contrib/mhchem/mhchem.min.js +1 -1
- package/dist/Temml-Asana.css +117 -34
- package/dist/Temml-Fira.css +117 -34
- package/dist/Temml-Latin-Modern.css +117 -34
- package/dist/Temml-Libertinus.css +117 -34
- package/dist/Temml-Local.css +117 -34
- package/dist/Temml-STIX2.css +117 -34
- package/dist/temml.cjs +7099 -6901
- package/dist/temml.js +4694 -4510
- package/dist/temml.min.js +1 -1
- package/dist/temml.mjs +7099 -6901
- package/dist/temmlPostProcess.js +1 -3
- package/package.json +8 -5
- package/src/Parser.js +7 -4
- package/src/buildMathML.js +55 -32
- package/src/environments/array.js +54 -13
- package/src/environments/cd.js +1 -1
- package/src/functions/accent.js +32 -7
- package/src/functions/color.js +2 -0
- package/src/functions/def.js +1 -2
- package/src/functions/delimsizing.js +14 -5
- package/src/functions/enclose.js +60 -31
- package/src/functions/op.js +15 -1
- package/src/functions/supsub.js +2 -2
- package/src/functions/text.js +7 -3
- package/src/macros.js +5 -1
- package/src/postProcess.js +1 -1
- package/src/symbols.js +5 -0
package/src/functions/op.js
CHANGED
@@ -12,7 +12,7 @@ const ordAtomTypes = ["textord", "mathord", "atom"]
|
|
12
12
|
const noSuccessor = ["\\smallint"];
|
13
13
|
|
14
14
|
// Math operators (e.g. \sin) need a space between these types and themselves:
|
15
|
-
export const ordTypes = ["textord", "mathord", "ordgroup", "close", "leftright"];
|
15
|
+
export const ordTypes = ["textord", "mathord", "ordgroup", "close", "leftright", "font"];
|
16
16
|
|
17
17
|
// NOTE: Unlike most `builders`s, this one handles not only "op", but also
|
18
18
|
// "supsub" since some of them (like \int) can affect super/subscripting.
|
@@ -32,6 +32,13 @@ const mathmlBuilder = (group, style) => {
|
|
32
32
|
node = new mathMLTree.MathNode("mo", [mml.makeText(group.name, group.mode)]);
|
33
33
|
if (noSuccessor.includes(group.name)) {
|
34
34
|
node.setAttribute("largeop", "false")
|
35
|
+
} else if (group.limits) {
|
36
|
+
// This is a workaround for a MathML/Chromium bug.
|
37
|
+
// This is being applied to singleCharBigOps, which are not really stretchy.
|
38
|
+
// But by setting the stretchy attribute, Chromium will vertically center
|
39
|
+
// big ops around the math axis. This is needed since STIX TWO does not do so.
|
40
|
+
// TODO: Remove this hack when MathML & Chromium fix their problem.
|
41
|
+
node.setAttribute("stretchy", "true")
|
35
42
|
} else {
|
36
43
|
node.setAttribute("movablelimits", "false")
|
37
44
|
}
|
@@ -81,6 +88,9 @@ const singleCharBigOps = {
|
|
81
88
|
"\u2a04": "\\biguplus",
|
82
89
|
"\u2a05": "\\bigsqcap",
|
83
90
|
"\u2a06": "\\bigsqcup",
|
91
|
+
"\u2a03": "\\bigcupdot",
|
92
|
+
"\u2a07": "\\bigdoublevee",
|
93
|
+
"\u2a08": "\\bigdoublewedge",
|
84
94
|
"\u2a09": "\\bigtimes"
|
85
95
|
};
|
86
96
|
|
@@ -91,8 +101,12 @@ defineFunction({
|
|
91
101
|
"\\bigvee",
|
92
102
|
"\\bigwedge",
|
93
103
|
"\\biguplus",
|
104
|
+
"\\bigcupplus",
|
105
|
+
"\\bigcupdot",
|
94
106
|
"\\bigcap",
|
95
107
|
"\\bigcup",
|
108
|
+
"\\bigdoublevee",
|
109
|
+
"\\bigdoublewedge",
|
96
110
|
"\\intop",
|
97
111
|
"\\prod",
|
98
112
|
"\\sum",
|
package/src/functions/supsub.js
CHANGED
@@ -55,9 +55,9 @@ defineFunctionBuilders({
|
|
55
55
|
if (group.sup) {
|
56
56
|
const sup = mml.buildGroup(group.sup, childStyle)
|
57
57
|
const testNode = sup.type === "mrow" ? sup.children[0] : sup
|
58
|
-
if ((testNode.type === "mo" && testNode.classes.includes("tml-prime"))
|
58
|
+
if ((testNode && testNode.type === "mo" && testNode.classes.includes("tml-prime"))
|
59
59
|
&& group.base && group.base.text && group.base.text === "f") {
|
60
|
-
// Chromium does not address italic correction on prime.
|
60
|
+
// Chromium does not address italic correction on prime. Prevent f′ from overlapping.
|
61
61
|
testNode.classes.push("prime-pad")
|
62
62
|
}
|
63
63
|
children.push(sup)
|
package/src/functions/text.js
CHANGED
@@ -30,9 +30,12 @@ const styleWithFont = (group, style) => {
|
|
30
30
|
return style.withTextFontFamily(textFontFamilies[font]);
|
31
31
|
} else if (textFontWeights[font]) {
|
32
32
|
return style.withTextFontWeight(textFontWeights[font]);
|
33
|
-
} else {
|
34
|
-
return style.
|
33
|
+
} else if (font === "\\emph") {
|
34
|
+
return style.fontShape === "textit"
|
35
|
+
? style.withTextFontShape("textup")
|
36
|
+
: style.withTextFontShape("textit")
|
35
37
|
}
|
38
|
+
return style.withTextFontShape(textFontShapes[font])
|
36
39
|
};
|
37
40
|
|
38
41
|
defineFunction({
|
@@ -50,7 +53,8 @@ defineFunction({
|
|
50
53
|
"\\textmd",
|
51
54
|
// Font Shapes
|
52
55
|
"\\textit",
|
53
|
-
"\\textup"
|
56
|
+
"\\textup",
|
57
|
+
"\\emph"
|
54
58
|
],
|
55
59
|
props: {
|
56
60
|
numArgs: 1,
|
package/src/macros.js
CHANGED
@@ -82,7 +82,7 @@ defineMacro("\\TextOrMath", function(context) {
|
|
82
82
|
}
|
83
83
|
});
|
84
84
|
|
85
|
-
const stringFromArg = arg => {
|
85
|
+
export const stringFromArg = arg => {
|
86
86
|
// Reverse the order of the arg and return a string.
|
87
87
|
let str = ""
|
88
88
|
for (let i = arg.length - 1; i > -1; i--) {
|
@@ -246,6 +246,10 @@ defineMacro("\\underbar", "\\underline{\\text{#1}}");
|
|
246
246
|
defineMacro("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}");
|
247
247
|
defineMacro("\u22ee", "\\vdots");
|
248
248
|
|
249
|
+
// {array} environment gaps
|
250
|
+
defineMacro("\\arraystretch", "1") // line spacing factor times 12pt
|
251
|
+
defineMacro("\\arraycolsep", "6pt") // half the width separating columns
|
252
|
+
|
249
253
|
//////////////////////////////////////////////////////////////////////
|
250
254
|
// amsmath.sty
|
251
255
|
// http://mirrors.concertpass.com/tex-archive/macros/latex/required/amsmath/amsmath.pdf
|
package/src/postProcess.js
CHANGED
package/src/symbols.js
CHANGED
@@ -427,6 +427,7 @@ defineSymbol(math, bin, "\u22d3", "\\Cup", true);
|
|
427
427
|
defineSymbol(math, bin, "\u2a5e", "\\doublebarwedge", true);
|
428
428
|
defineSymbol(math, bin, "\u229f", "\\boxminus", true);
|
429
429
|
defineSymbol(math, bin, "\u229e", "\\boxplus", true);
|
430
|
+
defineSymbol(math, bin, "\u29C4", "\\boxslash", true);
|
430
431
|
defineSymbol(math, bin, "\u22c7", "\\divideontimes", true);
|
431
432
|
defineSymbol(math, bin, "\u22c9", "\\ltimes", true);
|
432
433
|
defineSymbol(math, bin, "\u22ca", "\\rtimes", true);
|
@@ -811,6 +812,10 @@ defineSymbol(math, op, "\u2210", "\\coprod");
|
|
811
812
|
defineSymbol(math, op, "\u22c1", "\\bigvee");
|
812
813
|
defineSymbol(math, op, "\u22c0", "\\bigwedge");
|
813
814
|
defineSymbol(math, op, "\u2a04", "\\biguplus");
|
815
|
+
defineSymbol(math, op, "\u2a04", "\\bigcupplus");
|
816
|
+
defineSymbol(math, op, "\u2a03", "\\bigcupdot");
|
817
|
+
defineSymbol(math, op, "\u2a07", "\\bigdoublevee");
|
818
|
+
defineSymbol(math, op, "\u2a08", "\\bigdoublewedge");
|
814
819
|
defineSymbol(math, op, "\u22c2", "\\bigcap");
|
815
820
|
defineSymbol(math, op, "\u22c3", "\\bigcup");
|
816
821
|
defineSymbol(math, op, "\u222b", "\\int");
|