temml 0.11.11 → 0.12.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-Asana.css +28 -0
- package/dist/Temml-Latin-Modern.css +29 -1
- package/dist/Temml-Libertinus.css +28 -0
- package/dist/Temml-Local.css +28 -0
- package/dist/Temml-NotoSans.css +28 -0
- package/dist/Temml-STIX2.css +28 -0
- package/dist/temml.cjs +305 -253
- package/dist/temml.d.ts +2 -2
- package/dist/temml.js +305 -253
- package/dist/temml.min.js +1 -1
- package/dist/temml.mjs +305 -253
- package/dist/temmlPostProcess.js +1 -1
- package/package.json +1 -1
- package/src/Settings.js +3 -3
- package/src/buildMathML.js +1 -1
- package/src/canceltoArrow.svg +15 -0
- package/src/domTree.js +1 -1
- package/src/environments/array.js +7 -7
- package/src/environments/cd.js +1 -1
- package/src/functions/accent.js +3 -4
- package/src/functions/accentunder.js +2 -2
- package/src/functions/arrow.js +2 -2
- package/src/functions/cancelto.js +56 -16
- package/src/functions/color.js +1 -1
- package/src/functions/cr.js +1 -1
- package/src/functions/delimsizing.js +1 -1
- package/src/functions/enclose.js +8 -10
- package/src/functions/envTag.js +1 -1
- package/src/functions/font.js +1 -1
- package/src/functions/genfrac.js +1 -1
- package/src/functions/{horizBrace.js → horizBracket.js} +6 -6
- package/src/functions/includegraphics.js +1 -1
- package/src/functions/kern.js +1 -1
- package/src/functions/label.js +1 -1
- package/src/functions/lap.js +1 -1
- package/src/functions/mclass.js +2 -2
- package/src/functions/multiscript.js +1 -1
- package/src/functions/not.js +1 -1
- package/src/functions/op.js +2 -1
- package/src/functions/operatorname.js +1 -1
- package/src/functions/phantom.js +1 -1
- package/src/functions/raise.js +1 -1
- package/src/functions/rule.js +1 -1
- package/src/functions/sfrac.js +1 -1
- package/src/functions/smash.js +1 -1
- package/src/functions/sqrt.js +1 -1
- package/src/functions/supsub.js +6 -6
- package/src/functions/symbolsOp.js +1 -1
- package/src/functions/symbolsOrd.js +1 -1
- package/src/functions/symbolsSpacing.js +1 -1
- package/src/functions/tip.js +1 -1
- package/src/functions/toggle.js +1 -1
- package/src/functions/vcenter.js +1 -1
- package/src/functions/verb.js +1 -1
- package/src/functions.js +2 -2
- package/src/linebreaking.js +1 -1
- package/src/mathMLTree.js +1 -7
- package/src/postProcess.js +1 -1
- package/src/stretchy.js +5 -8
- package/src/units.js +1 -1
- package/src/utils.js +8 -15
package/dist/temmlPostProcess.js
CHANGED
package/package.json
CHANGED
package/src/Settings.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* default settings.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import utils from "./utils";
|
|
6
|
+
import * as utils from "./utils";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The main Settings object
|
|
@@ -18,9 +18,9 @@ export default class Settings {
|
|
|
18
18
|
this.throwOnError = utils.deflt(options.throwOnError, false); // boolean
|
|
19
19
|
this.errorColor = utils.deflt(options.errorColor, "#b22222"); // string
|
|
20
20
|
this.macros = options.macros || {};
|
|
21
|
-
this.wrap = utils.deflt(options.wrap, "
|
|
21
|
+
this.wrap = utils.deflt(options.wrap, "none") // "none" | "tex" | "="
|
|
22
22
|
this.xml = utils.deflt(options.xml, false); // boolean
|
|
23
|
-
this.colorIsTextColor = utils.deflt(options.colorIsTextColor, false); //
|
|
23
|
+
this.colorIsTextColor = utils.deflt(options.colorIsTextColor, false); // boolean
|
|
24
24
|
this.strict = utils.deflt(options.strict, false); // boolean
|
|
25
25
|
this.trust = utils.deflt(options.trust, false); // trust context. See html.js.
|
|
26
26
|
this.maxSize = (options.maxSize === undefined
|
package/src/buildMathML.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* parser.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import mathMLTree from "./mathMLTree"
|
|
7
|
+
import * as mathMLTree from "./mathMLTree"
|
|
8
8
|
import ParseError from "./ParseError"
|
|
9
9
|
import symbols, { ligatures } from "./symbols"
|
|
10
10
|
import { _mathmlGroupBuilders as groupBuilders } from "./defineFunction"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<svg xmlns='http://www.w3.org/2000/svg'>
|
|
2
|
+
<!--See Temml CSS files for minified versions of this arrow.-->
|
|
3
|
+
<defs>
|
|
4
|
+
<marker id='arrowhead'
|
|
5
|
+
markerWidth='7' markerHeight='5'
|
|
6
|
+
refX='7' refY='2.5'
|
|
7
|
+
orient='auto'
|
|
8
|
+
markerUnits='strokeWidth'>
|
|
9
|
+
<path d='M0,0 L7,2.5 L0,5 z' fill='currentColor' stroke='none'/>
|
|
10
|
+
</marker>
|
|
11
|
+
</defs>
|
|
12
|
+
<line y1='100%' x2='100%' stroke='currentColor' stroke-width='0.06em'
|
|
13
|
+
vector-effect='non-scaling-stroke' marker-end='url(#arrowhead)'>
|
|
14
|
+
</line>
|
|
15
|
+
</svg>
|
package/src/domTree.js
CHANGED
|
@@ -2,7 +2,7 @@ import defineEnvironment from "../defineEnvironment";
|
|
|
2
2
|
import { parseCD } from "./cd";
|
|
3
3
|
import { bordermatrixParseTree } from "./borderTree.js"
|
|
4
4
|
import defineFunction from "../defineFunction";
|
|
5
|
-
import mathMLTree from "../mathMLTree";
|
|
5
|
+
import * as mathMLTree from "../mathMLTree";
|
|
6
6
|
import { Span } from "../domTree"
|
|
7
7
|
import { Token } from "../Token";
|
|
8
8
|
import { StyleLevel } from "../constants"
|
|
@@ -267,6 +267,7 @@ const mathmlBuilder = function(group, style) {
|
|
|
267
267
|
const tbl = [];
|
|
268
268
|
const numRows = group.body.length
|
|
269
269
|
const hlines = group.hLinesBeforeRow;
|
|
270
|
+
const tagIsPresent = (group.tags && group.tags.some((tag) => tag));
|
|
270
271
|
|
|
271
272
|
for (let i = 0; i < numRows; i++) {
|
|
272
273
|
const rw = group.body[i];
|
|
@@ -296,7 +297,7 @@ const mathmlBuilder = function(group, style) {
|
|
|
296
297
|
for (let k = 0; k < numColumns - rw.length; k++) {
|
|
297
298
|
row.push(new mathMLTree.MathNode("mtd", [], [], style))
|
|
298
299
|
}
|
|
299
|
-
if (
|
|
300
|
+
if (tagIsPresent) {
|
|
300
301
|
const tag = group.tags[i];
|
|
301
302
|
let tagElement
|
|
302
303
|
if (tag === true) { // automatic numbering
|
|
@@ -408,7 +409,7 @@ const mathmlBuilder = function(group, style) {
|
|
|
408
409
|
if (j === numCols - 1 && hand === 1) { return "0" }
|
|
409
410
|
if (group.envClasses[0] !== "align") { return sidePadding }
|
|
410
411
|
if (hand === 1) { return "0" }
|
|
411
|
-
if (
|
|
412
|
+
if (tagIsPresent) {
|
|
412
413
|
return (j % 2) ? "1" : "0"
|
|
413
414
|
} else {
|
|
414
415
|
return (j % 2) ? "0" : "1"
|
|
@@ -444,7 +445,7 @@ const mathmlBuilder = function(group, style) {
|
|
|
444
445
|
// TODO: Remove -webkit- when Chromium no longer needs it.
|
|
445
446
|
row.children[j].classes = ["tml-" + (j % 2 ? "left" : "right")]
|
|
446
447
|
}
|
|
447
|
-
if (
|
|
448
|
+
if (tagIsPresent) {
|
|
448
449
|
const k = group.leqno ? 0 : row.children.length - 1
|
|
449
450
|
row.children[k].classes = []; // Default is center.
|
|
450
451
|
}
|
|
@@ -501,7 +502,7 @@ const mathmlBuilder = function(group, style) {
|
|
|
501
502
|
row.children[0].style.borderLeft = sep
|
|
502
503
|
}
|
|
503
504
|
}
|
|
504
|
-
let iCol =
|
|
505
|
+
let iCol = tagIsPresent ? 0 : -1
|
|
505
506
|
for (let i = iStart; i < iEnd; i++) {
|
|
506
507
|
if (cols[i].type === "align") {
|
|
507
508
|
const colAlign = alignMap[cols[i].align];
|
|
@@ -794,9 +795,8 @@ defineEnvironment({
|
|
|
794
795
|
numArgs: 0
|
|
795
796
|
},
|
|
796
797
|
handler(context) {
|
|
797
|
-
const payload = {
|
|
798
|
+
const payload = { envClasses: ["small"] };
|
|
798
799
|
const res = parseArray(context.parser, payload, "script");
|
|
799
|
-
res.envClasses = ["small"];
|
|
800
800
|
return res;
|
|
801
801
|
},
|
|
802
802
|
mathmlBuilder
|
package/src/environments/cd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import defineFunction from "../defineFunction";
|
|
2
|
-
import mathMLTree from "../mathMLTree";
|
|
2
|
+
import * as mathMLTree from "../mathMLTree";
|
|
3
3
|
import * as mml from "../buildMathML";
|
|
4
4
|
import { assertSymbolNodeType } from "../parseNode";
|
|
5
5
|
import ParseError from "../ParseError";
|
package/src/functions/accent.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import defineFunction, { normalizeArgument } from "../defineFunction"
|
|
2
|
-
import mathMLTree from "../mathMLTree"
|
|
3
|
-
import stretchy from "../stretchy"
|
|
2
|
+
import * as mathMLTree from "../mathMLTree"
|
|
3
|
+
import * as stretchy from "../stretchy"
|
|
4
4
|
import * as mml from "../buildMathML"
|
|
5
|
+
import { smalls } from "../utils"
|
|
5
6
|
|
|
6
|
-
// Identify letters to which we'll attach a combining accent character
|
|
7
|
-
const smalls = "acegıȷmnopqrsuvwxyzαγεηικμνοπρςστυχωϕ𝐚𝐜𝐞𝐠𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐮𝐯𝐰𝐱𝐲𝐳"
|
|
8
7
|
|
|
9
8
|
// From the KaTeX font metrics, identify letters whose accents need a italic correction.
|
|
10
9
|
const smallNudge = "DHKLUcegorsuvxyzΠΥΨαδηιμνοτυχϵ"
|
package/src/functions/arrow.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import defineFunction from "../defineFunction";
|
|
2
|
-
import mathMLTree from "../mathMLTree";
|
|
3
|
-
import stretchy from "../stretchy";
|
|
2
|
+
import * as mathMLTree from "../mathMLTree";
|
|
3
|
+
import * as stretchy from "../stretchy";
|
|
4
4
|
import { emScale } from "../units";
|
|
5
5
|
import * as mml from "../buildMathML";
|
|
6
6
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import defineFunction from "../defineFunction";
|
|
2
|
-
import mathMLTree from "../mathMLTree";
|
|
2
|
+
import * as mathMLTree from "../mathMLTree";
|
|
3
3
|
import * as mml from "../buildMathML";
|
|
4
|
+
import { isCharacterBox, smalls } from "../utils";
|
|
4
5
|
|
|
5
6
|
defineFunction({
|
|
6
7
|
type: "cancelto",
|
|
@@ -9,28 +10,67 @@ defineFunction({
|
|
|
9
10
|
numArgs: 2
|
|
10
11
|
},
|
|
11
12
|
handler({ parser }, args) {
|
|
13
|
+
const to = args[0];
|
|
14
|
+
const body = args[1];
|
|
12
15
|
return {
|
|
13
16
|
type: "cancelto",
|
|
14
17
|
mode: parser.mode,
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
body,
|
|
19
|
+
to,
|
|
20
|
+
isCharacterBox: isCharacterBox(body)
|
|
17
21
|
};
|
|
18
22
|
},
|
|
19
23
|
mathmlBuilder(group, style) {
|
|
20
|
-
const
|
|
21
|
-
"
|
|
22
|
-
[mml.buildGroup(group.
|
|
24
|
+
const fromNode = new mathMLTree.MathNode(
|
|
25
|
+
"mrow",
|
|
26
|
+
[mml.buildGroup(group.body, style)],
|
|
27
|
+
["ff-narrow"] // A zero-width mrow.
|
|
23
28
|
)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
// Write the arrow in a node written after the content.
|
|
30
|
+
// That way, the arrow will be an overlay on the content.
|
|
31
|
+
const phantom = new mathMLTree.MathNode("mphantom", [mml.buildGroup(group.body, style)])
|
|
32
|
+
const arrow = new mathMLTree.MathNode("mrow", [phantom], ["tml-cancelto"])
|
|
33
|
+
if (group.isCharacterBox && smalls.indexOf(group.body.body[0].text) > -1) {
|
|
34
|
+
arrow.style.left = "0.1em"
|
|
35
|
+
arrow.style.width = "90%"
|
|
36
|
+
}
|
|
37
|
+
const node = new mathMLTree.MathNode("mrow", [fromNode, arrow], ["menclose"])
|
|
38
|
+
if (!group.isCharacterBox || /[f∫∑]/.test(group.body.body[0].text)) {
|
|
39
|
+
// Add 0.2em space to right of content to make room for the arrowhead.
|
|
40
|
+
phantom.style.paddingRight = "0.2em"
|
|
41
|
+
} else {
|
|
42
|
+
phantom.style.padding = "0.5ex 0.1em 0 0"
|
|
43
|
+
const strut = new mathMLTree.MathNode('mspace', [])
|
|
44
|
+
strut.setAttribute('height', "0.85em")
|
|
45
|
+
fromNode.children.push(strut)
|
|
46
|
+
}
|
|
27
47
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
48
|
+
// Create the "to" value above and to the right of the arrow.
|
|
49
|
+
// First, we want a dummy node with the same height as the `from` content.
|
|
50
|
+
// We'll place the `to` node above the dummy to get the correct vertical alignment.
|
|
51
|
+
let dummyNode
|
|
52
|
+
if (group.isCharacterBox) {
|
|
53
|
+
dummyNode = new mathMLTree.MathNode('mspace', [])
|
|
54
|
+
dummyNode.setAttribute('height', "1em")
|
|
55
|
+
} else {
|
|
56
|
+
// Create a phantom node with the same content as the body.
|
|
57
|
+
const inner = mml.buildGroup(group.body, style)
|
|
58
|
+
// The phantom node will be zero-width, so it won't affect horizontal spacing.
|
|
59
|
+
const zeroWidthNode = new mathMLTree.MathNode("mpadded", [inner])
|
|
60
|
+
zeroWidthNode.setAttribute("width", "0.1px") // Don't use 0. WebKit would omit it.
|
|
61
|
+
dummyNode = new mathMLTree.MathNode("mphantom", [zeroWidthNode]) // Hide it.
|
|
62
|
+
}
|
|
63
|
+
const toNode = mml.buildGroup(group.to, style)
|
|
64
|
+
const zeroWidthToNode = new mathMLTree.MathNode("mpadded", [toNode])
|
|
65
|
+
if (!group.isCharacterBox || /[f∫∑]/.test(group.body.body[0].text)) {
|
|
66
|
+
const w = new mathMLTree.MathNode("mspace", [])
|
|
67
|
+
w.setAttribute('width', "0.2em")
|
|
68
|
+
zeroWidthToNode.children.unshift(w)
|
|
69
|
+
}
|
|
70
|
+
zeroWidthToNode.setAttribute("width", "0.1px") // Don't use 0. WebKit would hide it.
|
|
71
|
+
const mover = new mathMLTree.MathNode("mover", [dummyNode, zeroWidthToNode])
|
|
72
|
+
// Fix Firefox positioning.
|
|
73
|
+
const nudgeLeft = new mathMLTree.MathNode('mrow', [], ["ff-nudge-left"])
|
|
74
|
+
return mathMLTree.newDocumentFragment([mml.makeRow([node, mover]), nudgeLeft])
|
|
35
75
|
}
|
|
36
76
|
})
|
package/src/functions/color.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import defineFunction, { ordargument } from "../defineFunction"
|
|
2
|
-
import mathMLTree from "../mathMLTree"
|
|
2
|
+
import * as mathMLTree from "../mathMLTree"
|
|
3
3
|
import { assertNodeType } from "../parseNode"
|
|
4
4
|
import ParseError from "../ParseError"
|
|
5
5
|
import * as mml from "../buildMathML"
|
package/src/functions/cr.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Row breaks within tabular environments, and line breaks at top level
|
|
2
2
|
|
|
3
3
|
import defineFunction from "../defineFunction"
|
|
4
|
-
import mathMLTree from "../mathMLTree"
|
|
4
|
+
import * as mathMLTree from "../mathMLTree"
|
|
5
5
|
import { calculateSize } from "../units"
|
|
6
6
|
import { assertNodeType } from "../parseNode"
|
|
7
7
|
|
package/src/functions/enclose.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import defineFunction from "../defineFunction";
|
|
2
|
-
import mathMLTree from "../mathMLTree";
|
|
2
|
+
import * as mathMLTree from "../mathMLTree";
|
|
3
3
|
import { assertNodeType } from "../parseNode";
|
|
4
4
|
import { colorFromSpec, validateColor } from "./color"
|
|
5
5
|
import * as mml from "../buildMathML";
|
|
6
6
|
|
|
7
|
+
const boxTags = ["\\boxed", "\\fcolorbox", "\\colorbox"];
|
|
8
|
+
|
|
7
9
|
const mathmlBuilder = (group, style) => {
|
|
8
|
-
const
|
|
10
|
+
const tag = boxTags.includes(group.label) ? "mrow" : "menclose"
|
|
11
|
+
const node = new mathMLTree.MathNode(tag, [mml.buildGroup(group.body, style)])
|
|
9
12
|
switch (group.label) {
|
|
10
13
|
case "\\overline":
|
|
11
14
|
node.setAttribute("notation", "top") // for Firefox & WebKit
|
|
@@ -31,6 +34,7 @@ const mathmlBuilder = (group, style) => {
|
|
|
31
34
|
node.setAttribute("notation", "updiagonalstrike downdiagonalstrike")
|
|
32
35
|
node.classes.push("tml-xcancel")
|
|
33
36
|
break
|
|
37
|
+
// cancelto is handled in cancelto.js
|
|
34
38
|
case "\\longdiv":
|
|
35
39
|
node.setAttribute("notation", "longdiv")
|
|
36
40
|
node.classes.push("longdiv-top")
|
|
@@ -52,7 +56,6 @@ const mathmlBuilder = (group, style) => {
|
|
|
52
56
|
break
|
|
53
57
|
case "\\boxed":
|
|
54
58
|
// \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}} from amsmath.sty
|
|
55
|
-
node.setAttribute("notation", "box")
|
|
56
59
|
node.style.padding = "3pt"
|
|
57
60
|
node.style.border = "1px solid"
|
|
58
61
|
node.setAttribute("scriptlevel", "0")
|
|
@@ -64,13 +67,8 @@ const mathmlBuilder = (group, style) => {
|
|
|
64
67
|
break
|
|
65
68
|
case "\\fcolorbox":
|
|
66
69
|
case "\\colorbox": {
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
// included with <menclose>.
|
|
70
|
-
//const fboxsep = 3; // 3 pt from LaTeX source2e
|
|
71
|
-
//node.setAttribute("height", `+${2 * fboxsep}pt`)
|
|
72
|
-
//node.setAttribute("voffset", `${fboxsep}pt`)
|
|
73
|
-
node.style.padding = "3pt"
|
|
70
|
+
// Don't use <menclose>. WebKit would show a radical.
|
|
71
|
+
node.style.padding = "0.3em" // 3 pt from LaTeX source2e for a 10pt font
|
|
74
72
|
if (group.label === "\\fcolorbox") {
|
|
75
73
|
node.style.border = "0.0667em solid " + String(group.borderColor)
|
|
76
74
|
}
|
package/src/functions/envTag.js
CHANGED
package/src/functions/font.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import defineFunction, { normalizeArgument } from "../defineFunction"
|
|
2
2
|
import * as mml from "../buildMathML"
|
|
3
|
-
import mathMLTree from "../mathMLTree"
|
|
3
|
+
import * as mathMLTree from "../mathMLTree"
|
|
4
4
|
|
|
5
5
|
const isLongVariableName = (group, font) => {
|
|
6
6
|
if (font !== "mathrm" || group.body.type !== "ordgroup" || group.body.body.length === 1) {
|
package/src/functions/genfrac.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import defineFunction, { normalizeArgument } from "../defineFunction";
|
|
2
|
-
import mathMLTree from "../mathMLTree";
|
|
2
|
+
import * as mathMLTree from "../mathMLTree";
|
|
3
3
|
import { StyleLevel } from "../constants"
|
|
4
4
|
import { assertNodeType } from "../parseNode";
|
|
5
5
|
import { assert } from "../utils";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import defineFunction from "../defineFunction";
|
|
2
|
-
import mathMLTree from "../mathMLTree";
|
|
3
|
-
import stretchy from "../stretchy";
|
|
2
|
+
import * as mathMLTree from "../mathMLTree";
|
|
3
|
+
import * as stretchy from "../stretchy";
|
|
4
4
|
import * as mml from "../buildMathML";
|
|
5
5
|
|
|
6
6
|
const mathmlBuilder = (group, style) => {
|
|
@@ -12,16 +12,16 @@ const mathmlBuilder = (group, style) => {
|
|
|
12
12
|
]);
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
// Horizontal stretchy
|
|
15
|
+
// Horizontal stretchy brackets
|
|
16
16
|
defineFunction({
|
|
17
|
-
type: "
|
|
18
|
-
names: ["\\overbrace", "\\underbrace"],
|
|
17
|
+
type: "horizBracket",
|
|
18
|
+
names: ["\\overbrace", "\\underbrace", "\\overbracket", "\\underbracket"],
|
|
19
19
|
props: {
|
|
20
20
|
numArgs: 1
|
|
21
21
|
},
|
|
22
22
|
handler({ parser, funcName }, args) {
|
|
23
23
|
return {
|
|
24
|
-
type: "
|
|
24
|
+
type: "horizBracket",
|
|
25
25
|
mode: parser.mode,
|
|
26
26
|
label: funcName,
|
|
27
27
|
isOver: /^\\over/.test(funcName),
|
|
@@ -2,7 +2,7 @@ import defineFunction from "../defineFunction"
|
|
|
2
2
|
import { calculateSize, validUnit } from "../units"
|
|
3
3
|
import ParseError from "../ParseError"
|
|
4
4
|
import { Img } from "../domTree"
|
|
5
|
-
import mathMLTree from "../mathMLTree"
|
|
5
|
+
import * as mathMLTree from "../mathMLTree"
|
|
6
6
|
import { assertNodeType } from "../parseNode"
|
|
7
7
|
|
|
8
8
|
const sizeData = function(str) {
|
package/src/functions/kern.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Horizontal spacing commands
|
|
2
2
|
|
|
3
3
|
import defineFunction from "../defineFunction";
|
|
4
|
-
import mathMLTree from "../mathMLTree";
|
|
4
|
+
import * as mathMLTree from "../mathMLTree";
|
|
5
5
|
import { calculateSize } from "../units";
|
|
6
6
|
import { assertNodeType } from "../parseNode";
|
|
7
7
|
import ParseError from "../ParseError"
|
package/src/functions/label.js
CHANGED
package/src/functions/lap.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Horizontal overlap functions
|
|
2
2
|
import defineFunction, { ordargument } from "../defineFunction";
|
|
3
|
-
import mathMLTree from "../mathMLTree"
|
|
3
|
+
import * as mathMLTree from "../mathMLTree"
|
|
4
4
|
import * as mml from "../buildMathML"
|
|
5
5
|
import ParseError from "../ParseError";
|
|
6
6
|
|
package/src/functions/mclass.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import defineFunction, { ordargument } from "../defineFunction";
|
|
2
2
|
import symbols from "../symbols";
|
|
3
|
-
import mathMLTree from "../mathMLTree";
|
|
4
|
-
import utils from "../utils.js"
|
|
3
|
+
import * as mathMLTree from "../mathMLTree";
|
|
4
|
+
import * as utils from "../utils.js"
|
|
5
5
|
import { padding } from "./arrow";
|
|
6
6
|
|
|
7
7
|
import * as mml from "../buildMathML";
|
package/src/functions/not.js
CHANGED
package/src/functions/op.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import defineFunction, { ordargument } from "../defineFunction"
|
|
2
2
|
import defineMacro from "../defineMacro";
|
|
3
|
-
import mathMLTree from "../mathMLTree"
|
|
3
|
+
import * as mathMLTree from "../mathMLTree"
|
|
4
4
|
import { spaceCharacter } from "./kern"
|
|
5
5
|
import { ordTypes } from "./op"
|
|
6
6
|
import { isDelimiter } from "./delimsizing"
|
package/src/functions/phantom.js
CHANGED
package/src/functions/raise.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import defineFunction from "../defineFunction"
|
|
2
2
|
import { StyleLevel } from "../constants"
|
|
3
|
-
import mathMLTree from "../mathMLTree"
|
|
3
|
+
import * as mathMLTree from "../mathMLTree"
|
|
4
4
|
import { assertNodeType } from "../parseNode"
|
|
5
5
|
import { calculateSize } from "../units"
|
|
6
6
|
import * as mml from "../buildMathML"
|
package/src/functions/rule.js
CHANGED
package/src/functions/sfrac.js
CHANGED
package/src/functions/smash.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// smash, with optional [tb], as in AMS
|
|
2
2
|
import defineFunction from "../defineFunction";
|
|
3
|
-
import mathMLTree from "../mathMLTree";
|
|
3
|
+
import * as mathMLTree from "../mathMLTree";
|
|
4
4
|
import { assertNodeType } from "../parseNode";
|
|
5
5
|
|
|
6
6
|
import * as mml from "../buildMathML";
|
package/src/functions/sqrt.js
CHANGED
package/src/functions/supsub.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineFunctionBuilders } from "../defineFunction"
|
|
2
2
|
import { StyleLevel } from "../constants"
|
|
3
|
-
import mathMLTree from "../mathMLTree"
|
|
3
|
+
import * as mathMLTree from "../mathMLTree"
|
|
4
4
|
import * as mml from "../buildMathML"
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -24,18 +24,18 @@ const largePad = "AJdfΔΛ"
|
|
|
24
24
|
defineFunctionBuilders({
|
|
25
25
|
type: "supsub",
|
|
26
26
|
mathmlBuilder(group, style) {
|
|
27
|
-
// Is the inner group a relevant horizontal brace?
|
|
28
|
-
let
|
|
27
|
+
// Is the inner group a relevant horizontal brace or bracket?
|
|
28
|
+
let isBracket = false
|
|
29
29
|
let isOver
|
|
30
30
|
let isSup
|
|
31
31
|
let appendApplyFunction = false
|
|
32
32
|
let appendSpace = false
|
|
33
33
|
let needsLeadingSpace = false
|
|
34
34
|
|
|
35
|
-
if (group.base && group.base.type === "
|
|
35
|
+
if (group.base && group.base.type === "horizBracket") {
|
|
36
36
|
isSup = !!group.sup
|
|
37
37
|
if (isSup === group.base.isOver) {
|
|
38
|
-
|
|
38
|
+
isBracket = true
|
|
39
39
|
isOver = group.base.isOver
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -83,7 +83,7 @@ defineFunctionBuilders({
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
let nodeType;
|
|
86
|
-
if (
|
|
86
|
+
if (isBracket) {
|
|
87
87
|
nodeType = isOver ? "mover" : "munder"
|
|
88
88
|
} else if (!group.sub) {
|
|
89
89
|
const base = group.base
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineFunctionBuilders } from "../defineFunction"
|
|
2
2
|
import { getVariant } from "../variant"
|
|
3
3
|
import { variantChar, smallCaps } from "../replace"
|
|
4
|
-
import mathMLTree from "../mathMLTree"
|
|
4
|
+
import * as mathMLTree from "../mathMLTree"
|
|
5
5
|
import * as mml from "../buildMathML"
|
|
6
6
|
|
|
7
7
|
// "mathord" and "textord" ParseNodes created in Parser.js from symbol Groups in
|
package/src/functions/tip.js
CHANGED
package/src/functions/toggle.js
CHANGED
package/src/functions/vcenter.js
CHANGED