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/README.md +1 -1
- package/dist/Temml-Asana.css +5 -0
- package/dist/Temml-Latin-Modern.css +5 -0
- package/dist/Temml-Libertinus.css +5 -0
- package/dist/Temml-Local.css +5 -0
- package/dist/Temml-NotoSans.css +5 -0
- package/dist/Temml-STIX2.css +5 -0
- package/dist/temml.cjs +275 -252
- package/dist/temml.js +275 -252
- package/dist/temml.min.js +1 -1
- package/dist/temml.mjs +275 -252
- package/dist/temmlPostProcess.js +1 -1
- package/package.json +5 -3
- package/src/MacroExpander.js +2 -1
- package/src/environments/array.js +2 -2
- package/src/functions/bordermatrix.js +3 -5
- package/src/functions/delimiter.js +7 -10
- package/src/functions/enclose.js +20 -1
- package/src/functions/font.js +14 -4
- package/src/functions/phantom.js +1 -1
- package/src/postProcess.js +1 -1
package/dist/temml.cjs
CHANGED
|
@@ -6520,9 +6520,9 @@ const mathmlBuilder$9 = function(group, style) {
|
|
|
6520
6520
|
}
|
|
6521
6521
|
if (mustSquashRow) {
|
|
6522
6522
|
// All the cell contents are \hphantom. Squash the cell.
|
|
6523
|
+
// TODO: Remove the next line when Firefox no longer needs it.
|
|
6524
|
+
mtr.classes.push("ff-squash"); // necessary in Firefox only.
|
|
6523
6525
|
for (let j = 0; j < mtr.children.length; j++) {
|
|
6524
|
-
mtr.children[j].style.display = "block"; // necessary in Firefox only
|
|
6525
|
-
mtr.children[j].style.height = "0"; // necessary in Firefox only
|
|
6526
6526
|
mtr.children[j].style.paddingTop = "0";
|
|
6527
6527
|
mtr.children[j].style.paddingBottom = "0";
|
|
6528
6528
|
}
|
|
@@ -7163,13 +7163,11 @@ defineFunction({
|
|
|
7163
7163
|
},
|
|
7164
7164
|
handler: ({ parser, funcName }, args, optArgs) => {
|
|
7165
7165
|
// Find out if the author has defined custom delimiters
|
|
7166
|
-
let delimiters = ["(", ")"];
|
|
7166
|
+
let delimiters = ["(", ")"]; // default
|
|
7167
7167
|
if (funcName === "\\bordermatrix" && optArgs[0] && optArgs[0].body) {
|
|
7168
7168
|
const body = optArgs[0].body;
|
|
7169
|
-
if (body.length ===
|
|
7170
|
-
|
|
7171
|
-
delimiters = [body[0].text, body[1].text];
|
|
7172
|
-
}
|
|
7169
|
+
if (body.length === 1 && body[0].type === "delimiter") {
|
|
7170
|
+
delimiters = [body[0].left, body[0].right];
|
|
7173
7171
|
}
|
|
7174
7172
|
}
|
|
7175
7173
|
// consume the opening brace
|
|
@@ -8265,17 +8263,14 @@ defineFunction({
|
|
|
8265
8263
|
mathmlBuilder: (group) => {
|
|
8266
8264
|
const textNode = makeText(group.delim, group.mode);
|
|
8267
8265
|
const middleNode = new MathNode("mo", [textNode]);
|
|
8268
|
-
middleNode.setAttribute("
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
// \middle should get delimiter spacing instead.
|
|
8277
|
-
middleNode.setAttribute("lspace", "0.05em");
|
|
8278
|
-
middleNode.setAttribute("rspace", "0.05em");
|
|
8266
|
+
middleNode.setAttribute("stretchy", "true");
|
|
8267
|
+
middleNode.setAttribute("form", "infix");
|
|
8268
|
+
if (textNode.text !== "/") {
|
|
8269
|
+
// MathML gives 5/18em spacing to each <mo> element.
|
|
8270
|
+
// \middle should get delimiter spacing instead.
|
|
8271
|
+
middleNode.setAttribute("lspace", "0.05em");
|
|
8272
|
+
middleNode.setAttribute("rspace", "0.05em");
|
|
8273
|
+
}
|
|
8279
8274
|
return middleNode;
|
|
8280
8275
|
}
|
|
8281
8276
|
});
|
|
@@ -8442,7 +8437,7 @@ defineFunction({
|
|
|
8442
8437
|
|
|
8443
8438
|
defineFunction({
|
|
8444
8439
|
type: "enclose",
|
|
8445
|
-
names: ["\\angl", "\\cancel", "\\bcancel", "\\xcancel", "\\
|
|
8440
|
+
names: ["\\angl", "\\cancel", "\\bcancel", "\\xcancel", "\\overline",
|
|
8446
8441
|
"\\boxed", "\\longdiv", "\\phase"],
|
|
8447
8442
|
props: {
|
|
8448
8443
|
numArgs: 1
|
|
@@ -8459,6 +8454,25 @@ defineFunction({
|
|
|
8459
8454
|
mathmlBuilder: mathmlBuilder$7
|
|
8460
8455
|
});
|
|
8461
8456
|
|
|
8457
|
+
defineFunction({
|
|
8458
|
+
type: "enclose",
|
|
8459
|
+
names: ["\\sout"],
|
|
8460
|
+
props: {
|
|
8461
|
+
numArgs: 1,
|
|
8462
|
+
allowedInText: true
|
|
8463
|
+
},
|
|
8464
|
+
handler({ parser, funcName }, args) {
|
|
8465
|
+
const body = args[0];
|
|
8466
|
+
return {
|
|
8467
|
+
type: "enclose",
|
|
8468
|
+
mode: parser.mode,
|
|
8469
|
+
label: funcName,
|
|
8470
|
+
body
|
|
8471
|
+
};
|
|
8472
|
+
},
|
|
8473
|
+
mathmlBuilder: mathmlBuilder$7
|
|
8474
|
+
});
|
|
8475
|
+
|
|
8462
8476
|
defineFunction({
|
|
8463
8477
|
type: "enclose",
|
|
8464
8478
|
names: ["\\underline"],
|
|
@@ -8591,8 +8605,237 @@ defineFunction({
|
|
|
8591
8605
|
}
|
|
8592
8606
|
});
|
|
8593
8607
|
|
|
8608
|
+
// Chromium does not support the MathML `mathvariant` attribute.
|
|
8609
|
+
// Instead, we replace ASCII characters with Unicode characters that
|
|
8610
|
+
// are defined in the font as bold, italic, double-struck, etc.
|
|
8611
|
+
// This module identifies those Unicode code points.
|
|
8612
|
+
|
|
8613
|
+
// First, a few helpers.
|
|
8614
|
+
const script = Object.freeze({
|
|
8615
|
+
B: 0x20EA, // Offset from ASCII B to Unicode script B
|
|
8616
|
+
E: 0x20EB,
|
|
8617
|
+
F: 0x20EB,
|
|
8618
|
+
H: 0x20C3,
|
|
8619
|
+
I: 0x20C7,
|
|
8620
|
+
L: 0x20C6,
|
|
8621
|
+
M: 0x20E6,
|
|
8622
|
+
R: 0x20C9,
|
|
8623
|
+
e: 0x20CA,
|
|
8624
|
+
g: 0x20A3,
|
|
8625
|
+
o: 0x20C5
|
|
8626
|
+
});
|
|
8627
|
+
|
|
8628
|
+
const frak = Object.freeze({
|
|
8629
|
+
C: 0x20EA,
|
|
8630
|
+
H: 0x20C4,
|
|
8631
|
+
I: 0x20C8,
|
|
8632
|
+
R: 0x20CA,
|
|
8633
|
+
Z: 0x20CE
|
|
8634
|
+
});
|
|
8635
|
+
|
|
8636
|
+
const bbb = Object.freeze({
|
|
8637
|
+
C: 0x20BF, // blackboard bold
|
|
8638
|
+
H: 0x20C5,
|
|
8639
|
+
N: 0x20C7,
|
|
8640
|
+
P: 0x20C9,
|
|
8641
|
+
Q: 0x20C9,
|
|
8642
|
+
R: 0x20CB,
|
|
8643
|
+
Z: 0x20CA
|
|
8644
|
+
});
|
|
8645
|
+
|
|
8646
|
+
const bold = Object.freeze({
|
|
8647
|
+
"\u03f5": 0x1D2E7, // lunate epsilon
|
|
8648
|
+
"\u03d1": 0x1D30C, // vartheta
|
|
8649
|
+
"\u03f0": 0x1D2EE, // varkappa
|
|
8650
|
+
"\u03c6": 0x1D319, // varphi
|
|
8651
|
+
"\u03f1": 0x1D2EF, // varrho
|
|
8652
|
+
"\u03d6": 0x1D30B // varpi
|
|
8653
|
+
});
|
|
8654
|
+
|
|
8655
|
+
const boldItalic = Object.freeze({
|
|
8656
|
+
"\u03f5": 0x1D35B, // lunate epsilon
|
|
8657
|
+
"\u03d1": 0x1D380, // vartheta
|
|
8658
|
+
"\u03f0": 0x1D362, // varkappa
|
|
8659
|
+
"\u03c6": 0x1D38D, // varphi
|
|
8660
|
+
"\u03f1": 0x1D363, // varrho
|
|
8661
|
+
"\u03d6": 0x1D37F // varpi
|
|
8662
|
+
});
|
|
8663
|
+
|
|
8664
|
+
const boldsf = Object.freeze({
|
|
8665
|
+
"\u03f5": 0x1D395, // lunate epsilon
|
|
8666
|
+
"\u03d1": 0x1D3BA, // vartheta
|
|
8667
|
+
"\u03f0": 0x1D39C, // varkappa
|
|
8668
|
+
"\u03c6": 0x1D3C7, // varphi
|
|
8669
|
+
"\u03f1": 0x1D39D, // varrho
|
|
8670
|
+
"\u03d6": 0x1D3B9 // varpi
|
|
8671
|
+
});
|
|
8672
|
+
|
|
8673
|
+
const bisf = Object.freeze({
|
|
8674
|
+
"\u03f5": 0x1D3CF, // lunate epsilon
|
|
8675
|
+
"\u03d1": 0x1D3F4, // vartheta
|
|
8676
|
+
"\u03f0": 0x1D3D6, // varkappa
|
|
8677
|
+
"\u03c6": 0x1D401, // varphi
|
|
8678
|
+
"\u03f1": 0x1D3D7, // varrho
|
|
8679
|
+
"\u03d6": 0x1D3F3 // varpi
|
|
8680
|
+
});
|
|
8681
|
+
|
|
8682
|
+
// Code point offsets below are derived from https://www.unicode.org/charts/PDF/U1D400.pdf
|
|
8683
|
+
const offset = Object.freeze({
|
|
8684
|
+
upperCaseLatin: { // A-Z
|
|
8685
|
+
"normal": ch => { return 0 },
|
|
8686
|
+
"bold": ch => { return 0x1D3BF },
|
|
8687
|
+
"italic": ch => { return 0x1D3F3 },
|
|
8688
|
+
"bold-italic": ch => { return 0x1D427 },
|
|
8689
|
+
"script": ch => { return script[ch] || 0x1D45B },
|
|
8690
|
+
"script-bold": ch => { return 0x1D48F },
|
|
8691
|
+
"fraktur": ch => { return frak[ch] || 0x1D4C3 },
|
|
8692
|
+
"fraktur-bold": ch => { return 0x1D52B },
|
|
8693
|
+
"double-struck": ch => { return bbb[ch] || 0x1D4F7 },
|
|
8694
|
+
"sans-serif": ch => { return 0x1D55F },
|
|
8695
|
+
"sans-serif-bold": ch => { return 0x1D593 },
|
|
8696
|
+
"sans-serif-italic": ch => { return 0x1D5C7 },
|
|
8697
|
+
"sans-serif-bold-italic": ch => { return 0x1D63C },
|
|
8698
|
+
"monospace": ch => { return 0x1D62F }
|
|
8699
|
+
},
|
|
8700
|
+
lowerCaseLatin: { // a-z
|
|
8701
|
+
"normal": ch => { return 0 },
|
|
8702
|
+
"bold": ch => { return 0x1D3B9 },
|
|
8703
|
+
"italic": ch => { return ch === "h" ? 0x20A6 : 0x1D3ED },
|
|
8704
|
+
"bold-italic": ch => { return 0x1D421 },
|
|
8705
|
+
"script": ch => { return script[ch] || 0x1D455 },
|
|
8706
|
+
"script-bold": ch => { return 0x1D489 },
|
|
8707
|
+
"fraktur": ch => { return 0x1D4BD },
|
|
8708
|
+
"fraktur-bold": ch => { return 0x1D525 },
|
|
8709
|
+
"double-struck": ch => { return 0x1D4F1 },
|
|
8710
|
+
"sans-serif": ch => { return 0x1D559 },
|
|
8711
|
+
"sans-serif-bold": ch => { return 0x1D58D },
|
|
8712
|
+
"sans-serif-italic": ch => { return 0x1D5C1 },
|
|
8713
|
+
"sans-serif-bold-italic": ch => { return 0x1D5F5 },
|
|
8714
|
+
"monospace": ch => { return 0x1D629 }
|
|
8715
|
+
},
|
|
8716
|
+
upperCaseGreek: { // A-Ω
|
|
8717
|
+
"normal": ch => { return 0 },
|
|
8718
|
+
"bold": ch => { return 0x1D317 },
|
|
8719
|
+
"italic": ch => { return 0x1D351 },
|
|
8720
|
+
// \boldsymbol actually returns upright bold for upperCaseGreek
|
|
8721
|
+
"bold-italic": ch => { return 0x1D317 },
|
|
8722
|
+
"script": ch => { return 0 },
|
|
8723
|
+
"script-bold": ch => { return 0 },
|
|
8724
|
+
"fraktur": ch => { return 0 },
|
|
8725
|
+
"fraktur-bold": ch => { return 0 },
|
|
8726
|
+
"double-struck": ch => { return 0 },
|
|
8727
|
+
// Unicode has no code points for regular-weight san-serif Greek. Use bold.
|
|
8728
|
+
"sans-serif": ch => { return 0x1D3C5 },
|
|
8729
|
+
"sans-serif-bold": ch => { return 0x1D3C5 },
|
|
8730
|
+
"sans-serif-italic": ch => { return 0 },
|
|
8731
|
+
"sans-serif-bold-italic": ch => { return 0x1D3FF },
|
|
8732
|
+
"monospace": ch => { return 0 }
|
|
8733
|
+
},
|
|
8734
|
+
lowerCaseGreek: { // α-ω
|
|
8735
|
+
"normal": ch => { return 0 },
|
|
8736
|
+
"bold": ch => { return 0x1D311 },
|
|
8737
|
+
"italic": ch => { return 0x1D34B },
|
|
8738
|
+
"bold-italic": ch => { return ch === "\u03d5" ? 0x1D37E : 0x1D385 },
|
|
8739
|
+
"script": ch => { return 0 },
|
|
8740
|
+
"script-bold": ch => { return 0 },
|
|
8741
|
+
"fraktur": ch => { return 0 },
|
|
8742
|
+
"fraktur-bold": ch => { return 0 },
|
|
8743
|
+
"double-struck": ch => { return 0 },
|
|
8744
|
+
// Unicode has no code points for regular-weight san-serif Greek. Use bold.
|
|
8745
|
+
"sans-serif": ch => { return 0x1D3BF },
|
|
8746
|
+
"sans-serif-bold": ch => { return 0x1D3BF },
|
|
8747
|
+
"sans-serif-italic": ch => { return 0 },
|
|
8748
|
+
"sans-serif-bold-italic": ch => { return 0x1D3F9 },
|
|
8749
|
+
"monospace": ch => { return 0 }
|
|
8750
|
+
},
|
|
8751
|
+
varGreek: { // \varGamma, etc
|
|
8752
|
+
"normal": ch => { return 0 },
|
|
8753
|
+
"bold": ch => { return bold[ch] || -51 },
|
|
8754
|
+
"italic": ch => { return 0 },
|
|
8755
|
+
"bold-italic": ch => { return boldItalic[ch] || 0x3A },
|
|
8756
|
+
"script": ch => { return 0 },
|
|
8757
|
+
"script-bold": ch => { return 0 },
|
|
8758
|
+
"fraktur": ch => { return 0 },
|
|
8759
|
+
"fraktur-bold": ch => { return 0 },
|
|
8760
|
+
"double-struck": ch => { return 0 },
|
|
8761
|
+
"sans-serif": ch => { return boldsf[ch] || 0x74 },
|
|
8762
|
+
"sans-serif-bold": ch => { return boldsf[ch] || 0x74 },
|
|
8763
|
+
"sans-serif-italic": ch => { return 0 },
|
|
8764
|
+
"sans-serif-bold-italic": ch => { return bisf[ch] || 0xAE },
|
|
8765
|
+
"monospace": ch => { return 0 }
|
|
8766
|
+
},
|
|
8767
|
+
numeral: { // 0-9
|
|
8768
|
+
"normal": ch => { return 0 },
|
|
8769
|
+
"bold": ch => { return 0x1D79E },
|
|
8770
|
+
"italic": ch => { return 0 },
|
|
8771
|
+
"bold-italic": ch => { return 0 },
|
|
8772
|
+
"script": ch => { return 0 },
|
|
8773
|
+
"script-bold": ch => { return 0 },
|
|
8774
|
+
"fraktur": ch => { return 0 },
|
|
8775
|
+
"fraktur-bold": ch => { return 0 },
|
|
8776
|
+
"double-struck": ch => { return 0x1D7A8 },
|
|
8777
|
+
"sans-serif": ch => { return 0x1D7B2 },
|
|
8778
|
+
"sans-serif-bold": ch => { return 0x1D7BC },
|
|
8779
|
+
"sans-serif-italic": ch => { return 0 },
|
|
8780
|
+
"sans-serif-bold-italic": ch => { return 0 },
|
|
8781
|
+
"monospace": ch => { return 0x1D7C6 }
|
|
8782
|
+
}
|
|
8783
|
+
});
|
|
8784
|
+
|
|
8785
|
+
const variantChar = (ch, variant) => {
|
|
8786
|
+
const codePoint = ch.codePointAt(0);
|
|
8787
|
+
const block = 0x40 < codePoint && codePoint < 0x5b
|
|
8788
|
+
? "upperCaseLatin"
|
|
8789
|
+
: 0x60 < codePoint && codePoint < 0x7b
|
|
8790
|
+
? "lowerCaseLatin"
|
|
8791
|
+
: (0x390 < codePoint && codePoint < 0x3AA)
|
|
8792
|
+
? "upperCaseGreek"
|
|
8793
|
+
: 0x3B0 < codePoint && codePoint < 0x3CA || ch === "\u03d5"
|
|
8794
|
+
? "lowerCaseGreek"
|
|
8795
|
+
: 0x1D6E1 < codePoint && codePoint < 0x1D6FC || bold[ch]
|
|
8796
|
+
? "varGreek"
|
|
8797
|
+
: (0x2F < codePoint && codePoint < 0x3A)
|
|
8798
|
+
? "numeral"
|
|
8799
|
+
: "other";
|
|
8800
|
+
return block === "other"
|
|
8801
|
+
? ch
|
|
8802
|
+
: String.fromCodePoint(codePoint + offset[block][variant](ch))
|
|
8803
|
+
};
|
|
8804
|
+
|
|
8805
|
+
const smallCaps = Object.freeze({
|
|
8806
|
+
a: "ᴀ",
|
|
8807
|
+
b: "ʙ",
|
|
8808
|
+
c: "ᴄ",
|
|
8809
|
+
d: "ᴅ",
|
|
8810
|
+
e: "ᴇ",
|
|
8811
|
+
f: "ꜰ",
|
|
8812
|
+
g: "ɢ",
|
|
8813
|
+
h: "ʜ",
|
|
8814
|
+
i: "ɪ",
|
|
8815
|
+
j: "ᴊ",
|
|
8816
|
+
k: "ᴋ",
|
|
8817
|
+
l: "ʟ",
|
|
8818
|
+
m: "ᴍ",
|
|
8819
|
+
n: "ɴ",
|
|
8820
|
+
o: "ᴏ",
|
|
8821
|
+
p: "ᴘ",
|
|
8822
|
+
q: "ǫ",
|
|
8823
|
+
r: "ʀ",
|
|
8824
|
+
s: "s",
|
|
8825
|
+
t: "ᴛ",
|
|
8826
|
+
u: "ᴜ",
|
|
8827
|
+
v: "ᴠ",
|
|
8828
|
+
w: "ᴡ",
|
|
8829
|
+
x: "x",
|
|
8830
|
+
y: "ʏ",
|
|
8831
|
+
z: "ᴢ"
|
|
8832
|
+
});
|
|
8833
|
+
|
|
8834
|
+
const varNameFonts = ["mathrm", "mathit"];
|
|
8835
|
+
|
|
8594
8836
|
const isLongVariableName = (group, font) => {
|
|
8595
|
-
if (font
|
|
8837
|
+
if (!varNameFonts.includes(font) || !group.body || group.body.type !== "ordgroup" ||
|
|
8838
|
+
group.body.body.length === 1) {
|
|
8596
8839
|
return false
|
|
8597
8840
|
}
|
|
8598
8841
|
if (group.body.body[0].type !== "mathord") { return false }
|
|
@@ -8618,8 +8861,7 @@ const mathmlBuilder$6 = (group, style) => {
|
|
|
8618
8861
|
}
|
|
8619
8862
|
// Check if it is possible to consolidate elements into a single <mi> element.
|
|
8620
8863
|
if (isLongVariableName(group, font)) {
|
|
8621
|
-
// This is a \mathrm{…} group. It gets special treatment
|
|
8622
|
-
// wraps <mi> elements with <mpadded>s to work around a Firefox bug.
|
|
8864
|
+
// This is a \mathrm{…} or \mathit{…} group. It gets special treatment.
|
|
8623
8865
|
const mi = mathGroup.children[0].children[0].children
|
|
8624
8866
|
? mathGroup.children[0].children[0]
|
|
8625
8867
|
: mathGroup.children[0];
|
|
@@ -8629,7 +8871,14 @@ const mathmlBuilder$6 = (group, style) => {
|
|
|
8629
8871
|
? mathGroup.children[i].children[0].children[0].text
|
|
8630
8872
|
: mathGroup.children[i].children[0].text;
|
|
8631
8873
|
}
|
|
8632
|
-
|
|
8874
|
+
if (font === "mathit") {
|
|
8875
|
+
// Long <mi> elements are normally rendered in upright font.
|
|
8876
|
+
// To get italic, we need to convert each character to the corresponding italic character.
|
|
8877
|
+
mi.children[0].text = mi.children[0].text.split("")
|
|
8878
|
+
.map(c => variantChar(c, "italic")).join("");
|
|
8879
|
+
return mi
|
|
8880
|
+
}
|
|
8881
|
+
// Otherwise, font is "mathrm". Wrap in a <mpadded> to prevent a Firefox spacing bug.
|
|
8633
8882
|
const mpadded = new MathNode("mpadded", [mi]);
|
|
8634
8883
|
mpadded.setAttribute("lspace", "0");
|
|
8635
8884
|
return mpadded
|
|
@@ -10507,7 +10756,7 @@ defineFunction({
|
|
|
10507
10756
|
const inner = buildExpression(ordargument(group.body), style);
|
|
10508
10757
|
const phantom = new MathNode("mphantom", inner);
|
|
10509
10758
|
const node = new MathNode("mpadded", [phantom]);
|
|
10510
|
-
node.setAttribute("width", "
|
|
10759
|
+
node.setAttribute("width", "0.1px");
|
|
10511
10760
|
return node;
|
|
10512
10761
|
}
|
|
10513
10762
|
});
|
|
@@ -11324,232 +11573,6 @@ const getVariant = function(group, style) {
|
|
|
11324
11573
|
return Object.prototype.hasOwnProperty.call(fontMap, font) ? fontMap[font] : null
|
|
11325
11574
|
};
|
|
11326
11575
|
|
|
11327
|
-
// Chromium does not support the MathML `mathvariant` attribute.
|
|
11328
|
-
// Instead, we replace ASCII characters with Unicode characters that
|
|
11329
|
-
// are defined in the font as bold, italic, double-struck, etc.
|
|
11330
|
-
// This module identifies those Unicode code points.
|
|
11331
|
-
|
|
11332
|
-
// First, a few helpers.
|
|
11333
|
-
const script = Object.freeze({
|
|
11334
|
-
B: 0x20EA, // Offset from ASCII B to Unicode script B
|
|
11335
|
-
E: 0x20EB,
|
|
11336
|
-
F: 0x20EB,
|
|
11337
|
-
H: 0x20C3,
|
|
11338
|
-
I: 0x20C7,
|
|
11339
|
-
L: 0x20C6,
|
|
11340
|
-
M: 0x20E6,
|
|
11341
|
-
R: 0x20C9,
|
|
11342
|
-
e: 0x20CA,
|
|
11343
|
-
g: 0x20A3,
|
|
11344
|
-
o: 0x20C5
|
|
11345
|
-
});
|
|
11346
|
-
|
|
11347
|
-
const frak = Object.freeze({
|
|
11348
|
-
C: 0x20EA,
|
|
11349
|
-
H: 0x20C4,
|
|
11350
|
-
I: 0x20C8,
|
|
11351
|
-
R: 0x20CA,
|
|
11352
|
-
Z: 0x20CE
|
|
11353
|
-
});
|
|
11354
|
-
|
|
11355
|
-
const bbb = Object.freeze({
|
|
11356
|
-
C: 0x20BF, // blackboard bold
|
|
11357
|
-
H: 0x20C5,
|
|
11358
|
-
N: 0x20C7,
|
|
11359
|
-
P: 0x20C9,
|
|
11360
|
-
Q: 0x20C9,
|
|
11361
|
-
R: 0x20CB,
|
|
11362
|
-
Z: 0x20CA
|
|
11363
|
-
});
|
|
11364
|
-
|
|
11365
|
-
const bold = Object.freeze({
|
|
11366
|
-
"\u03f5": 0x1D2E7, // lunate epsilon
|
|
11367
|
-
"\u03d1": 0x1D30C, // vartheta
|
|
11368
|
-
"\u03f0": 0x1D2EE, // varkappa
|
|
11369
|
-
"\u03c6": 0x1D319, // varphi
|
|
11370
|
-
"\u03f1": 0x1D2EF, // varrho
|
|
11371
|
-
"\u03d6": 0x1D30B // varpi
|
|
11372
|
-
});
|
|
11373
|
-
|
|
11374
|
-
const boldItalic = Object.freeze({
|
|
11375
|
-
"\u03f5": 0x1D35B, // lunate epsilon
|
|
11376
|
-
"\u03d1": 0x1D380, // vartheta
|
|
11377
|
-
"\u03f0": 0x1D362, // varkappa
|
|
11378
|
-
"\u03c6": 0x1D38D, // varphi
|
|
11379
|
-
"\u03f1": 0x1D363, // varrho
|
|
11380
|
-
"\u03d6": 0x1D37F // varpi
|
|
11381
|
-
});
|
|
11382
|
-
|
|
11383
|
-
const boldsf = Object.freeze({
|
|
11384
|
-
"\u03f5": 0x1D395, // lunate epsilon
|
|
11385
|
-
"\u03d1": 0x1D3BA, // vartheta
|
|
11386
|
-
"\u03f0": 0x1D39C, // varkappa
|
|
11387
|
-
"\u03c6": 0x1D3C7, // varphi
|
|
11388
|
-
"\u03f1": 0x1D39D, // varrho
|
|
11389
|
-
"\u03d6": 0x1D3B9 // varpi
|
|
11390
|
-
});
|
|
11391
|
-
|
|
11392
|
-
const bisf = Object.freeze({
|
|
11393
|
-
"\u03f5": 0x1D3CF, // lunate epsilon
|
|
11394
|
-
"\u03d1": 0x1D3F4, // vartheta
|
|
11395
|
-
"\u03f0": 0x1D3D6, // varkappa
|
|
11396
|
-
"\u03c6": 0x1D401, // varphi
|
|
11397
|
-
"\u03f1": 0x1D3D7, // varrho
|
|
11398
|
-
"\u03d6": 0x1D3F3 // varpi
|
|
11399
|
-
});
|
|
11400
|
-
|
|
11401
|
-
// Code point offsets below are derived from https://www.unicode.org/charts/PDF/U1D400.pdf
|
|
11402
|
-
const offset = Object.freeze({
|
|
11403
|
-
upperCaseLatin: { // A-Z
|
|
11404
|
-
"normal": ch => { return 0 },
|
|
11405
|
-
"bold": ch => { return 0x1D3BF },
|
|
11406
|
-
"italic": ch => { return 0x1D3F3 },
|
|
11407
|
-
"bold-italic": ch => { return 0x1D427 },
|
|
11408
|
-
"script": ch => { return script[ch] || 0x1D45B },
|
|
11409
|
-
"script-bold": ch => { return 0x1D48F },
|
|
11410
|
-
"fraktur": ch => { return frak[ch] || 0x1D4C3 },
|
|
11411
|
-
"fraktur-bold": ch => { return 0x1D52B },
|
|
11412
|
-
"double-struck": ch => { return bbb[ch] || 0x1D4F7 },
|
|
11413
|
-
"sans-serif": ch => { return 0x1D55F },
|
|
11414
|
-
"sans-serif-bold": ch => { return 0x1D593 },
|
|
11415
|
-
"sans-serif-italic": ch => { return 0x1D5C7 },
|
|
11416
|
-
"sans-serif-bold-italic": ch => { return 0x1D63C },
|
|
11417
|
-
"monospace": ch => { return 0x1D62F }
|
|
11418
|
-
},
|
|
11419
|
-
lowerCaseLatin: { // a-z
|
|
11420
|
-
"normal": ch => { return 0 },
|
|
11421
|
-
"bold": ch => { return 0x1D3B9 },
|
|
11422
|
-
"italic": ch => { return ch === "h" ? 0x20A6 : 0x1D3ED },
|
|
11423
|
-
"bold-italic": ch => { return 0x1D421 },
|
|
11424
|
-
"script": ch => { return script[ch] || 0x1D455 },
|
|
11425
|
-
"script-bold": ch => { return 0x1D489 },
|
|
11426
|
-
"fraktur": ch => { return 0x1D4BD },
|
|
11427
|
-
"fraktur-bold": ch => { return 0x1D525 },
|
|
11428
|
-
"double-struck": ch => { return 0x1D4F1 },
|
|
11429
|
-
"sans-serif": ch => { return 0x1D559 },
|
|
11430
|
-
"sans-serif-bold": ch => { return 0x1D58D },
|
|
11431
|
-
"sans-serif-italic": ch => { return 0x1D5C1 },
|
|
11432
|
-
"sans-serif-bold-italic": ch => { return 0x1D5F5 },
|
|
11433
|
-
"monospace": ch => { return 0x1D629 }
|
|
11434
|
-
},
|
|
11435
|
-
upperCaseGreek: { // A-Ω
|
|
11436
|
-
"normal": ch => { return 0 },
|
|
11437
|
-
"bold": ch => { return 0x1D317 },
|
|
11438
|
-
"italic": ch => { return 0x1D351 },
|
|
11439
|
-
// \boldsymbol actually returns upright bold for upperCaseGreek
|
|
11440
|
-
"bold-italic": ch => { return 0x1D317 },
|
|
11441
|
-
"script": ch => { return 0 },
|
|
11442
|
-
"script-bold": ch => { return 0 },
|
|
11443
|
-
"fraktur": ch => { return 0 },
|
|
11444
|
-
"fraktur-bold": ch => { return 0 },
|
|
11445
|
-
"double-struck": ch => { return 0 },
|
|
11446
|
-
// Unicode has no code points for regular-weight san-serif Greek. Use bold.
|
|
11447
|
-
"sans-serif": ch => { return 0x1D3C5 },
|
|
11448
|
-
"sans-serif-bold": ch => { return 0x1D3C5 },
|
|
11449
|
-
"sans-serif-italic": ch => { return 0 },
|
|
11450
|
-
"sans-serif-bold-italic": ch => { return 0x1D3FF },
|
|
11451
|
-
"monospace": ch => { return 0 }
|
|
11452
|
-
},
|
|
11453
|
-
lowerCaseGreek: { // α-ω
|
|
11454
|
-
"normal": ch => { return 0 },
|
|
11455
|
-
"bold": ch => { return 0x1D311 },
|
|
11456
|
-
"italic": ch => { return 0x1D34B },
|
|
11457
|
-
"bold-italic": ch => { return ch === "\u03d5" ? 0x1D37E : 0x1D385 },
|
|
11458
|
-
"script": ch => { return 0 },
|
|
11459
|
-
"script-bold": ch => { return 0 },
|
|
11460
|
-
"fraktur": ch => { return 0 },
|
|
11461
|
-
"fraktur-bold": ch => { return 0 },
|
|
11462
|
-
"double-struck": ch => { return 0 },
|
|
11463
|
-
// Unicode has no code points for regular-weight san-serif Greek. Use bold.
|
|
11464
|
-
"sans-serif": ch => { return 0x1D3BF },
|
|
11465
|
-
"sans-serif-bold": ch => { return 0x1D3BF },
|
|
11466
|
-
"sans-serif-italic": ch => { return 0 },
|
|
11467
|
-
"sans-serif-bold-italic": ch => { return 0x1D3F9 },
|
|
11468
|
-
"monospace": ch => { return 0 }
|
|
11469
|
-
},
|
|
11470
|
-
varGreek: { // \varGamma, etc
|
|
11471
|
-
"normal": ch => { return 0 },
|
|
11472
|
-
"bold": ch => { return bold[ch] || -51 },
|
|
11473
|
-
"italic": ch => { return 0 },
|
|
11474
|
-
"bold-italic": ch => { return boldItalic[ch] || 0x3A },
|
|
11475
|
-
"script": ch => { return 0 },
|
|
11476
|
-
"script-bold": ch => { return 0 },
|
|
11477
|
-
"fraktur": ch => { return 0 },
|
|
11478
|
-
"fraktur-bold": ch => { return 0 },
|
|
11479
|
-
"double-struck": ch => { return 0 },
|
|
11480
|
-
"sans-serif": ch => { return boldsf[ch] || 0x74 },
|
|
11481
|
-
"sans-serif-bold": ch => { return boldsf[ch] || 0x74 },
|
|
11482
|
-
"sans-serif-italic": ch => { return 0 },
|
|
11483
|
-
"sans-serif-bold-italic": ch => { return bisf[ch] || 0xAE },
|
|
11484
|
-
"monospace": ch => { return 0 }
|
|
11485
|
-
},
|
|
11486
|
-
numeral: { // 0-9
|
|
11487
|
-
"normal": ch => { return 0 },
|
|
11488
|
-
"bold": ch => { return 0x1D79E },
|
|
11489
|
-
"italic": ch => { return 0 },
|
|
11490
|
-
"bold-italic": ch => { return 0 },
|
|
11491
|
-
"script": ch => { return 0 },
|
|
11492
|
-
"script-bold": ch => { return 0 },
|
|
11493
|
-
"fraktur": ch => { return 0 },
|
|
11494
|
-
"fraktur-bold": ch => { return 0 },
|
|
11495
|
-
"double-struck": ch => { return 0x1D7A8 },
|
|
11496
|
-
"sans-serif": ch => { return 0x1D7B2 },
|
|
11497
|
-
"sans-serif-bold": ch => { return 0x1D7BC },
|
|
11498
|
-
"sans-serif-italic": ch => { return 0 },
|
|
11499
|
-
"sans-serif-bold-italic": ch => { return 0 },
|
|
11500
|
-
"monospace": ch => { return 0x1D7C6 }
|
|
11501
|
-
}
|
|
11502
|
-
});
|
|
11503
|
-
|
|
11504
|
-
const variantChar = (ch, variant) => {
|
|
11505
|
-
const codePoint = ch.codePointAt(0);
|
|
11506
|
-
const block = 0x40 < codePoint && codePoint < 0x5b
|
|
11507
|
-
? "upperCaseLatin"
|
|
11508
|
-
: 0x60 < codePoint && codePoint < 0x7b
|
|
11509
|
-
? "lowerCaseLatin"
|
|
11510
|
-
: (0x390 < codePoint && codePoint < 0x3AA)
|
|
11511
|
-
? "upperCaseGreek"
|
|
11512
|
-
: 0x3B0 < codePoint && codePoint < 0x3CA || ch === "\u03d5"
|
|
11513
|
-
? "lowerCaseGreek"
|
|
11514
|
-
: 0x1D6E1 < codePoint && codePoint < 0x1D6FC || bold[ch]
|
|
11515
|
-
? "varGreek"
|
|
11516
|
-
: (0x2F < codePoint && codePoint < 0x3A)
|
|
11517
|
-
? "numeral"
|
|
11518
|
-
: "other";
|
|
11519
|
-
return block === "other"
|
|
11520
|
-
? ch
|
|
11521
|
-
: String.fromCodePoint(codePoint + offset[block][variant](ch))
|
|
11522
|
-
};
|
|
11523
|
-
|
|
11524
|
-
const smallCaps = Object.freeze({
|
|
11525
|
-
a: "ᴀ",
|
|
11526
|
-
b: "ʙ",
|
|
11527
|
-
c: "ᴄ",
|
|
11528
|
-
d: "ᴅ",
|
|
11529
|
-
e: "ᴇ",
|
|
11530
|
-
f: "ꜰ",
|
|
11531
|
-
g: "ɢ",
|
|
11532
|
-
h: "ʜ",
|
|
11533
|
-
i: "ɪ",
|
|
11534
|
-
j: "ᴊ",
|
|
11535
|
-
k: "ᴋ",
|
|
11536
|
-
l: "ʟ",
|
|
11537
|
-
m: "ᴍ",
|
|
11538
|
-
n: "ɴ",
|
|
11539
|
-
o: "ᴏ",
|
|
11540
|
-
p: "ᴘ",
|
|
11541
|
-
q: "ǫ",
|
|
11542
|
-
r: "ʀ",
|
|
11543
|
-
s: "s",
|
|
11544
|
-
t: "ᴛ",
|
|
11545
|
-
u: "ᴜ",
|
|
11546
|
-
v: "ᴠ",
|
|
11547
|
-
w: "ᴡ",
|
|
11548
|
-
x: "x",
|
|
11549
|
-
y: "ʏ",
|
|
11550
|
-
z: "ᴢ"
|
|
11551
|
-
});
|
|
11552
|
-
|
|
11553
11576
|
// "mathord" and "textord" ParseNodes created in Parser.js from symbol Groups in
|
|
11554
11577
|
// src/symbols.js.
|
|
11555
11578
|
|
|
@@ -12169,7 +12192,7 @@ class MacroExpander {
|
|
|
12169
12192
|
this.pushToken(new Token("EOF", end.loc));
|
|
12170
12193
|
|
|
12171
12194
|
this.pushTokens(tokens);
|
|
12172
|
-
return
|
|
12195
|
+
return new Token("", SourceLocation.range(start, end));
|
|
12173
12196
|
}
|
|
12174
12197
|
|
|
12175
12198
|
/**
|
|
@@ -14174,7 +14197,7 @@ class Style {
|
|
|
14174
14197
|
* https://mit-license.org/
|
|
14175
14198
|
*/
|
|
14176
14199
|
|
|
14177
|
-
const version = "0.13.
|
|
14200
|
+
const version = "0.13.3";
|
|
14178
14201
|
|
|
14179
14202
|
function postProcess(block) {
|
|
14180
14203
|
const labelMap = {};
|