katex 0.15.0 → 0.15.3

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.
@@ -22,7 +22,7 @@ function mathmlBuilder(group: ParseNode<"mclass">, options) {
22
22
  const inner = mml.buildExpression(group.body, options);
23
23
 
24
24
  if (group.mclass === "minner") {
25
- return mathMLTree.newDocumentFragment(inner);
25
+ node = new mathMLTree.MathNode("mpadded", inner);
26
26
  } else if (group.mclass === "mord") {
27
27
  if (group.isCharacterBox) {
28
28
  node = inner[0];
@@ -49,6 +49,9 @@ function mathmlBuilder(group: ParseNode<"mclass">, options) {
49
49
  } else if (group.mclass === "mopen" || group.mclass === "mclose") {
50
50
  node.attributes.lspace = "0em";
51
51
  node.attributes.rspace = "0em";
52
+ } else if (group.mclass === "minner") {
53
+ node.attributes.lspace = "0.0556em"; // 1 mu is the most likely option
54
+ node.attributes.width = "+0.1111em";
52
55
  }
53
56
  // MathML <mo> default space is 5/18 em, so <mrel> needs no action.
54
57
  // Ref: https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mo
package/src/parseNode.js CHANGED
@@ -39,7 +39,8 @@ type ParseNodeTypes = {
39
39
  body: AnyParseNode[][], // List of rows in the (2D) array.
40
40
  rowGaps: (?Measurement)[],
41
41
  hLinesBeforeRow: Array<boolean[]>,
42
- addEqnNum?: boolean,
42
+ // Whether each row should be automatically numbered, or an explicit tag
43
+ tags?: (boolean | AnyParseNode[])[],
43
44
  leqno?: boolean,
44
45
  isCD?: boolean,
45
46
  |},
package/src/parseTree.js CHANGED
@@ -6,6 +6,7 @@
6
6
 
7
7
  import Parser from "./Parser";
8
8
  import ParseError from "./ParseError";
9
+ import {Token} from "./Token";
9
10
 
10
11
  import type Settings from "./Settings";
11
12
  import type {AnyParseNode} from "./parseNode";
@@ -34,12 +35,11 @@ const parseTree = function(toParse: string, settings: Settings): AnyParseNode[]
34
35
  if (!settings.displayMode) {
35
36
  throw new ParseError("\\tag works only in display equations");
36
37
  }
37
- parser.gullet.feed("\\df@tag");
38
38
  tree = [{
39
39
  type: "tag",
40
40
  mode: "text",
41
41
  body: tree,
42
- tag: parser.parse(),
42
+ tag: parser.subparse([new Token("\\df@tag")]),
43
43
  }];
44
44
  }
45
45
 
package/src/symbols.js CHANGED
@@ -171,7 +171,7 @@ defineSymbol(math, main, bin, "\u2293", "\\sqcap", true);
171
171
  defineSymbol(math, main, bin, "\u2217", "\\ast");
172
172
  defineSymbol(math, main, bin, "\u2294", "\\sqcup", true);
173
173
  defineSymbol(math, main, bin, "\u25ef", "\\bigcirc", true);
174
- defineSymbol(math, main, bin, "\u2219", "\\bullet");
174
+ defineSymbol(math, main, bin, "\u2219", "\\bullet", true);
175
175
  defineSymbol(math, main, bin, "\u2021", "\\ddagger");
176
176
  defineSymbol(math, main, bin, "\u2240", "\\wr", true);
177
177
  defineSymbol(math, main, bin, "\u2a3f", "\\amalg");
@@ -538,13 +538,13 @@ defineSymbol(math, main, bin, "\u2217", "*", true);
538
538
  defineSymbol(math, main, bin, "+", "+");
539
539
  defineSymbol(math, main, bin, "\u2212", "-", true);
540
540
  defineSymbol(math, main, bin, "\u22c5", "\\cdot", true);
541
- defineSymbol(math, main, bin, "\u2218", "\\circ");
541
+ defineSymbol(math, main, bin, "\u2218", "\\circ", true);
542
542
  defineSymbol(math, main, bin, "\u00f7", "\\div", true);
543
543
  defineSymbol(math, main, bin, "\u00b1", "\\pm", true);
544
544
  defineSymbol(math, main, bin, "\u00d7", "\\times", true);
545
545
  defineSymbol(math, main, bin, "\u2229", "\\cap", true);
546
546
  defineSymbol(math, main, bin, "\u222a", "\\cup", true);
547
- defineSymbol(math, main, bin, "\u2216", "\\setminus");
547
+ defineSymbol(math, main, bin, "\u2216", "\\setminus", true);
548
548
  defineSymbol(math, main, bin, "\u2227", "\\land");
549
549
  defineSymbol(math, main, bin, "\u2228", "\\lor");
550
550
  defineSymbol(math, main, bin, "\u2227", "\\wedge", true);