temml 0.10.24 → 0.10.30

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,7 @@ const ordAtomTypes = ["textord", "mathord", "atom"]
12
12
  const noSuccessor = ["\\smallint"];
13
13
 
14
14
  // Math operators (e.g. \sin) need a space between these types and themselves:
15
- export const ordTypes = ["textord", "mathord", "ordgroup", "close", "leftright"];
15
+ export const ordTypes = ["textord", "mathord", "ordgroup", "close", "leftright", "font"];
16
16
 
17
17
  // NOTE: Unlike most `builders`s, this one handles not only "op", but also
18
18
  // "supsub" since some of them (like \int) can affect super/subscripting.
@@ -32,6 +32,13 @@ const mathmlBuilder = (group, style) => {
32
32
  node = new mathMLTree.MathNode("mo", [mml.makeText(group.name, group.mode)]);
33
33
  if (noSuccessor.includes(group.name)) {
34
34
  node.setAttribute("largeop", "false")
35
+ } else if (group.limits) {
36
+ // This is a workaround for a MathML/Chromium bug.
37
+ // This is being applied to singleCharBigOps, which are not really stretchy.
38
+ // But by setting the stretchy attribute, Chromium will vertically center
39
+ // big ops around the math axis. This is needed since STIX TWO does not do so.
40
+ // TODO: Remove this hack when MathML & Chromium fix their problem.
41
+ node.setAttribute("stretchy", "true")
35
42
  } else {
36
43
  node.setAttribute("movablelimits", "false")
37
44
  }
@@ -81,6 +88,9 @@ const singleCharBigOps = {
81
88
  "\u2a04": "\\biguplus",
82
89
  "\u2a05": "\\bigsqcap",
83
90
  "\u2a06": "\\bigsqcup",
91
+ "\u2a03": "\\bigcupdot",
92
+ "\u2a07": "\\bigdoublevee",
93
+ "\u2a08": "\\bigdoublewedge",
84
94
  "\u2a09": "\\bigtimes"
85
95
  };
86
96
 
@@ -91,8 +101,12 @@ defineFunction({
91
101
  "\\bigvee",
92
102
  "\\bigwedge",
93
103
  "\\biguplus",
104
+ "\\bigcupplus",
105
+ "\\bigcupdot",
94
106
  "\\bigcap",
95
107
  "\\bigcup",
108
+ "\\bigdoublevee",
109
+ "\\bigdoublewedge",
96
110
  "\\intop",
97
111
  "\\prod",
98
112
  "\\sum",
@@ -55,9 +55,9 @@ defineFunctionBuilders({
55
55
  if (group.sup) {
56
56
  const sup = mml.buildGroup(group.sup, childStyle)
57
57
  const testNode = sup.type === "mrow" ? sup.children[0] : sup
58
- if ((testNode.type === "mo" && testNode.classes.includes("tml-prime"))
58
+ if ((testNode && testNode.type === "mo" && testNode.classes.includes("tml-prime"))
59
59
  && group.base && group.base.text && group.base.text === "f") {
60
- // Chromium does not address italic correction on prime. Prevent f′ from overlapping.
60
+ // Chromium does not address italic correction on prime. Prevent f′ from overlapping.
61
61
  testNode.classes.push("prime-pad")
62
62
  }
63
63
  children.push(sup)
@@ -30,9 +30,12 @@ const styleWithFont = (group, style) => {
30
30
  return style.withTextFontFamily(textFontFamilies[font]);
31
31
  } else if (textFontWeights[font]) {
32
32
  return style.withTextFontWeight(textFontWeights[font]);
33
- } else {
34
- return style.withTextFontShape(textFontShapes[font]);
33
+ } else if (font === "\\emph") {
34
+ return style.fontShape === "textit"
35
+ ? style.withTextFontShape("textup")
36
+ : style.withTextFontShape("textit")
35
37
  }
38
+ return style.withTextFontShape(textFontShapes[font])
36
39
  };
37
40
 
38
41
  defineFunction({
@@ -50,7 +53,8 @@ defineFunction({
50
53
  "\\textmd",
51
54
  // Font Shapes
52
55
  "\\textit",
53
- "\\textup"
56
+ "\\textup",
57
+ "\\emph"
54
58
  ],
55
59
  props: {
56
60
  numArgs: 1,
package/src/macros.js CHANGED
@@ -82,7 +82,7 @@ defineMacro("\\TextOrMath", function(context) {
82
82
  }
83
83
  });
84
84
 
85
- const stringFromArg = arg => {
85
+ export const stringFromArg = arg => {
86
86
  // Reverse the order of the arg and return a string.
87
87
  let str = ""
88
88
  for (let i = arg.length - 1; i > -1; i--) {
@@ -246,6 +246,10 @@ defineMacro("\\underbar", "\\underline{\\text{#1}}");
246
246
  defineMacro("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}");
247
247
  defineMacro("\u22ee", "\\vdots");
248
248
 
249
+ // {array} environment gaps
250
+ defineMacro("\\arraystretch", "1") // line spacing factor times 12pt
251
+ defineMacro("\\arraycolsep", "6pt") // half the width separating columns
252
+
249
253
  //////////////////////////////////////////////////////////////////////
250
254
  // amsmath.sty
251
255
  // http://mirrors.concertpass.com/tex-archive/macros/latex/required/amsmath/amsmath.pdf
@@ -8,7 +8,7 @@
8
8
  * https://mit-license.org/
9
9
  */
10
10
 
11
- export const version = "0.10.24";
11
+ export const version = "0.10.30";
12
12
 
13
13
  export function postProcess(block) {
14
14
  const labelMap = {}
package/src/symbols.js CHANGED
@@ -427,6 +427,7 @@ defineSymbol(math, bin, "\u22d3", "\\Cup", true);
427
427
  defineSymbol(math, bin, "\u2a5e", "\\doublebarwedge", true);
428
428
  defineSymbol(math, bin, "\u229f", "\\boxminus", true);
429
429
  defineSymbol(math, bin, "\u229e", "\\boxplus", true);
430
+ defineSymbol(math, bin, "\u29C4", "\\boxslash", true);
430
431
  defineSymbol(math, bin, "\u22c7", "\\divideontimes", true);
431
432
  defineSymbol(math, bin, "\u22c9", "\\ltimes", true);
432
433
  defineSymbol(math, bin, "\u22ca", "\\rtimes", true);
@@ -811,6 +812,10 @@ defineSymbol(math, op, "\u2210", "\\coprod");
811
812
  defineSymbol(math, op, "\u22c1", "\\bigvee");
812
813
  defineSymbol(math, op, "\u22c0", "\\bigwedge");
813
814
  defineSymbol(math, op, "\u2a04", "\\biguplus");
815
+ defineSymbol(math, op, "\u2a04", "\\bigcupplus");
816
+ defineSymbol(math, op, "\u2a03", "\\bigcupdot");
817
+ defineSymbol(math, op, "\u2a07", "\\bigdoublevee");
818
+ defineSymbol(math, op, "\u2a08", "\\bigdoublewedge");
814
819
  defineSymbol(math, op, "\u22c2", "\\bigcap");
815
820
  defineSymbol(math, op, "\u22c3", "\\bigcup");
816
821
  defineSymbol(math, op, "\u222b", "\\int");