jekyll-theme-hydejack 8.3.2 → 8.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -27
- data/_includes/body/footer.html +1 -1
- data/_includes/head/links.html +1 -1
- data/_includes/head/meta.html +5 -1
- data/_includes/head/styles.html +1 -1
- data/_includes/header.txt +1 -1
- data/_includes/scripts.html +33 -0
- data/_layouts/compress.html +1 -1
- data/assets/bower_components/katex/.bower.json +6 -6
- data/assets/bower_components/katex/bower.json +1 -1
- data/assets/bower_components/katex/dist/contrib/auto-render.js +4 -0
- data/assets/bower_components/katex/dist/contrib/auto-render.min.js +1 -1
- data/assets/bower_components/katex/dist/contrib/auto-render.mjs +215 -0
- data/assets/bower_components/katex/dist/contrib/copy-tex.js +9 -4
- data/assets/bower_components/katex/dist/contrib/copy-tex.min.css +1 -1
- data/assets/bower_components/katex/dist/contrib/copy-tex.min.js +1 -1
- data/assets/bower_components/katex/dist/contrib/copy-tex.mjs +85 -0
- data/assets/bower_components/katex/dist/contrib/mathtex-script-type.min.js +1 -1
- data/assets/bower_components/katex/dist/contrib/mathtex-script-type.mjs +24 -0
- data/assets/bower_components/katex/dist/contrib/mhchem.js +3241 -0
- data/assets/bower_components/katex/dist/contrib/mhchem.min.js +1 -0
- data/assets/bower_components/katex/dist/contrib/mhchem.mjs +3109 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/katex.css +8 -4
- data/assets/bower_components/katex/dist/katex.js +470 -414
- data/assets/bower_components/katex/dist/katex.min.css +1 -1
- data/assets/bower_components/katex/dist/katex.min.js +1 -1
- data/assets/bower_components/katex/dist/katex.mjs +495 -456
- data/assets/bower_components/katex/yarn.lock +3091 -2622
- data/assets/css/{hydejack-8.3.2.css → hydejack-7.5.2.css} +0 -0
- data/assets/css/hydejack-8.4.0.css +3 -0
- data/assets/js/hydejack-8.4.0.js +47 -0
- data/assets/version.json +1 -1
- metadata +12 -5
- data/assets/bower_components/katex/dist/README.md +0 -90
- data/assets/bower_components/katex/lint_blacklist.txt +0 -5
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -967,10 +967,7 @@
|
|
967
967
|
.katex .boxpad {
|
968
968
|
padding: 0 0.3em 0 0.3em;
|
969
969
|
}
|
970
|
-
.katex .fbox
|
971
|
-
box-sizing: border-box;
|
972
|
-
border: 0.04em solid black;
|
973
|
-
}
|
970
|
+
.katex .fbox,
|
974
971
|
.katex .fcolorbox {
|
975
972
|
box-sizing: border-box;
|
976
973
|
border: 0.04em solid;
|
@@ -1004,4 +1001,11 @@
|
|
1004
1001
|
position: absolute;
|
1005
1002
|
right: 0;
|
1006
1003
|
}
|
1004
|
+
.katex-display.leqno > .katex > .katex-html > .tag {
|
1005
|
+
left: 0;
|
1006
|
+
right: auto;
|
1007
|
+
}
|
1008
|
+
.katex-display.fleqn > .katex {
|
1009
|
+
text-align: left;
|
1010
|
+
}
|
1007
1011
|
|
@@ -91,7 +91,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
91
91
|
/******/
|
92
92
|
/******/
|
93
93
|
/******/ // Load entry module and return exports
|
94
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
94
|
+
/******/ return __webpack_require__(__webpack_require__.s = 1);
|
95
95
|
/******/ })
|
96
96
|
/************************************************************************/
|
97
97
|
/******/ ([
|
@@ -101,8 +101,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
101
101
|
// extracted by mini-css-extract-plugin
|
102
102
|
|
103
103
|
/***/ }),
|
104
|
-
/* 1
|
105
|
-
/* 2 */
|
104
|
+
/* 1 */
|
106
105
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
107
106
|
|
108
107
|
"use strict";
|
@@ -131,12 +130,6 @@ function () {
|
|
131
130
|
this.start = start;
|
132
131
|
this.end = end;
|
133
132
|
}
|
134
|
-
|
135
|
-
var _proto = SourceLocation.prototype;
|
136
|
-
|
137
|
-
_proto.getSource = function getSource() {
|
138
|
-
return this.lexer.input.slice(this.start, this.end);
|
139
|
-
};
|
140
133
|
/**
|
141
134
|
* Merges two `SourceLocation`s from location providers, given they are
|
142
135
|
* provided in order of appearance.
|
@@ -403,6 +396,8 @@ var Settings_Settings =
|
|
403
396
|
function () {
|
404
397
|
function Settings(options) {
|
405
398
|
this.displayMode = void 0;
|
399
|
+
this.leqno = void 0;
|
400
|
+
this.fleqn = void 0;
|
406
401
|
this.throwOnError = void 0;
|
407
402
|
this.errorColor = void 0;
|
408
403
|
this.macros = void 0;
|
@@ -414,6 +409,8 @@ function () {
|
|
414
409
|
// allow null options
|
415
410
|
options = options || {};
|
416
411
|
this.displayMode = utils.deflt(options.displayMode, false);
|
412
|
+
this.leqno = utils.deflt(options.leqno, false);
|
413
|
+
this.fleqn = utils.deflt(options.fleqn, false);
|
417
414
|
this.throwOnError = utils.deflt(options.throwOnError, true);
|
418
415
|
this.errorColor = utils.deflt(options.errorColor, "#cc0000");
|
419
416
|
this.macros = options.macros || {};
|
@@ -450,7 +447,7 @@ function () {
|
|
450
447
|
// won't happen in type-safe code
|
451
448
|
typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]"));
|
452
449
|
}
|
453
|
-
}
|
450
|
+
}
|
454
451
|
/**
|
455
452
|
* Check whether to apply strict (LaTeX-adhering) behavior for unusual
|
456
453
|
* input (like `\\`). Unlike `nonstrict`, will not throw an error;
|
@@ -459,7 +456,7 @@ function () {
|
|
459
456
|
* "warn" prints a warning and returns `false`.
|
460
457
|
* This is for the second category of `errorCode`s listed in the README.
|
461
458
|
*/
|
462
|
-
|
459
|
+
;
|
463
460
|
|
464
461
|
_proto.useStrictBehavior = function useStrictBehavior(errorCode, errorMsg, token) {
|
465
462
|
var strict = this.strict;
|
@@ -527,54 +524,54 @@ function () {
|
|
527
524
|
|
528
525
|
_proto.sup = function sup() {
|
529
526
|
return Style_styles[_sup[this.id]];
|
530
|
-
}
|
527
|
+
}
|
531
528
|
/**
|
532
529
|
* Get the style of a subscript given a base in the current style.
|
533
530
|
*/
|
534
|
-
|
531
|
+
;
|
535
532
|
|
536
533
|
_proto.sub = function sub() {
|
537
534
|
return Style_styles[_sub[this.id]];
|
538
|
-
}
|
535
|
+
}
|
539
536
|
/**
|
540
537
|
* Get the style of a fraction numerator given the fraction in the current
|
541
538
|
* style.
|
542
539
|
*/
|
543
|
-
|
540
|
+
;
|
544
541
|
|
545
542
|
_proto.fracNum = function fracNum() {
|
546
543
|
return Style_styles[_fracNum[this.id]];
|
547
|
-
}
|
544
|
+
}
|
548
545
|
/**
|
549
546
|
* Get the style of a fraction denominator given the fraction in the current
|
550
547
|
* style.
|
551
548
|
*/
|
552
|
-
|
549
|
+
;
|
553
550
|
|
554
551
|
_proto.fracDen = function fracDen() {
|
555
552
|
return Style_styles[_fracDen[this.id]];
|
556
|
-
}
|
553
|
+
}
|
557
554
|
/**
|
558
555
|
* Get the cramped version of a style (in particular, cramping a cramped style
|
559
556
|
* doesn't change the style).
|
560
557
|
*/
|
561
|
-
|
558
|
+
;
|
562
559
|
|
563
560
|
_proto.cramp = function cramp() {
|
564
561
|
return Style_styles[_cramp[this.id]];
|
565
|
-
}
|
562
|
+
}
|
566
563
|
/**
|
567
564
|
* Get a text or display version of this style.
|
568
565
|
*/
|
569
|
-
|
566
|
+
;
|
570
567
|
|
571
568
|
_proto.text = function text() {
|
572
569
|
return Style_styles[_text[this.id]];
|
573
|
-
}
|
570
|
+
}
|
574
571
|
/**
|
575
572
|
* Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle)
|
576
573
|
*/
|
577
|
-
|
574
|
+
;
|
578
575
|
|
579
576
|
_proto.isTight = function isTight() {
|
580
577
|
return this.size >= 2;
|
@@ -810,7 +807,7 @@ var svgGeometry_path = {
|
|
810
807
|
// The next ten paths support reaction arrows from the mhchem package.
|
811
808
|
// Arrows for \ce{<-->} are offset from xAxis by 0.22ex, per mhchem in LaTeX
|
812
809
|
// baraboveleftarrow is mostly from from glyph U+2190 in font KaTeX Main
|
813
|
-
baraboveleftarrow: "M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100
|
810
|
+
baraboveleftarrow: "M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",
|
814
811
|
// rightarrowabovebar is mostly from glyph U+2192, KaTeX Main
|
815
812
|
rightarrowabovebar: "M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",
|
816
813
|
// The short left harpoon has 0.5em (i.e. 500 units) kern on the left end.
|
@@ -855,9 +852,9 @@ function () {
|
|
855
852
|
|
856
853
|
_proto.hasClass = function hasClass(className) {
|
857
854
|
return utils.contains(this.classes, className);
|
858
|
-
}
|
855
|
+
}
|
859
856
|
/** Convert the fragment into a node. */
|
860
|
-
|
857
|
+
;
|
861
858
|
|
862
859
|
_proto.toNode = function toNode() {
|
863
860
|
var frag = document.createDocumentFragment();
|
@@ -867,9 +864,9 @@ function () {
|
|
867
864
|
}
|
868
865
|
|
869
866
|
return frag;
|
870
|
-
}
|
867
|
+
}
|
871
868
|
/** Convert the fragment into HTML markup. */
|
872
|
-
|
869
|
+
;
|
873
870
|
|
874
871
|
_proto.toMarkup = function toMarkup() {
|
875
872
|
var markup = ""; // Simply concatenate the markup for the children together.
|
@@ -879,12 +876,12 @@ function () {
|
|
879
876
|
}
|
880
877
|
|
881
878
|
return markup;
|
882
|
-
}
|
879
|
+
}
|
883
880
|
/**
|
884
881
|
* Converts the math node into a string, similar to innerText. Applies to
|
885
882
|
* MathDomNode's only.
|
886
883
|
*/
|
887
|
-
|
884
|
+
;
|
888
885
|
|
889
886
|
_proto.toText = function toText() {
|
890
887
|
// To avoid this, we would subclass documentFragment separately for
|
@@ -1176,12 +1173,12 @@ function () {
|
|
1176
1173
|
|
1177
1174
|
_proto3.hasClass = function hasClass(className) {
|
1178
1175
|
return utils.contains(this.classes, className);
|
1179
|
-
}
|
1176
|
+
}
|
1180
1177
|
/**
|
1181
1178
|
* Creates a text node or span from a symbol node. Note that a span is only
|
1182
1179
|
* created if it is needed.
|
1183
1180
|
*/
|
1184
|
-
|
1181
|
+
;
|
1185
1182
|
|
1186
1183
|
_proto3.toNode = function toNode() {
|
1187
1184
|
var node = document.createTextNode(this.text);
|
@@ -1211,11 +1208,11 @@ function () {
|
|
1211
1208
|
} else {
|
1212
1209
|
return node;
|
1213
1210
|
}
|
1214
|
-
}
|
1211
|
+
}
|
1215
1212
|
/**
|
1216
1213
|
* Creates markup for a symbol node.
|
1217
1214
|
*/
|
1218
|
-
|
1215
|
+
;
|
1219
1216
|
|
1220
1217
|
_proto3.toMarkup = function toMarkup() {
|
1221
1218
|
// TODO(alpert): More duplication than I'd like from
|
@@ -1913,7 +1910,6 @@ function assertSpan(group) {
|
|
1913
1910
|
"730": [0, 0.69444, 0, 0, 0.86944],
|
1914
1911
|
"732": [0, 0.69444, 0, 0, 0.575],
|
1915
1912
|
"733": [0, 0.69444, 0, 0, 0.575],
|
1916
|
-
"824": [0.19444, 0.69444, 0, 0, 0],
|
1917
1913
|
"915": [0, 0.68611, 0, 0, 0.69166],
|
1918
1914
|
"916": [0, 0.68611, 0, 0, 0.95833],
|
1919
1915
|
"920": [0, 0.68611, 0, 0, 0.89444],
|
@@ -2041,7 +2037,8 @@ function assertSpan(group) {
|
|
2041
2037
|
"10217": [0.25, 0.75, 0, 0, 0.44722],
|
2042
2038
|
"10815": [0, 0.68611, 0, 0, 0.9],
|
2043
2039
|
"10927": [0.19667, 0.69667, 0, 0, 0.89444],
|
2044
|
-
"10928": [0.19667, 0.69667, 0, 0, 0.89444]
|
2040
|
+
"10928": [0.19667, 0.69667, 0, 0, 0.89444],
|
2041
|
+
"57376": [0.19444, 0.69444, 0, 0, 0]
|
2045
2042
|
},
|
2046
2043
|
"Main-BoldItalic": {
|
2047
2044
|
"33": [0, 0.69444, 0.11417, 0, 0.38611],
|
@@ -2424,7 +2421,6 @@ function assertSpan(group) {
|
|
2424
2421
|
"730": [0, 0.69444, 0, 0, 0.75],
|
2425
2422
|
"732": [0, 0.66786, 0, 0, 0.5],
|
2426
2423
|
"733": [0, 0.69444, 0, 0, 0.5],
|
2427
|
-
"824": [0.19444, 0.69444, 0, 0, 0],
|
2428
2424
|
"915": [0, 0.68333, 0, 0, 0.625],
|
2429
2425
|
"916": [0, 0.68333, 0, 0, 0.83334],
|
2430
2426
|
"920": [0, 0.68333, 0, 0, 0.77778],
|
@@ -2509,7 +2505,6 @@ function assertSpan(group) {
|
|
2509
2505
|
"8776": [-0.01688, 0.48312, 0, 0, 0.77778],
|
2510
2506
|
"8781": [-0.03625, 0.46375, 0, 0, 0.77778],
|
2511
2507
|
"8784": [-0.133, 0.67, 0, 0, 0.778],
|
2512
|
-
"8800": [0.215, 0.716, 0, 0, 0.778],
|
2513
2508
|
"8801": [-0.03625, 0.46375, 0, 0, 0.77778],
|
2514
2509
|
"8804": [0.13597, 0.63597, 0, 0, 0.77778],
|
2515
2510
|
"8805": [0.13597, 0.63597, 0, 0, 0.77778],
|
@@ -2576,10 +2571,10 @@ function assertSpan(group) {
|
|
2576
2571
|
"10236": [0.011, 0.511, 0, 0, 1.638],
|
2577
2572
|
"10815": [0, 0.68333, 0, 0, 0.75],
|
2578
2573
|
"10927": [0.13597, 0.63597, 0, 0, 0.77778],
|
2579
|
-
"10928": [0.13597, 0.63597, 0, 0, 0.77778]
|
2574
|
+
"10928": [0.13597, 0.63597, 0, 0, 0.77778],
|
2575
|
+
"57376": [0.19444, 0.69444, 0, 0, 0]
|
2580
2576
|
},
|
2581
2577
|
"Math-BoldItalic": {
|
2582
|
-
"47": [0.19444, 0.69444, 0, 0, 0],
|
2583
2578
|
"65": [0, 0.68611, 0, 0, 0.86944],
|
2584
2579
|
"66": [0, 0.68611, 0.04835, 0, 0.8664],
|
2585
2580
|
"67": [0, 0.68611, 0.06979, 0, 0.81694],
|
@@ -2675,7 +2670,6 @@ function assertSpan(group) {
|
|
2675
2670
|
"1013": [0, 0.44444, 0, 0, 0.48333]
|
2676
2671
|
},
|
2677
2672
|
"Math-Italic": {
|
2678
|
-
"47": [0.19444, 0.69444, 0, 0, 0],
|
2679
2673
|
"65": [0, 0.68333, 0, 0.13889, 0.75],
|
2680
2674
|
"66": [0, 0.68333, 0.05017, 0.08334, 0.75851],
|
2681
2675
|
"67": [0, 0.68333, 0.07153, 0.08334, 0.71472],
|
@@ -3820,7 +3814,7 @@ function getGlobalMetrics(size) {
|
|
3820
3814
|
normal font), or "ams" (the ams fonts).
|
3821
3815
|
* - group (required): the ParseNode group type the symbol should have (i.e.
|
3822
3816
|
"textord", "mathord", etc).
|
3823
|
-
See https://github.com/
|
3817
|
+
See https://github.com/KaTeX/KaTeX/wiki/Examining-TeX#group-types
|
3824
3818
|
* - replace: the character that this symbol or function should be
|
3825
3819
|
* replaced with (i.e. "\phi" has a replace value of "\u03d5", the phi
|
3826
3820
|
* character in the main font).
|
@@ -4346,7 +4340,7 @@ defineSymbol(symbols_math, main, rel, "\u2265", "\\geq", true);
|
|
4346
4340
|
defineSymbol(symbols_math, main, rel, "\u2190", "\\gets");
|
4347
4341
|
defineSymbol(symbols_math, main, rel, ">", "\\gt");
|
4348
4342
|
defineSymbol(symbols_math, main, rel, "\u2208", "\\in", true);
|
4349
|
-
defineSymbol(symbols_math, main, rel, "\
|
4343
|
+
defineSymbol(symbols_math, main, rel, "\uE020", "\\@not");
|
4350
4344
|
defineSymbol(symbols_math, main, rel, "\u2282", "\\subset", true);
|
4351
4345
|
defineSymbol(symbols_math, main, rel, "\u2283", "\\supset", true);
|
4352
4346
|
defineSymbol(symbols_math, main, rel, "\u2286", "\\subseteq", true);
|
@@ -4422,6 +4416,8 @@ defineSymbol(symbols_math, main, symbols_textord, "\u2225", "\\|");
|
|
4422
4416
|
defineSymbol(symbols_math, main, symbols_textord, "\u2225", "\\Vert");
|
4423
4417
|
defineSymbol(symbols_text, main, symbols_textord, "\u2225", "\\textbardbl");
|
4424
4418
|
defineSymbol(symbols_text, main, symbols_textord, "~", "\\textasciitilde");
|
4419
|
+
defineSymbol(symbols_text, main, symbols_textord, "\\", "\\textbackslash");
|
4420
|
+
defineSymbol(symbols_text, main, symbols_textord, "^", "\\textasciicircum");
|
4425
4421
|
defineSymbol(symbols_math, main, rel, "\u2191", "\\uparrow", true);
|
4426
4422
|
defineSymbol(symbols_math, main, rel, "\u21D1", "\\Uparrow", true);
|
4427
4423
|
defineSymbol(symbols_math, main, rel, "\u2193", "\\downarrow", true);
|
@@ -4564,13 +4560,32 @@ for (var symbols_i2 = 0; symbols_i2 < letters.length; symbols_i2++) {
|
|
4564
4560
|
|
4565
4561
|
defineSymbol(symbols_math, main, mathord, _ch2, _ch2);
|
4566
4562
|
defineSymbol(symbols_text, main, symbols_textord, _ch2, _ch2);
|
4567
|
-
} //
|
4563
|
+
} // Blackboard bold and script letters in Unicode range
|
4564
|
+
|
4565
|
+
|
4566
|
+
defineSymbol(symbols_math, ams, symbols_textord, "C", "\u2102"); // blackboard bold
|
4567
|
+
|
4568
|
+
defineSymbol(symbols_text, ams, symbols_textord, "C", "\u2102");
|
4569
|
+
defineSymbol(symbols_math, ams, symbols_textord, "H", "\u210D");
|
4570
|
+
defineSymbol(symbols_text, ams, symbols_textord, "H", "\u210D");
|
4571
|
+
defineSymbol(symbols_math, ams, symbols_textord, "N", "\u2115");
|
4572
|
+
defineSymbol(symbols_text, ams, symbols_textord, "N", "\u2115");
|
4573
|
+
defineSymbol(symbols_math, ams, symbols_textord, "P", "\u2119");
|
4574
|
+
defineSymbol(symbols_text, ams, symbols_textord, "P", "\u2119");
|
4575
|
+
defineSymbol(symbols_math, ams, symbols_textord, "Q", "\u211A");
|
4576
|
+
defineSymbol(symbols_text, ams, symbols_textord, "Q", "\u211A");
|
4577
|
+
defineSymbol(symbols_math, ams, symbols_textord, "R", "\u211D");
|
4578
|
+
defineSymbol(symbols_text, ams, symbols_textord, "R", "\u211D");
|
4579
|
+
defineSymbol(symbols_math, ams, symbols_textord, "Z", "\u2124");
|
4580
|
+
defineSymbol(symbols_text, ams, symbols_textord, "Z", "\u2124");
|
4581
|
+
defineSymbol(symbols_math, main, mathord, "h", "\u210E"); // italic h, Planck constant
|
4582
|
+
|
4583
|
+
defineSymbol(symbols_text, main, mathord, "h", "\u210E"); // The next loop loads wide (surrogate pair) characters.
|
4568
4584
|
// We support some letters in the Unicode range U+1D400 to U+1D7FF,
|
4569
4585
|
// Mathematical Alphanumeric Symbols.
|
4570
4586
|
// Some editors do not deal well with wide characters. So don't write the
|
4571
4587
|
// string into this file. Instead, create the string from the surrogate pair.
|
4572
4588
|
|
4573
|
-
|
4574
4589
|
var symbols_wideChar = "";
|
4575
4590
|
|
4576
4591
|
for (var _i3 = 0; _i3 < letters.length; _i3++) {
|
@@ -4858,12 +4873,12 @@ function () {
|
|
4858
4873
|
}
|
4859
4874
|
|
4860
4875
|
return new Options(data);
|
4861
|
-
}
|
4876
|
+
}
|
4862
4877
|
/**
|
4863
4878
|
* Return an options object with the given style. If `this.style === style`,
|
4864
4879
|
* returns `this`.
|
4865
4880
|
*/
|
4866
|
-
|
4881
|
+
;
|
4867
4882
|
|
4868
4883
|
_proto.havingStyle = function havingStyle(style) {
|
4869
4884
|
if (this.style === style) {
|
@@ -4874,21 +4889,21 @@ function () {
|
|
4874
4889
|
size: sizeAtStyle(this.textSize, style)
|
4875
4890
|
});
|
4876
4891
|
}
|
4877
|
-
}
|
4892
|
+
}
|
4878
4893
|
/**
|
4879
4894
|
* Return an options object with a cramped version of the current style. If
|
4880
4895
|
* the current style is cramped, returns `this`.
|
4881
4896
|
*/
|
4882
|
-
|
4897
|
+
;
|
4883
4898
|
|
4884
4899
|
_proto.havingCrampedStyle = function havingCrampedStyle() {
|
4885
4900
|
return this.havingStyle(this.style.cramp());
|
4886
|
-
}
|
4901
|
+
}
|
4887
4902
|
/**
|
4888
4903
|
* Return an options object with the given size and in at least `\textstyle`.
|
4889
4904
|
* Returns `this` if appropriate.
|
4890
4905
|
*/
|
4891
|
-
|
4906
|
+
;
|
4892
4907
|
|
4893
4908
|
_proto.havingSize = function havingSize(size) {
|
4894
4909
|
if (this.size === size && this.textSize === size) {
|
@@ -4901,12 +4916,12 @@ function () {
|
|
4901
4916
|
sizeMultiplier: sizeMultipliers[size - 1]
|
4902
4917
|
});
|
4903
4918
|
}
|
4904
|
-
}
|
4919
|
+
}
|
4905
4920
|
/**
|
4906
4921
|
* Like `this.havingSize(BASESIZE).havingStyle(style)`. If `style` is omitted,
|
4907
4922
|
* changes to at least `\textstyle`.
|
4908
4923
|
*/
|
4909
|
-
|
4924
|
+
;
|
4910
4925
|
|
4911
4926
|
_proto.havingBaseStyle = function havingBaseStyle(style) {
|
4912
4927
|
style = style || this.style.text();
|
@@ -4920,12 +4935,12 @@ function () {
|
|
4920
4935
|
size: wantSize
|
4921
4936
|
});
|
4922
4937
|
}
|
4923
|
-
}
|
4938
|
+
}
|
4924
4939
|
/**
|
4925
4940
|
* Remove the effect of sizing changes such as \Huge.
|
4926
4941
|
* Keep the effect of the current style, such as \scriptstyle.
|
4927
4942
|
*/
|
4928
|
-
|
4943
|
+
;
|
4929
4944
|
|
4930
4945
|
_proto.havingBaseSizing = function havingBaseSizing() {
|
4931
4946
|
var size;
|
@@ -4952,76 +4967,76 @@ function () {
|
|
4952
4967
|
style: this.style.text(),
|
4953
4968
|
size: size
|
4954
4969
|
});
|
4955
|
-
}
|
4970
|
+
}
|
4956
4971
|
/**
|
4957
4972
|
* Create a new options object with the given color.
|
4958
4973
|
*/
|
4959
|
-
|
4974
|
+
;
|
4960
4975
|
|
4961
4976
|
_proto.withColor = function withColor(color) {
|
4962
4977
|
return this.extend({
|
4963
4978
|
color: color
|
4964
4979
|
});
|
4965
|
-
}
|
4980
|
+
}
|
4966
4981
|
/**
|
4967
4982
|
* Create a new options object with "phantom" set to true.
|
4968
4983
|
*/
|
4969
|
-
|
4984
|
+
;
|
4970
4985
|
|
4971
4986
|
_proto.withPhantom = function withPhantom() {
|
4972
4987
|
return this.extend({
|
4973
4988
|
phantom: true
|
4974
4989
|
});
|
4975
|
-
}
|
4990
|
+
}
|
4976
4991
|
/**
|
4977
4992
|
* Creates a new options object with the given math font or old text font.
|
4978
4993
|
* @type {[type]}
|
4979
4994
|
*/
|
4980
|
-
|
4995
|
+
;
|
4981
4996
|
|
4982
4997
|
_proto.withFont = function withFont(font) {
|
4983
4998
|
return this.extend({
|
4984
4999
|
font: font
|
4985
5000
|
});
|
4986
|
-
}
|
5001
|
+
}
|
4987
5002
|
/**
|
4988
5003
|
* Create a new options objects with the given fontFamily.
|
4989
5004
|
*/
|
4990
|
-
|
5005
|
+
;
|
4991
5006
|
|
4992
5007
|
_proto.withTextFontFamily = function withTextFontFamily(fontFamily) {
|
4993
5008
|
return this.extend({
|
4994
5009
|
fontFamily: fontFamily,
|
4995
5010
|
font: ""
|
4996
5011
|
});
|
4997
|
-
}
|
5012
|
+
}
|
4998
5013
|
/**
|
4999
5014
|
* Creates a new options object with the given font weight
|
5000
5015
|
*/
|
5001
|
-
|
5016
|
+
;
|
5002
5017
|
|
5003
5018
|
_proto.withTextFontWeight = function withTextFontWeight(fontWeight) {
|
5004
5019
|
return this.extend({
|
5005
5020
|
fontWeight: fontWeight,
|
5006
5021
|
font: ""
|
5007
5022
|
});
|
5008
|
-
}
|
5023
|
+
}
|
5009
5024
|
/**
|
5010
5025
|
* Creates a new options object with the given font weight
|
5011
5026
|
*/
|
5012
|
-
|
5027
|
+
;
|
5013
5028
|
|
5014
5029
|
_proto.withTextFontShape = function withTextFontShape(fontShape) {
|
5015
5030
|
return this.extend({
|
5016
5031
|
fontShape: fontShape,
|
5017
5032
|
font: ""
|
5018
5033
|
});
|
5019
|
-
}
|
5034
|
+
}
|
5020
5035
|
/**
|
5021
5036
|
* Return the CSS sizing classes required to switch from enclosing options
|
5022
5037
|
* `oldOptions` to `this`. Returns an array of classes.
|
5023
5038
|
*/
|
5024
|
-
|
5039
|
+
;
|
5025
5040
|
|
5026
5041
|
_proto.sizingClasses = function sizingClasses(oldOptions) {
|
5027
5042
|
if (oldOptions.size !== this.size) {
|
@@ -5029,12 +5044,12 @@ function () {
|
|
5029
5044
|
} else {
|
5030
5045
|
return [];
|
5031
5046
|
}
|
5032
|
-
}
|
5047
|
+
}
|
5033
5048
|
/**
|
5034
5049
|
* Return the CSS sizing classes required to switch to the base size. Like
|
5035
5050
|
* `this.havingSize(BASESIZE).sizingClasses(this)`.
|
5036
5051
|
*/
|
5037
|
-
|
5052
|
+
;
|
5038
5053
|
|
5039
5054
|
_proto.baseSizingClasses = function baseSizingClasses() {
|
5040
5055
|
if (this.size !== Options.BASESIZE) {
|
@@ -5042,11 +5057,11 @@ function () {
|
|
5042
5057
|
} else {
|
5043
5058
|
return [];
|
5044
5059
|
}
|
5045
|
-
}
|
5060
|
+
}
|
5046
5061
|
/**
|
5047
5062
|
* Return the font metrics for this size.
|
5048
5063
|
*/
|
5049
|
-
|
5064
|
+
;
|
5050
5065
|
|
5051
5066
|
_proto.fontMetrics = function fontMetrics() {
|
5052
5067
|
if (!this._fontMetrics) {
|
@@ -5054,12 +5069,12 @@ function () {
|
|
5054
5069
|
}
|
5055
5070
|
|
5056
5071
|
return this._fontMetrics;
|
5057
|
-
}
|
5072
|
+
}
|
5058
5073
|
/**
|
5059
5074
|
* A map of color names to CSS colors.
|
5060
5075
|
* TODO(emily): Remove this when we have real macros
|
5061
5076
|
*/
|
5062
|
-
|
5077
|
+
;
|
5063
5078
|
|
5064
5079
|
/**
|
5065
5080
|
* Gets the CSS color of the current options object, accounting for the
|
@@ -6270,25 +6285,8 @@ var buildHTML_makeSpan = buildCommon.makeSpan; // Binary atoms (first class `mbi
|
|
6270
6285
|
// depending on their surroundings. See TeXbook pg. 442-446, Rules 5 and 6,
|
6271
6286
|
// and the text before Rule 19.
|
6272
6287
|
|
6273
|
-
var
|
6274
|
-
|
6275
|
-
// of its `classes` array. A later cleanup should ensure this, for
|
6276
|
-
// instance by changing the signature of `makeSpan`.
|
6277
|
-
if (node) {
|
6278
|
-
return utils.contains(["mbin", "mopen", "mrel", "mop", "mpunct"], getTypeOfDomTree(node, "right"));
|
6279
|
-
} else {
|
6280
|
-
return isRealGroup;
|
6281
|
-
}
|
6282
|
-
};
|
6283
|
-
|
6284
|
-
var buildHTML_isBinRightCanceller = function isBinRightCanceller(node, isRealGroup) {
|
6285
|
-
if (node) {
|
6286
|
-
return utils.contains(["mrel", "mclose", "mpunct"], getTypeOfDomTree(node, "left"));
|
6287
|
-
} else {
|
6288
|
-
return isRealGroup;
|
6289
|
-
}
|
6290
|
-
};
|
6291
|
-
|
6288
|
+
var binLeftCanceller = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"];
|
6289
|
+
var binRightCanceller = ["rightmost", "mrel", "mclose", "mpunct"];
|
6292
6290
|
var buildHTML_styleMap = {
|
6293
6291
|
"display": src_Style.DISPLAY,
|
6294
6292
|
"text": src_Style.TEXT,
|
@@ -6320,114 +6318,159 @@ var buildHTML_buildExpression = function buildExpression(expression, options, is
|
|
6320
6318
|
}
|
6321
6319
|
|
6322
6320
|
// Parse expressions into `groups`.
|
6323
|
-
var
|
6321
|
+
var groups = [];
|
6324
6322
|
|
6325
6323
|
for (var i = 0; i < expression.length; i++) {
|
6326
6324
|
var output = buildHTML_buildGroup(expression[i], options);
|
6327
6325
|
|
6328
6326
|
if (output instanceof tree_DocumentFragment) {
|
6329
6327
|
var children = output.children;
|
6330
|
-
|
6328
|
+
groups.push.apply(groups, children);
|
6331
6329
|
} else {
|
6332
|
-
|
6330
|
+
groups.push(output);
|
6333
6331
|
}
|
6334
|
-
} //
|
6335
|
-
//
|
6336
|
-
// spacing should go between atoms of different classes, and add dummy
|
6337
|
-
// spans for determining spacings between surrounding atoms.
|
6332
|
+
} // If `expression` is a partial group, let the parent handle spacings
|
6333
|
+
// to avoid processing groups multiple times.
|
6338
6334
|
|
6339
6335
|
|
6340
|
-
|
6341
|
-
return
|
6342
|
-
}
|
6343
|
-
|
6336
|
+
if (!isRealGroup) {
|
6337
|
+
return groups;
|
6338
|
+
}
|
6339
|
+
|
6340
|
+
var glueOptions = options;
|
6344
6341
|
|
6345
|
-
|
6346
|
-
var
|
6347
|
-
var left = buildHTML_getOutermostNode(nonSpacesI, "left");
|
6342
|
+
if (expression.length === 1) {
|
6343
|
+
var node = checkNodeType(expression[0], "sizing") || checkNodeType(expression[0], "styling");
|
6348
6344
|
|
6349
|
-
if (
|
6350
|
-
|
6345
|
+
if (!node) {// No match.
|
6346
|
+
} else if (node.type === "sizing") {
|
6347
|
+
glueOptions = options.havingSize(node.size);
|
6348
|
+
} else if (node.type === "styling") {
|
6349
|
+
glueOptions = options.havingStyle(buildHTML_styleMap[node.style]);
|
6351
6350
|
}
|
6351
|
+
} // Dummy spans for determining spacings between surrounding atoms.
|
6352
|
+
// If `expression` has no atoms on the left or right, class "leftmost"
|
6353
|
+
// or "rightmost", respectively, is used to indicate it.
|
6354
|
+
|
6355
|
+
|
6356
|
+
var dummyPrev = buildHTML_makeSpan([surrounding[0] || "leftmost"], [], options);
|
6357
|
+
var dummyNext = buildHTML_makeSpan([surrounding[1] || "rightmost"], [], options); // TODO: These code assumes that a node's math class is the first element
|
6358
|
+
// of its `classes` array. A later cleanup should ensure this, for
|
6359
|
+
// instance by changing the signature of `makeSpan`.
|
6360
|
+
// Before determining what spaces to insert, perform bin cancellation.
|
6361
|
+
// Binary operators change to ordinary symbols in some contexts.
|
6352
6362
|
|
6353
|
-
|
6363
|
+
traverseNonSpaceNodes(groups, function (node, prev) {
|
6364
|
+
var prevType = prev.classes[0];
|
6365
|
+
var type = node.classes[0];
|
6354
6366
|
|
6355
|
-
if (
|
6356
|
-
|
6367
|
+
if (prevType === "mbin" && utils.contains(binRightCanceller, type)) {
|
6368
|
+
prev.classes[0] = "mord";
|
6369
|
+
} else if (type === "mbin" && utils.contains(binLeftCanceller, prevType)) {
|
6370
|
+
node.classes[0] = "mord";
|
6357
6371
|
}
|
6358
|
-
}
|
6372
|
+
}, {
|
6373
|
+
node: dummyPrev
|
6374
|
+
}, dummyNext);
|
6375
|
+
traverseNonSpaceNodes(groups, function (node, prev) {
|
6376
|
+
var prevType = getTypeOfDomTree(prev);
|
6377
|
+
var type = getTypeOfDomTree(node); // 'mtight' indicates that the node is script or scriptscript style.
|
6359
6378
|
|
6360
|
-
|
6361
|
-
var j = 0;
|
6379
|
+
var space = prevType && type ? node.hasClass("mtight") ? tightSpacings[prevType][type] : spacings[prevType][type] : null;
|
6362
6380
|
|
6363
|
-
|
6364
|
-
|
6365
|
-
|
6366
|
-
|
6381
|
+
if (space) {
|
6382
|
+
// Insert glue (spacing) after the `prev`.
|
6383
|
+
return buildCommon.makeGlue(space, glueOptions);
|
6384
|
+
}
|
6385
|
+
}, {
|
6386
|
+
node: dummyPrev
|
6387
|
+
}, dummyNext);
|
6388
|
+
return groups;
|
6389
|
+
}; // Depth-first traverse non-space `nodes`, calling `callback` with the current and
|
6390
|
+
// previous node as arguments, optionally returning a node to insert after the
|
6391
|
+
// previous node. `prev` is an object with the previous node and `insertAfter`
|
6392
|
+
// function to insert after it. `next` is a node that will be added to the right.
|
6393
|
+
// Used for bin cancellation and inserting spacings.
|
6394
|
+
|
6395
|
+
var traverseNonSpaceNodes = function traverseNonSpaceNodes(nodes, callback, prev, next) {
|
6396
|
+
if (next) {
|
6397
|
+
// temporarily append the right node, if exists
|
6398
|
+
nodes.push(next);
|
6399
|
+
}
|
6367
6400
|
|
6368
|
-
|
6369
|
-
// if current non-space node is left dummy span, add a glue before
|
6370
|
-
// first real non-space node
|
6371
|
-
if (j === 0) {
|
6372
|
-
groups.pop();
|
6373
|
-
_i2--;
|
6374
|
-
} // Get the type of the current non-space node. If it's a document
|
6375
|
-
// fragment, get the type of the rightmost node in the fragment.
|
6401
|
+
var i = 0;
|
6376
6402
|
|
6403
|
+
for (; i < nodes.length; i++) {
|
6404
|
+
var node = nodes[i];
|
6405
|
+
var partialGroup = buildHTML_checkPartialGroup(node);
|
6377
6406
|
|
6378
|
-
|
6379
|
-
//
|
6407
|
+
if (partialGroup) {
|
6408
|
+
// Recursive DFS
|
6409
|
+
traverseNonSpaceNodes(partialGroup.children, callback, prev);
|
6410
|
+
continue;
|
6411
|
+
} // Ignore explicit spaces (e.g., \;, \,) when determining what implicit
|
6412
|
+
// spacing should go between atoms of different classes
|
6380
6413
|
|
6381
6414
|
|
6382
|
-
|
6383
|
-
|
6384
|
-
|
6415
|
+
if (node.classes[0] === "mspace") {
|
6416
|
+
continue;
|
6417
|
+
}
|
6385
6418
|
|
6419
|
+
var result = callback(node, prev.node);
|
6386
6420
|
|
6387
|
-
|
6388
|
-
|
6389
|
-
|
6421
|
+
if (result) {
|
6422
|
+
if (prev.insertAfter) {
|
6423
|
+
prev.insertAfter(result);
|
6424
|
+
} else {
|
6425
|
+
// insert at front
|
6426
|
+
nodes.unshift(result);
|
6427
|
+
i++;
|
6428
|
+
}
|
6429
|
+
}
|
6390
6430
|
|
6391
|
-
|
6392
|
-
var glueOptions = options;
|
6431
|
+
prev.node = node;
|
6393
6432
|
|
6394
|
-
|
6395
|
-
|
6433
|
+
prev.insertAfter = function (index) {
|
6434
|
+
return function (n) {
|
6435
|
+
nodes.splice(index + 1, 0, n);
|
6436
|
+
i++;
|
6437
|
+
};
|
6438
|
+
}(i);
|
6439
|
+
}
|
6396
6440
|
|
6397
|
-
|
6398
|
-
|
6399
|
-
|
6400
|
-
|
6401
|
-
glueOptions = options.havingStyle(buildHTML_styleMap[node.style]);
|
6402
|
-
}
|
6403
|
-
}
|
6441
|
+
if (next) {
|
6442
|
+
nodes.pop();
|
6443
|
+
}
|
6444
|
+
}; // Check if given node is a partial group, i.e., does not affect spacing around.
|
6404
6445
|
|
6405
|
-
groups.push(buildCommon.makeGlue(space, glueOptions));
|
6406
|
-
}
|
6407
|
-
}
|
6408
6446
|
|
6409
|
-
|
6410
|
-
|
6447
|
+
var buildHTML_checkPartialGroup = function checkPartialGroup(node) {
|
6448
|
+
if (node instanceof tree_DocumentFragment || node instanceof domTree_Anchor) {
|
6449
|
+
return node;
|
6411
6450
|
}
|
6412
6451
|
|
6413
|
-
return
|
6452
|
+
return null;
|
6414
6453
|
}; // Return the outermost node of a domTree.
|
6415
6454
|
|
6416
|
-
|
6417
|
-
|
6418
|
-
|
6455
|
+
|
6456
|
+
var getOutermostNode = function getOutermostNode(node, side) {
|
6457
|
+
var partialGroup = buildHTML_checkPartialGroup(node);
|
6458
|
+
|
6459
|
+
if (partialGroup) {
|
6460
|
+
var children = partialGroup.children;
|
6419
6461
|
|
6420
6462
|
if (children.length) {
|
6421
6463
|
if (side === "right") {
|
6422
6464
|
return getOutermostNode(children[children.length - 1], "right");
|
6423
6465
|
} else if (side === "left") {
|
6424
|
-
return getOutermostNode(children[0], "
|
6466
|
+
return getOutermostNode(children[0], "left");
|
6425
6467
|
}
|
6426
6468
|
}
|
6427
6469
|
}
|
6428
6470
|
|
6429
6471
|
return node;
|
6430
6472
|
}; // Return math atom class (mclass) of a domTree.
|
6473
|
+
// If `side` is given, it will get the type of the outermost node at given side.
|
6431
6474
|
|
6432
6475
|
|
6433
6476
|
var getTypeOfDomTree = function getTypeOfDomTree(node, side) {
|
@@ -6435,18 +6478,13 @@ var getTypeOfDomTree = function getTypeOfDomTree(node, side) {
|
|
6435
6478
|
return null;
|
6436
6479
|
}
|
6437
6480
|
|
6438
|
-
|
6481
|
+
if (side) {
|
6482
|
+
node = getOutermostNode(node, side);
|
6483
|
+
} // This makes a lot of assumptions as to where the type of atom
|
6439
6484
|
// appears. We should do a better job of enforcing this.
|
6440
6485
|
|
6486
|
+
|
6441
6487
|
return DomEnum[node.classes[0]] || null;
|
6442
|
-
}; // If `node` is an atom return whether it's been assigned the mtight class.
|
6443
|
-
// If `node` is a document fragment, return the value of isLeftTight() for the
|
6444
|
-
// leftmost node in the fragment.
|
6445
|
-
// 'mtight' indicates that the node is script or scriptscript style.
|
6446
|
-
|
6447
|
-
var isLeftTight = function isLeftTight(node) {
|
6448
|
-
node = buildHTML_getOutermostNode(node, "left");
|
6449
|
-
return node.hasClass("mtight");
|
6450
6488
|
};
|
6451
6489
|
var makeNullDelimiter = function makeNullDelimiter(options, classes) {
|
6452
6490
|
var moreClasses = ["nulldelimiter"].concat(options.baseSizingClasses());
|
@@ -6534,10 +6572,10 @@ function buildHTML(tree, options) {
|
|
6534
6572
|
|
6535
6573
|
if (expression[i].hasClass("mbin") || expression[i].hasClass("mrel") || expression[i].hasClass("allowbreak")) {
|
6536
6574
|
// Put any post-operator glue on same line as operator.
|
6537
|
-
// Watch for \nobreak along the way.
|
6575
|
+
// Watch for \nobreak along the way, and stop at \newline.
|
6538
6576
|
var nobreak = false;
|
6539
6577
|
|
6540
|
-
while (i < expression.length - 1 && expression[i + 1].hasClass("mspace")) {
|
6578
|
+
while (i < expression.length - 1 && expression[i + 1].hasClass("mspace") && !expression[i + 1].hasClass("newline")) {
|
6541
6579
|
i++;
|
6542
6580
|
parts.push(expression[i]);
|
6543
6581
|
|
@@ -6632,19 +6670,19 @@ function () {
|
|
6632
6670
|
|
6633
6671
|
_proto.setAttribute = function setAttribute(name, value) {
|
6634
6672
|
this.attributes[name] = value;
|
6635
|
-
}
|
6673
|
+
}
|
6636
6674
|
/**
|
6637
6675
|
* Gets an attribute on a MathML node.
|
6638
6676
|
*/
|
6639
|
-
|
6677
|
+
;
|
6640
6678
|
|
6641
6679
|
_proto.getAttribute = function getAttribute(name) {
|
6642
6680
|
return this.attributes[name];
|
6643
|
-
}
|
6681
|
+
}
|
6644
6682
|
/**
|
6645
6683
|
* Converts the math node into a MathML-namespaced DOM element.
|
6646
6684
|
*/
|
6647
|
-
|
6685
|
+
;
|
6648
6686
|
|
6649
6687
|
_proto.toNode = function toNode() {
|
6650
6688
|
var node = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type);
|
@@ -6660,11 +6698,11 @@ function () {
|
|
6660
6698
|
}
|
6661
6699
|
|
6662
6700
|
return node;
|
6663
|
-
}
|
6701
|
+
}
|
6664
6702
|
/**
|
6665
6703
|
* Converts the math node into an HTML markup string.
|
6666
6704
|
*/
|
6667
|
-
|
6705
|
+
;
|
6668
6706
|
|
6669
6707
|
_proto.toMarkup = function toMarkup() {
|
6670
6708
|
var markup = "<" + this.type; // Add the attributes
|
@@ -6685,11 +6723,11 @@ function () {
|
|
6685
6723
|
|
6686
6724
|
markup += "</" + this.type + ">";
|
6687
6725
|
return markup;
|
6688
|
-
}
|
6726
|
+
}
|
6689
6727
|
/**
|
6690
6728
|
* Converts the math node into a string, similar to innerText, but escaped.
|
6691
6729
|
*/
|
6692
|
-
|
6730
|
+
;
|
6693
6731
|
|
6694
6732
|
_proto.toText = function toText() {
|
6695
6733
|
return this.children.map(function (child) {
|
@@ -6706,15 +6744,9 @@ function () {
|
|
6706
6744
|
var mathMLTree_TextNode =
|
6707
6745
|
/*#__PURE__*/
|
6708
6746
|
function () {
|
6709
|
-
function TextNode(text
|
6710
|
-
if (needsEscape === void 0) {
|
6711
|
-
needsEscape = true;
|
6712
|
-
}
|
6713
|
-
|
6747
|
+
function TextNode(text) {
|
6714
6748
|
this.text = void 0;
|
6715
|
-
this.needsEscape = void 0;
|
6716
6749
|
this.text = text;
|
6717
|
-
this.needsEscape = needsEscape;
|
6718
6750
|
}
|
6719
6751
|
/**
|
6720
6752
|
* Converts the text node into a DOM text node.
|
@@ -6724,25 +6756,25 @@ function () {
|
|
6724
6756
|
var _proto2 = TextNode.prototype;
|
6725
6757
|
|
6726
6758
|
_proto2.toNode = function toNode() {
|
6727
|
-
return document.createTextNode(this.
|
6728
|
-
}
|
6759
|
+
return document.createTextNode(this.text);
|
6760
|
+
}
|
6729
6761
|
/**
|
6730
6762
|
* Converts the text node into escaped HTML markup
|
6731
6763
|
* (representing the text itself).
|
6732
6764
|
*/
|
6733
|
-
|
6765
|
+
;
|
6734
6766
|
|
6735
6767
|
_proto2.toMarkup = function toMarkup() {
|
6736
|
-
return this.toText();
|
6737
|
-
}
|
6768
|
+
return utils.escape(this.toText());
|
6769
|
+
}
|
6738
6770
|
/**
|
6739
|
-
* Converts the text node into
|
6771
|
+
* Converts the text node into a string
|
6740
6772
|
* (representing the text iteself).
|
6741
6773
|
*/
|
6742
|
-
|
6774
|
+
;
|
6743
6775
|
|
6744
6776
|
_proto2.toText = function toText() {
|
6745
|
-
return this.
|
6777
|
+
return this.text;
|
6746
6778
|
};
|
6747
6779
|
|
6748
6780
|
return TextNode;
|
@@ -6762,26 +6794,26 @@ function () {
|
|
6762
6794
|
this.width = void 0;
|
6763
6795
|
this.character = void 0;
|
6764
6796
|
this.width = width; // See https://www.w3.org/TR/2000/WD-MathML2-20000328/chapter6.html
|
6765
|
-
// for a table of space-like characters. We
|
6766
|
-
// &LongNames;
|
6767
|
-
//
|
6797
|
+
// for a table of space-like characters. We use Unicode
|
6798
|
+
// representations instead of &LongNames; as it's not clear how to
|
6799
|
+
// make the latter via document.createTextNode.
|
6768
6800
|
|
6769
6801
|
if (width >= 0.05555 && width <= 0.05556) {
|
6770
|
-
this.character = "
|
6802
|
+
this.character = "\u200A"; //  
|
6771
6803
|
} else if (width >= 0.1666 && width <= 0.1667) {
|
6772
|
-
this.character = "
|
6804
|
+
this.character = "\u2009"; //  
|
6773
6805
|
} else if (width >= 0.2222 && width <= 0.2223) {
|
6774
|
-
this.character = "
|
6806
|
+
this.character = "\u2005"; //  
|
6775
6807
|
} else if (width >= 0.2777 && width <= 0.2778) {
|
6776
|
-
this.character = "
|
6808
|
+
this.character = "\u2005\u200A"; //   
|
6777
6809
|
} else if (width >= -0.05556 && width <= -0.05555) {
|
6778
|
-
this.character = "​
|
6810
|
+
this.character = "\u200A\u2063"; // ​
|
6779
6811
|
} else if (width >= -0.1667 && width <= -0.1666) {
|
6780
|
-
this.character = "​
|
6812
|
+
this.character = "\u2009\u2063"; // ​
|
6781
6813
|
} else if (width >= -0.2223 && width <= -0.2222) {
|
6782
|
-
this.character = "​
|
6814
|
+
this.character = "\u205F\u2063"; // ​
|
6783
6815
|
} else if (width >= -0.2778 && width <= -0.2777) {
|
6784
|
-
this.character = "​
|
6816
|
+
this.character = "\u2005\u2063"; // ​
|
6785
6817
|
} else {
|
6786
6818
|
this.character = null;
|
6787
6819
|
}
|
@@ -6801,11 +6833,11 @@ function () {
|
|
6801
6833
|
node.setAttribute("width", this.width + "em");
|
6802
6834
|
return node;
|
6803
6835
|
}
|
6804
|
-
}
|
6836
|
+
}
|
6805
6837
|
/**
|
6806
6838
|
* Converts the math node into an HTML markup string.
|
6807
6839
|
*/
|
6808
|
-
|
6840
|
+
;
|
6809
6841
|
|
6810
6842
|
_proto3.toMarkup = function toMarkup() {
|
6811
6843
|
if (this.character) {
|
@@ -6813,11 +6845,11 @@ function () {
|
|
6813
6845
|
} else {
|
6814
6846
|
return "<mspace width=\"" + this.width + "em\"/>";
|
6815
6847
|
}
|
6816
|
-
}
|
6848
|
+
}
|
6817
6849
|
/**
|
6818
6850
|
* Converts the math node into a string, similar to innerText.
|
6819
6851
|
*/
|
6820
|
-
|
6852
|
+
;
|
6821
6853
|
|
6822
6854
|
_proto3.toText = function toText() {
|
6823
6855
|
if (this.character) {
|
@@ -7055,28 +7087,36 @@ var buildTree_optionsFromSettings = function optionsFromSettings(settings) {
|
|
7055
7087
|
});
|
7056
7088
|
};
|
7057
7089
|
|
7090
|
+
var buildTree_displayWrap = function displayWrap(node, settings) {
|
7091
|
+
if (settings.displayMode) {
|
7092
|
+
var classes = ["katex-display"];
|
7093
|
+
|
7094
|
+
if (settings.leqno) {
|
7095
|
+
classes.push("leqno");
|
7096
|
+
}
|
7097
|
+
|
7098
|
+
if (settings.fleqn) {
|
7099
|
+
classes.push("fleqn");
|
7100
|
+
}
|
7101
|
+
|
7102
|
+
node = buildCommon.makeSpan(classes, [node]);
|
7103
|
+
}
|
7104
|
+
|
7105
|
+
return node;
|
7106
|
+
};
|
7107
|
+
|
7058
7108
|
var buildTree_buildTree = function buildTree(tree, expression, settings) {
|
7059
7109
|
var options = buildTree_optionsFromSettings(settings);
|
7060
7110
|
var mathMLNode = buildMathML(tree, expression, options);
|
7061
7111
|
var htmlNode = buildHTML(tree, options);
|
7062
7112
|
var katexNode = buildCommon.makeSpan(["katex"], [mathMLNode, htmlNode]);
|
7063
|
-
|
7064
|
-
if (settings.displayMode) {
|
7065
|
-
return buildCommon.makeSpan(["katex-display"], [katexNode]);
|
7066
|
-
} else {
|
7067
|
-
return katexNode;
|
7068
|
-
}
|
7113
|
+
return buildTree_displayWrap(katexNode, settings);
|
7069
7114
|
};
|
7070
7115
|
var buildTree_buildHTMLTree = function buildHTMLTree(tree, expression, settings) {
|
7071
7116
|
var options = buildTree_optionsFromSettings(settings);
|
7072
7117
|
var htmlNode = buildHTML(tree, options);
|
7073
7118
|
var katexNode = buildCommon.makeSpan(["katex"], [htmlNode]);
|
7074
|
-
|
7075
|
-
if (settings.displayMode) {
|
7076
|
-
return buildCommon.makeSpan(["katex-display"], [katexNode]);
|
7077
|
-
} else {
|
7078
|
-
return katexNode;
|
7079
|
-
}
|
7119
|
+
return buildTree_displayWrap(katexNode, settings);
|
7080
7120
|
};
|
7081
7121
|
/* harmony default export */ var src_buildTree = (buildTree_buildTree);
|
7082
7122
|
// CONCATENATED MODULE: ./src/stretchy.js
|
@@ -8867,7 +8907,7 @@ defineFunction({
|
|
8867
8907
|
htmlBuilder: function htmlBuilder(group, options) {
|
8868
8908
|
assertParsed(group); // Build the inner expression
|
8869
8909
|
|
8870
|
-
var inner = buildHTML_buildExpression(group.body, options, true, [
|
8910
|
+
var inner = buildHTML_buildExpression(group.body, options, true, ["mopen", "mclose"]);
|
8871
8911
|
var innerHeight = 0;
|
8872
8912
|
var innerDepth = 0;
|
8873
8913
|
var hadMiddle = false; // Calculate its height and depth
|
@@ -10221,7 +10261,6 @@ defineFunction({
|
|
10221
10261
|
funcName = _ref3.funcName,
|
10222
10262
|
breakOnTokenText = _ref3.breakOnTokenText;
|
10223
10263
|
var mode = parser.mode;
|
10224
|
-
parser.consumeSpaces();
|
10225
10264
|
var body = parser.parseExpression(true, breakOnTokenText);
|
10226
10265
|
var style = "math" + funcName.slice(1);
|
10227
10266
|
return {
|
@@ -10609,24 +10648,20 @@ defineFunction({
|
|
10609
10648
|
var numer = args[4];
|
10610
10649
|
var denom = args[5]; // Look into the parse nodes to get the desired delimiters.
|
10611
10650
|
|
10612
|
-
var leftNode = checkNodeType(args[0], "
|
10651
|
+
var leftNode = checkNodeType(args[0], "atom");
|
10613
10652
|
|
10614
10653
|
if (leftNode) {
|
10615
|
-
leftNode = assertAtomFamily(leftNode.body[0], "open");
|
10616
|
-
} else {
|
10617
10654
|
leftNode = assertAtomFamily(args[0], "open");
|
10618
10655
|
}
|
10619
10656
|
|
10620
|
-
var leftDelim = delimFromValue(leftNode.text);
|
10621
|
-
var rightNode = checkNodeType(args[1], "
|
10657
|
+
var leftDelim = leftNode ? delimFromValue(leftNode.text) : null;
|
10658
|
+
var rightNode = checkNodeType(args[1], "atom");
|
10622
10659
|
|
10623
10660
|
if (rightNode) {
|
10624
|
-
rightNode = assertAtomFamily(rightNode.body[0], "close");
|
10625
|
-
} else {
|
10626
10661
|
rightNode = assertAtomFamily(args[1], "close");
|
10627
10662
|
}
|
10628
10663
|
|
10629
|
-
var rightDelim = delimFromValue(rightNode.text);
|
10664
|
+
var rightDelim = rightNode ? delimFromValue(rightNode.text) : null;
|
10630
10665
|
var barNode = assertNodeType(args[2], "size");
|
10631
10666
|
var hasBarLine;
|
10632
10667
|
var barSize = null;
|
@@ -11479,7 +11514,7 @@ var singleCharBigOps = {
|
|
11479
11514
|
"\u22C0": "\\bigwedge",
|
11480
11515
|
"\u22C1": "\\bigvee",
|
11481
11516
|
"\u22C2": "\\bigcap",
|
11482
|
-
"\u22C3": "\\
|
11517
|
+
"\u22C3": "\\bigcup",
|
11483
11518
|
"\u2A00": "\\bigodot",
|
11484
11519
|
"\u2A01": "\\bigoplus",
|
11485
11520
|
"\u2A02": "\\bigotimes",
|
@@ -11717,9 +11752,8 @@ defineFunction({
|
|
11717
11752
|
// Write a single TextNode instead of multiple nested tags.
|
11718
11753
|
var word = expression.map(function (node) {
|
11719
11754
|
return node.toText();
|
11720
|
-
}).join("");
|
11721
|
-
|
11722
|
-
expression = [new mathMLTree.TextNode(word, false)];
|
11755
|
+
}).join("");
|
11756
|
+
expression = [new mathMLTree.TextNode(word)];
|
11723
11757
|
}
|
11724
11758
|
|
11725
11759
|
var identifier = new mathMLTree.MathNode("mi", expression);
|
@@ -11738,6 +11772,10 @@ defineFunction({
|
|
11738
11772
|
defineFunctionBuilders({
|
11739
11773
|
type: "ordgroup",
|
11740
11774
|
htmlBuilder: function htmlBuilder(group, options) {
|
11775
|
+
if (group.semisimple) {
|
11776
|
+
return buildCommon.makeFragment(buildHTML_buildExpression(group.body, options, false));
|
11777
|
+
}
|
11778
|
+
|
11741
11779
|
return buildCommon.makeSpan(["mord"], buildHTML_buildExpression(group.body, options, true), options);
|
11742
11780
|
},
|
11743
11781
|
mathmlBuilder: function mathmlBuilder(group, options) {
|
@@ -11866,8 +11904,9 @@ defineFunction({
|
|
11866
11904
|
type: "elem",
|
11867
11905
|
elem: node
|
11868
11906
|
}]
|
11869
|
-
}, options);
|
11870
|
-
|
11907
|
+
}, options); // For spacing, TeX treats \smash as a math group (same spacing as ord).
|
11908
|
+
|
11909
|
+
return buildCommon.makeSpan(["mord"], [node], options);
|
11871
11910
|
},
|
11872
11911
|
mathmlBuilder: function mathmlBuilder(group, options) {
|
11873
11912
|
var inner = buildMathML_buildExpression(defineFunction_ordargument(group.body), options);
|
@@ -11952,7 +11991,6 @@ defineFunction({
|
|
11952
11991
|
var breakOnTokenText = _ref.breakOnTokenText,
|
11953
11992
|
funcName = _ref.funcName,
|
11954
11993
|
parser = _ref.parser;
|
11955
|
-
parser.consumeSpaces();
|
11956
11994
|
var body = parser.parseExpression(false, breakOnTokenText);
|
11957
11995
|
return {
|
11958
11996
|
type: "sizing",
|
@@ -12155,7 +12193,7 @@ defineFunction({
|
|
12155
12193
|
};
|
12156
12194
|
},
|
12157
12195
|
htmlBuilder: function htmlBuilder(group, options) {
|
12158
|
-
var node = buildCommon.makeSpan([
|
12196
|
+
var node = buildCommon.makeSpan([], [buildHTML_buildGroup(group.body, options)]);
|
12159
12197
|
|
12160
12198
|
if (!group.smashHeight && !group.smashDepth) {
|
12161
12199
|
return node;
|
@@ -12185,13 +12223,15 @@ defineFunction({
|
|
12185
12223
|
// from acting on that line height. So we'll call makeVList now.
|
12186
12224
|
|
12187
12225
|
|
12188
|
-
|
12226
|
+
var smashedNode = buildCommon.makeVList({
|
12189
12227
|
positionType: "firstBaseline",
|
12190
12228
|
children: [{
|
12191
12229
|
type: "elem",
|
12192
12230
|
elem: node
|
12193
12231
|
}]
|
12194
|
-
}, options);
|
12232
|
+
}, options); // For spacing, TeX treats \hphantom as a math group (same spacing as ord).
|
12233
|
+
|
12234
|
+
return buildCommon.makeSpan(["mord"], [smashedNode], options);
|
12195
12235
|
},
|
12196
12236
|
mathmlBuilder: function mathmlBuilder(group, options) {
|
12197
12237
|
var node = new mathMLTree.MathNode("mpadded", [buildMathML_buildGroup(group.body, options)]);
|
@@ -12348,7 +12388,6 @@ defineFunction({
|
|
12348
12388
|
funcName = _ref.funcName,
|
12349
12389
|
parser = _ref.parser;
|
12350
12390
|
// parse out the implicit body
|
12351
|
-
parser.consumeSpaces();
|
12352
12391
|
var body = parser.parseExpression(true, breakOnTokenText); // TODO: Refactor to avoid duplicating styleMap in multiple places (e.g.
|
12353
12392
|
// here and in buildHTML and de-dupe the enumeration of all the styles).
|
12354
12393
|
// $FlowFixMe: The names above exactly match the styles.
|
@@ -13070,28 +13109,37 @@ combiningDiacriticalMarkString + "*") + // ...plus accents
|
|
13070
13109
|
"|\\\\verb([^*a-zA-Z]).*?\\4" + ( // \verb unstarred
|
13071
13110
|
"|" + controlWordWhitespaceRegexString) + ( // \macroName + spaces
|
13072
13111
|
"|" + controlSymbolRegexString + ")"); // \\, \', etc.
|
13073
|
-
// These regexs are for matching results from tokenRegex,
|
13074
|
-
// so they do have ^ markers.
|
13075
13112
|
|
13076
|
-
var controlWordRegex = new RegExp("^" + controlWordRegexString);
|
13077
13113
|
/** Main Lexer class */
|
13078
13114
|
|
13079
13115
|
var Lexer_Lexer =
|
13080
13116
|
/*#__PURE__*/
|
13081
13117
|
function () {
|
13082
|
-
|
13118
|
+
// category codes, only supports comment characters (14) for now
|
13119
|
+
function Lexer(input, settings) {
|
13083
13120
|
this.input = void 0;
|
13121
|
+
this.settings = void 0;
|
13084
13122
|
this.tokenRegex = void 0;
|
13123
|
+
this.catcodes = void 0;
|
13085
13124
|
// Separate accents from characters
|
13086
13125
|
this.input = input;
|
13126
|
+
this.settings = settings;
|
13087
13127
|
this.tokenRegex = new RegExp(tokenRegexString, 'g');
|
13128
|
+
this.catcodes = {
|
13129
|
+
"%": 14 // comment character
|
13130
|
+
|
13131
|
+
};
|
13132
|
+
}
|
13133
|
+
|
13134
|
+
var _proto = Lexer.prototype;
|
13135
|
+
|
13136
|
+
_proto.setCatcode = function setCatcode(char, code) {
|
13137
|
+
this.catcodes[char] = code;
|
13088
13138
|
}
|
13089
13139
|
/**
|
13090
13140
|
* This function lexes a single token.
|
13091
13141
|
*/
|
13092
|
-
|
13093
|
-
|
13094
|
-
var _proto = Lexer.prototype;
|
13142
|
+
;
|
13095
13143
|
|
13096
13144
|
_proto.lex = function lex() {
|
13097
13145
|
var input = this.input;
|
@@ -13107,7 +13155,23 @@ function () {
|
|
13107
13155
|
throw new src_ParseError("Unexpected character: '" + input[pos] + "'", new Token_Token(input[pos], new SourceLocation(this, pos, pos + 1)));
|
13108
13156
|
}
|
13109
13157
|
|
13110
|
-
var text = match[2] || " ";
|
13158
|
+
var text = match[2] || " ";
|
13159
|
+
|
13160
|
+
if (this.catcodes[text] === 14) {
|
13161
|
+
// comment character
|
13162
|
+
var nlIndex = input.indexOf('\n', this.tokenRegex.lastIndex);
|
13163
|
+
|
13164
|
+
if (nlIndex === -1) {
|
13165
|
+
this.tokenRegex.lastIndex = input.length; // EOF
|
13166
|
+
|
13167
|
+
this.settings.reportNonstrict("commentAtEnd", "% comment has no terminating newline; LaTeX would " + "fail because of commenting the end of math mode (e.g. $)");
|
13168
|
+
} else {
|
13169
|
+
this.tokenRegex.lastIndex = nlIndex + 1;
|
13170
|
+
}
|
13171
|
+
|
13172
|
+
return this.lex();
|
13173
|
+
} // Trim any trailing whitespace from control word match
|
13174
|
+
|
13111
13175
|
|
13112
13176
|
var controlMatch = text.match(controlWordWhitespaceRegex);
|
13113
13177
|
|
@@ -13166,11 +13230,11 @@ function () {
|
|
13166
13230
|
|
13167
13231
|
_proto.beginGroup = function beginGroup() {
|
13168
13232
|
this.undefStack.push({});
|
13169
|
-
}
|
13233
|
+
}
|
13170
13234
|
/**
|
13171
13235
|
* End current nested group, restoring values before the group began.
|
13172
13236
|
*/
|
13173
|
-
|
13237
|
+
;
|
13174
13238
|
|
13175
13239
|
_proto.endGroup = function endGroup() {
|
13176
13240
|
if (this.undefStack.length === 0) {
|
@@ -13188,16 +13252,16 @@ function () {
|
|
13188
13252
|
}
|
13189
13253
|
}
|
13190
13254
|
}
|
13191
|
-
}
|
13255
|
+
}
|
13192
13256
|
/**
|
13193
13257
|
* Detect whether `name` has a definition. Equivalent to
|
13194
13258
|
* `get(name) != null`.
|
13195
13259
|
*/
|
13196
|
-
|
13260
|
+
;
|
13197
13261
|
|
13198
13262
|
_proto.has = function has(name) {
|
13199
13263
|
return this.current.hasOwnProperty(name) || this.builtins.hasOwnProperty(name);
|
13200
|
-
}
|
13264
|
+
}
|
13201
13265
|
/**
|
13202
13266
|
* Get the current value of a name, or `undefined` if there is no value.
|
13203
13267
|
*
|
@@ -13206,7 +13270,7 @@ function () {
|
|
13206
13270
|
* to `false` in JavaScript. Use `if (namespace.get(...) != null)` or
|
13207
13271
|
* `if (namespace.has(...))`.
|
13208
13272
|
*/
|
13209
|
-
|
13273
|
+
;
|
13210
13274
|
|
13211
13275
|
_proto.get = function get(name) {
|
13212
13276
|
if (this.current.hasOwnProperty(name)) {
|
@@ -13214,14 +13278,14 @@ function () {
|
|
13214
13278
|
} else {
|
13215
13279
|
return this.builtins[name];
|
13216
13280
|
}
|
13217
|
-
}
|
13281
|
+
}
|
13218
13282
|
/**
|
13219
13283
|
* Set the current value of a name, and optionally set it globally too.
|
13220
13284
|
* Local set() sets the current value and (when appropriate) adds an undo
|
13221
13285
|
* operation to the undo stack. Global set() may change the undo
|
13222
13286
|
* operation at every level, so takes time linear in their number.
|
13223
13287
|
*/
|
13224
|
-
|
13288
|
+
;
|
13225
13289
|
|
13226
13290
|
_proto.set = function set(name, value, global) {
|
13227
13291
|
if (global === void 0) {
|
@@ -13544,9 +13608,7 @@ defineMacro("\\providecommand", function (context) {
|
|
13544
13608
|
// \let\bgroup={ \let\egroup=}
|
13545
13609
|
|
13546
13610
|
defineMacro("\\bgroup", "{");
|
13547
|
-
defineMacro("\\egroup", "}");
|
13548
|
-
defineMacro("\\begingroup", "{");
|
13549
|
-
defineMacro("\\endgroup", "}"); // Symbols from latex.ltx:
|
13611
|
+
defineMacro("\\egroup", "}"); // Symbols from latex.ltx:
|
13550
13612
|
// \def\lq{`}
|
13551
13613
|
// \def\rq{'}
|
13552
13614
|
// \def \aa {\r a}
|
@@ -13564,17 +13626,7 @@ defineMacro("\\AA", "\\r A"); // Copyright (C) and registered (R) symbols. Use r
|
|
13564
13626
|
|
13565
13627
|
defineMacro("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}");
|
13566
13628
|
defineMacro("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");
|
13567
|
-
defineMacro("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"); // Unicode
|
13568
|
-
|
13569
|
-
defineMacro("\u2102", "\\mathbb{C}");
|
13570
|
-
defineMacro("\u210D", "\\mathbb{H}");
|
13571
|
-
defineMacro("\u2115", "\\mathbb{N}");
|
13572
|
-
defineMacro("\u2119", "\\mathbb{P}");
|
13573
|
-
defineMacro("\u211A", "\\mathbb{Q}");
|
13574
|
-
defineMacro("\u211D", "\\mathbb{R}");
|
13575
|
-
defineMacro("\u2124", "\\mathbb{Z}");
|
13576
|
-
defineMacro("\u210E", "\\mathit{h}"); // Planck constant
|
13577
|
-
// Characters omitted from Unicode range 1D400–1D7FF
|
13629
|
+
defineMacro("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"); // Characters omitted from Unicode range 1D400–1D7FF
|
13578
13630
|
|
13579
13631
|
defineMacro("\u212C", "\\mathscr{B}"); // script
|
13580
13632
|
|
@@ -14054,7 +14106,12 @@ defineMacro("\\Tau", "\\mathrm{T}");
|
|
14054
14106
|
defineMacro("\\thetasym", "\\vartheta"); // TODO: defineMacro("\\varcoppa", "\\\mbox{\\coppa}");
|
14055
14107
|
|
14056
14108
|
defineMacro("\\weierp", "\\wp");
|
14057
|
-
defineMacro("\\Zeta", "\\mathrm{Z}");
|
14109
|
+
defineMacro("\\Zeta", "\\mathrm{Z}"); //////////////////////////////////////////////////////////////////////
|
14110
|
+
// statmath.sty
|
14111
|
+
// https://ctan.math.illinois.edu/macros/latex/contrib/statmath/statmath.pdf
|
14112
|
+
|
14113
|
+
defineMacro("\\argmin", "\\DOTSB\\mathop{\\operatorname{arg\\,min}}\\limits");
|
14114
|
+
defineMacro("\\argmax", "\\DOTSB\\mathop{\\operatorname{arg\\,max}}\\limits");
|
14058
14115
|
// CONCATENATED MODULE: ./src/MacroExpander.js
|
14059
14116
|
/**
|
14060
14117
|
* This file contains the “gullet” where macros are expanded
|
@@ -14109,37 +14166,37 @@ function () {
|
|
14109
14166
|
var _proto = MacroExpander.prototype;
|
14110
14167
|
|
14111
14168
|
_proto.feed = function feed(input) {
|
14112
|
-
this.lexer = new Lexer_Lexer(input);
|
14113
|
-
}
|
14169
|
+
this.lexer = new Lexer_Lexer(input, this.settings);
|
14170
|
+
}
|
14114
14171
|
/**
|
14115
14172
|
* Switches between "text" and "math" modes.
|
14116
14173
|
*/
|
14117
|
-
|
14174
|
+
;
|
14118
14175
|
|
14119
14176
|
_proto.switchMode = function switchMode(newMode) {
|
14120
14177
|
this.mode = newMode;
|
14121
|
-
}
|
14178
|
+
}
|
14122
14179
|
/**
|
14123
14180
|
* Start a new group nesting within all namespaces.
|
14124
14181
|
*/
|
14125
|
-
|
14182
|
+
;
|
14126
14183
|
|
14127
14184
|
_proto.beginGroup = function beginGroup() {
|
14128
14185
|
this.macros.beginGroup();
|
14129
|
-
}
|
14186
|
+
}
|
14130
14187
|
/**
|
14131
14188
|
* End current group nesting within all namespaces.
|
14132
14189
|
*/
|
14133
|
-
|
14190
|
+
;
|
14134
14191
|
|
14135
14192
|
_proto.endGroup = function endGroup() {
|
14136
14193
|
this.macros.endGroup();
|
14137
|
-
}
|
14194
|
+
}
|
14138
14195
|
/**
|
14139
14196
|
* Returns the topmost token on the stack, without expanding it.
|
14140
14197
|
* Similar in behavior to TeX's `\futurelet`.
|
14141
14198
|
*/
|
14142
|
-
|
14199
|
+
;
|
14143
14200
|
|
14144
14201
|
_proto.future = function future() {
|
14145
14202
|
if (this.stack.length === 0) {
|
@@ -14147,40 +14204,40 @@ function () {
|
|
14147
14204
|
}
|
14148
14205
|
|
14149
14206
|
return this.stack[this.stack.length - 1];
|
14150
|
-
}
|
14207
|
+
}
|
14151
14208
|
/**
|
14152
14209
|
* Remove and return the next unexpanded token.
|
14153
14210
|
*/
|
14154
|
-
|
14211
|
+
;
|
14155
14212
|
|
14156
14213
|
_proto.popToken = function popToken() {
|
14157
14214
|
this.future(); // ensure non-empty stack
|
14158
14215
|
|
14159
14216
|
return this.stack.pop();
|
14160
|
-
}
|
14217
|
+
}
|
14161
14218
|
/**
|
14162
14219
|
* Add a given token to the token stack. In particular, this get be used
|
14163
14220
|
* to put back a token returned from one of the other methods.
|
14164
14221
|
*/
|
14165
|
-
|
14222
|
+
;
|
14166
14223
|
|
14167
14224
|
_proto.pushToken = function pushToken(token) {
|
14168
14225
|
this.stack.push(token);
|
14169
|
-
}
|
14226
|
+
}
|
14170
14227
|
/**
|
14171
14228
|
* Append an array of tokens to the token stack.
|
14172
14229
|
*/
|
14173
|
-
|
14230
|
+
;
|
14174
14231
|
|
14175
14232
|
_proto.pushTokens = function pushTokens(tokens) {
|
14176
14233
|
var _this$stack;
|
14177
14234
|
|
14178
14235
|
(_this$stack = this.stack).push.apply(_this$stack, tokens);
|
14179
|
-
}
|
14236
|
+
}
|
14180
14237
|
/**
|
14181
14238
|
* Consume all following space tokens, without expansion.
|
14182
14239
|
*/
|
14183
|
-
|
14240
|
+
;
|
14184
14241
|
|
14185
14242
|
_proto.consumeSpaces = function consumeSpaces() {
|
14186
14243
|
for (;;) {
|
@@ -14192,12 +14249,12 @@ function () {
|
|
14192
14249
|
break;
|
14193
14250
|
}
|
14194
14251
|
}
|
14195
|
-
}
|
14252
|
+
}
|
14196
14253
|
/**
|
14197
14254
|
* Consume the specified number of arguments from the token stream,
|
14198
14255
|
* and return the resulting array of arguments.
|
14199
14256
|
*/
|
14200
|
-
|
14257
|
+
;
|
14201
14258
|
|
14202
14259
|
_proto.consumeArgs = function consumeArgs(numArgs) {
|
14203
14260
|
var args = []; // obtain arguments, either single token or balanced {…} group
|
@@ -14237,7 +14294,7 @@ function () {
|
|
14237
14294
|
}
|
14238
14295
|
|
14239
14296
|
return args;
|
14240
|
-
}
|
14297
|
+
}
|
14241
14298
|
/**
|
14242
14299
|
* Expand the next token only once if possible.
|
14243
14300
|
*
|
@@ -14258,7 +14315,7 @@ function () {
|
|
14258
14315
|
* i.e. things like those defined by \def\foo#1\end{…}.
|
14259
14316
|
* See the TeX book page 202ff. for details on how those should behave.
|
14260
14317
|
*/
|
14261
|
-
|
14318
|
+
;
|
14262
14319
|
|
14263
14320
|
_proto.expandOnce = function expandOnce() {
|
14264
14321
|
var topToken = this.popToken();
|
@@ -14314,23 +14371,23 @@ function () {
|
|
14314
14371
|
|
14315
14372
|
this.pushTokens(tokens);
|
14316
14373
|
return tokens;
|
14317
|
-
}
|
14374
|
+
}
|
14318
14375
|
/**
|
14319
14376
|
* Expand the next token only once (if possible), and return the resulting
|
14320
14377
|
* top token on the stack (without removing anything from the stack).
|
14321
14378
|
* Similar in behavior to TeX's `\expandafter\futurelet`.
|
14322
14379
|
* Equivalent to expandOnce() followed by future().
|
14323
14380
|
*/
|
14324
|
-
|
14381
|
+
;
|
14325
14382
|
|
14326
14383
|
_proto.expandAfterFuture = function expandAfterFuture() {
|
14327
14384
|
this.expandOnce();
|
14328
14385
|
return this.future();
|
14329
|
-
}
|
14386
|
+
}
|
14330
14387
|
/**
|
14331
14388
|
* Recursively expand first token, then return first non-expandable token.
|
14332
14389
|
*/
|
14333
|
-
|
14390
|
+
;
|
14334
14391
|
|
14335
14392
|
_proto.expandNextToken = function expandNextToken() {
|
14336
14393
|
for (;;) {
|
@@ -14350,12 +14407,12 @@ function () {
|
|
14350
14407
|
|
14351
14408
|
|
14352
14409
|
throw new Error(); // eslint-disable-line no-unreachable
|
14353
|
-
}
|
14410
|
+
}
|
14354
14411
|
/**
|
14355
14412
|
* Fully expand the given macro name and return the resulting list of
|
14356
14413
|
* tokens, or return `undefined` if no such macro is defined.
|
14357
14414
|
*/
|
14358
|
-
|
14415
|
+
;
|
14359
14416
|
|
14360
14417
|
_proto.expandMacro = function expandMacro(name) {
|
14361
14418
|
if (!this.macros.get(name)) {
|
@@ -14375,12 +14432,12 @@ function () {
|
|
14375
14432
|
}
|
14376
14433
|
|
14377
14434
|
return output;
|
14378
|
-
}
|
14435
|
+
}
|
14379
14436
|
/**
|
14380
14437
|
* Fully expand the given macro name and return the result as a string,
|
14381
14438
|
* or return `undefined` if no such macro is defined.
|
14382
14439
|
*/
|
14383
|
-
|
14440
|
+
;
|
14384
14441
|
|
14385
14442
|
_proto.expandMacroAsText = function expandMacroAsText(name) {
|
14386
14443
|
var tokens = this.expandMacro(name);
|
@@ -14392,12 +14449,12 @@ function () {
|
|
14392
14449
|
} else {
|
14393
14450
|
return tokens;
|
14394
14451
|
}
|
14395
|
-
}
|
14452
|
+
}
|
14396
14453
|
/**
|
14397
14454
|
* Returns the expanded macro as a reversed array of tokens and a macro
|
14398
14455
|
* argument count. Or returns `null` if no such macro.
|
14399
14456
|
*/
|
14400
|
-
|
14457
|
+
;
|
14401
14458
|
|
14402
14459
|
_proto._getExpansion = function _getExpansion(name) {
|
14403
14460
|
var definition = this.macros.get(name);
|
@@ -14420,7 +14477,7 @@ function () {
|
|
14420
14477
|
}
|
14421
14478
|
}
|
14422
14479
|
|
14423
|
-
var bodyLexer = new Lexer_Lexer(expansion);
|
14480
|
+
var bodyLexer = new Lexer_Lexer(expansion, this.settings);
|
14424
14481
|
var tokens = [];
|
14425
14482
|
var tok = bodyLexer.lex();
|
14426
14483
|
|
@@ -14439,14 +14496,14 @@ function () {
|
|
14439
14496
|
}
|
14440
14497
|
|
14441
14498
|
return expansion;
|
14442
|
-
}
|
14499
|
+
}
|
14443
14500
|
/**
|
14444
14501
|
* Determine whether a command is currently "defined" (has some
|
14445
14502
|
* functionality), meaning that it's a macro (in the current group),
|
14446
14503
|
* a function, a symbol, or one of the special commands listed in
|
14447
14504
|
* `implicitCommands`.
|
14448
14505
|
*/
|
14449
|
-
|
14506
|
+
;
|
14450
14507
|
|
14451
14508
|
_proto.isDefined = function isDefined(name) {
|
14452
14509
|
return this.macros.has(name) || src_functions.hasOwnProperty(name) || src_symbols.math.hasOwnProperty(name) || src_symbols.text.hasOwnProperty(name) || implicitCommands.hasOwnProperty(name);
|
@@ -15229,29 +15286,29 @@ function () {
|
|
15229
15286
|
if (consume) {
|
15230
15287
|
this.consume();
|
15231
15288
|
}
|
15232
|
-
}
|
15289
|
+
}
|
15233
15290
|
/**
|
15234
15291
|
* Considers the current look ahead token as consumed,
|
15235
15292
|
* and fetches the one after that as the new look ahead.
|
15236
15293
|
*/
|
15237
|
-
|
15294
|
+
;
|
15238
15295
|
|
15239
15296
|
_proto.consume = function consume() {
|
15240
15297
|
this.nextToken = this.gullet.expandNextToken();
|
15241
|
-
}
|
15298
|
+
}
|
15242
15299
|
/**
|
15243
15300
|
* Switches between "text" and "math" modes.
|
15244
15301
|
*/
|
15245
|
-
|
15302
|
+
;
|
15246
15303
|
|
15247
15304
|
_proto.switchMode = function switchMode(newMode) {
|
15248
15305
|
this.mode = newMode;
|
15249
15306
|
this.gullet.switchMode(newMode);
|
15250
|
-
}
|
15307
|
+
}
|
15251
15308
|
/**
|
15252
15309
|
* Main parsing function, which parses an entire input.
|
15253
15310
|
*/
|
15254
|
-
|
15311
|
+
;
|
15255
15312
|
|
15256
15313
|
_proto.parse = function parse() {
|
15257
15314
|
// Create a group namespace for the math expression.
|
@@ -15274,17 +15331,6 @@ function () {
|
|
15274
15331
|
return parse;
|
15275
15332
|
};
|
15276
15333
|
|
15277
|
-
/**
|
15278
|
-
* Parses an "expression", which is a list of atoms.
|
15279
|
-
*
|
15280
|
-
* `breakOnInfix`: Should the parsing stop when we hit infix nodes? This
|
15281
|
-
* happens when functions have higher precendence han infix
|
15282
|
-
* nodes in implicit parses.
|
15283
|
-
*
|
15284
|
-
* `breakOnTokenText`: The text of the token that the expression should end
|
15285
|
-
* with, or `null` if something else should end the
|
15286
|
-
* expression.
|
15287
|
-
*/
|
15288
15334
|
_proto.parseExpression = function parseExpression(breakOnInfix, breakOnTokenText) {
|
15289
15335
|
var body = []; // Keep adding atoms to the body until we can't parse any more atoms (either
|
15290
15336
|
// we reached the end, a }, or a \right)
|
@@ -15323,7 +15369,7 @@ function () {
|
|
15323
15369
|
}
|
15324
15370
|
|
15325
15371
|
return this.handleInfixNodes(body);
|
15326
|
-
}
|
15372
|
+
}
|
15327
15373
|
/**
|
15328
15374
|
* Rewrites infix operators such as \over with corresponding commands such
|
15329
15375
|
* as \frac.
|
@@ -15331,7 +15377,7 @@ function () {
|
|
15331
15377
|
* There can only be one infix operator per group. If there's more than one
|
15332
15378
|
* then the expression is ambiguous. This can be resolved by adding {}.
|
15333
15379
|
*/
|
15334
|
-
|
15380
|
+
;
|
15335
15381
|
|
15336
15382
|
_proto.handleInfixNodes = function handleInfixNodes(body) {
|
15337
15383
|
var overIndex = -1;
|
@@ -15388,8 +15434,8 @@ function () {
|
|
15388
15434
|
} else {
|
15389
15435
|
return body;
|
15390
15436
|
}
|
15391
|
-
}
|
15392
|
-
|
15437
|
+
} // The greediness of a superscript or subscript
|
15438
|
+
;
|
15393
15439
|
|
15394
15440
|
/**
|
15395
15441
|
* Handle a subscript or superscript with nice errors.
|
@@ -15407,12 +15453,12 @@ function () {
|
|
15407
15453
|
}
|
15408
15454
|
|
15409
15455
|
return group;
|
15410
|
-
}
|
15456
|
+
}
|
15411
15457
|
/**
|
15412
15458
|
* Converts the textual input of an unsupported command into a text node
|
15413
15459
|
* contained within a color node whose color is determined by errorColor
|
15414
15460
|
*/
|
15415
|
-
|
15461
|
+
;
|
15416
15462
|
|
15417
15463
|
_proto.handleUnsupportedCmd = function handleUnsupportedCmd() {
|
15418
15464
|
var text = this.nextToken.text;
|
@@ -15439,11 +15485,11 @@ function () {
|
|
15439
15485
|
};
|
15440
15486
|
this.consume();
|
15441
15487
|
return colorNode;
|
15442
|
-
}
|
15488
|
+
}
|
15443
15489
|
/**
|
15444
15490
|
* Parses a group with optional super/subscripts.
|
15445
15491
|
*/
|
15446
|
-
|
15492
|
+
;
|
15447
15493
|
|
15448
15494
|
_proto.parseAtom = function parseAtom(breakOnTokenText) {
|
15449
15495
|
// The body of an atom is an implicit group, so that things like
|
@@ -15524,8 +15570,6 @@ function () {
|
|
15524
15570
|
mode: this.mode,
|
15525
15571
|
body: primes
|
15526
15572
|
};
|
15527
|
-
} else if (lex.text === "%") {
|
15528
|
-
this.consumeComment();
|
15529
15573
|
} else {
|
15530
15574
|
// If it wasn't ^, _, or ', stop parsing super/subscripts
|
15531
15575
|
break;
|
@@ -15547,11 +15591,11 @@ function () {
|
|
15547
15591
|
// Otherwise return the original body
|
15548
15592
|
return base;
|
15549
15593
|
}
|
15550
|
-
}
|
15594
|
+
}
|
15551
15595
|
/**
|
15552
15596
|
* Parses an entire function, including its base and all of its arguments.
|
15553
15597
|
*/
|
15554
|
-
|
15598
|
+
;
|
15555
15599
|
|
15556
15600
|
_proto.parseFunction = function parseFunction(breakOnTokenText, name, // For error reporting.
|
15557
15601
|
greediness) {
|
@@ -15569,6 +15613,11 @@ function () {
|
|
15569
15613
|
throw new src_ParseError("Can't use function '" + func + "' in text mode", token);
|
15570
15614
|
} else if (this.mode === "math" && funcData.allowedInMath === false) {
|
15571
15615
|
throw new src_ParseError("Can't use function '" + func + "' in math mode", token);
|
15616
|
+
} // hyperref package sets the catcode of % as an active character
|
15617
|
+
|
15618
|
+
|
15619
|
+
if (funcData.argTypes && funcData.argTypes[0] === "url") {
|
15620
|
+
this.gullet.lexer.setCatcode("%", 13);
|
15572
15621
|
} // Consume the command token after possibly switching to the
|
15573
15622
|
// mode specified by the function (for instant mode switching),
|
15574
15623
|
// and then immediately switch back.
|
@@ -15588,11 +15637,11 @@ function () {
|
|
15588
15637
|
optArgs = _this$parseArguments.optArgs;
|
15589
15638
|
|
15590
15639
|
return this.callFunction(func, args, optArgs, token, breakOnTokenText);
|
15591
|
-
}
|
15640
|
+
}
|
15592
15641
|
/**
|
15593
15642
|
* Call a function handler with a suitable context and arguments.
|
15594
15643
|
*/
|
15595
|
-
|
15644
|
+
;
|
15596
15645
|
|
15597
15646
|
_proto.callFunction = function callFunction(name, args, optArgs, token, breakOnTokenText) {
|
15598
15647
|
var context = {
|
@@ -15608,11 +15657,11 @@ function () {
|
|
15608
15657
|
} else {
|
15609
15658
|
throw new src_ParseError("No function handler for " + name);
|
15610
15659
|
}
|
15611
|
-
}
|
15660
|
+
}
|
15612
15661
|
/**
|
15613
15662
|
* Parses the arguments of a function or environment
|
15614
15663
|
*/
|
15615
|
-
|
15664
|
+
;
|
15616
15665
|
|
15617
15666
|
_proto.parseArguments = function parseArguments(func, // Should look like "\name" or "\begin{name}".
|
15618
15667
|
funcData) {
|
@@ -15669,11 +15718,11 @@ function () {
|
|
15669
15718
|
args: args,
|
15670
15719
|
optArgs: optArgs
|
15671
15720
|
};
|
15672
|
-
}
|
15721
|
+
}
|
15673
15722
|
/**
|
15674
15723
|
* Parses a group when the mode is changing.
|
15675
15724
|
*/
|
15676
|
-
|
15725
|
+
;
|
15677
15726
|
|
15678
15727
|
_proto.parseGroupOfType = function parseGroupOfType(name, type, optional, greediness) {
|
15679
15728
|
switch (type) {
|
@@ -15690,6 +15739,25 @@ function () {
|
|
15690
15739
|
case "text":
|
15691
15740
|
return this.parseGroup(name, optional, greediness, undefined, type);
|
15692
15741
|
|
15742
|
+
case "raw":
|
15743
|
+
{
|
15744
|
+
if (optional && this.nextToken.text === "{") {
|
15745
|
+
return null;
|
15746
|
+
}
|
15747
|
+
|
15748
|
+
var token = this.parseStringGroup("raw", optional, true);
|
15749
|
+
|
15750
|
+
if (token) {
|
15751
|
+
return {
|
15752
|
+
type: "raw",
|
15753
|
+
mode: "text",
|
15754
|
+
string: token.text
|
15755
|
+
};
|
15756
|
+
} else {
|
15757
|
+
throw new src_ParseError("Expected raw group", this.nextToken);
|
15758
|
+
}
|
15759
|
+
}
|
15760
|
+
|
15693
15761
|
case "original":
|
15694
15762
|
case null:
|
15695
15763
|
case undefined:
|
@@ -15704,34 +15772,12 @@ function () {
|
|
15704
15772
|
while (this.nextToken.text === " ") {
|
15705
15773
|
this.consume();
|
15706
15774
|
}
|
15707
|
-
}
|
15708
|
-
|
15709
|
-
_proto.consumeComment = function consumeComment() {
|
15710
|
-
// the newline character is normalized in Lexer, check original source
|
15711
|
-
while (this.nextToken.text !== "EOF" && this.nextToken.loc && this.nextToken.loc.getSource().indexOf("\n") === -1) {
|
15712
|
-
this.consume();
|
15713
|
-
}
|
15714
|
-
|
15715
|
-
if (this.nextToken.text === "EOF") {
|
15716
|
-
this.settings.reportNonstrict("commentAtEnd", "% comment has no terminating newline; LaTeX would " + "fail because of commenting the end of math mode (e.g. $)");
|
15717
|
-
}
|
15718
|
-
|
15719
|
-
if (this.mode === "math") {
|
15720
|
-
this.consumeSpaces(); // ignore spaces in math mode
|
15721
|
-
} else if (this.nextToken.loc) {
|
15722
|
-
// text mode
|
15723
|
-
var source = this.nextToken.loc.getSource();
|
15724
|
-
|
15725
|
-
if (source.indexOf("\n") === source.length - 1) {
|
15726
|
-
this.consumeSpaces(); // if no space after the first newline
|
15727
|
-
}
|
15728
|
-
}
|
15729
|
-
};
|
15775
|
+
}
|
15730
15776
|
/**
|
15731
15777
|
* Parses a group, essentially returning the string formed by the
|
15732
15778
|
* brace-enclosed tokens plus some position information.
|
15733
15779
|
*/
|
15734
|
-
|
15780
|
+
;
|
15735
15781
|
|
15736
15782
|
_proto.parseStringGroup = function parseStringGroup(modeName, // Used to describe the mode in error messages.
|
15737
15783
|
optional, raw) {
|
@@ -15744,6 +15790,8 @@ function () {
|
|
15744
15790
|
return null;
|
15745
15791
|
} else if (raw && nextToken.text !== "EOF" && /[^{}[\]]/.test(nextToken.text)) {
|
15746
15792
|
// allow a single character in raw string group
|
15793
|
+
this.gullet.lexer.setCatcode("%", 14); // reset the catcode of %
|
15794
|
+
|
15747
15795
|
this.consume();
|
15748
15796
|
return nextToken;
|
15749
15797
|
}
|
@@ -15763,15 +15811,6 @@ function () {
|
|
15763
15811
|
case "EOF":
|
15764
15812
|
throw new src_ParseError("Unexpected end of input in " + modeName, firstToken.range(lastToken, str));
|
15765
15813
|
|
15766
|
-
case "%":
|
15767
|
-
if (!raw) {
|
15768
|
-
// allow % in raw string group
|
15769
|
-
this.consumeComment();
|
15770
|
-
continue;
|
15771
|
-
}
|
15772
|
-
|
15773
|
-
break;
|
15774
|
-
|
15775
15814
|
case groupBegin:
|
15776
15815
|
nested++;
|
15777
15816
|
break;
|
@@ -15787,15 +15826,17 @@ function () {
|
|
15787
15826
|
}
|
15788
15827
|
|
15789
15828
|
this.mode = outerMode;
|
15829
|
+
this.gullet.lexer.setCatcode("%", 14); // reset the catcode of %
|
15830
|
+
|
15790
15831
|
this.expect(groupEnd);
|
15791
15832
|
return firstToken.range(lastToken, str);
|
15792
|
-
}
|
15833
|
+
}
|
15793
15834
|
/**
|
15794
15835
|
* Parses a regex-delimited group: the largest sequence of tokens
|
15795
15836
|
* whose concatenated strings match `regex`. Returns the string
|
15796
15837
|
* formed by the tokens plus some position information.
|
15797
15838
|
*/
|
15798
|
-
|
15839
|
+
;
|
15799
15840
|
|
15800
15841
|
_proto.parseRegexGroup = function parseRegexGroup(regex, modeName) {
|
15801
15842
|
var outerMode = this.mode;
|
@@ -15804,12 +15845,7 @@ function () {
|
|
15804
15845
|
var lastToken = firstToken;
|
15805
15846
|
var str = "";
|
15806
15847
|
|
15807
|
-
while (this.nextToken.text !== "EOF" &&
|
15808
|
-
if (this.nextToken.text === "%") {
|
15809
|
-
this.consumeComment();
|
15810
|
-
continue;
|
15811
|
-
}
|
15812
|
-
|
15848
|
+
while (this.nextToken.text !== "EOF" && regex.test(str + this.nextToken.text)) {
|
15813
15849
|
lastToken = this.nextToken;
|
15814
15850
|
str += lastToken.text;
|
15815
15851
|
this.consume();
|
@@ -15821,11 +15857,11 @@ function () {
|
|
15821
15857
|
|
15822
15858
|
this.mode = outerMode;
|
15823
15859
|
return firstToken.range(lastToken, str);
|
15824
|
-
}
|
15860
|
+
}
|
15825
15861
|
/**
|
15826
15862
|
* Parses a color description.
|
15827
15863
|
*/
|
15828
|
-
|
15864
|
+
;
|
15829
15865
|
|
15830
15866
|
_proto.parseColorGroup = function parseColorGroup(optional) {
|
15831
15867
|
var res = this.parseStringGroup("color", optional);
|
@@ -15854,11 +15890,11 @@ function () {
|
|
15854
15890
|
mode: this.mode,
|
15855
15891
|
color: color
|
15856
15892
|
};
|
15857
|
-
}
|
15893
|
+
}
|
15858
15894
|
/**
|
15859
15895
|
* Parses a size specification, consisting of magnitude and unit.
|
15860
15896
|
*/
|
15861
|
-
|
15897
|
+
;
|
15862
15898
|
|
15863
15899
|
_proto.parseSizeGroup = function parseSizeGroup(optional) {
|
15864
15900
|
var res;
|
@@ -15905,11 +15941,11 @@ function () {
|
|
15905
15941
|
value: data,
|
15906
15942
|
isBlank: isBlank
|
15907
15943
|
};
|
15908
|
-
}
|
15944
|
+
}
|
15909
15945
|
/**
|
15910
15946
|
* Parses an URL, checking escaped letters and allowed protocols.
|
15911
15947
|
*/
|
15912
|
-
|
15948
|
+
;
|
15913
15949
|
|
15914
15950
|
_proto.parseUrlGroup = function parseUrlGroup(optional) {
|
15915
15951
|
var res = this.parseStringGroup("url", optional, true); // get raw string
|
@@ -15936,7 +15972,7 @@ function () {
|
|
15936
15972
|
mode: this.mode,
|
15937
15973
|
url: url
|
15938
15974
|
};
|
15939
|
-
}
|
15975
|
+
}
|
15940
15976
|
/**
|
15941
15977
|
* If `optional` is false or absent, this parses an ordinary group,
|
15942
15978
|
* which is either a single nucleus (like "x") or an expression
|
@@ -15949,7 +15985,7 @@ function () {
|
|
15949
15985
|
* If `mode` is present, switches to that mode while parsing the group,
|
15950
15986
|
* and switches back after.
|
15951
15987
|
*/
|
15952
|
-
|
15988
|
+
;
|
15953
15989
|
|
15954
15990
|
_proto.parseGroup = function parseGroup(name, // For error reporting.
|
15955
15991
|
optional, greediness, breakOnTokenText, mode) {
|
@@ -15961,29 +15997,29 @@ function () {
|
|
15961
15997
|
this.switchMode(mode);
|
15962
15998
|
}
|
15963
15999
|
|
15964
|
-
var
|
16000
|
+
var groupEnd;
|
16001
|
+
var result; // Try to parse an open brace or \begingroup
|
16002
|
+
|
16003
|
+
if (optional ? text === "[" : text === "{" || text === "\\begingroup") {
|
16004
|
+
groupEnd = Parser.endOfGroup[text]; // Start a new group namespace
|
15965
16005
|
|
15966
|
-
if (text === (optional ? "[" : "{")) {
|
15967
|
-
// Start a new group namespace
|
15968
16006
|
this.gullet.beginGroup(); // If we get a brace, parse an expression
|
15969
16007
|
|
15970
16008
|
this.consume();
|
15971
|
-
var expression = this.parseExpression(false,
|
15972
|
-
var lastToken = this.nextToken; //
|
15973
|
-
|
15974
|
-
if (mode) {
|
15975
|
-
this.switchMode(outerMode);
|
15976
|
-
} // End group namespace before consuming symbol after close brace
|
16009
|
+
var expression = this.parseExpression(false, groupEnd);
|
16010
|
+
var lastToken = this.nextToken; // End group namespace before consuming symbol after close brace
|
15977
16011
|
|
15978
|
-
|
15979
|
-
|
15980
|
-
|
15981
|
-
this.expect(optional ? "]" : "}");
|
15982
|
-
return {
|
16012
|
+
this.gullet.endGroup();
|
16013
|
+
result = {
|
15983
16014
|
type: "ordgroup",
|
15984
16015
|
mode: this.mode,
|
15985
16016
|
loc: SourceLocation.range(firstToken, lastToken),
|
15986
|
-
body: expression
|
16017
|
+
body: expression,
|
16018
|
+
// A group formed by \begingroup...\endgroup is a semi-simple group
|
16019
|
+
// which doesn't affect spacing in math mode, i.e., is transparent.
|
16020
|
+
// https://tex.stackexchange.com/questions/1930/when-should-one-
|
16021
|
+
// use-begingroup-instead-of-bgroup
|
16022
|
+
semisimple: text === "\\begingroup" || undefined
|
15987
16023
|
};
|
15988
16024
|
} else if (optional) {
|
15989
16025
|
// Return nothing for an optional group
|
@@ -16005,10 +16041,15 @@ function () {
|
|
16005
16041
|
|
16006
16042
|
if (mode) {
|
16007
16043
|
this.switchMode(outerMode);
|
16044
|
+
} // Make sure we got a close brace
|
16045
|
+
|
16046
|
+
|
16047
|
+
if (groupEnd) {
|
16048
|
+
this.expect(groupEnd);
|
16008
16049
|
}
|
16009
16050
|
|
16010
16051
|
return result;
|
16011
|
-
}
|
16052
|
+
}
|
16012
16053
|
/**
|
16013
16054
|
* Form ligature-like combinations of characters for text mode.
|
16014
16055
|
* This includes inputs like "--", "---", "``" and "''".
|
@@ -16017,7 +16058,7 @@ function () {
|
|
16017
16058
|
* characters in its value. The representation is still ASCII source.
|
16018
16059
|
* The group will be modified in place.
|
16019
16060
|
*/
|
16020
|
-
|
16061
|
+
;
|
16021
16062
|
|
16022
16063
|
_proto.formLigatures = function formLigatures(group) {
|
16023
16064
|
var n = group.length - 1;
|
@@ -16057,12 +16098,12 @@ function () {
|
|
16057
16098
|
n -= 1;
|
16058
16099
|
}
|
16059
16100
|
}
|
16060
|
-
}
|
16101
|
+
}
|
16061
16102
|
/**
|
16062
16103
|
* Parse a single symbol out of the string. Here, we handle single character
|
16063
16104
|
* symbols and special functions like verbatim
|
16064
16105
|
*/
|
16065
|
-
|
16106
|
+
;
|
16066
16107
|
|
16067
16108
|
_proto.parseSymbol = function parseSymbol() {
|
16068
16109
|
var nucleus = this.nextToken;
|
@@ -16091,9 +16132,6 @@ function () {
|
|
16091
16132
|
body: arg,
|
16092
16133
|
star: star
|
16093
16134
|
};
|
16094
|
-
} else if (text === "%") {
|
16095
|
-
this.consumeComment();
|
16096
|
-
return this.parseSymbol();
|
16097
16135
|
} // At this point, we should have a symbol, possibly with accents.
|
16098
16136
|
// First expand any accented base symbol according to unicodeSymbols.
|
16099
16137
|
|
@@ -16207,7 +16245,24 @@ function () {
|
|
16207
16245
|
return Parser;
|
16208
16246
|
}();
|
16209
16247
|
|
16210
|
-
Parser_Parser.endOfExpression = ["}", "\\end", "\\right", "&"];
|
16248
|
+
Parser_Parser.endOfExpression = ["}", "\\endgroup", "\\end", "\\right", "&"];
|
16249
|
+
Parser_Parser.endOfGroup = {
|
16250
|
+
"[": "]",
|
16251
|
+
"{": "}",
|
16252
|
+
"\\begingroup": "\\endgroup"
|
16253
|
+
/**
|
16254
|
+
* Parses an "expression", which is a list of atoms.
|
16255
|
+
*
|
16256
|
+
* `breakOnInfix`: Should the parsing stop when we hit infix nodes? This
|
16257
|
+
* happens when functions have higher precendence han infix
|
16258
|
+
* nodes in implicit parses.
|
16259
|
+
*
|
16260
|
+
* `breakOnTokenText`: The text of the token that the expression should end
|
16261
|
+
* with, or `null` if something else should end the
|
16262
|
+
* expression.
|
16263
|
+
*/
|
16264
|
+
|
16265
|
+
};
|
16211
16266
|
Parser_Parser.SUPSUB_GREEDINESS = 1;
|
16212
16267
|
|
16213
16268
|
// CONCATENATED MODULE: ./src/parseTree.js
|
@@ -16363,7 +16418,7 @@ var katex_renderToHTMLTree = function renderToHTMLTree(expression, options) {
|
|
16363
16418
|
/**
|
16364
16419
|
* Current KaTeX version
|
16365
16420
|
*/
|
16366
|
-
version: "0.10.
|
16421
|
+
version: "0.10.1",
|
16367
16422
|
|
16368
16423
|
/**
|
16369
16424
|
* Renders the given LaTeX into an HTML+MathML combination, and adds
|
@@ -16446,8 +16501,9 @@ var katex_renderToHTMLTree = function renderToHTMLTree(expression, options) {
|
|
16446
16501
|
});
|
16447
16502
|
// CONCATENATED MODULE: ./katex.webpack.js
|
16448
16503
|
/**
|
16449
|
-
* This is the webpack entry point for KaTeX. As flow[1] and jest[2]
|
16450
|
-
* CSS modules natively, a separate entry point is used and
|
16504
|
+
* This is the webpack entry point for KaTeX. As ECMAScript, flow[1] and jest[2]
|
16505
|
+
* doesn't support CSS modules natively, a separate entry point is used and
|
16506
|
+
* it is not flowtyped.
|
16451
16507
|
*
|
16452
16508
|
* [1] https://gist.github.com/lambdahands/d19e0da96285b749f0ef
|
16453
16509
|
* [2] https://facebook.github.io/jest/docs/en/webpack.html
|