katex 0.12.0 → 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/CHANGELOG.md +112 -0
- package/LICENSE +1 -1
- package/README.md +8 -7
- package/contrib/auto-render/auto-render.js +12 -19
- package/contrib/auto-render/index.html +9 -3
- package/contrib/auto-render/splitAtDelimiters.js +44 -61
- package/contrib/auto-render/test/auto-render-spec.js +88 -52
- package/contrib/copy-tex/README.md +5 -9
- package/contrib/copy-tex/copy-tex.css +0 -3
- package/contrib/mathtex-script-type/README.md +5 -5
- package/contrib/mhchem/README.md +4 -2
- package/contrib/render-a11y-string/render-a11y-string.js +31 -2
- package/contrib/render-a11y-string/test/render-a11y-string-spec.js +23 -0
- package/dist/README.md +8 -7
- package/dist/contrib/auto-render.js +148 -171
- package/dist/contrib/auto-render.min.js +1 -1
- package/dist/contrib/auto-render.mjs +91 -95
- package/dist/contrib/copy-tex.css +3 -3
- package/dist/contrib/copy-tex.js +11 -108
- package/dist/contrib/copy-tex.min.css +1 -1
- package/dist/contrib/copy-tex.min.js +1 -1
- package/dist/contrib/copy-tex.mjs +21 -20
- package/dist/contrib/mathtex-script-type.js +66 -91
- package/dist/contrib/mathtex-script-type.min.js +1 -1
- package/dist/contrib/mathtex-script-type.mjs +3 -3
- package/dist/contrib/mhchem.js +70 -95
- package/dist/contrib/mhchem.min.js +1 -1
- package/dist/contrib/mhchem.mjs +2 -2
- package/dist/contrib/render-a11y-string.js +97 -92
- package/dist/contrib/render-a11y-string.min.js +1 -1
- package/dist/contrib/render-a11y-string.mjs +86 -45
- package/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/katex.css +66 -10
- package/dist/katex.js +2714 -1950
- package/dist/katex.min.css +1 -1
- package/dist/katex.min.js +1 -1
- package/dist/katex.mjs +3162 -2372
- package/katex.js +4 -3
- package/package.json +69 -59
- package/src/Lexer.js +4 -2
- package/src/MacroExpander.js +117 -37
- package/src/Options.js +2 -2
- package/src/ParseError.js +1 -1
- package/src/Parser.js +100 -159
- package/src/Settings.js +2 -2
- package/src/Style.js +4 -4
- package/src/Token.js +1 -1
- package/src/buildCommon.js +12 -5
- package/src/buildHTML.js +11 -0
- package/src/buildMathML.js +6 -0
- package/src/defineEnvironment.js +0 -3
- package/src/defineFunction.js +15 -22
- package/src/delimiter.js +61 -57
- package/src/domTree.js +1 -1
- package/src/environments/array.js +223 -35
- package/src/environments/cd.js +312 -0
- package/src/fontMetrics.js +1 -1
- package/src/fontMetricsData.js +2076 -0
- package/src/fonts/.gitignore +9 -0
- package/src/fonts/Makefile +139 -0
- package/src/fonts/default.cfg +20 -0
- package/src/fonts/generate_fonts.py +61 -0
- package/src/fonts/lib/Extra.otf +0 -0
- package/src/fonts/lib/Space.ttx +234 -0
- package/src/fonts/makeBlacker +49 -0
- package/src/fonts/makeFF +2003 -0
- package/src/fonts/xbbold.mf +182 -0
- package/src/fonts.less +64 -0
- package/src/functions/accent.js +3 -2
- package/src/functions/arrow.js +8 -2
- package/src/functions/color.js +4 -4
- package/src/functions/cr.js +7 -25
- package/src/functions/def.js +50 -24
- package/src/functions/delimsizing.js +8 -0
- package/src/functions/enclose.js +80 -12
- package/src/functions/environment.js +1 -1
- package/src/functions/font.js +3 -4
- package/src/functions/genfrac.js +36 -11
- package/src/functions/hbox.js +39 -0
- package/src/functions/kern.js +1 -0
- package/src/functions/mathchoice.js +1 -0
- package/src/functions/mclass.js +2 -1
- package/src/functions/op.js +3 -7
- package/src/functions/operatorname.js +1 -1
- package/src/functions/raisebox.js +0 -1
- package/src/functions/styling.js +1 -0
- package/src/functions/supsub.js +1 -3
- package/src/functions/symbolsOrd.js +0 -2
- package/src/functions/text.js +2 -3
- package/src/functions/vcenter.js +44 -0
- package/src/functions.js +3 -0
- package/src/katex.less +69 -16
- package/src/macros.js +42 -6
- package/src/mathMLTree.js +16 -1
- package/src/metrics/.gitignore +1 -0
- package/src/metrics/README.md +23 -0
- package/src/metrics/extract_tfms.py +114 -0
- package/src/metrics/extract_ttfs.py +119 -0
- package/src/metrics/format_json.py +28 -0
- package/src/metrics/mapping.pl +1224 -0
- package/src/metrics/parse_tfm.py +211 -0
- package/src/parseNode.js +29 -1
- package/src/parseTree.js +6 -0
- package/src/stretchy.js +12 -5
- package/src/svgGeometry.js +33 -4
- package/src/symbols.js +5 -3
- package/src/types.js +3 -2
- package/src/unicodeScripts.js +5 -0
|
@@ -15,7 +15,7 @@ import katex from '../katex.mjs';
|
|
|
15
15
|
* The commas in the string aim to increase ease of understanding
|
|
16
16
|
* when read by a screenreader.
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
var stringMap = {
|
|
19
19
|
"(": "left parenthesis",
|
|
20
20
|
")": "right parenthesis",
|
|
21
21
|
"[": "open bracket",
|
|
@@ -88,22 +88,22 @@ const stringMap = {
|
|
|
88
88
|
"\\hat": "hat",
|
|
89
89
|
"\\acute": "acute"
|
|
90
90
|
};
|
|
91
|
-
|
|
91
|
+
var powerMap = {
|
|
92
92
|
"prime": "prime",
|
|
93
93
|
"degree": "degrees",
|
|
94
94
|
"circle": "degrees",
|
|
95
95
|
"2": "squared",
|
|
96
96
|
"3": "cubed"
|
|
97
97
|
};
|
|
98
|
-
|
|
98
|
+
var openMap = {
|
|
99
99
|
"|": "open vertical bar",
|
|
100
100
|
".": ""
|
|
101
101
|
};
|
|
102
|
-
|
|
102
|
+
var closeMap = {
|
|
103
103
|
"|": "close vertical bar",
|
|
104
104
|
".": ""
|
|
105
105
|
};
|
|
106
|
-
|
|
106
|
+
var binMap = {
|
|
107
107
|
"+": "plus",
|
|
108
108
|
"-": "minus",
|
|
109
109
|
"\\pm": "plus minus",
|
|
@@ -115,7 +115,7 @@ const binMap = {
|
|
|
115
115
|
"\\circ": "circle",
|
|
116
116
|
"\\bullet": "bullet"
|
|
117
117
|
};
|
|
118
|
-
|
|
118
|
+
var relMap = {
|
|
119
119
|
"=": "equals",
|
|
120
120
|
"\\approx": "approximately equals",
|
|
121
121
|
"≠": "does not equal",
|
|
@@ -131,7 +131,7 @@ const relMap = {
|
|
|
131
131
|
"\\Rightarrow": "right arrow",
|
|
132
132
|
":": "colon"
|
|
133
133
|
};
|
|
134
|
-
|
|
134
|
+
var accentUnderMap = {
|
|
135
135
|
"\\underleftarrow": "left arrow",
|
|
136
136
|
"\\underrightarrow": "right arrow",
|
|
137
137
|
"\\underleftrightarrow": "left-right arrow",
|
|
@@ -140,12 +140,12 @@ const accentUnderMap = {
|
|
|
140
140
|
"\\utilde": "tilde"
|
|
141
141
|
};
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
var buildString = (str, type, a11yStrings) => {
|
|
144
144
|
if (!str) {
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
var ret;
|
|
149
149
|
|
|
150
150
|
if (type === "open") {
|
|
151
151
|
ret = str in openMap ? openMap[str] : stringMap[str] || str;
|
|
@@ -164,7 +164,8 @@ const buildString = (str, type, a11yStrings) => {
|
|
|
164
164
|
|
|
165
165
|
if (/^\d+$/.test(ret) && a11yStrings.length > 0 && // TODO(kevinb): check that the last item in a11yStrings is a string
|
|
166
166
|
// I think we might be able to drop the nested arrays, which would make
|
|
167
|
-
// this easier to type
|
|
167
|
+
// this easier to type
|
|
168
|
+
// $FlowFixMe
|
|
168
169
|
/^\d+$/.test(a11yStrings[a11yStrings.length - 1])) {
|
|
169
170
|
a11yStrings[a11yStrings.length - 1] += ret;
|
|
170
171
|
} else if (ret) {
|
|
@@ -172,13 +173,13 @@ const buildString = (str, type, a11yStrings) => {
|
|
|
172
173
|
}
|
|
173
174
|
};
|
|
174
175
|
|
|
175
|
-
|
|
176
|
-
|
|
176
|
+
var buildRegion = (a11yStrings, callback) => {
|
|
177
|
+
var regionStrings = [];
|
|
177
178
|
a11yStrings.push(regionStrings);
|
|
178
179
|
callback(regionStrings);
|
|
179
180
|
};
|
|
180
181
|
|
|
181
|
-
|
|
182
|
+
var handleObject = (tree, a11yStrings, atomType) => {
|
|
182
183
|
// Everything else is assumed to be an object...
|
|
183
184
|
switch (tree.type) {
|
|
184
185
|
case "accent":
|
|
@@ -211,7 +212,9 @@ const handleObject = (tree, a11yStrings, atomType) => {
|
|
|
211
212
|
|
|
212
213
|
case "atom":
|
|
213
214
|
{
|
|
214
|
-
|
|
215
|
+
var {
|
|
216
|
+
text
|
|
217
|
+
} = tree;
|
|
215
218
|
|
|
216
219
|
switch (tree.family) {
|
|
217
220
|
case "bin":
|
|
@@ -254,7 +257,7 @@ const handleObject = (tree, a11yStrings, atomType) => {
|
|
|
254
257
|
default:
|
|
255
258
|
{
|
|
256
259
|
tree.family;
|
|
257
|
-
throw new Error(
|
|
260
|
+
throw new Error("\"" + tree.family + "\" is not a valid atom type");
|
|
258
261
|
}
|
|
259
262
|
}
|
|
260
263
|
|
|
@@ -263,7 +266,7 @@ const handleObject = (tree, a11yStrings, atomType) => {
|
|
|
263
266
|
|
|
264
267
|
case "color":
|
|
265
268
|
{
|
|
266
|
-
|
|
269
|
+
var color = tree.color.replace(/katex-/, "");
|
|
267
270
|
buildRegion(a11yStrings, regionStrings => {
|
|
268
271
|
regionStrings.push("start color " + color);
|
|
269
272
|
buildA11yStrings(tree.body, regionStrings, atomType);
|
|
@@ -292,8 +295,10 @@ const handleObject = (tree, a11yStrings, atomType) => {
|
|
|
292
295
|
{
|
|
293
296
|
buildRegion(a11yStrings, regionStrings => {
|
|
294
297
|
// genfrac can have unbalanced delimiters
|
|
295
|
-
|
|
296
|
-
|
|
298
|
+
var {
|
|
299
|
+
leftDelim,
|
|
300
|
+
rightDelim
|
|
301
|
+
} = tree; // NOTE: Not sure if this is a safe assumption
|
|
297
302
|
// hasBarLine true -> fraction, false -> binomial
|
|
298
303
|
|
|
299
304
|
if (tree.hasBarLine) {
|
|
@@ -317,6 +322,12 @@ const handleObject = (tree, a11yStrings, atomType) => {
|
|
|
317
322
|
break;
|
|
318
323
|
}
|
|
319
324
|
|
|
325
|
+
case "hbox":
|
|
326
|
+
{
|
|
327
|
+
buildA11yStrings(tree.body, a11yStrings, atomType);
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
|
|
320
331
|
case "kern":
|
|
321
332
|
{
|
|
322
333
|
// No op: we don't attempt to present kerning information
|
|
@@ -354,8 +365,10 @@ const handleObject = (tree, a11yStrings, atomType) => {
|
|
|
354
365
|
|
|
355
366
|
case "op":
|
|
356
367
|
{
|
|
357
|
-
|
|
358
|
-
|
|
368
|
+
var {
|
|
369
|
+
body,
|
|
370
|
+
name
|
|
371
|
+
} = tree;
|
|
359
372
|
|
|
360
373
|
if (body) {
|
|
361
374
|
buildA11yStrings(body, a11yStrings, atomType);
|
|
@@ -429,11 +442,13 @@ const handleObject = (tree, a11yStrings, atomType) => {
|
|
|
429
442
|
case "sqrt":
|
|
430
443
|
{
|
|
431
444
|
buildRegion(a11yStrings, regionStrings => {
|
|
432
|
-
|
|
433
|
-
|
|
445
|
+
var {
|
|
446
|
+
body,
|
|
447
|
+
index
|
|
448
|
+
} = tree;
|
|
434
449
|
|
|
435
450
|
if (index) {
|
|
436
|
-
|
|
451
|
+
var indexString = flatten(buildA11yStrings(index, [], atomType)).join(",");
|
|
437
452
|
|
|
438
453
|
if (indexString === "3") {
|
|
439
454
|
regionStrings.push("cube root of");
|
|
@@ -458,10 +473,12 @@ const handleObject = (tree, a11yStrings, atomType) => {
|
|
|
458
473
|
|
|
459
474
|
case "supsub":
|
|
460
475
|
{
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
476
|
+
var {
|
|
477
|
+
base,
|
|
478
|
+
sub,
|
|
479
|
+
sup
|
|
480
|
+
} = tree;
|
|
481
|
+
var isLog = false;
|
|
465
482
|
|
|
466
483
|
if (base) {
|
|
467
484
|
buildA11yStrings(base, a11yStrings, atomType);
|
|
@@ -469,17 +486,17 @@ const handleObject = (tree, a11yStrings, atomType) => {
|
|
|
469
486
|
}
|
|
470
487
|
|
|
471
488
|
if (sub) {
|
|
472
|
-
|
|
489
|
+
var regionName = isLog ? "base" : "subscript";
|
|
473
490
|
buildRegion(a11yStrings, function (regionStrings) {
|
|
474
|
-
regionStrings.push(
|
|
491
|
+
regionStrings.push("start " + regionName);
|
|
475
492
|
buildA11yStrings(sub, regionStrings, atomType);
|
|
476
|
-
regionStrings.push(
|
|
493
|
+
regionStrings.push("end " + regionName);
|
|
477
494
|
});
|
|
478
495
|
}
|
|
479
496
|
|
|
480
497
|
if (sup) {
|
|
481
498
|
buildRegion(a11yStrings, function (regionStrings) {
|
|
482
|
-
|
|
499
|
+
var supString = flatten(buildA11yStrings(sup, [], atomType)).join(",");
|
|
483
500
|
|
|
484
501
|
if (supString in powerMap) {
|
|
485
502
|
regionStrings.push(powerMap[supString]);
|
|
@@ -553,9 +570,22 @@ const handleObject = (tree, a11yStrings, atomType) => {
|
|
|
553
570
|
regionStrings.push("end strikeout");
|
|
554
571
|
});
|
|
555
572
|
break;
|
|
573
|
+
} else if (/phase/.test(tree.label)) {
|
|
574
|
+
buildRegion(a11yStrings, function (regionStrings) {
|
|
575
|
+
regionStrings.push("start phase angle");
|
|
576
|
+
buildA11yStrings(tree.body, regionStrings, atomType);
|
|
577
|
+
regionStrings.push("end phase angle");
|
|
578
|
+
});
|
|
579
|
+
break;
|
|
556
580
|
}
|
|
557
581
|
|
|
558
|
-
throw new Error(
|
|
582
|
+
throw new Error("KaTeX-a11y: enclose node with " + tree.label + " not supported yet");
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
case "vcenter":
|
|
586
|
+
{
|
|
587
|
+
buildA11yStrings(tree.body, a11yStrings, atomType);
|
|
588
|
+
break;
|
|
559
589
|
}
|
|
560
590
|
|
|
561
591
|
case "vphantom":
|
|
@@ -603,9 +633,9 @@ const handleObject = (tree, a11yStrings, atomType) => {
|
|
|
603
633
|
|
|
604
634
|
case "verb":
|
|
605
635
|
{
|
|
606
|
-
buildString(
|
|
636
|
+
buildString("start verbatim", "normal", a11yStrings);
|
|
607
637
|
buildString(tree.body, "normal", a11yStrings);
|
|
608
|
-
buildString(
|
|
638
|
+
buildString("end verbatim", "normal", a11yStrings);
|
|
609
639
|
break;
|
|
610
640
|
}
|
|
611
641
|
|
|
@@ -616,9 +646,9 @@ const handleObject = (tree, a11yStrings, atomType) => {
|
|
|
616
646
|
|
|
617
647
|
case "horizBrace":
|
|
618
648
|
{
|
|
619
|
-
buildString(
|
|
649
|
+
buildString("start " + tree.label.slice(1), "normal", a11yStrings);
|
|
620
650
|
buildA11yStrings(tree.base, a11yStrings, atomType);
|
|
621
|
-
buildString(
|
|
651
|
+
buildString("end " + tree.label.slice(1), "normal", a11yStrings);
|
|
622
652
|
break;
|
|
623
653
|
}
|
|
624
654
|
|
|
@@ -667,13 +697,24 @@ const handleObject = (tree, a11yStrings, atomType) => {
|
|
|
667
697
|
throw new Error("KaTeX-a11y: xArrow not implemented yet");
|
|
668
698
|
}
|
|
669
699
|
|
|
700
|
+
case "cdlabel":
|
|
701
|
+
{
|
|
702
|
+
throw new Error("KaTeX-a11y: cdlabel not implemented yet");
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
case "cdlabelparent":
|
|
706
|
+
{
|
|
707
|
+
throw new Error("KaTeX-a11y: cdlabelparent not implemented yet");
|
|
708
|
+
}
|
|
709
|
+
|
|
670
710
|
case "mclass":
|
|
671
711
|
{
|
|
672
712
|
// \neq and \ne are macros so we let "htmlmathml" render the mathmal
|
|
673
713
|
// side of things and extract the text from that.
|
|
674
|
-
|
|
714
|
+
var _atomType = tree.mclass.slice(1); // $FlowFixMe: drop the leading "m" from the values in mclass
|
|
675
715
|
|
|
676
|
-
|
|
716
|
+
|
|
717
|
+
buildA11yStrings(tree.body, a11yStrings, _atomType);
|
|
677
718
|
break;
|
|
678
719
|
}
|
|
679
720
|
|
|
@@ -715,13 +756,13 @@ const handleObject = (tree, a11yStrings, atomType) => {
|
|
|
715
756
|
}
|
|
716
757
|
};
|
|
717
758
|
|
|
718
|
-
|
|
759
|
+
var buildA11yStrings = function buildA11yStrings(tree, a11yStrings, atomType) {
|
|
719
760
|
if (a11yStrings === void 0) {
|
|
720
761
|
a11yStrings = [];
|
|
721
762
|
}
|
|
722
763
|
|
|
723
764
|
if (tree instanceof Array) {
|
|
724
|
-
for (
|
|
765
|
+
for (var i = 0; i < tree.length; i++) {
|
|
725
766
|
buildA11yStrings(tree[i], a11yStrings, atomType);
|
|
726
767
|
}
|
|
727
768
|
} else {
|
|
@@ -731,8 +772,8 @@ const buildA11yStrings = function buildA11yStrings(tree, a11yStrings, atomType)
|
|
|
731
772
|
return a11yStrings;
|
|
732
773
|
};
|
|
733
774
|
|
|
734
|
-
|
|
735
|
-
|
|
775
|
+
var flatten = function flatten(array) {
|
|
776
|
+
var result = [];
|
|
736
777
|
array.forEach(function (item) {
|
|
737
778
|
if (item instanceof Array) {
|
|
738
779
|
result = result.concat(flatten(item));
|
|
@@ -743,10 +784,10 @@ const flatten = function flatten(array) {
|
|
|
743
784
|
return result;
|
|
744
785
|
};
|
|
745
786
|
|
|
746
|
-
|
|
747
|
-
|
|
787
|
+
var renderA11yString = function renderA11yString(text, settings) {
|
|
788
|
+
var tree = katex.__parse(text, settings);
|
|
748
789
|
|
|
749
|
-
|
|
790
|
+
var a11yStrings = buildA11yStrings(tree, [], "normal");
|
|
750
791
|
return flatten(a11yStrings).join(", ");
|
|
751
792
|
};
|
|
752
793
|
|
|
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
|
package/dist/katex.css
CHANGED
|
@@ -124,15 +124,17 @@
|
|
|
124
124
|
line-height: 1.2;
|
|
125
125
|
text-indent: 0;
|
|
126
126
|
text-rendering: auto;
|
|
127
|
-
border-color: currentColor;
|
|
128
127
|
}
|
|
129
128
|
.katex * {
|
|
130
129
|
-ms-high-contrast-adjust: none !important;
|
|
130
|
+
border-color: currentColor;
|
|
131
131
|
}
|
|
132
132
|
.katex .katex-version::after {
|
|
133
|
-
content: "0.
|
|
133
|
+
content: "0.13.3";
|
|
134
134
|
}
|
|
135
135
|
.katex .katex-mathml {
|
|
136
|
+
/* Accessibility hack to only show to screen readers
|
|
137
|
+
Found at: http://a11yproject.com/posts/how-to-hide-content/ */
|
|
136
138
|
position: absolute;
|
|
137
139
|
clip: rect(1px, 1px, 1px, 1px);
|
|
138
140
|
padding: 0;
|
|
@@ -151,6 +153,8 @@
|
|
|
151
153
|
position: relative;
|
|
152
154
|
display: inline-block;
|
|
153
155
|
white-space: nowrap;
|
|
156
|
+
width: -webkit-min-content;
|
|
157
|
+
width: -moz-min-content;
|
|
154
158
|
width: min-content;
|
|
155
159
|
}
|
|
156
160
|
.katex .strut {
|
|
@@ -266,22 +270,28 @@
|
|
|
266
270
|
min-width: 2px;
|
|
267
271
|
}
|
|
268
272
|
.katex .vbox {
|
|
269
|
-
display: -
|
|
273
|
+
display: -webkit-inline-box;
|
|
270
274
|
display: inline-flex;
|
|
271
|
-
-
|
|
272
|
-
|
|
273
|
-
|
|
275
|
+
-webkit-box-orient: vertical;
|
|
276
|
+
-webkit-box-direction: normal;
|
|
277
|
+
flex-direction: column;
|
|
278
|
+
-webkit-box-align: baseline;
|
|
279
|
+
align-items: baseline;
|
|
274
280
|
}
|
|
275
281
|
.katex .hbox {
|
|
276
|
-
display: -
|
|
282
|
+
display: -webkit-inline-box;
|
|
277
283
|
display: inline-flex;
|
|
278
|
-
-
|
|
279
|
-
|
|
284
|
+
-webkit-box-orient: horizontal;
|
|
285
|
+
-webkit-box-direction: normal;
|
|
286
|
+
flex-direction: row;
|
|
280
287
|
width: 100%;
|
|
281
288
|
}
|
|
282
289
|
.katex .thinbox {
|
|
290
|
+
display: -webkit-inline-box;
|
|
283
291
|
display: inline-flex;
|
|
284
|
-
|
|
292
|
+
-webkit-box-orient: horizontal;
|
|
293
|
+
-webkit-box-direction: normal;
|
|
294
|
+
flex-direction: row;
|
|
285
295
|
width: 0;
|
|
286
296
|
max-width: 0;
|
|
287
297
|
}
|
|
@@ -352,6 +362,8 @@
|
|
|
352
362
|
border-bottom-style: dashed;
|
|
353
363
|
}
|
|
354
364
|
.katex .sqrt > .root {
|
|
365
|
+
/* These values are taken from the definition of `\r@@t`,
|
|
366
|
+
`\mkern 5mu` and `\mkern -10mu`. */
|
|
355
367
|
margin-left: 0.27777778em;
|
|
356
368
|
margin-right: -0.55555556em;
|
|
357
369
|
}
|
|
@@ -982,6 +994,9 @@
|
|
|
982
994
|
.katex .x-arrow-pad {
|
|
983
995
|
padding: 0 0.5em;
|
|
984
996
|
}
|
|
997
|
+
.katex .cd-arrow-pad {
|
|
998
|
+
padding: 0 0.55556em 0 0.27778em;
|
|
999
|
+
}
|
|
985
1000
|
.katex .x-arrow,
|
|
986
1001
|
.katex .mover,
|
|
987
1002
|
.katex .munder {
|
|
@@ -1006,6 +1021,44 @@
|
|
|
1006
1021
|
border-bottom-style: solid;
|
|
1007
1022
|
border-bottom-width: 0.08em;
|
|
1008
1023
|
}
|
|
1024
|
+
.katex .angl {
|
|
1025
|
+
box-sizing: border-content;
|
|
1026
|
+
border-top: 0.049em solid;
|
|
1027
|
+
border-right: 0.049em solid;
|
|
1028
|
+
margin-right: 0.03889em;
|
|
1029
|
+
}
|
|
1030
|
+
.katex .anglpad {
|
|
1031
|
+
padding: 0 0.03889em 0 0.03889em;
|
|
1032
|
+
}
|
|
1033
|
+
.katex .eqn-num::before {
|
|
1034
|
+
counter-increment: katexEqnNo;
|
|
1035
|
+
content: "(" counter(katexEqnNo) ")";
|
|
1036
|
+
}
|
|
1037
|
+
.katex .mml-eqn-num::before {
|
|
1038
|
+
counter-increment: mmlEqnNo;
|
|
1039
|
+
content: "(" counter(mmlEqnNo) ")";
|
|
1040
|
+
}
|
|
1041
|
+
.katex .mtr-glue {
|
|
1042
|
+
width: 50%;
|
|
1043
|
+
}
|
|
1044
|
+
.katex .cd-vert-arrow {
|
|
1045
|
+
display: inline-block;
|
|
1046
|
+
position: relative;
|
|
1047
|
+
}
|
|
1048
|
+
.katex .cd-label-left {
|
|
1049
|
+
display: inline-block;
|
|
1050
|
+
position: absolute;
|
|
1051
|
+
right: -webkit-calc(50% + 0.3em);
|
|
1052
|
+
right: calc(50% + 0.3em);
|
|
1053
|
+
text-align: left;
|
|
1054
|
+
}
|
|
1055
|
+
.katex .cd-label-right {
|
|
1056
|
+
display: inline-block;
|
|
1057
|
+
position: absolute;
|
|
1058
|
+
left: -webkit-calc(50% + 0.3em);
|
|
1059
|
+
left: calc(50% + 0.3em);
|
|
1060
|
+
text-align: right;
|
|
1061
|
+
}
|
|
1009
1062
|
.katex-display {
|
|
1010
1063
|
display: block;
|
|
1011
1064
|
margin: 1em 0;
|
|
@@ -1032,4 +1085,7 @@
|
|
|
1032
1085
|
text-align: left;
|
|
1033
1086
|
padding-left: 2em;
|
|
1034
1087
|
}
|
|
1088
|
+
body {
|
|
1089
|
+
counter-reset: katexEqnNo mmlEqnNo;
|
|
1090
|
+
}
|
|
1035
1091
|
|