temml 0.10.10 → 0.10.12
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/dist/temml.cjs +11 -3
- package/dist/temml.js +11 -3
- package/dist/temml.min.js +1 -1
- package/dist/temml.mjs +11 -3
- package/dist/temmlPostProcess.js +1 -1
- package/package.json +2 -2
- package/src/Settings.js +1 -0
- package/src/buildMathML.js +1 -1
- package/src/functions/mclass.js +4 -1
- package/src/functions/symbolsOrd.js +2 -0
- package/src/postProcess.js +1 -1
- package/src/symbols.js +3 -0
package/dist/temml.mjs
CHANGED
@@ -186,6 +186,7 @@ class Settings {
|
|
186
186
|
this.displayMode = utils.deflt(options.displayMode, false); // boolean
|
187
187
|
this.annotate = utils.deflt(options.annotate, false); // boolean
|
188
188
|
this.leqno = utils.deflt(options.leqno, false); // boolean
|
189
|
+
this.throwOnError = utils.deflt(options.throwOnError, false); // boolean
|
189
190
|
this.errorColor = utils.deflt(options.errorColor, "#b22222"); // string
|
190
191
|
this.macros = options.macros || {};
|
191
192
|
this.wrap = utils.deflt(options.wrap, "tex"); // "tex" | "="
|
@@ -863,6 +864,9 @@ defineSymbol(math, rel, "\u225e", "\\measeq", true);
|
|
863
864
|
defineSymbol(math, rel, "\u225f", "\\questeq", true);
|
864
865
|
defineSymbol(math, rel, "\u2260", "\\ne", true);
|
865
866
|
defineSymbol(math, rel, "\u2260", "\\neq");
|
867
|
+
// unicodemath
|
868
|
+
defineSymbol(math, rel, "\u2a75", "\\eqeq", true);
|
869
|
+
defineSymbol(math, rel, "\u2a76", "\\eqeqeq", true);
|
866
870
|
// mathtools.sty
|
867
871
|
defineSymbol(math, rel, "\u2237", "\\dblcolon", true);
|
868
872
|
defineSymbol(math, rel, "\u2254", "\\coloneqq", true);
|
@@ -2128,7 +2132,7 @@ function buildMathML(tree, texExpression, style, settings) {
|
|
2128
2132
|
math.setAttribute("display", "block");
|
2129
2133
|
math.style.display = math.children.length === 1 && math.children[0].type === "mtable"
|
2130
2134
|
? "inline"
|
2131
|
-
: "
|
2135
|
+
: "block math";
|
2132
2136
|
}
|
2133
2137
|
return math;
|
2134
2138
|
}
|
@@ -5999,7 +6003,9 @@ defineFunction({
|
|
5999
6003
|
const arr = (body.body) ? body.body : [body];
|
6000
6004
|
for (const arg of arr) {
|
6001
6005
|
if (textAtomTypes.includes(arg.type)) {
|
6002
|
-
if (arg.text) {
|
6006
|
+
if (symbols[parser.mode][arg.text]) {
|
6007
|
+
mord.text += symbols[parser.mode][arg.text].replace;
|
6008
|
+
} else if (arg.text) {
|
6003
6009
|
mord.text += arg.text;
|
6004
6010
|
} else if (arg.body) {
|
6005
6011
|
arg.body.map(e => { mord.text += e.text; });
|
@@ -7746,6 +7752,8 @@ defineFunctionBuilders({
|
|
7746
7752
|
node = new mathMLTree.MathNode("mi", [text]);
|
7747
7753
|
if (text.text === origText && latinRegEx.test(origText)) {
|
7748
7754
|
node.setAttribute("mathvariant", "italic");
|
7755
|
+
} else if (text.text === "∇" && variant === "normal") {
|
7756
|
+
node.setAttribute("mathvariant", "normal");
|
7749
7757
|
}
|
7750
7758
|
}
|
7751
7759
|
return node
|
@@ -12867,7 +12875,7 @@ class Style {
|
|
12867
12875
|
* https://mit-license.org/
|
12868
12876
|
*/
|
12869
12877
|
|
12870
|
-
const version = "0.10.
|
12878
|
+
const version = "0.10.12";
|
12871
12879
|
|
12872
12880
|
function postProcess(block) {
|
12873
12881
|
const labelMap = {};
|
package/dist/temmlPostProcess.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "temml",
|
3
|
-
"version": "0.10.
|
3
|
+
"version": "0.10.12",
|
4
4
|
"description": "TeX to MathML conversion in JavaScript.",
|
5
5
|
"main": "dist/temml.js",
|
6
6
|
"exports": {
|
@@ -23,7 +23,7 @@
|
|
23
23
|
],
|
24
24
|
"license": "MIT",
|
25
25
|
"devDependencies": {
|
26
|
-
"eslint": "^8.
|
26
|
+
"eslint": "^8.39.0",
|
27
27
|
"esm": "^3.2.25",
|
28
28
|
"rollup": "^2.66.1",
|
29
29
|
"terser": "^5.14.2"
|
package/src/Settings.js
CHANGED
@@ -15,6 +15,7 @@ export default class Settings {
|
|
15
15
|
this.displayMode = utils.deflt(options.displayMode, false); // boolean
|
16
16
|
this.annotate = utils.deflt(options.annotate, false) // boolean
|
17
17
|
this.leqno = utils.deflt(options.leqno, false); // boolean
|
18
|
+
this.throwOnError = utils.deflt(options.throwOnError, false); // boolean
|
18
19
|
this.errorColor = utils.deflt(options.errorColor, "#b22222"); // string
|
19
20
|
this.macros = options.macros || {};
|
20
21
|
this.wrap = utils.deflt(options.wrap, "tex") // "tex" | "="
|
package/src/buildMathML.js
CHANGED
@@ -262,7 +262,7 @@ export default function buildMathML(tree, texExpression, style, settings) {
|
|
262
262
|
math.setAttribute("display", "block");
|
263
263
|
math.style.display = math.children.length === 1 && math.children[0].type === "mtable"
|
264
264
|
? "inline"
|
265
|
-
: "
|
265
|
+
: "block math"
|
266
266
|
}
|
267
267
|
return math;
|
268
268
|
}
|
package/src/functions/mclass.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import defineFunction, { ordargument } from "../defineFunction";
|
2
|
+
import symbols from "../symbols";
|
2
3
|
import mathMLTree from "../mathMLTree";
|
3
4
|
import utils from "../utils";
|
4
5
|
|
@@ -112,7 +113,9 @@ defineFunction({
|
|
112
113
|
const arr = (body.body) ? body.body : [body];
|
113
114
|
for (const arg of arr) {
|
114
115
|
if (textAtomTypes.includes(arg.type)) {
|
115
|
-
if (arg.text) {
|
116
|
+
if (symbols[parser.mode][arg.text]) {
|
117
|
+
mord.text += symbols[parser.mode][arg.text].replace
|
118
|
+
} else if (arg.text) {
|
116
119
|
mord.text += arg.text
|
117
120
|
} else if (arg.body) {
|
118
121
|
arg.body.map(e => { mord.text += e.text })
|
@@ -88,6 +88,8 @@ defineFunctionBuilders({
|
|
88
88
|
node = new mathMLTree.MathNode("mi", [text])
|
89
89
|
if (text.text === origText && latinRegEx.test(origText)) {
|
90
90
|
node.setAttribute("mathvariant", "italic")
|
91
|
+
} else if (text.text === "∇" && variant === "normal") {
|
92
|
+
node.setAttribute("mathvariant", "normal")
|
91
93
|
}
|
92
94
|
}
|
93
95
|
return node
|
package/src/postProcess.js
CHANGED
package/src/symbols.js
CHANGED
@@ -105,6 +105,9 @@ defineSymbol(math, rel, "\u225e", "\\measeq", true);
|
|
105
105
|
defineSymbol(math, rel, "\u225f", "\\questeq", true);
|
106
106
|
defineSymbol(math, rel, "\u2260", "\\ne", true);
|
107
107
|
defineSymbol(math, rel, "\u2260", "\\neq");
|
108
|
+
// unicodemath
|
109
|
+
defineSymbol(math, rel, "\u2a75", "\\eqeq", true);
|
110
|
+
defineSymbol(math, rel, "\u2a76", "\\eqeqeq", true);
|
108
111
|
// mathtools.sty
|
109
112
|
defineSymbol(math, rel, "\u2237", "\\dblcolon", true);
|
110
113
|
defineSymbol(math, rel, "\u2254", "\\coloneqq", true);
|