temml 0.12.2 → 0.13.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 +3 -4
- package/contrib/mhchem/mhchem.min.js +1 -1
- package/dist/Temml-Asana.css +11 -13
- package/dist/Temml-Latin-Modern.css +11 -13
- package/dist/Temml-Libertinus.css +11 -13
- package/dist/Temml-Local.css +11 -13
- package/dist/Temml-NotoSans.css +11 -13
- package/dist/Temml-STIX2.css +11 -13
- package/dist/temml.cjs +227 -116
- package/dist/temml.js +227 -116
- package/dist/temml.min.js +1 -1
- package/dist/temml.mjs +227 -116
- package/dist/temmlPostProcess.js +1 -1
- package/package.json +2 -2
- package/src/Parser.js +11 -4
- package/src/Settings.js +1 -0
- package/src/functions/cancelto.js +2 -0
- package/src/functions/color.js +1 -1
- package/src/functions/{delimsizing.js → delimiter.js} +132 -42
- package/src/functions/enclose.js +1 -1
- package/src/functions/genfrac.js +32 -45
- package/src/functions/mclass.js +10 -2
- package/src/functions/op.js +1 -1
- package/src/functions/operatorname.js +9 -1
- package/src/functions/symbolsOrd.js +2 -2
- package/src/functions.js +1 -1
- package/src/linebreaking.js +3 -10
- package/src/macros.js +2 -2
- package/src/parseNode.js +1 -1
- package/src/parseTree.js +20 -4
- package/src/postProcess.js +1 -1
- package/src/symbols.js +2 -3
package/src/parseTree.js
CHANGED
|
@@ -8,11 +8,27 @@ const parseTree = function(toParse, settings) {
|
|
|
8
8
|
if (!(typeof toParse === "string" || toParse instanceof String)) {
|
|
9
9
|
throw new TypeError("Temml can only parse string typed expression")
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
let tree;
|
|
12
|
+
let parser;
|
|
13
|
+
try {
|
|
14
|
+
parser = new Parser(toParse, settings)
|
|
15
|
+
// Blank out any \df@tag to avoid spurious "Duplicate \tag" errors
|
|
16
|
+
delete parser.gullet.macros.current["\\df@tag"]
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
tree = parser.parse()
|
|
19
|
+
} catch (error) {
|
|
20
|
+
if (error.toString() === "ParseError: Unmatched delimiter") {
|
|
21
|
+
// Abandon the attempt to wrap delimiter pairs in an <mrow>.
|
|
22
|
+
// Try again, and put each delimiter into an <mo> element.
|
|
23
|
+
settings.wrapDelimiterPairs = false;
|
|
24
|
+
parser = new Parser(toParse, settings)
|
|
25
|
+
// Blank out any \df@tag to avoid spurious "Duplicate \tag" errors
|
|
26
|
+
delete parser.gullet.macros.current["\\df@tag"]
|
|
27
|
+
tree = parser.parse()
|
|
28
|
+
} else {
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
16
32
|
|
|
17
33
|
// LaTeX ignores a \tag placed outside an AMS environment.
|
|
18
34
|
if (!(tree.length > 0 && tree[0].type && tree[0].type === "array" && tree[0].addEqnNum)) {
|
package/src/postProcess.js
CHANGED
package/src/symbols.js
CHANGED
|
@@ -128,8 +128,7 @@ defineSymbol(math, textord, "\u2135", "\\aleph", true);
|
|
|
128
128
|
defineSymbol(math, textord, "\u2200", "\\forall", true);
|
|
129
129
|
defineSymbol(math, textord, "\u210f", "\\hbar", true);
|
|
130
130
|
defineSymbol(math, textord, "\u2203", "\\exists", true);
|
|
131
|
-
|
|
132
|
-
defineSymbol(math, bin, "\u2207", "\\nabla", true);
|
|
131
|
+
defineSymbol(math, open, "\u2207", "\\nabla", true);
|
|
133
132
|
defineSymbol(math, textord, "\u266d", "\\flat", true);
|
|
134
133
|
defineSymbol(math, textord, "\u2113", "\\ell", true);
|
|
135
134
|
defineSymbol(math, textord, "\u266e", "\\natural", true);
|
|
@@ -222,7 +221,7 @@ defineSymbol(math, mathord, "\u2295", "\\Earth");
|
|
|
222
221
|
|
|
223
222
|
// AMS Negated Binary Relations
|
|
224
223
|
defineSymbol(math, rel, "\u226e", "\\nless", true);
|
|
225
|
-
// Symbol names
|
|
224
|
+
// Symbol names preceded by "@" each have a corresponding macro.
|
|
226
225
|
defineSymbol(math, rel, "\u2a87", "\\lneq", true);
|
|
227
226
|
defineSymbol(math, rel, "\u2268", "\\lneqq", true);
|
|
228
227
|
defineSymbol(math, rel, "\u2268\ufe00", "\\lvertneqq");
|