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.
Files changed (62) hide show
  1. package/README.md +1 -1
  2. package/dist/Temml-Asana.css +28 -0
  3. package/dist/Temml-Latin-Modern.css +29 -1
  4. package/dist/Temml-Libertinus.css +28 -0
  5. package/dist/Temml-Local.css +28 -0
  6. package/dist/Temml-NotoSans.css +28 -0
  7. package/dist/Temml-STIX2.css +28 -0
  8. package/dist/temml.cjs +305 -253
  9. package/dist/temml.d.ts +2 -2
  10. package/dist/temml.js +305 -253
  11. package/dist/temml.min.js +1 -1
  12. package/dist/temml.mjs +305 -253
  13. package/dist/temmlPostProcess.js +1 -1
  14. package/package.json +1 -1
  15. package/src/Settings.js +3 -3
  16. package/src/buildMathML.js +1 -1
  17. package/src/canceltoArrow.svg +15 -0
  18. package/src/domTree.js +1 -1
  19. package/src/environments/array.js +7 -7
  20. package/src/environments/cd.js +1 -1
  21. package/src/functions/accent.js +3 -4
  22. package/src/functions/accentunder.js +2 -2
  23. package/src/functions/arrow.js +2 -2
  24. package/src/functions/cancelto.js +56 -16
  25. package/src/functions/color.js +1 -1
  26. package/src/functions/cr.js +1 -1
  27. package/src/functions/delimsizing.js +1 -1
  28. package/src/functions/enclose.js +8 -10
  29. package/src/functions/envTag.js +1 -1
  30. package/src/functions/font.js +1 -1
  31. package/src/functions/genfrac.js +1 -1
  32. package/src/functions/{horizBrace.js → horizBracket.js} +6 -6
  33. package/src/functions/includegraphics.js +1 -1
  34. package/src/functions/kern.js +1 -1
  35. package/src/functions/label.js +1 -1
  36. package/src/functions/lap.js +1 -1
  37. package/src/functions/mclass.js +2 -2
  38. package/src/functions/multiscript.js +1 -1
  39. package/src/functions/not.js +1 -1
  40. package/src/functions/op.js +2 -1
  41. package/src/functions/operatorname.js +1 -1
  42. package/src/functions/phantom.js +1 -1
  43. package/src/functions/raise.js +1 -1
  44. package/src/functions/rule.js +1 -1
  45. package/src/functions/sfrac.js +1 -1
  46. package/src/functions/smash.js +1 -1
  47. package/src/functions/sqrt.js +1 -1
  48. package/src/functions/supsub.js +6 -6
  49. package/src/functions/symbolsOp.js +1 -1
  50. package/src/functions/symbolsOrd.js +1 -1
  51. package/src/functions/symbolsSpacing.js +1 -1
  52. package/src/functions/tip.js +1 -1
  53. package/src/functions/toggle.js +1 -1
  54. package/src/functions/vcenter.js +1 -1
  55. package/src/functions/verb.js +1 -1
  56. package/src/functions.js +2 -2
  57. package/src/linebreaking.js +1 -1
  58. package/src/mathMLTree.js +1 -7
  59. package/src/postProcess.js +1 -1
  60. package/src/stretchy.js +5 -8
  61. package/src/units.js +1 -1
  62. package/src/utils.js +8 -15
@@ -11,7 +11,7 @@
11
11
  * https://mit-license.org/
12
12
  */
13
13
 
14
- const version = "0.11.11";
14
+ const version = "0.12.02";
15
15
 
16
16
  function postProcess(block) {
17
17
  const labelMap = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "temml",
3
- "version": "0.11.11",
3
+ "version": "0.12.02",
4
4
  "description": "TeX to MathML conversion in JavaScript.",
5
5
  "main": "dist/temml.js",
6
6
  "engines": {
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, "tex") // "tex" | "="
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); // booelean
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
@@ -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
@@ -8,7 +8,7 @@
8
8
  * Similar functions for working with MathML nodes exist in mathMLTree.js.
9
9
  *
10
10
  */
11
- import utils from "./utils";
11
+ import * as utils from "./utils";
12
12
 
