temml 0.13.5 → 0.14.0

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/dist/temml.mjs CHANGED
@@ -1803,9 +1803,11 @@ defineSymbol(math, op, "\u222b", "\\smallint");
1803
1803
  defineSymbol(text, inner, "\u2026", "\\textellipsis");
1804
1804
  defineSymbol(math, inner, "\u2026", "\\mathellipsis");
1805
1805
  defineSymbol(text, inner, "\u2026", "\\ldots", true);
1806
+ defineSymbol(math, inner, "\u2026", "\\dotso");
1807
+ defineSymbol(math, inner, "\u2026", "\\dotsc");
1806
1808
  defineSymbol(math, inner, "\u2026", "\\ldots", true);
1807
1809
  defineSymbol(math, inner, "\u22f0", "\\iddots", true);
1808
- defineSymbol(math, inner, "\u22ef", "\\@cdots", true);
1810
+ defineSymbol(math, inner, "\u22ef", "\\cdots", true);
1809
1811
  defineSymbol(math, inner, "\u22f1", "\\ddots", true);
1810
1812
  defineSymbol(math, textord, "\u22ee", "\\varvdots"); // \vdots is a macro
1811
1813
  defineSymbol(text, textord, "\u22ee", "\\varvdots");
@@ -3940,60 +3942,6 @@ defineMacro("\\dots", function(context) {
3940
3942
  return thedots;
3941
3943
  });
3942
3944
 
3943
- const spaceAfterDots = {
3944
- // \rightdelim@ checks for the following:
3945
- ")": true,
3946
- "]": true,
3947
- "\\rbrack": true,
3948
- "\\}": true,
3949
- "\\rbrace": true,
3950
- "\\rangle": true,
3951
- "\\rceil": true,
3952
- "\\rfloor": true,
3953
- "\\rgroup": true,
3954
- "\\rmoustache": true,
3955
- "\\right": true,
3956
- "\\bigr": true,
3957
- "\\biggr": true,
3958
- "\\Bigr": true,
3959
- "\\Biggr": true,
3960
- // \extra@ also tests for the following:
3961
- $: true,
3962
- // \extrap@ checks for the following:
3963
- ";": true,
3964
- ".": true,
3965
- ",": true
3966
- };
3967
-
3968
- defineMacro("\\dotso", function(context) {
3969
- const next = context.future().text;
3970
- if (next in spaceAfterDots) {
3971
- return "\\ldots\\,";
3972
- } else {
3973
- return "\\ldots";
3974
- }
3975
- });
3976
-
3977
- defineMacro("\\dotsc", function(context) {
3978
- const next = context.future().text;
3979
- // \dotsc uses \extra@ but not \extrap@, instead specially checking for
3980
- // ';' and '.', but doesn't check for ','.
3981
- if (next in spaceAfterDots && next !== ",") {
3982
- return "\\ldots\\,";
3983
- } else {
3984
- return "\\ldots";
3985
- }
3986
- });
3987
-
3988
- defineMacro("\\cdots", function(context) {
3989
- const next = context.future().text;
3990
- if (next in spaceAfterDots) {
3991
- return "\\@cdots\\,";
3992
- } else {
3993
- return "\\@cdots";
3994
- }
3995
- });
3996
-
3997
3945
  defineMacro("\\dotsb", "\\cdots");
3998
3946
  defineMacro("\\dotsm", "\\cdots");
3999
3947
  defineMacro("\\dotsi", "\\!\\cdots");
@@ -4123,7 +4071,7 @@ defineMacro("\\colon", `\\mathpunct{\\char"3a}`);
4123
4071
  //////////////////////////////////////////////////////////////////////
4124
4072
  // mathtools.sty
4125
4073
 
4126
- defineMacro("\\prescript", "\\pres@cript{_{#1}^{#2}}{}{#3}");
4074
+ defineMacro("\\prescript", "\\pres@cript{^{#1}_{#2}}{}{#3}");
4127
4075
 
4128
4076
  //\providecommand\ordinarycolon{:}
4129
4077
  defineMacro("\\ordinarycolon", `\\char"3a`);
