temml 0.13.2 → 0.13.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.
package/dist/temml.js CHANGED
@@ -4607,9 +4607,9 @@ var temml = (function () {
4607
4607
  }
4608
4608
  if (mustSquashRow) {
4609
4609
  // All the cell contents are \hphantom. Squash the cell.
4610
+ // TODO: Remove the next line when Firefox no longer needs it.
4611
+ mtr.classes.push("ff-squash"); // necessary in Firefox only.
4610
4612
  for (let j = 0; j < mtr.children.length; j++) {
4611
- mtr.children[j].style.display = "block"; // necessary in Firefox only
4612
- mtr.children[j].style.height = "0"; // necessary in Firefox only
4613
4613
  mtr.children[j].style.paddingTop = "0";
4614
4614
  mtr.children[j].style.paddingBottom = "0";
4615
4615
  }
@@ -5250,13 +5250,11 @@ var temml = (function () {
5250
5250
  },
5251
5251
  handler: ({ parser, funcName }, args, optArgs) => {
5252
5252
  // Find out if the author has defined custom delimiters
5253
- let delimiters = ["(", ")"];
5253
+ let delimiters = ["(", ")"]; // default
5254
5254
  if (funcName === "\\bordermatrix" && optArgs[0] && optArgs[0].body) {
5255
5255
  const body = optArgs[0].body;
5256
- if (body.length === 2 && body[0].type === "atom" && body[1].type === "atom") {
5257
- if (body[0].family === "open" && body[1].family === "close") {
5258
- delimiters = [body[0].text, body[1].text];
5259
- }
5256
+ if (body.length === 1 && body[0].type === "delimiter") {
5257
+ delimiters = [body[0].left, body[0].right];
5260
5258
  }
5261
5259
  }
5262
5260
  // consume the opening brace
@@ -6352,17 +6350,14 @@ var temml = (function () {
6352
6350
  mathmlBuilder: (group) => {
6353
6351
  const textNode = makeText(group.delim, group.mode);
6354
6352
  const middleNode = new MathNode("mo", [textNode]);
6355
- middleNode.setAttribute("fence", "true");
6356
- if (group.delim.indexOf("arrow") > -1) {
6357
- middleNode.setAttribute("stretchy", "true");
6358
- }
6359
- // The next line is not semantically correct, but
6360
- // Chromium fails to stretch if it is not there.
6361
- middleNode.setAttribute("form", "prefix");
6362
- // MathML gives 5/18em spacing to each <mo> element.
6363
- // \middle should get delimiter spacing instead.
6364
- middleNode.setAttribute("lspace", "0.05em");
6365
- middleNode.setAttribute("rspace", "0.05em");
6353
+ middleNode.setAttribute("stretchy", "true");
6354
+ middleNode.setAttribute("form", "infix");
6355
+ if (textNode.text !== "/") {
6356
+ // MathML gives 5/18em spacing to each <mo> element.
6357
+ // \middle should get delimiter spacing instead.
6358
+ middleNode.setAttribute("lspace", "0.05em");
6359
+ middleNode.setAttribute("rspace", "0.05em");
6360
+ }
6366
6361
  return middleNode;
6367
6362
  }
6368
6363
  });
@@ -6529,7 +6524,7 @@ var temml = (function () {
6529
6524
 
6530
6525
  defineFunction({
6531
6526
  type: "enclose",
6532
- names: ["\\angl", "\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\overline",
6527
+ names: ["\\angl", "\\cancel", "\\bcancel", "\\xcancel", "\\overline",
6533
6528
  "\\boxed", "\\longdiv", "\\phase"],
6534
6529
  props: {
6535
6530
  numArgs: 1
@@ -6546,6 +6541,25 @@ var temml = (function () {
6546
6541
  mathmlBuilder: mathmlBuilder$7
6547
6542
  });
6548
6543
 
6544
+ defineFunction({
6545
+ type: "enclose",
6546
+ names: ["\\sout"],
6547
+ props: {
6548
+ numArgs: 1,
6549
+ allowedInText: true
6550
+ },
6551
+ handler({ parser, funcName }, args) {
6552
+ const body = args[0];
6553
+ return {
6554
+ type: "enclose",
6555
+ mode: parser.mode,
6556
+ label: funcName,
6557
+ body
6558
+ };
6559
+ },
6560
+ mathmlBuilder: mathmlBuilder$7
6561
+ });
6562
+
6549
6563
  defineFunction({
6550
6564
  type: "enclose",
6551
6565
  names: ["\\underline"],
@@ -6678,8 +6692,237 @@ var temml = (function () {
6678
6692
  }
6679
6693
  });
6680
6694
 
6695
+ // Chromium does not support the MathML `mathvariant` attribute.
6696
+ // Instead, we replace ASCII characters with Unicode characters that
6697
+ // are defined in the font as bold, italic, double-struck, etc.
6698
+ // This module identifies those Unicode code points.
6699
+
6700
+ // First, a few helpers.
6701
+ const script = Object.freeze({
6702
+ B: 0x20EA, // Offset from ASCII B to Unicode script B
6703
+ E: 0x20EB,
6704
+ F: 0x20EB,
6705
+ H: 0x20C3,
6706
+ I: 0x20C7,
6707
+ L: 0x20C6,
6708
+ M: 0x20E6,
6709
+ R: 0x20C9,
6710
+ e: 0x20CA,
6711
+ g: 0x20A3,
6712
+ o: 0x20C5
6713
+ });
6714
+
6715
+ const frak = Object.freeze({
6716
+ C: 0x20EA,
6717
+ H: 0x20C4,
6718
+ I: 0x20C8,
6719
+ R: 0x20CA,
6720
+ Z: 0x20CE
6721
+ });
6722
+
6723
+ const bbb = Object.freeze({
6724
+ C: 0x20BF, // blackboard bold
6725
+ H: 0x20C5,
6726
+ N: 0x20C7,
6727
+ P: 0x20C9,
6728
+ Q: 0x20C9,
6729
+ R: 0x20CB,
6730
+ Z: 0x20CA
6731
+ });
6732
+
6733
+ const bold = Object.freeze({
6734
+ "\u03f5": 0x1D2E7, // lunate epsilon
6735
+ "\u03d1": 0x1D30C, // vartheta
6736
+ "\u03f0": 0x1D2EE, // varkappa
6737
+ "\u03c6": 0x1D319, // varphi
6738
+ "\u03f1": 0x1D2EF, // varrho
6739
+ "\u03d6": 0x1D30B // varpi
6740
+ });
6741
+
6742
+ const boldItalic = Object.freeze({
6743
+ "\u03f5": 0x1D35B, // lunate epsilon
6744
+ "\u03d1": 0x1D380, // vartheta
6745
+ "\u03f0": 0x1D362, // varkappa
6746
+ "\u03c6": 0x1D38D, // varphi
6747
+ "\u03f1": 0x1D363, // varrho
6748
+ "\u03d6": 0x1D37F // varpi
6749
+ });
6750
+
6751
+ const boldsf = Object.freeze({
6752
+ "\u03f5": 0x1D395, // lunate epsilon
6753
+ "\u03d1": 0x1D3BA, // vartheta
6754
+ "\u03f0": 0x1D39C, // varkappa
6755
+ "\u03c6": 0x1D3C7, // varphi
6756
+ "\u03f1": 0x1D39D, // varrho
6757
+ "\u03d6": 0x1D3B9 // varpi
6758
+ });
6759
+
6760
+ const bisf = Object.freeze({
6761
+ "\u03f5": 0x1D3CF, // lunate epsilon
6762
+ "\u03d1": 0x1D3F4, // vartheta
6763
+ "\u03f0": 0x1D3D6, // varkappa
6764
+ "\u03c6": 0x1D401, // varphi
6765
+ "\u03f1": 0x1D3D7, // varrho
6766
+ "\u03d6": 0x1D3F3 // varpi
6767
+ });
6768
+
6769
+ // Code point offsets below are derived from https://www.unicode.org/charts/PDF/U1D400.pdf
6770
+ const offset = Object.freeze({
6771
+ upperCaseLatin: { // A-Z
6772
+ "normal": ch => { return 0 },
6773
+ "bold": ch => { return 0x1D3BF },
6774
+ "italic": ch => { return 0x1D3F3 },
6775
+ "bold-italic": ch => { return 0x1D427 },
6776
+ "script": ch => { return script[ch] || 0x1D45B },
6777
+ "script-bold": ch => { return 0x1D48F },
6778
+ "fraktur": ch => { return frak[ch] || 0x1D4C3 },
6779
+ "fraktur-bold": ch => { return 0x1D52B },
6780
+ "double-struck": ch => { return bbb[ch] || 0x1D4F7 },
6781
+ "sans-serif": ch => { return 0x1D55F },
6782
+ "sans-serif-bold": ch => { return 0x1D593 },
6783
+ "sans-serif-italic": ch => { return 0x1D5C7 },
6784
+ "sans-serif-bold-italic": ch => { return 0x1D63C },
6785
+ "monospace": ch => { return 0x1D62F }
6786
+ },
6787
+ lowerCaseLatin: { // a-z
6788
+ "normal": ch => { return 0 },
6789
+ "bold": ch => { return 0x1D3B9 },
6790
+ "italic": ch => { return ch === "h" ? 0x20A6 : 0x1D3ED },
6791
+ "bold-italic": ch => { return 0x1D421 },
6792
+ "script": ch => { return script[ch] || 0x1D455 },
6793
+ "script-bold": ch => { return 0x1D489 },
6794
+ "fraktur": ch => { return 0x1D4BD },
6795
+ "fraktur-bold": ch => { return 0x1D525 },
6796
+ "double-struck": ch => { return 0x1D4F1 },
6797
+ "sans-serif": ch => { return 0x1D559 },
6798
+ "sans-serif-bold": ch => { return 0x1D58D },
6799
+ "sans-serif-italic": ch => { return 0x1D5C1 },
6800
+ "sans-serif-bold-italic": ch => { return 0x1D5F5 },
6801
+ "monospace": ch => { return 0x1D629 }
6802
+ },
6803
+ upperCaseGreek: { // A-Ω
6804
+ "normal": ch => { return 0 },
6805
+ "bold": ch => { return 0x1D317 },
6806
+ "italic": ch => { return 0x1D351 },
6807
+ // \boldsymbol actually returns upright bold for upperCaseGreek
6808
+ "bold-italic": ch => { return 0x1D317 },
6809
+ "script": ch => { return 0 },
6810
+ "script-bold": ch => { return 0 },
6811
+ "fraktur": ch => { return 0 },
6812
+ "fraktur-bold": ch => { return 0 },
6813
+ "double-struck": ch => { return 0 },
6814
+ // Unicode has no code points for regular-weight san-serif Greek. Use bold.
6815
+ "sans-serif": ch => { return 0x1D3C5 },
6816
+ "sans-serif-bold": ch => { return 0x1D3C5 },
6817
+ "sans-serif-italic": ch => { return 0 },
6818
+ "sans-serif-bold-italic": ch => { return 0x1D3FF },
6819
+ "monospace": ch => { return 0 }
6820
+ },
6821
+ lowerCaseGreek: { // α-ω
6822
+ "normal": ch => { return 0 },
6823
+ "bold": ch => { return 0x1D311 },
6824
+ "italic": ch => { return 0x1D34B },
6825
+ "bold-italic": ch => { return ch === "\u03d5" ? 0x1D37E : 0x1D385 },
6826
+ "script": ch => { return 0 },
6827
+ "script-bold": ch => { return 0 },
6828
+ "fraktur": ch => { return 0 },
6829
+ "fraktur-bold": ch => { return 0 },
6830
+ "double-struck": ch => { return 0 },
6831
+ // Unicode has no code points for regular-weight san-serif Greek. Use bold.
6832
+ "sans-serif": ch => { return 0x1D3BF },
6833
+ "sans-serif-bold": ch => { return 0x1D3BF },
6834
+ "sans-serif-italic": ch => { return 0 },
6835
+ "sans-serif-bold-italic": ch => { return 0x1D3F9 },
6836
+ "monospace": ch => { return 0 }
6837
+ },
6838
+ varGreek: { // \varGamma, etc
6839
+ "normal": ch => { return 0 },
6840
+ "bold": ch => { return bold[ch] || -51 },
6841
+ "italic": ch => { return 0 },
6842
+ "bold-italic": ch => { return boldItalic[ch] || 0x3A },
6843
+ "script": ch => { return 0 },
6844
+ "script-bold": ch => { return 0 },
6845
+ "fraktur": ch => { return 0 },
6846
+ "fraktur-bold": ch => { return 0 },
6847
+ "double-struck": ch => { return 0 },
6848
+ "sans-serif": ch => { return boldsf[ch] || 0x74 },
6849
+ "sans-serif-bold": ch => { return boldsf[ch] || 0x74 },
6850
+ "sans-serif-italic": ch => { return 0 },
6851
+ "sans-serif-bold-italic": ch => { return bisf[ch] || 0xAE },
6852
+ "monospace": ch => { return 0 }
6853
+ },
6854
+ numeral: { // 0-9
6855
+ "normal": ch => { return 0 },
6856
+ "bold": ch => { return 0x1D79E },
6857
+ "italic": ch => { return 0 },
6858
+ "bold-italic": ch => { return 0 },
6859
+ "script": ch => { return 0 },
6860
+ "script-bold": ch => { return 0 },
6861
+ "fraktur": ch => { return 0 },
6862
+ "fraktur-bold": ch => { return 0 },
6863
+ "double-struck": ch => { return 0x1D7A8 },
6864
+ "sans-serif": ch => { return 0x1D7B2 },
6865
+ "sans-serif-bold": ch => { return 0x1D7BC },
6866
+ "sans-serif-italic": ch => { return 0 },
6867
+ "sans-serif-bold-italic": ch => { return 0 },
6868
+ "monospace": ch => { return 0x1D7C6 }
6869
+ }
6870
+ });
6871
+
6872
+ const variantChar = (ch, variant) => {
6873
+ const codePoint = ch.codePointAt(0);
6874
+ const block = 0x40 < codePoint && codePoint < 0x5b
6875
+ ? "upperCaseLatin"
6876
+ : 0x60 < codePoint && codePoint < 0x7b
6877
+ ? "lowerCaseLatin"
6878
+ : (0x390 < codePoint && codePoint < 0x3AA)
6879
+ ? "upperCaseGreek"
6880
+ : 0x3B0 < codePoint && codePoint < 0x3CA || ch === "\u03d5"
6881
+ ? "lowerCaseGreek"
6882
+ : 0x1D6E1 < codePoint && codePoint < 0x1D6FC || bold[ch]
6883
+ ? "varGreek"
6884
+ : (0x2F < codePoint && codePoint < 0x3A)
6885
+ ? "numeral"
6886
+ : "other";
6887
+ return block === "other"
6888
+ ? ch
6889
+ : String.fromCodePoint(codePoint + offset[block][variant](ch))
6890
+ };
6891
+
6892
+ const smallCaps = Object.freeze({
6893
+ a: "ᴀ",
6894
+ b: "ʙ",
6895
+ c: "ᴄ",
6896
+ d: "ᴅ",
6897
+ e: "ᴇ",
6898
+ f: "ꜰ",
6899
+ g: "ɢ",
6900
+ h: "ʜ",
6901
+ i: "ɪ",
6902
+ j: "ᴊ",
6903
+ k: "ᴋ",
6904
+ l: "ʟ",
6905
+ m: "ᴍ",
6906
+ n: "ɴ",
6907
+ o: "ᴏ",
6908
+ p: "ᴘ",
6909
+ q: "ǫ",
6910
+ r: "ʀ",
6911
+ s: "s",
6912
+ t: "ᴛ",
6913
+ u: "ᴜ",
6914
+ v: "ᴠ",
6915
+ w: "ᴡ",
6916
+ x: "x",
6917
+ y: "ʏ",
6918
+ z: "ᴢ"
6919
+ });
6920
+
6921
+ const varNameFonts = ["mathrm", "mathit"];
6922
+
6681
6923
  const isLongVariableName = (group, font) => {
6682
- if (font !== "mathrm" || group.body.type !== "ordgroup" || group.body.body.length === 1) {
6924
+ if (!varNameFonts.includes(font) || !group.body || group.body.type !== "ordgroup" ||
6925
+ group.body.body.length === 1) {
6683
6926
  return false
6684
6927
  }
6685
6928
  if (group.body.body[0].type !== "mathord") { return false }
@@ -6705,8 +6948,7 @@ var temml = (function () {
6705
6948
  }
6706
6949
  // Check if it is possible to consolidate elements into a single <mi> element.
6707
6950
  if (isLongVariableName(group, font)) {
6708
- // This is a \mathrm{…} group. It gets special treatment because symbolsOrd.js
6709
- // wraps <mi> elements with <mpadded>s to work around a Firefox bug.
6951
+ // This is a \mathrm{…} or \mathit{…} group. It gets special treatment.
6710
6952
  const mi = mathGroup.children[0].children[0].children
6711
6953
  ? mathGroup.children[0].children[0]
6712
6954
  : mathGroup.children[0];
@@ -6716,7 +6958,14 @@ var temml = (function () {
6716
6958
  ? mathGroup.children[i].children[0].children[0].text
6717
6959
  : mathGroup.children[i].children[0].text;
6718
6960
  }
6719
- // Wrap in a <mpadded> to prevent the same Firefox bug.
6961
+ if (font === "mathit") {
6962
+ // Long <mi> elements are normally rendered in upright font.
6963
+ // To get italic, we need to convert each character to the corresponding italic character.
6964
+ mi.children[0].text = mi.children[0].text.split("")
6965
+ .map(c => variantChar(c, "italic")).join("");
6966
+ return mi
6967
+ }
6968
+ // Otherwise, font is "mathrm". Wrap in a <mpadded> to prevent a Firefox spacing bug.
6720
6969
  const mpadded = new MathNode("mpadded", [mi]);
6721
6970
  mpadded.setAttribute("lspace", "0");
6722
6971
  return mpadded
@@ -8594,7 +8843,7 @@ var temml = (function () {
8594
8843
  const inner = buildExpression(ordargument(group.body), style);
8595
8844
  const phantom = new MathNode("mphantom", inner);
8596
8845
  const node = new MathNode("mpadded", [phantom]);
8597
- node.setAttribute("width", "0px");
8846
+ node.setAttribute("width", "0.1px");
8598
8847
  return node;
8599
8848
  }
8600
8849
  });
@@ -9411,232 +9660,6 @@ var temml = (function () {
9411
9660
  return Object.prototype.hasOwnProperty.call(fontMap, font) ? fontMap[font] : null
9412
9661
  };
9413
9662
 
9414
- // Chromium does not support the MathML `mathvariant` attribute.
9415
- // Instead, we replace ASCII characters with Unicode characters that
9416
- // are defined in the font as bold, italic, double-struck, etc.
9417
- // This module identifies those Unicode code points.
9418
-
9419
- // First, a few helpers.
9420
- const script = Object.freeze({
9421
- B: 0x20EA, // Offset from ASCII B to Unicode script B
9422
- E: 0x20EB,
9423
- F: 0x20EB,
9424
- H: 0x20C3,
9425
- I: 0x20C7,
9426
- L: 0x20C6,
9427
- M: 0x20E6,
9428
- R: 0x20C9,
9429
- e: 0x20CA,
9430
- g: 0x20A3,
9431
- o: 0x20C5
9432
- });
9433
-
9434
- const frak = Object.freeze({
9435
- C: 0x20EA,
9436
- H: 0x20C4,
9437
- I: 0x20C8,
9438
- R: 0x20CA,
9439
- Z: 0x20CE
9440
- });
9441
-
9442
- const bbb = Object.freeze({
9443
- C: 0x20BF, // blackboard bold
9444
- H: 0x20C5,
9445
- N: 0x20C7,
9446
- P: 0x20C9,
9447
- Q: 0x20C9,
9448
- R: 0x20CB,
9449
- Z: 0x20CA
9450
- });
9451
-
9452
- const bold = Object.freeze({
9453
- "\u03f5": 0x1D2E7, // lunate epsilon
9454
- "\u03d1": 0x1D30C, // vartheta
9455
- "\u03f0": 0x1D2EE, // varkappa
9456
- "\u03c6": 0x1D319, // varphi
9457
- "\u03f1": 0x1D2EF, // varrho
9458
- "\u03d6": 0x1D30B // varpi
9459
- });
9460
-
9461
- const boldItalic = Object.freeze({
9462
- "\u03f5": 0x1D35B, // lunate epsilon
9463
- "\u03d1": 0x1D380, // vartheta
9464
- "\u03f0": 0x1D362, // varkappa
9465
- "\u03c6": 0x1D38D, // varphi
9466
- "\u03f1": 0x1D363, // varrho
9467
- "\u03d6": 0x1D37F // varpi
9468
- });
9469
-
9470
- const boldsf = Object.freeze({
9471
- "\u03f5": 0x1D395, // lunate epsilon
9472
- "\u03d1": 0x1D3BA, // vartheta
9473
- "\u03f0": 0x1D39C, // varkappa
9474
- "\u03c6": 0x1D3C7, // varphi
9475
- "\u03f1": 0x1D39D, // varrho
9476
- "\u03d6": 0x1D3B9 // varpi
9477
- });
9478
-
9479
- const bisf = Object.freeze({
9480
- "\u03f5": 0x1D3CF, // lunate epsilon
9481
- "\u03d1": 0x1D3F4, // vartheta
9482
- "\u03f0": 0x1D3D6, // varkappa
9483
- "\u03c6": 0x1D401, // varphi
9484
- "\u03f1": 0x1D3D7, // varrho
9485
- "\u03d6": 0x1D3F3 // varpi
9486
- });
9487
-
9488
- // Code point offsets below are derived from https://www.unicode.org/charts/PDF/U1D400.pdf
9489
- const offset = Object.freeze({
9490
- upperCaseLatin: { // A-Z
9491
- "normal": ch => { return 0 },
9492
- "bold": ch => { return 0x1D3BF },
9493
- "italic": ch => { return 0x1D3F3 },
9494
- "bold-italic": ch => { return 0x1D427 },
9495
- "script": ch => { return script[ch] || 0x1D45B },
9496
- "script-bold": ch => { return 0x1D48F },
9497
- "fraktur": ch => { return frak[ch] || 0x1D4C3 },
9498
- "fraktur-bold": ch => { return 0x1D52B },
9499
- "double-struck": ch => { return bbb[ch] || 0x1D4F7 },
9500
- "sans-serif": ch => { return 0x1D55F },
9501
- "sans-serif-bold": ch => { return 0x1D593 },
9502
- "sans-serif-italic": ch => { return 0x1D5C7 },
9503
- "sans-serif-bold-italic": ch => { return 0x1D63C },
9504
- "monospace": ch => { return 0x1D62F }
9505
- },
9506
- lowerCaseLatin: { // a-z
9507
- "normal": ch => { return 0 },
9508
- "bold": ch => { return 0x1D3B9 },
9509
- "italic": ch => { return ch === "h" ? 0x20A6 : 0x1D3ED },
9510
- "bold-italic": ch => { return 0x1D421 },
9511
- "script": ch => { return script[ch] || 0x1D455 },
9512
- "script-bold": ch => { return 0x1D489 },
9513
- "fraktur": ch => { return 0x1D4BD },
9514
- "fraktur-bold": ch => { return 0x1D525 },
9515
- "double-struck": ch => { return 0x1D4F1 },
9516
- "sans-serif": ch => { return 0x1D559 },
9517
- "sans-serif-bold": ch => { return 0x1D58D },
9518
- "sans-serif-italic": ch => { return 0x1D5C1 },
9519
- "sans-serif-bold-italic": ch => { return 0x1D5F5 },
9520
- "monospace": ch => { return 0x1D629 }
9521
- },
9522
- upperCaseGreek: { // A-Ω
9523
- "normal": ch => { return 0 },
9524
- "bold": ch => { return 0x1D317 },
9525
- "italic": ch => { return 0x1D351 },
9526
- // \boldsymbol actually returns upright bold for upperCaseGreek
9527
- "bold-italic": ch => { return 0x1D317 },
9528
- "script": ch => { return 0 },
9529
- "script-bold": ch => { return 0 },
9530
- "fraktur": ch => { return 0 },
9531
- "fraktur-bold": ch => { return 0 },
9532
- "double-struck": ch => { return 0 },
9533
- // Unicode has no code points for regular-weight san-serif Greek. Use bold.
9534
- "sans-serif": ch => { return 0x1D3C5 },
9535
- "sans-serif-bold": ch => { return 0x1D3C5 },
9536
- "sans-serif-italic": ch => { return 0 },
9537
- "sans-serif-bold-italic": ch => { return 0x1D3FF },
9538
- "monospace": ch => { return 0 }
9539
- },
9540
- lowerCaseGreek: { // α-ω
9541
- "normal": ch => { return 0 },
9542
- "bold": ch => { return 0x1D311 },
9543
- "italic": ch => { return 0x1D34B },
9544
- "bold-italic": ch => { return ch === "\u03d5" ? 0x1D37E : 0x1D385 },
9545
- "script": ch => { return 0 },
9546
- "script-bold": ch => { return 0 },
9547
- "fraktur": ch => { return 0 },
9548
- "fraktur-bold": ch => { return 0 },
9549
- "double-struck": ch => { return 0 },
9550
- // Unicode has no code points for regular-weight san-serif Greek. Use bold.
9551
- "sans-serif": ch => { return 0x1D3BF },
9552
- "sans-serif-bold": ch => { return 0x1D3BF },
9553
- "sans-serif-italic": ch => { return 0 },
9554
- "sans-serif-bold-italic": ch => { return 0x1D3F9 },
9555
- "monospace": ch => { return 0 }
9556
- },
9557
- varGreek: { // \varGamma, etc
9558
- "normal": ch => { return 0 },
9559
- "bold": ch => { return bold[ch] || -51 },
9560
- "italic": ch => { return 0 },
9561
- "bold-italic": ch => { return boldItalic[ch] || 0x3A },
9562
- "script": ch => { return 0 },
9563
- "script-bold": ch => { return 0 },
9564
- "fraktur": ch => { return 0 },
9565
- "fraktur-bold": ch => { return 0 },
9566
- "double-struck": ch => { return 0 },
9567
- "sans-serif": ch => { return boldsf[ch] || 0x74 },
9568
- "sans-serif-bold": ch => { return boldsf[ch] || 0x74 },
9569
- "sans-serif-italic": ch => { return 0 },
9570
- "sans-serif-bold-italic": ch => { return bisf[ch] || 0xAE },
9571
- "monospace": ch => { return 0 }
9572
- },
9573
- numeral: { // 0-9
9574
- "normal": ch => { return 0 },
9575
- "bold": ch => { return 0x1D79E },
9576
- "italic": ch => { return 0 },
9577
- "bold-italic": ch => { return 0 },
9578
- "script": ch => { return 0 },
9579
- "script-bold": ch => { return 0 },
9580
- "fraktur": ch => { return 0 },
9581
- "fraktur-bold": ch => { return 0 },
9582
- "double-struck": ch => { return 0x1D7A8 },
9583
- "sans-serif": ch => { return 0x1D7B2 },
9584
- "sans-serif-bold": ch => { return 0x1D7BC },
9585
- "sans-serif-italic": ch => { return 0 },
9586
- "sans-serif-bold-italic": ch => { return 0 },
9587
- "monospace": ch => { return 0x1D7C6 }
9588
- }
9589
- });
9590
-
9591
- const variantChar = (ch, variant) => {
9592
- const codePoint = ch.codePointAt(0);
9593
- const block = 0x40 < codePoint && codePoint < 0x5b
9594
- ? "upperCaseLatin"
9595
- : 0x60 < codePoint && codePoint < 0x7b
9596
- ? "lowerCaseLatin"
9597
- : (0x390 < codePoint && codePoint < 0x3AA)
9598
- ? "upperCaseGreek"
9599
- : 0x3B0 < codePoint && codePoint < 0x3CA || ch === "\u03d5"
9600
- ? "lowerCaseGreek"
9601
- : 0x1D6E1 < codePoint && codePoint < 0x1D6FC || bold[ch]
9602
- ? "varGreek"
9603
- : (0x2F < codePoint && codePoint < 0x3A)
9604
- ? "numeral"
9605
- : "other";
9606
- return block === "other"
9607
- ? ch
9608
- : String.fromCodePoint(codePoint + offset[block][variant](ch))
9609
- };
9610
-
9611
- const smallCaps = Object.freeze({
9612
- a: "ᴀ",
9613
- b: "ʙ",
9614
- c: "ᴄ",
9615
- d: "ᴅ",
9616
- e: "ᴇ",
9617
- f: "ꜰ",
9618
- g: "ɢ",
9619
- h: "ʜ",
9620
- i: "ɪ",
9621
- j: "ᴊ",
9622
- k: "ᴋ",
9623
- l: "ʟ",
9624
- m: "ᴍ",
9625
- n: "ɴ",
9626
- o: "ᴏ",
9627
- p: "ᴘ",
9628
- q: "ǫ",
9629
- r: "ʀ",
9630
- s: "s",
9631
- t: "ᴛ",
9632
- u: "ᴜ",
9633
- v: "ᴠ",
9634
- w: "ᴡ",
9635
- x: "x",
9636
- y: "ʏ",
9637
- z: "ᴢ"
9638
- });
9639
-
9640
9663
  // "mathord" and "textord" ParseNodes created in Parser.js from symbol Groups in
9641
9664
  // src/symbols.js.
9642
9665
 
@@ -10256,7 +10279,7 @@ var temml = (function () {
10256
10279
  this.pushToken(new Token("EOF", end.loc));
10257
10280
 
10258
10281
  this.pushTokens(tokens);
10259
- return start.range(end, "");
10282
+ return new Token("", SourceLocation.range(start, end));
10260
10283
  }
10261
10284
 
10262
10285
  /**
@@ -12261,7 +12284,7 @@ var temml = (function () {
12261
12284
  * https://mit-license.org/
12262
12285
  */
12263
12286
 
12264
- const version = "0.13.02";
12287
+ const version = "0.13.3";
12265
12288
 
12266
12289
  function postProcess(block) {
12267
12290
  const labelMap = {};