13
13
  /**
14
14
  * Create an HTML className based on a list of classes. In addition to joining
@@ -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 (group.autoTag) {
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 (group.autoTag) {
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 (group.autoTag) {
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 = group.autoTag ? 0 : -1
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 = { type: "small" };
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
@@ -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";
@@ -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ΠΥΨαδηιμνοτυχϵ"
@@ -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
 
5
5
  import * as mml from "../buildMathML";
6
6
 
@@ -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
- value: args[0],
16
- expression: args[1]
18
+ body,
19
+ to,
20
+ isCharacterBox: isCharacterBox(body)
17
21
  };
18
22
  },
19
23
  mathmlBuilder(group, style) {
20
- const value = new mathMLTree.MathNode(
21
- "mpadded",
22
- [mml.buildGroup(group.value, style)]
24
+ const fromNode = new mathMLTree.MathNode(
25
+ "mrow",
26
+ [mml.buildGroup(group.body, style)],
27
+ ["ff-narrow"] // A zero-width mrow.
23
28
  )
24
- value.setAttribute("depth", `-0.1em`)
25
- value.setAttribute("height", `+0.1em`)
26
- value.setAttribute("voffset", `0.1em`)
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
- const expression = new mathMLTree.MathNode(
29
- "menclose",
30
- [mml.buildGroup(group.expression, style)]
31
- )
32
- expression.setAttribute("notation", `updiagonalarrow`)
33
-
34
- return new mathMLTree.MathNode("msup", [expression, value])
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
  })
@@ -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"
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  import defineFunction from "../defineFunction";
2
- import mathMLTree from "../mathMLTree";
2
+ import * as mathMLTree from "../mathMLTree";
3
3
  import ParseError from "../ParseError";
4
4
  import { assertNodeType, checkSymbolNodeType } from "../parseNode";
5
5
 
@@ -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 node = new mathMLTree.MathNode("menclose", [mml.buildGroup(group.body, style)])
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
- // <menclose> doesn't have a good notation option for \colorbox.
68
- // So use <mpadded> instead. Set some attributes that come
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
  }
@@ -1,5 +1,5 @@
1
1
  import defineFunction from "../defineFunction";
2
- import mathMLTree from "../mathMLTree";
2
+ import * as mathMLTree from "../mathMLTree";
3
3
 
4
4
  defineFunction({
5
5
  type: "envTag",
@@ -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) {
@@ -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 braces
15
+ // Horizontal stretchy brackets
16
16
  defineFunction({
17
- type: "horizBrace",
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: "horizBrace",
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) {
@@ -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"
@@ -1,5 +1,5 @@
1
1
  import defineFunction from "../defineFunction";
2
- import mathMLTree from "../mathMLTree";
2
+ import * as mathMLTree from "../mathMLTree";
3
3
 
4
4
  // Limit valid characters to a small set, for safety.
5
5
  export const invalidIdRegEx = /[^A-Za-z_0-9-]/g
@@ -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
 
@@ -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";
@@ -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 ParseError from "../ParseError";
5
5
 
@@ -1,7 +1,7 @@
1
1
  import defineFunction, { ordargument } from "../defineFunction";
2
2
  import symbols from "../symbols";
3
3
  import * as mml from "../buildMathML";
4
- import utils from "../utils"
4
+ import * as utils from "../utils"
5
5
 
6
6
  defineFunction({
7
7
  type: "not",
@@ -337,7 +337,8 @@ defineFunction({
337
337
  "\u2a1a"
338
338
  ],
339
339
  props: {
340
- numArgs: 0
340
+ numArgs: 0,
341
+ allowedInArgument: true
341
342
  },
342
343
  handler({ parser, funcName }) {
343
344
  let fName = funcName;
@@ -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"
@@ -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 * as mml from "../buildMathML";
4
4
 
5
5
  defineFunction({
@@ -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"
@@ -1,5 +1,5 @@
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 { calculateSize } from "../units";
5
5
 
@@ -1,5 +1,5 @@
1
1
  import defineFunction from "../defineFunction";
2
- import mathMLTree from "../mathMLTree";
2
+ import * as mathMLTree from "../mathMLTree";
3
3
  import ParseError from "../ParseError"
4
4
 
5
5
  const numRegEx = /^[0-9]$/
@@ -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";
@@ -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
 
5
5
  // Letters that are x-height w/o a descender.
@@ -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 isBrace = false
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 === "horizBrace") {
35
+ if (group.base && group.base.type === "horizBracket") {
36
36
  isSup = !!group.sup
37
37
  if (isSup === group.base.isOver) {
38
- isBrace = true
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 (isBrace) {
86
+ if (isBracket) {
87
87
  nodeType = isOver ? "mover" : "munder"
88
88
  } else if (!group.sub) {
89
89
  const base = group.base
@@ -1,5 +1,5 @@
1
1
  import { defineFunctionBuilders } from "../defineFunction";
2
- import mathMLTree from "../mathMLTree";
2
+ import * as mathMLTree from "../mathMLTree";
3
3
  import * as mml from "../buildMathML";
4
4
  import { padding } from "./arrow";
5
5
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  import { defineFunctionBuilders } from "../defineFunction"
2
- import mathMLTree from "../mathMLTree"
2
+ import * as mathMLTree from "../mathMLTree"
3
3
  import ParseError from "../ParseError"
4
4
 
5
5
  // A map of CSS-based spacing functions to their CSS class.
@@ -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
 
5
5
  // Two functions included to enable migration from Mathjax.
@@ -1,5 +1,5 @@
1
1
  import { defineFunctionBuilders } from "../defineFunction";
2
- import mathMLTree from "../mathMLTree";
2
+ import * as mathMLTree from "../mathMLTree";
3
3
  import * as mml from "../buildMathML";
4
4
 
5
5
  defineFunctionBuilders({
@@ -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
 
5
5
  // \vcenter: Vertically center the argument group on the math axis.