@@ -11481,6 +11429,11 @@ const isArrow = str => {
11481
11429
  defineFunctionBuilders({
11482
11430
  type: "atom",
11483
11431
  mathmlBuilder(group, style) {
11432
+ if (group.family === "inner") {
11433
+ // Give \dots ORD spacing, not OP spacing.
11434
+ const tag = group.mode === "text" ? "mtext" : "mi";
11435
+ return new MathNode(tag, [makeText(group.text, group.mode)])
11436
+ }
11484
11437
  const node = new MathNode("mo", [makeText(group.text, group.mode)]);
11485
11438
  if (group.family === "punct") {
11486
11439
  node.setAttribute("separator", "true");
@@ -14244,7 +14197,7 @@ class Style {
14244
14197
  * https://mit-license.org/
14245
14198
  */
14246
14199
 
14247
- const version = "0.13.5";
14200
+ const version = "0.14.0";
14248
14201
 
14249
14202
  function postProcess(block) {
14250
14203
  const labelMap = {};
@@ -11,7 +11,7 @@
11
11
  * https://mit-license.org/
12
12
  */
13
13
 
14
- const version = "0.13.5";
14
+ const version = "0.14.0";
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.13.5",
3
+ "version": "0.14.0",
4
4
  "description": "TeX to MathML conversion in JavaScript.",
5
5
  "main": "dist/temml.js",
6
6
  "engines": {
@@ -17,7 +17,7 @@
17
17
  "homepage": "https://temml.org",
18
18
  "repository": {
19
19
  "type": "git",
20
- "url": "git://github.com/ronkok/Temml"
20
+ "url": "git+https://github.com/ronkok/Temml.git"
21
21
  },
22
22
  "packageManager": "yarn@3.3.1",
23
23
  "files": [
@@ -21,6 +21,11 @@ const isArrow = str => {
21
21
  defineFunctionBuilders({
22
22
  type: "atom",
23
23
  mathmlBuilder(group, style) {
24
+ if (group.family === "inner") {
25
+ // Give \dots ORD spacing, not OP spacing.
26
+ const tag = group.mode === "text" ? "mtext" : "mi"
27
+ return new mathMLTree.MathNode(tag, [mml.makeText(group.text, group.mode)])
28
+ }
24
29
  const node = new mathMLTree.MathNode("mo", [mml.makeText(group.text, group.mode)]);
25
30
  if (group.family === "punct") {
26
31
  node.setAttribute("separator", "true");
package/src/macros.js CHANGED
@@ -342,60 +342,6 @@ defineMacro("\\dots", function(context) {
342
342
  return thedots;
343
343
  });
344
344
 
345
- const spaceAfterDots = {
346
- // \rightdelim@ checks for the following:
347
- ")": true,
348
- "]": true,
349
- "\\rbrack": true,
350
- "\\}": true,
351
- "\\rbrace": true,
352
- "\\rangle": true,
353
- "\\rceil": true,
354
- "\\rfloor": true,
355
- "\\rgroup": true,
356
- "\\rmoustache": true,
357
- "\\right": true,
358
- "\\bigr": true,
359
- "\\biggr": true,
360
- "\\Bigr": true,
361
- "\\Biggr": true,
362
- // \extra@ also tests for the following:
363
- $: true,
364
- // \extrap@ checks for the following:
365
- ";": true,
366
- ".": true,
367
- ",": true
368
- };
369
-
370
- defineMacro("\\dotso", function(context) {
371
- const next = context.future().text;
372
- if (next in spaceAfterDots) {
373
- return "\\ldots\\,";
374
- } else {
375
- return "\\ldots";
376
- }
377
- });
378
-
379
- defineMacro("\\dotsc", function(context) {
380
- const next = context.future().text;
381
- // \dotsc uses \extra@ but not \extrap@, instead specially checking for
382
- // ';' and '.', but doesn't check for ','.
383
- if (next in spaceAfterDots && next !== ",") {
384
- return "\\ldots\\,";
385
- } else {
386
- return "\\ldots";
387
- }
388
- });
389
-
390
- defineMacro("\\cdots", function(context) {
391
- const next = context.future().text;
392
- if (next in spaceAfterDots) {
393
- return "\\@cdots\\,";
394
- } else {
395
- return "\\@cdots";
396
- }
397
- });
398
-
399
345
  defineMacro("\\dotsb", "\\cdots");
400
346
  defineMacro("\\dotsm", "\\cdots");
401
347
  defineMacro("\\dotsi", "\\!\\cdots");
@@ -525,7 +471,7 @@ defineMacro("\\colon", `\\mathpunct{\\char"3a}`)
525
471
  //////////////////////////////////////////////////////////////////////
526
472
  // mathtools.sty
527
473
 
528
- defineMacro("\\prescript", "\\pres@cript{_{#1}^{#2}}{}{#3}")
474
+ defineMacro("\\prescript", "\\pres@cript{^{#1}_{#2}}{}{#3}")
529
475
 
530
476
  //\providecommand\ordinarycolon{:}
531
477
  defineMacro("\\ordinarycolon", `\\char"3a`);
@@ -5,7 +5,7 @@
5
5
  * https://mit-license.org/
6
6
  */
7
7
 
8
- export const version = "0.13.5";
8
+ export const version = "0.14.0";
9
9
 
10
10
  export function postProcess(block) {
11
11
  const labelMap = {}
package/src/symbols.js CHANGED
@@ -891,9 +891,11 @@ defineSymbol(math, op, "\u222b", "\\smallint");
891
891
  defineSymbol(text, inner, "\u2026", "\\textellipsis");
892
892
  defineSymbol(math, inner, "\u2026", "\\mathellipsis");
893
893
  defineSymbol(text, inner, "\u2026", "\\ldots", true);
894
+ defineSymbol(math, inner, "\u2026", "\\dotso");
895
+ defineSymbol(math, inner, "\u2026", "\\dotsc");
894
896
  defineSymbol(math, inner, "\u2026", "\\ldots", true);
895
897
  defineSymbol(math, inner, "\u22f0", "\\iddots", true);
896
- defineSymbol(math, inner, "\u22ef", "\\@cdots", true);
898
+ defineSymbol(math, inner, "\u22ef", "\\cdots", true);
897
899
  defineSymbol(math, inner, "\u22f1", "\\ddots", true);
898
900
  defineSymbol(math, textord, "\u22ee", "\\varvdots"); // \vdots is a macro
899
901
  defineSymbol(text, textord, "\u22ee", "\\varvdots");