· 6 years ago · Aug 12, 2019, 11:48 PM
1(function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory();
4 else if(typeof define === 'function' && define.amd)
5 define([], factory);
6 else if(typeof exports === 'object')
7 exports["katex"] = factory();
8 else
9 root["katex"] = factory();
10})(typeof self !== 'undefined' ? self : this, function() {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14/******/
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17/******/
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId]) {
20/******/ return installedModules[moduleId].exports;
21/******/ }
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ i: moduleId,
25/******/ l: false,
26/******/ exports: {}
27/******/ };
28/******/
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31/******/
32/******/ // Flag the module as loaded
33/******/ module.l = true;
34/******/
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38/******/
39/******/
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42/******/
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45/******/
46/******/ // define getter function for harmony exports
47/******/ __webpack_require__.d = function(exports, name, getter) {
48/******/ if(!__webpack_require__.o(exports, name)) {
49/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
50/******/ }
51/******/ };
52/******/
53/******/ // define __esModule on exports
54/******/ __webpack_require__.r = function(exports) {
55/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57/******/ }
58/******/ Object.defineProperty(exports, '__esModule', { value: true });
59/******/ };
60/******/
61/******/ // create a fake namespace object
62/******/ // mode & 1: value is a module id, require it
63/******/ // mode & 2: merge all properties of value into the ns
64/******/ // mode & 4: return value when already ns object
65/******/ // mode & 8|1: behave like require
66/******/ __webpack_require__.t = function(value, mode) {
67/******/ if(mode & 1) value = __webpack_require__(value);
68/******/ if(mode & 8) return value;
69/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70/******/ var ns = Object.create(null);
71/******/ __webpack_require__.r(ns);
72/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74/******/ return ns;
75/******/ };
76/******/
77/******/ // getDefaultExport function for compatibility with non-harmony modules
78/******/ __webpack_require__.n = function(module) {
79/******/ var getter = module && module.__esModule ?
80/******/ function getDefault() { return module['default']; } :
81/******/ function getModuleExports() { return module; };
82/******/ __webpack_require__.d(getter, 'a', getter);
83/******/ return getter;
84/******/ };
85/******/
86/******/ // Object.prototype.hasOwnProperty.call
87/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
88/******/
89/******/ // __webpack_public_path__
90/******/ __webpack_require__.p = "";
91/******/
92/******/
93/******/ // Load entry module and return exports
94/******/ return __webpack_require__(__webpack_require__.s = 66);
95/******/ })
96/************************************************************************/
97/******/ ([
98/* 0 */
99/***/ (function(module, exports, __webpack_require__) {
100
101"use strict";
102
103
104exports.__esModule = true;
105
106exports.default = function (instance, Constructor) {
107 if (!(instance instanceof Constructor)) {
108 throw new TypeError("Cannot call a class as a function");
109 }
110};
111
112/***/ }),
113/* 1 */
114/***/ (function(module, exports, __webpack_require__) {
115
116"use strict";
117
118
119exports.__esModule = true;
120
121var _defineProperty = __webpack_require__(120);
122
123var _defineProperty2 = _interopRequireDefault(_defineProperty);
124
125function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
126
127exports.default = function () {
128 function defineProperties(target, props) {
129 for (var i = 0; i < props.length; i++) {
130 var descriptor = props[i];
131 descriptor.enumerable = descriptor.enumerable || false;
132 descriptor.configurable = true;
133 if ("value" in descriptor) descriptor.writable = true;
134 (0, _defineProperty2.default)(target, descriptor.key, descriptor);
135 }
136 }
137
138 return function (Constructor, protoProps, staticProps) {
139 if (protoProps) defineProperties(Constructor.prototype, protoProps);
140 if (staticProps) defineProperties(Constructor, staticProps);
141 return Constructor;
142 };
143}();
144
145/***/ }),
146/* 2 */
147/***/ (function(module, exports) {
148
149var core = module.exports = { version: '2.5.7' };
150if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
151
152
153/***/ }),
154/* 3 */
155/***/ (function(module, exports, __webpack_require__) {
156
157module.exports = { "default": __webpack_require__(100), __esModule: true };
158
159/***/ }),
160/* 4 */
161/***/ (function(module, exports, __webpack_require__) {
162
163"use strict";
164
165
166exports.__esModule = true;
167
168var _from = __webpack_require__(113);
169
170var _from2 = _interopRequireDefault(_from);
171
172function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
173
174exports.default = function (arr) {
175 if (Array.isArray(arr)) {
176 for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
177 arr2[i] = arr[i];
178 }
179
180 return arr2;
181 } else {
182 return (0, _from2.default)(arr);
183 }
184};
185
186/***/ }),
187/* 5 */
188/***/ (function(module, exports, __webpack_require__) {
189
190var store = __webpack_require__(32)('wks');
191var uid = __webpack_require__(25);
192var Symbol = __webpack_require__(7).Symbol;
193var USE_SYMBOL = typeof Symbol == 'function';
194
195var $exports = module.exports = function (name) {
196 return store[name] || (store[name] =
197 USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
198};
199
200$exports.store = store;
201
202
203/***/ }),
204/* 6 */
205/***/ (function(module, exports, __webpack_require__) {
206
207var anObject = __webpack_require__(12);
208var IE8_DOM_DEFINE = __webpack_require__(59);
209var toPrimitive = __webpack_require__(38);
210var dP = Object.defineProperty;
211
212exports.f = __webpack_require__(10) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
213 anObject(O);
214 P = toPrimitive(P, true);
215 anObject(Attributes);
216 if (IE8_DOM_DEFINE) try {
217 return dP(O, P, Attributes);
218 } catch (e) { /* empty */ }
219 if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
220 if ('value' in Attributes) O[P] = Attributes.value;
221 return O;
222};
223
224
225/***/ }),
226/* 7 */
227/***/ (function(module, exports) {
228
229// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
230var global = module.exports = typeof window != 'undefined' && window.Math == Math
231 ? window : typeof self != 'undefined' && self.Math == Math ? self
232 // eslint-disable-next-line no-new-func
233 : Function('return this')();
234if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
235
236
237/***/ }),
238/* 8 */
239/***/ (function(module, exports, __webpack_require__) {
240
241var global = __webpack_require__(7);
242var core = __webpack_require__(2);
243var ctx = __webpack_require__(39);
244var hide = __webpack_require__(16);
245var has = __webpack_require__(9);
246var PROTOTYPE = 'prototype';
247
248var $export = function (type, name, source) {
249 var IS_FORCED = type & $export.F;
250 var IS_GLOBAL = type & $export.G;
251 var IS_STATIC = type & $export.S;
252 var IS_PROTO = type & $export.P;
253 var IS_BIND = type & $export.B;
254 var IS_WRAP = type & $export.W;
255 var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
256 var expProto = exports[PROTOTYPE];
257 var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
258 var key, own, out;
259 if (IS_GLOBAL) source = name;
260 for (key in source) {
261 // contains in native
262 own = !IS_FORCED && target && target[key] !== undefined;
263 if (own && has(exports, key)) continue;
264 // export native or passed
265 out = own ? target[key] : source[key];
266 // prevent global pollution for namespaces
267 exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
268 // bind timers to global for call from export context
269 : IS_BIND && own ? ctx(out, global)
270 // wrap global constructors for prevent change them in library
271 : IS_WRAP && target[key] == out ? (function (C) {
272 var F = function (a, b, c) {
273 if (this instanceof C) {
274 switch (arguments.length) {
275 case 0: return new C();
276 case 1: return new C(a);
277 case 2: return new C(a, b);
278 } return new C(a, b, c);
279 } return C.apply(this, arguments);
280 };
281 F[PROTOTYPE] = C[PROTOTYPE];
282 return F;
283 // make static versions for prototype methods
284 })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
285 // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
286 if (IS_PROTO) {
287 (exports.virtual || (exports.virtual = {}))[key] = out;
288 // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
289 if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
290 }
291 }
292};
293// type bitmap
294$export.F = 1; // forced
295$export.G = 2; // global
296$export.S = 4; // static
297$export.P = 8; // proto
298$export.B = 16; // bind
299$export.W = 32; // wrap
300$export.U = 64; // safe
301$export.R = 128; // real proto method for `library`
302module.exports = $export;
303
304
305/***/ }),
306/* 9 */
307/***/ (function(module, exports) {
308
309var hasOwnProperty = {}.hasOwnProperty;
310module.exports = function (it, key) {
311 return hasOwnProperty.call(it, key);
312};
313
314
315/***/ }),
316/* 10 */
317/***/ (function(module, exports, __webpack_require__) {
318
319// Thank's IE8 for his funny defineProperty
320module.exports = !__webpack_require__(15)(function () {
321 return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
322});
323
324
325/***/ }),
326/* 11 */
327/***/ (function(module, exports) {
328
329module.exports = function (it) {
330 return typeof it === 'object' ? it !== null : typeof it === 'function';
331};
332
333
334/***/ }),
335/* 12 */
336/***/ (function(module, exports, __webpack_require__) {
337
338var isObject = __webpack_require__(11);
339module.exports = function (it) {
340 if (!isObject(it)) throw TypeError(it + ' is not an object!');
341 return it;
342};
343
344
345/***/ }),
346/* 13 */
347/***/ (function(module, exports, __webpack_require__) {
348
349// to indexed object, toObject with fallback for non-array-like ES3 strings
350var IObject = __webpack_require__(53);
351var defined = __webpack_require__(36);
352module.exports = function (it) {
353 return IObject(defined(it));
354};
355
356
357/***/ }),
358/* 14 */
359/***/ (function(module, exports) {
360
361module.exports = {};
362
363
364/***/ }),
365/* 15 */
366/***/ (function(module, exports) {
367
368module.exports = function (exec) {
369 try {
370 return !!exec();
371 } catch (e) {
372 return true;
373 }
374};
375
376
377/***/ }),
378/* 16 */
379/***/ (function(module, exports, __webpack_require__) {
380
381var dP = __webpack_require__(6);
382var createDesc = __webpack_require__(19);
383module.exports = __webpack_require__(10) ? function (object, key, value) {
384 return dP.f(object, key, createDesc(1, value));
385} : function (object, key, value) {
386 object[key] = value;
387 return object;
388};
389
390
391/***/ }),
392/* 17 */
393/***/ (function(module, exports, __webpack_require__) {
394
395// 7.1.13 ToObject(argument)
396var defined = __webpack_require__(36);
397module.exports = function (it) {
398 return Object(defined(it));
399};
400
401
402/***/ }),
403/* 18 */
404/***/ (function(module, exports, __webpack_require__) {
405
406// 19.1.2.14 / 15.2.3.14 Object.keys(O)
407var $keys = __webpack_require__(54);
408var enumBugKeys = __webpack_require__(31);
409
410module.exports = Object.keys || function keys(O) {
411 return $keys(O, enumBugKeys);
412};
413
414
415/***/ }),
416/* 19 */
417/***/ (function(module, exports) {
418
419module.exports = function (bitmap, value) {
420 return {
421 enumerable: !(bitmap & 1),
422 configurable: !(bitmap & 2),
423 writable: !(bitmap & 4),
424 value: value
425 };
426};
427
428
429/***/ }),
430/* 20 */
431/***/ (function(module, exports, __webpack_require__) {
432
433"use strict";
434
435
436exports.__esModule = true;
437
438var _isIterable2 = __webpack_require__(95);
439
440var _isIterable3 = _interopRequireDefault(_isIterable2);
441
442var _getIterator2 = __webpack_require__(3);
443
444var _getIterator3 = _interopRequireDefault(_getIterator2);
445
446function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
447
448exports.default = function () {
449 function sliceIterator(arr, i) {
450 var _arr = [];
451 var _n = true;
452 var _d = false;
453 var _e = undefined;
454
455 try {
456 for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) {
457 _arr.push(_s.value);
458
459 if (i && _arr.length === i) break;
460 }
461 } catch (err) {
462 _d = true;
463 _e = err;
464 } finally {
465 try {
466 if (!_n && _i["return"]) _i["return"]();
467 } finally {
468 if (_d) throw _e;
469 }
470 }
471
472 return _arr;
473 }
474
475 return function (arr, i) {
476 if (Array.isArray(arr)) {
477 return arr;
478 } else if ((0, _isIterable3.default)(Object(arr))) {
479 return sliceIterator(arr, i);
480 } else {
481 throw new TypeError("Invalid attempt to destructure non-iterable instance");
482 }
483 };
484}();
485
486/***/ }),
487/* 21 */
488/***/ (function(module, exports) {
489
490exports.f = {}.propertyIsEnumerable;
491
492
493/***/ }),
494/* 22 */
495/***/ (function(module, exports) {
496
497module.exports = true;
498
499
500/***/ }),
501/* 23 */
502/***/ (function(module, exports, __webpack_require__) {
503
504"use strict";
505
506var $at = __webpack_require__(111)(true);
507
508// 21.1.3.27 String.prototype[@@iterator]()
509__webpack_require__(56)(String, 'String', function (iterated) {
510 this._t = String(iterated); // target
511 this._i = 0; // next index
512// 21.1.5.2.1 %StringIteratorPrototype%.next()
513}, function () {
514 var O = this._t;
515 var index = this._i;
516 var point;
517 if (index >= O.length) return { value: undefined, done: true };
518 point = $at(O, index);
519 this._i += point.length;
520 return { value: point, done: false };
521});
522
523
524/***/ }),
525/* 24 */
526/***/ (function(module, exports, __webpack_require__) {
527
528// most Object methods by ES6 should accept primitives
529var $export = __webpack_require__(8);
530var core = __webpack_require__(2);
531var fails = __webpack_require__(15);
532module.exports = function (KEY, exec) {
533 var fn = (core.Object || {})[KEY] || Object[KEY];
534 var exp = {};
535 exp[KEY] = exec(fn);
536 $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
537};
538
539
540/***/ }),
541/* 25 */
542/***/ (function(module, exports) {
543
544var id = 0;
545var px = Math.random();
546module.exports = function (key) {
547 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
548};
549
550
551/***/ }),
552/* 26 */
553/***/ (function(module, exports) {
554
555exports.f = Object.getOwnPropertySymbols;
556
557
558/***/ }),
559/* 27 */
560/***/ (function(module, exports, __webpack_require__) {
561
562var global = __webpack_require__(7);
563var core = __webpack_require__(2);
564var LIBRARY = __webpack_require__(22);
565var wksExt = __webpack_require__(28);
566var defineProperty = __webpack_require__(6).f;
567module.exports = function (name) {
568 var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
569 if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
570};
571
572
573/***/ }),
574/* 28 */
575/***/ (function(module, exports, __webpack_require__) {
576
577exports.f = __webpack_require__(5);
578
579
580/***/ }),
581/* 29 */
582/***/ (function(module, exports, __webpack_require__) {
583
584__webpack_require__(99);
585var global = __webpack_require__(7);
586var hide = __webpack_require__(16);
587var Iterators = __webpack_require__(14);
588var TO_STRING_TAG = __webpack_require__(5)('toStringTag');
589
590var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
591 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
592 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
593 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
594 'TextTrackList,TouchList').split(',');
595
596for (var i = 0; i < DOMIterables.length; i++) {
597 var NAME = DOMIterables[i];
598 var Collection = global[NAME];
599 var proto = Collection && Collection.prototype;
600 if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
601 Iterators[NAME] = Iterators.Array;
602}
603
604
605/***/ }),
606/* 30 */
607/***/ (function(module, exports, __webpack_require__) {
608
609var def = __webpack_require__(6).f;
610var has = __webpack_require__(9);
611var TAG = __webpack_require__(5)('toStringTag');
612
613module.exports = function (it, tag, stat) {
614 if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
615};
616
617
618/***/ }),
619/* 31 */
620/***/ (function(module, exports) {
621
622// IE 8- don't enum bug keys
623module.exports = (
624 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
625).split(',');
626
627
628/***/ }),
629/* 32 */
630/***/ (function(module, exports, __webpack_require__) {
631
632var core = __webpack_require__(2);
633var global = __webpack_require__(7);
634var SHARED = '__core-js_shared__';
635var store = global[SHARED] || (global[SHARED] = {});
636
637(module.exports = function (key, value) {
638 return store[key] || (store[key] = value !== undefined ? value : {});
639})('versions', []).push({
640 version: core.version,
641 mode: __webpack_require__(22) ? 'pure' : 'global',
642 copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
643});
644
645
646/***/ }),
647/* 33 */
648/***/ (function(module, exports, __webpack_require__) {
649
650var shared = __webpack_require__(32)('keys');
651var uid = __webpack_require__(25);
652module.exports = function (key) {
653 return shared[key] || (shared[key] = uid(key));
654};
655
656
657/***/ }),
658/* 34 */
659/***/ (function(module, exports) {
660
661var toString = {}.toString;
662
663module.exports = function (it) {
664 return toString.call(it).slice(8, -1);
665};
666
667
668/***/ }),
669/* 35 */
670/***/ (function(module, exports, __webpack_require__) {
671
672// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
673var anObject = __webpack_require__(12);
674var dPs = __webpack_require__(109);
675var enumBugKeys = __webpack_require__(31);
676var IE_PROTO = __webpack_require__(33)('IE_PROTO');
677var Empty = function () { /* empty */ };
678var PROTOTYPE = 'prototype';
679
680// Create object with fake `null` prototype: use iframe Object with cleared prototype
681var createDict = function () {
682 // Thrash, waste and sodomy: IE GC bug
683 var iframe = __webpack_require__(58)('iframe');
684 var i = enumBugKeys.length;
685 var lt = '<';
686 var gt = '>';
687 var iframeDocument;
688 iframe.style.display = 'none';
689 __webpack_require__(106).appendChild(iframe);
690 iframe.src = 'javascript:'; // eslint-disable-line no-script-url
691 // createDict = iframe.contentWindow.Object;
692 // html.removeChild(iframe);
693 iframeDocument = iframe.contentWindow.document;
694 iframeDocument.open();
695 iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
696 iframeDocument.close();
697 createDict = iframeDocument.F;
698 while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
699 return createDict();
700};
701
702module.exports = Object.create || function create(O, Properties) {
703 var result;
704 if (O !== null) {
705 Empty[PROTOTYPE] = anObject(O);
706 result = new Empty();
707 Empty[PROTOTYPE] = null;
708 // add "__proto__" for Object.getPrototypeOf polyfill
709 result[IE_PROTO] = O;
710 } else result = createDict();
711 return Properties === undefined ? result : dPs(result, Properties);
712};
713
714
715/***/ }),
716/* 36 */
717/***/ (function(module, exports) {
718
719// 7.2.1 RequireObjectCoercible(argument)
720module.exports = function (it) {
721 if (it == undefined) throw TypeError("Can't call method on " + it);
722 return it;
723};
724
725
726/***/ }),
727/* 37 */
728/***/ (function(module, exports) {
729
730// 7.1.4 ToInteger
731var ceil = Math.ceil;
732var floor = Math.floor;
733module.exports = function (it) {
734 return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
735};
736
737
738/***/ }),
739/* 38 */
740/***/ (function(module, exports, __webpack_require__) {
741
742// 7.1.1 ToPrimitive(input [, PreferredType])
743var isObject = __webpack_require__(11);
744// instead of the ES6 spec version, we didn't implement @@toPrimitive case
745// and the second argument - flag - preferred type is a string
746module.exports = function (it, S) {
747 if (!isObject(it)) return it;
748 var fn, val;
749 if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
750 if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
751 if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
752 throw TypeError("Can't convert object to primitive value");
753};
754
755
756/***/ }),
757/* 39 */
758/***/ (function(module, exports, __webpack_require__) {
759
760// optional / simple context binding
761var aFunction = __webpack_require__(117);
762module.exports = function (fn, that, length) {
763 aFunction(fn);
764 if (that === undefined) return fn;
765 switch (length) {
766 case 1: return function (a) {
767 return fn.call(that, a);
768 };
769 case 2: return function (a, b) {
770 return fn.call(that, a, b);
771 };
772 case 3: return function (a, b, c) {
773 return fn.call(that, a, b, c);
774 };
775 }
776 return function (/* ...args */) {
777 return fn.apply(that, arguments);
778 };
779};
780
781
782/***/ }),
783/* 40 */
784/***/ (function(module, exports) {
785
786// Mapping of Unicode accent characters to their LaTeX equivalent in text and
787// math mode (when they exist).
788
789// NOTE: This module needs to be written with Node-style modules (not
790// ES6 modules) so that unicodeMake.js (a Node application) can import it.
791module.exports = {
792 '\u0301': { text: "\\'", math: '\\acute' },
793 '\u0300': { text: '\\`', math: '\\grave' },
794 '\u0308': { text: '\\"', math: '\\ddot' },
795 '\u0303': { text: '\\~', math: '\\tilde' },
796 '\u0304': { text: '\\=', math: '\\bar' },
797 '\u0306': { text: '\\u', math: '\\breve' },
798 '\u030C': { text: '\\v', math: '\\check' },
799 '\u0302': { text: '\\^', math: '\\hat' },
800 '\u0307': { text: '\\.', math: '\\dot' },
801 '\u030A': { text: '\\r', math: '\\mathring' },
802 '\u030B': { text: '\\H' }
803};
804
805/***/ }),
806/* 41 */
807/***/ (function(module, exports, __webpack_require__) {
808
809module.exports = { "default": __webpack_require__(73), __esModule: true };
810
811/***/ }),
812/* 42 */
813/***/ (function(module, exports, __webpack_require__) {
814
815"use strict";
816
817
818exports.__esModule = true;
819
820var _setPrototypeOf = __webpack_require__(80);
821
822var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
823
824var _create = __webpack_require__(76);
825
826var _create2 = _interopRequireDefault(_create);
827
828var _typeof2 = __webpack_require__(48);
829
830var _typeof3 = _interopRequireDefault(_typeof2);
831
832function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
833
834exports.default = function (subClass, superClass) {
835 if (typeof superClass !== "function" && superClass !== null) {
836 throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
837 }
838
839 subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
840 constructor: {
841 value: subClass,
842 enumerable: false,
843 writable: true,
844 configurable: true
845 }
846 });
847 if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
848};
849
850/***/ }),
851/* 43 */
852/***/ (function(module, exports, __webpack_require__) {
853
854"use strict";
855
856
857exports.__esModule = true;
858
859var _typeof2 = __webpack_require__(48);
860
861var _typeof3 = _interopRequireDefault(_typeof2);
862
863function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
864
865exports.default = function (self, call) {
866 if (!self) {
867 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
868 }
869
870 return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
871};
872
873/***/ }),
874/* 44 */
875/***/ (function(module, exports, __webpack_require__) {
876
877module.exports = { "default": __webpack_require__(92), __esModule: true };
878
879/***/ }),
880/* 45 */
881/***/ (function(module, exports, __webpack_require__) {
882
883var pIE = __webpack_require__(21);
884var createDesc = __webpack_require__(19);
885var toIObject = __webpack_require__(13);
886var toPrimitive = __webpack_require__(38);
887var has = __webpack_require__(9);
888var IE8_DOM_DEFINE = __webpack_require__(59);
889var gOPD = Object.getOwnPropertyDescriptor;
890
891exports.f = __webpack_require__(10) ? gOPD : function getOwnPropertyDescriptor(O, P) {
892 O = toIObject(O);
893 P = toPrimitive(P, true);
894 if (IE8_DOM_DEFINE) try {
895 return gOPD(O, P);
896 } catch (e) { /* empty */ }
897 if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
898};
899
900
901/***/ }),
902/* 46 */
903/***/ (function(module, exports, __webpack_require__) {
904
905// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
906var $keys = __webpack_require__(54);
907var hiddenKeys = __webpack_require__(31).concat('length', 'prototype');
908
909exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
910 return $keys(O, hiddenKeys);
911};
912
913
914/***/ }),
915/* 47 */
916/***/ (function(module, exports, __webpack_require__) {
917
918// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
919var toIObject = __webpack_require__(13);
920var gOPN = __webpack_require__(46).f;
921var toString = {}.toString;
922
923var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
924 ? Object.getOwnPropertyNames(window) : [];
925
926var getWindowNames = function (it) {
927 try {
928 return gOPN(it);
929 } catch (e) {
930 return windowNames.slice();
931 }
932};
933
934module.exports.f = function getOwnPropertyNames(it) {
935 return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
936};
937
938
939/***/ }),
940/* 48 */
941/***/ (function(module, exports, __webpack_require__) {
942
943"use strict";
944
945
946exports.__esModule = true;
947
948var _iterator = __webpack_require__(90);
949
950var _iterator2 = _interopRequireDefault(_iterator);
951
952var _symbol = __webpack_require__(88);
953
954var _symbol2 = _interopRequireDefault(_symbol);
955
956var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
957
958function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
959
960exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
961 return typeof obj === "undefined" ? "undefined" : _typeof(obj);
962} : function (obj) {
963 return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
964};
965
966/***/ }),
967/* 49 */
968/***/ (function(module, exports, __webpack_require__) {
969
970// getting tag from 19.1.3.6 Object.prototype.toString()
971var cof = __webpack_require__(34);
972var TAG = __webpack_require__(5)('toStringTag');
973// ES3 wrong here
974var ARG = cof(function () { return arguments; }()) == 'Arguments';
975
976// fallback for IE11 Script Access Denied error
977var tryGet = function (it, key) {
978 try {
979 return it[key];
980 } catch (e) { /* empty */ }
981};
982
983module.exports = function (it) {
984 var O, T, B;
985 return it === undefined ? 'Undefined' : it === null ? 'Null'
986 // @@toStringTag case
987 : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
988 // builtinTag case
989 : ARG ? cof(O)
990 // ES3 arguments fallback
991 : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
992};
993
994
995/***/ }),
996/* 50 */
997/***/ (function(module, exports, __webpack_require__) {
998
999var classof = __webpack_require__(49);
1000var ITERATOR = __webpack_require__(5)('iterator');
1001var Iterators = __webpack_require__(14);
1002module.exports = __webpack_require__(2).getIteratorMethod = function (it) {
1003 if (it != undefined) return it[ITERATOR]
1004 || it['@@iterator']
1005 || Iterators[classof(it)];
1006};
1007
1008
1009/***/ }),
1010/* 51 */
1011/***/ (function(module, exports, __webpack_require__) {
1012
1013// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
1014var has = __webpack_require__(9);
1015var toObject = __webpack_require__(17);
1016var IE_PROTO = __webpack_require__(33)('IE_PROTO');
1017var ObjectProto = Object.prototype;
1018
1019module.exports = Object.getPrototypeOf || function (O) {
1020 O = toObject(O);
1021 if (has(O, IE_PROTO)) return O[IE_PROTO];
1022 if (typeof O.constructor == 'function' && O instanceof O.constructor) {
1023 return O.constructor.prototype;
1024 } return O instanceof Object ? ObjectProto : null;
1025};
1026
1027
1028/***/ }),
1029/* 52 */
1030/***/ (function(module, exports, __webpack_require__) {
1031
1032// 7.1.15 ToLength
1033var toInteger = __webpack_require__(37);
1034var min = Math.min;
1035module.exports = function (it) {
1036 return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
1037};
1038
1039
1040/***/ }),
1041/* 53 */
1042/***/ (function(module, exports, __webpack_require__) {
1043
1044// fallback for non-array-like ES3 and non-enumerable old V8 strings
1045var cof = __webpack_require__(34);
1046// eslint-disable-next-line no-prototype-builtins
1047module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
1048 return cof(it) == 'String' ? it.split('') : Object(it);
1049};
1050
1051
1052/***/ }),
1053/* 54 */
1054/***/ (function(module, exports, __webpack_require__) {
1055
1056var has = __webpack_require__(9);
1057var toIObject = __webpack_require__(13);
1058var arrayIndexOf = __webpack_require__(108)(false);
1059var IE_PROTO = __webpack_require__(33)('IE_PROTO');
1060
1061module.exports = function (object, names) {
1062 var O = toIObject(object);
1063 var i = 0;
1064 var result = [];
1065 var key;
1066 for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
1067 // Don't enum bug & hidden keys
1068 while (names.length > i) if (has(O, key = names[i++])) {
1069 ~arrayIndexOf(result, key) || result.push(key);
1070 }
1071 return result;
1072};
1073
1074
1075/***/ }),
1076/* 55 */
1077/***/ (function(module, exports, __webpack_require__) {
1078
1079module.exports = __webpack_require__(16);
1080
1081
1082/***/ }),
1083/* 56 */
1084/***/ (function(module, exports, __webpack_require__) {
1085
1086"use strict";
1087
1088var LIBRARY = __webpack_require__(22);
1089var $export = __webpack_require__(8);
1090var redefine = __webpack_require__(55);
1091var hide = __webpack_require__(16);
1092var Iterators = __webpack_require__(14);
1093var $iterCreate = __webpack_require__(110);
1094var setToStringTag = __webpack_require__(30);
1095var getPrototypeOf = __webpack_require__(51);
1096var ITERATOR = __webpack_require__(5)('iterator');
1097var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
1098var FF_ITERATOR = '@@iterator';
1099var KEYS = 'keys';
1100var VALUES = 'values';
1101
1102var returnThis = function () { return this; };
1103
1104module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
1105 $iterCreate(Constructor, NAME, next);
1106 var getMethod = function (kind) {
1107 if (!BUGGY && kind in proto) return proto[kind];
1108 switch (kind) {
1109 case KEYS: return function keys() { return new Constructor(this, kind); };
1110 case VALUES: return function values() { return new Constructor(this, kind); };
1111 } return function entries() { return new Constructor(this, kind); };
1112 };
1113 var TAG = NAME + ' Iterator';
1114 var DEF_VALUES = DEFAULT == VALUES;
1115 var VALUES_BUG = false;
1116 var proto = Base.prototype;
1117 var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
1118 var $default = $native || getMethod(DEFAULT);
1119 var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
1120 var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
1121 var methods, key, IteratorPrototype;
1122 // Fix native
1123 if ($anyNative) {
1124 IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
1125 if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
1126 // Set @@toStringTag to native iterators
1127 setToStringTag(IteratorPrototype, TAG, true);
1128 // fix for some old engines
1129 if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
1130 }
1131 }
1132 // fix Array#{values, @@iterator}.name in V8 / FF
1133 if (DEF_VALUES && $native && $native.name !== VALUES) {
1134 VALUES_BUG = true;
1135 $default = function values() { return $native.call(this); };
1136 }
1137 // Define iterator
1138 if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
1139 hide(proto, ITERATOR, $default);
1140 }
1141 // Plug for library
1142 Iterators[NAME] = $default;
1143 Iterators[TAG] = returnThis;
1144 if (DEFAULT) {
1145 methods = {
1146 values: DEF_VALUES ? $default : getMethod(VALUES),
1147 keys: IS_SET ? $default : getMethod(KEYS),
1148 entries: $entries
1149 };
1150 if (FORCED) for (key in methods) {
1151 if (!(key in proto)) redefine(proto, key, methods[key]);
1152 } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
1153 }
1154 return methods;
1155};
1156
1157
1158/***/ }),
1159/* 57 */
1160/***/ (function(module, exports, __webpack_require__) {
1161
1162var META = __webpack_require__(25)('meta');
1163var isObject = __webpack_require__(11);
1164var has = __webpack_require__(9);
1165var setDesc = __webpack_require__(6).f;
1166var id = 0;
1167var isExtensible = Object.isExtensible || function () {
1168 return true;
1169};
1170var FREEZE = !__webpack_require__(15)(function () {
1171 return isExtensible(Object.preventExtensions({}));
1172});
1173var setMeta = function (it) {
1174 setDesc(it, META, { value: {
1175 i: 'O' + ++id, // object ID
1176 w: {} // weak collections IDs
1177 } });
1178};
1179var fastKey = function (it, create) {
1180 // return primitive with prefix
1181 if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
1182 if (!has(it, META)) {
1183 // can't set metadata to uncaught frozen object
1184 if (!isExtensible(it)) return 'F';
1185 // not necessary to add metadata
1186 if (!create) return 'E';
1187 // add missing metadata
1188 setMeta(it);
1189 // return object ID
1190 } return it[META].i;
1191};
1192var getWeak = function (it, create) {
1193 if (!has(it, META)) {
1194 // can't set metadata to uncaught frozen object
1195 if (!isExtensible(it)) return true;
1196 // not necessary to add metadata
1197 if (!create) return false;
1198 // add missing metadata
1199 setMeta(it);
1200 // return hash weak collections IDs
1201 } return it[META].w;
1202};
1203// add metadata on freeze-family methods calling
1204var onFreeze = function (it) {
1205 if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
1206 return it;
1207};
1208var meta = module.exports = {
1209 KEY: META,
1210 NEED: false,
1211 fastKey: fastKey,
1212 getWeak: getWeak,
1213 onFreeze: onFreeze
1214};
1215
1216
1217/***/ }),
1218/* 58 */
1219/***/ (function(module, exports, __webpack_require__) {
1220
1221var isObject = __webpack_require__(11);
1222var document = __webpack_require__(7).document;
1223// typeof document.createElement is 'object' in old IE
1224var is = isObject(document) && isObject(document.createElement);
1225module.exports = function (it) {
1226 return is ? document.createElement(it) : {};
1227};
1228
1229
1230/***/ }),
1231/* 59 */
1232/***/ (function(module, exports, __webpack_require__) {
1233
1234module.exports = !__webpack_require__(10) && !__webpack_require__(15)(function () {
1235 return Object.defineProperty(__webpack_require__(58)('div'), 'a', { get: function () { return 7; } }).a != 7;
1236});
1237
1238
1239/***/ }),
1240/* 60 */
1241/***/ (function(module) {
1242
1243module.exports = {"a":"0.10.0-beta"};
1244
1245/***/ }),
1246/* 61 */
1247/***/ (function(module, exports, __webpack_require__) {
1248
1249module.exports = { "default": __webpack_require__(68), __esModule: true };
1250
1251/***/ }),
1252/* 62 */
1253/***/ (function(module, exports) {
1254
1255function getRelocatable(re) {
1256 // In the future, this could use a WeakMap instead of an expando.
1257 if (!re.__matchAtRelocatable) {
1258 // Disjunctions are the lowest-precedence operator, so we can make any
1259 // pattern match the empty string by appending `|()` to it:
1260 // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-patterns
1261 var source = re.source + '|()';
1262
1263 // We always make the new regex global.
1264 var flags = 'g' + (re.ignoreCase ? 'i' : '') + (re.multiline ? 'm' : '') + (re.unicode ? 'u' : '')
1265 // sticky (/.../y) doesn't make sense in conjunction with our relocation
1266 // logic, so we ignore it here.
1267 ;
1268
1269 re.__matchAtRelocatable = new RegExp(source, flags);
1270 }
1271 return re.__matchAtRelocatable;
1272}
1273
1274function matchAt(re, str, pos) {
1275 if (re.global || re.sticky) {
1276 throw new Error('matchAt(...): Only non-global regexes are supported');
1277 }
1278 var reloc = getRelocatable(re);
1279 reloc.lastIndex = pos;
1280 var match = reloc.exec(str);
1281 // Last capturing group is our sentinel that indicates whether the regex
1282 // matched at the given location.
1283 if (match[match.length - 1] == null) {
1284 // Original regex matched.
1285 match.length = match.length - 1;
1286 return match;
1287 } else {
1288 return null;
1289 }
1290}
1291
1292module.exports = matchAt;
1293
1294/***/ }),
1295/* 63 */
1296/***/ (function(module, exports, __webpack_require__) {
1297
1298module.exports = { "default": __webpack_require__(70), __esModule: true };
1299
1300/***/ }),
1301/* 64 */
1302/***/ (function(module, exports, __webpack_require__) {
1303
1304module.exports = { "default": __webpack_require__(114), __esModule: true };
1305
1306/***/ }),
1307/* 65 */
1308/***/ (function(module, exports, __webpack_require__) {
1309
1310module.exports = { "default": __webpack_require__(116), __esModule: true };
1311
1312/***/ }),
1313/* 66 */
1314/***/ (function(module, __webpack_exports__, __webpack_require__) {
1315
1316"use strict";
1317__webpack_require__.r(__webpack_exports__);
1318
1319// EXTERNAL MODULE: ./src/katex.less
1320var katex = __webpack_require__(122);
1321
1322// EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/classCallCheck.js
1323var classCallCheck = __webpack_require__(0);
1324var classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck);
1325
1326// EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/createClass.js
1327var createClass = __webpack_require__(1);
1328var createClass_default = /*#__PURE__*/__webpack_require__.n(createClass);
1329
1330// EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/object/freeze.js
1331var freeze = __webpack_require__(65);
1332var freeze_default = /*#__PURE__*/__webpack_require__.n(freeze);
1333
1334// CONCATENATED MODULE: ./src/SourceLocation.js
1335
1336
1337
1338
1339/**
1340 * Lexing or parsing positional information for error reporting.
1341 * This object is immutable.
1342 */
1343var SourceLocation_SourceLocation = function () {
1344 // End offset, zero-based exclusive.
1345
1346 // Lexer holding the input string.
1347 function SourceLocation(lexer, start, end) {
1348 classCallCheck_default()(this, SourceLocation);
1349
1350 this.lexer = lexer;
1351 this.start = start;
1352 this.end = end;
1353 freeze_default()(this); // Immutable to allow sharing in range().
1354 }
1355
1356 /**
1357 * Merges two `SourceLocation`s from location providers, given they are
1358 * provided in order of appearance.
1359 * - Returns the first one's location if only the first is provided.
1360 * - Returns a merged range of the first and the last if both are provided
1361 * and their lexers match.
1362 * - Otherwise, returns null.
1363 */
1364 // Start offset, zero-based inclusive.
1365
1366
1367 createClass_default()(SourceLocation, null, [{
1368 key: "range",
1369 value: function range(first, second) {
1370 if (!second) {
1371 return first && first.loc;
1372 } else if (!first || !first.loc || !second.loc || first.loc.lexer !== second.loc.lexer) {
1373 return null;
1374 } else {
1375 return new SourceLocation(first.loc.lexer, first.loc.start, second.loc.end);
1376 }
1377 }
1378 }]);
1379
1380 return SourceLocation;
1381}();
1382
1383/* harmony default export */ var src_SourceLocation = (SourceLocation_SourceLocation);
1384// CONCATENATED MODULE: ./src/Token.js
1385
1386
1387
1388
1389/**
1390 * Interface required to break circular dependency between Token, Lexer, and
1391 * ParseError.
1392 */
1393
1394
1395/**
1396 * The resulting token returned from `lex`.
1397 *
1398 * It consists of the token text plus some position information.
1399 * The position information is essentially a range in an input string,
1400 * but instead of referencing the bare input string, we refer to the lexer.
1401 * That way it is possible to attach extra metadata to the input string,
1402 * like for example a file name or similar.
1403 *
1404 * The position information is optional, so it is OK to construct synthetic
1405 * tokens if appropriate. Not providing available position information may
1406 * lead to degraded error reporting, though.
1407 */
1408var Token_Token = function () {
1409 function Token(text, // the text of this token
1410 loc) {
1411 classCallCheck_default()(this, Token);
1412
1413 this.text = text;
1414 this.loc = loc;
1415 }
1416
1417 /**
1418 * Given a pair of tokens (this and endToken), compute a `Token` encompassing
1419 * the whole input range enclosed by these two.
1420 */
1421
1422
1423 createClass_default()(Token, [{
1424 key: "range",
1425 value: function range(endToken, // last token of the range, inclusive
1426 text) // the text of the newly constructed token
1427 {
1428 return new Token(text, src_SourceLocation.range(this, endToken));
1429 }
1430 }]);
1431
1432 return Token;
1433}();
1434// CONCATENATED MODULE: ./src/ParseError.js
1435
1436
1437
1438/**
1439 * This is the ParseError class, which is the main error thrown by KaTeX
1440 * functions when something has gone wrong. This is used to distinguish internal
1441 * errors from errors in the expression that the user provided.
1442 *
1443 * If possible, a caller should provide a Token or ParseNode with information
1444 * about where in the source string the problem occurred.
1445 */
1446var ParseError_ParseError =
1447// Error position based on passed-in Token or ParseNode.
1448
1449function ParseError(message, // The error message
1450token) // An object providing position information
1451{
1452 classCallCheck_default()(this, ParseError);
1453
1454 var error = "KaTeX parse error: " + message;
1455 var start = void 0;
1456
1457 var loc = token && token.loc;
1458 if (loc && loc.start <= loc.end) {
1459 // If we have the input and a position, make the error a bit fancier
1460
1461 // Get the input
1462 var input = loc.lexer.input;
1463
1464 // Prepend some information
1465 start = loc.start;
1466 var end = loc.end;
1467 if (start === input.length) {
1468 error += " at end of input: ";
1469 } else {
1470 error += " at position " + (start + 1) + ": ";
1471 }
1472
1473 // Underline token in question using combining underscores
1474 var underlined = input.slice(start, end).replace(/[^]/g, "$&\u0332");
1475
1476 // Extract some context from the input and add it to the error
1477 var left = void 0;
1478 if (start > 15) {
1479 left = "?" + input.slice(start - 15, start);
1480 } else {
1481 left = input.slice(0, start);
1482 }
1483 var right = void 0;
1484 if (end + 15 < input.length) {
1485 right = input.slice(end, end + 15) + "?";
1486 } else {
1487 right = input.slice(end);
1488 }
1489 error += left + underlined + right;
1490 }
1491
1492 // Some hackery to make ParseError a prototype of Error
1493 // See http://stackoverflow.com/a/8460753
1494 var self = new Error(error);
1495 self.name = "ParseError";
1496 // $FlowFixMe
1497 self.__proto__ = ParseError.prototype;
1498 // $FlowFixMe
1499 self.position = start;
1500 return self;
1501};
1502
1503// $FlowFixMe More hackery
1504
1505
1506ParseError_ParseError.prototype.__proto__ = Error.prototype;
1507
1508/* harmony default export */ var src_ParseError = (ParseError_ParseError);
1509// CONCATENATED MODULE: ./src/utils.js
1510
1511
1512/**
1513 * Provide an `indexOf` function which works in IE8, but defers to native if
1514 * possible.
1515 */
1516var nativeIndexOf = Array.prototype.indexOf;
1517/**
1518 * This file contains a list of utility functions which are useful in other
1519 * files.
1520 */
1521
1522var indexOf = function indexOf(list, elem) {
1523 if (list == null) {
1524 return -1;
1525 }
1526 if (nativeIndexOf && list.indexOf === nativeIndexOf) {
1527 return list.indexOf(elem);
1528 }
1529 var l = list.length;
1530 for (var i = 0; i < l; i++) {
1531 if (list[i] === elem) {
1532 return i;
1533 }
1534 }
1535 return -1;
1536};
1537
1538/**
1539 * Return whether an element is contained in a list
1540 */
1541var contains = function contains(list, elem) {
1542 return indexOf(list, elem) !== -1;
1543};
1544
1545/**
1546 * Provide a default value if a setting is undefined
1547 * NOTE: Couldn't use `T` as the output type due to facebook/flow#5022.
1548 */
1549var deflt = function deflt(setting, defaultIfUndefined) {
1550 return setting === undefined ? defaultIfUndefined : setting;
1551};
1552
1553// hyphenate and escape adapted from Facebook's React under Apache 2 license
1554
1555var uppercase = /([A-Z])/g;
1556var hyphenate = function hyphenate(str) {
1557 return str.replace(uppercase, "-$1").toLowerCase();
1558};
1559
1560var ESCAPE_LOOKUP = {
1561 "&": "&",
1562 ">": ">",
1563 "<": "<",
1564 "\"": """,
1565 "'": "'"
1566};
1567
1568var ESCAPE_REGEX = /[&><"']/g;
1569
1570/**
1571 * Escapes text to prevent scripting attacks.
1572 */
1573function utils_escape(text) {
1574 return String(text).replace(ESCAPE_REGEX, function (match) {
1575 return ESCAPE_LOOKUP[match];
1576 });
1577}
1578
1579/**
1580 * A function to set the text content of a DOM element in all supported
1581 * browsers. Note that we don't define this if there is no document.
1582 */
1583var setTextContent = void 0;
1584if (typeof document !== "undefined") {
1585 var testNode = document.createElement("span");
1586 if ("textContent" in testNode) {
1587 setTextContent = function setTextContent(node, text) {
1588 node.textContent = text;
1589 };
1590 } else {
1591 setTextContent = function setTextContent(node, text) {
1592 node.innerText = text;
1593 };
1594 }
1595}
1596
1597/**
1598 * A function to clear a node.
1599 */
1600function clearNode(node) {
1601 setTextContent(node, "");
1602}
1603
1604/**
1605 * Sometimes we want to pull out the innermost element of a group. In most
1606 * cases, this will just be the group itself, but when ordgroups and colors have
1607 * a single element, we want to pull that out.
1608 */
1609var getBaseElem = function getBaseElem(group) {
1610 if (group.type === "ordgroup") {
1611 if (group.value.length === 1) {
1612 return getBaseElem(group.value[0]);
1613 } else {
1614 return group;
1615 }
1616 } else if (group.type === "color") {
1617 if (group.value.value.length === 1) {
1618 return getBaseElem(group.value.value[0]);
1619 } else {
1620 return group;
1621 }
1622 } else if (group.type === "font") {
1623 return getBaseElem(group.value.body);
1624 } else {
1625 return group;
1626 }
1627};
1628
1629/**
1630 * TeXbook algorithms often reference "character boxes", which are simply groups
1631 * with a single character in them. To decide if something is a character box,
1632 * we find its innermost group, and see if it is a single character.
1633 */
1634var utils_isCharacterBox = function isCharacterBox(group) {
1635 var baseElem = getBaseElem(group);
1636
1637 // These are all they types of groups which hold single characters
1638 return baseElem.type === "mathord" || baseElem.type === "textord" || baseElem.type === "bin" || baseElem.type === "rel" || baseElem.type === "inner" || baseElem.type === "open" || baseElem.type === "close" || baseElem.type === "punct";
1639};
1640
1641var assert = function assert(value) {
1642 if (!value) {
1643 throw new Error('Expected non-null, but got ' + String(value));
1644 }
1645 return value;
1646};
1647
1648/* harmony default export */ var utils = ({
1649 contains: contains,
1650 deflt: deflt,
1651 escape: utils_escape,
1652 hyphenate: hyphenate,
1653 indexOf: indexOf,
1654 setTextContent: setTextContent,
1655 clearNode: clearNode,
1656 getBaseElem: getBaseElem,
1657 isCharacterBox: utils_isCharacterBox
1658});
1659// CONCATENATED MODULE: ./src/Settings.js
1660
1661
1662
1663/* eslint no-console:0 */
1664/**
1665 * This is a module for storing settings passed into KaTeX. It correctly handles
1666 * default settings.
1667 */
1668
1669
1670
1671
1672
1673/**
1674 * The main Settings object
1675 *
1676 * The current options stored are:
1677 * - displayMode: Whether the expression should be typeset as inline math
1678 * (false, the default), meaning that the math starts in
1679 * \textstyle and is placed in an inline-block); or as display
1680 * math (true), meaning that the math starts in \displaystyle
1681 * and is placed in a block with vertical margin.
1682 */
1683var Settings_Settings = function () {
1684 function Settings(options) {
1685 classCallCheck_default()(this, Settings);
1686
1687 // allow null options
1688 options = options || {};
1689 this.displayMode = utils.deflt(options.displayMode, false);
1690 this.throwOnError = utils.deflt(options.throwOnError, true);
1691 this.errorColor = utils.deflt(options.errorColor, "#cc0000");
1692 this.macros = options.macros || {};
1693 this.colorIsTextColor = utils.deflt(options.colorIsTextColor, false);
1694 this.strict = utils.deflt(options.strict, "warn");
1695 this.maxSize = Math.max(0, utils.deflt(options.maxSize, Infinity));
1696 this.maxExpand = Math.max(0, utils.deflt(options.maxExpand, 1000));
1697 }
1698
1699 /**
1700 * Report nonstrict (non-LaTeX-compatible) input.
1701 * Can safely not be called if `this.strict` is false in JavaScript.
1702 */
1703
1704
1705 createClass_default()(Settings, [{
1706 key: "reportNonstrict",
1707 value: function reportNonstrict(errorCode, errorMsg, token) {
1708 var strict = this.strict;
1709 if (typeof strict === "function") {
1710 // Allow return value of strict function to be boolean or string
1711 // (or null/undefined, meaning no further processing).
1712 strict = strict(errorCode, errorMsg, token);
1713 }
1714 if (!strict || strict === "ignore") {
1715 return;
1716 } else if (strict === true || strict === "error") {
1717 throw new src_ParseError("LaTeX-incompatible input and strict mode is set to 'error': " + (errorMsg + " [" + errorCode + "]"), token);
1718 } else if (strict === "warn") {
1719 typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]"));
1720 } else {
1721 // won't happen in type-safe code
1722 typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]"));
1723 }
1724 }
1725
1726 /**
1727 * Check whether to apply strict (LaTeX-adhering) behavior for unusual
1728 * input (like `\\`). Unlike `nonstrict`, will not throw an error;
1729 * instead, "error" translates to a return value of `true`, while "ignore"
1730 * translates to a return value of `false`. May still print a warning:
1731 * "warn" prints a warning and returns `false`.
1732 * This is for the second category of `errorCode`s listed in the README.
1733 */
1734
1735 }, {
1736 key: "useStrictBehavior",
1737 value: function useStrictBehavior(errorCode, errorMsg, token) {
1738 var strict = this.strict;
1739 if (typeof strict === "function") {
1740 // Allow return value of strict function to be boolean or string
1741 // (or null/undefined, meaning no further processing).
1742 // But catch any exceptions thrown by function, treating them
1743 // like "error".
1744 try {
1745 strict = strict(errorCode, errorMsg, token);
1746 } catch (error) {
1747 strict = "error";
1748 }
1749 }
1750 if (!strict || strict === "ignore") {
1751 return false;
1752 } else if (strict === true || strict === "error") {
1753 return true;
1754 } else if (strict === "warn") {
1755 typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]"));
1756 return false;
1757 } else {
1758 // won't happen in type-safe code
1759 typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]"));
1760 return false;
1761 }
1762 }
1763 }]);
1764
1765 return Settings;
1766}();
1767
1768/* harmony default export */ var src_Settings = (Settings_Settings);
1769// EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/json/stringify.js
1770var stringify = __webpack_require__(64);
1771var stringify_default = /*#__PURE__*/__webpack_require__.n(stringify);
1772
1773// EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/toConsumableArray.js
1774var toConsumableArray = __webpack_require__(4);
1775var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
1776
1777// CONCATENATED MODULE: ./src/Style.js
1778
1779
1780
1781/**
1782 * This file contains information and classes for the various kinds of styles
1783 * used in TeX. It provides a generic `Style` class, which holds information
1784 * about a specific style. It then provides instances of all the different kinds
1785 * of styles possible, and provides functions to move between them and get
1786 * information about them.
1787 */
1788
1789/**
1790 * The main style class. Contains a unique id for the style, a size (which is
1791 * the same for cramped and uncramped version of a style), and a cramped flag.
1792 */
1793var Style_Style = function () {
1794 function Style(id, size, cramped) {
1795 classCallCheck_default()(this, Style);
1796
1797 this.id = id;
1798 this.size = size;
1799 this.cramped = cramped;
1800 }
1801
1802 /**
1803 * Get the style of a superscript given a base in the current style.
1804 */
1805
1806
1807 createClass_default()(Style, [{
1808 key: "sup",
1809 value: function sup() {
1810 return Style_styles[_sup[this.id]];
1811 }
1812
1813 /**
1814 * Get the style of a subscript given a base in the current style.
1815 */
1816
1817 }, {
1818 key: "sub",
1819 value: function sub() {
1820 return Style_styles[_sub[this.id]];
1821 }
1822
1823 /**
1824 * Get the style of a fraction numerator given the fraction in the current
1825 * style.
1826 */
1827
1828 }, {
1829 key: "fracNum",
1830 value: function fracNum() {
1831 return Style_styles[_fracNum[this.id]];
1832 }
1833
1834 /**
1835 * Get the style of a fraction denominator given the fraction in the current
1836 * style.
1837 */
1838
1839 }, {
1840 key: "fracDen",
1841 value: function fracDen() {
1842 return Style_styles[_fracDen[this.id]];
1843 }
1844
1845 /**
1846 * Get the cramped version of a style (in particular, cramping a cramped style
1847 * doesn't change the style).
1848 */
1849
1850 }, {
1851 key: "cramp",
1852 value: function cramp() {
1853 return Style_styles[_cramp[this.id]];
1854 }
1855
1856 /**
1857 * Get a text or display version of this style.
1858 */
1859
1860 }, {
1861 key: "text",
1862 value: function text() {
1863 return Style_styles[_text[this.id]];
1864 }
1865
1866 /**
1867 * Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle)
1868 */
1869
1870 }, {
1871 key: "isTight",
1872 value: function isTight() {
1873 return this.size >= 2;
1874 }
1875 }]);
1876
1877 return Style;
1878}();
1879
1880// Export an interface for type checking, but don't expose the implementation.
1881// This way, no more styles can be generated.
1882
1883
1884// IDs of the different styles
1885var D = 0;
1886var Dc = 1;
1887var T = 2;
1888var Tc = 3;
1889var S = 4;
1890var Sc = 5;
1891var SS = 6;
1892var SSc = 7;
1893
1894// Instances of the different styles
1895var Style_styles = [new Style_Style(D, 0, false), new Style_Style(Dc, 0, true), new Style_Style(T, 1, false), new Style_Style(Tc, 1, true), new Style_Style(S, 2, false), new Style_Style(Sc, 2, true), new Style_Style(SS, 3, false), new Style_Style(SSc, 3, true)];
1896
1897// Lookup tables for switching from one style to another
1898var _sup = [S, Sc, S, Sc, SS, SSc, SS, SSc];
1899var _sub = [Sc, Sc, Sc, Sc, SSc, SSc, SSc, SSc];
1900var _fracNum = [T, Tc, S, Sc, SS, SSc, SS, SSc];
1901var _fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc];
1902var _cramp = [Dc, Dc, Tc, Tc, Sc, Sc, SSc, SSc];
1903var _text = [D, Dc, T, Tc, T, Tc, T, Tc];
1904
1905// We only export some of the styles.
1906/* harmony default export */ var src_Style = ({
1907 DISPLAY: Style_styles[D],
1908 TEXT: Style_styles[T],
1909 SCRIPT: Style_styles[S],
1910 SCRIPTSCRIPT: Style_styles[SS]
1911});
1912// EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/get-iterator.js
1913var get_iterator = __webpack_require__(3);
1914var get_iterator_default = /*#__PURE__*/__webpack_require__.n(get_iterator);
1915
1916// EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/slicedToArray.js
1917var slicedToArray = __webpack_require__(20);
1918var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
1919
1920// EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/object/get-prototype-of.js
1921var get_prototype_of = __webpack_require__(44);
1922var get_prototype_of_default = /*#__PURE__*/__webpack_require__.n(get_prototype_of);
1923
1924// EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/possibleConstructorReturn.js
1925var possibleConstructorReturn = __webpack_require__(43);
1926var possibleConstructorReturn_default = /*#__PURE__*/__webpack_require__.n(possibleConstructorReturn);
1927
1928// EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/inherits.js
1929var inherits = __webpack_require__(42);
1930var inherits_default = /*#__PURE__*/__webpack_require__.n(inherits);
1931
1932// EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/object/assign.js
1933var object_assign = __webpack_require__(41);
1934var assign_default = /*#__PURE__*/__webpack_require__.n(object_assign);
1935
1936// CONCATENATED MODULE: ./src/unicodeScripts.js
1937
1938
1939
1940
1941/**
1942 * Unicode block data for the families of scripts we support in \text{}.
1943 * Scripts only need to appear here if they do not have font metrics.
1944 */
1945var scriptData = [{
1946 // Latin characters beyond the Latin-1 characters we have metrics for.
1947 // Needed for Czech, Hungarian and Turkish text, for example.
1948 name: 'latin',
1949 blocks: [[0x0100, 0x024f], // Latin Extended-A and Latin Extended-B
1950 [0x0300, 0x036f]]
1951}, {
1952 // The Cyrillic script used by Russian and related languages.
1953 // A Cyrillic subset used to be supported as explicitly defined
1954 // symbols in symbols.js
1955 name: 'cyrillic',
1956 blocks: [[0x0400, 0x04ff]]
1957}, {
1958 // The Brahmic scripts of South and Southeast Asia
1959 // Devanagari (0900?097F)
1960 // Bengali (0980?09FF)
1961 // Gurmukhi (0A00?0A7F)
1962 // Gujarati (0A80?0AFF)
1963 // Oriya (0B00?0B7F)
1964 // Tamil (0B80?0BFF)
1965 // Telugu (0C00?0C7F)
1966 // Kannada (0C80?0CFF)
1967 // Malayalam (0D00?0D7F)
1968 // Sinhala (0D80?0DFF)
1969 // Thai (0E00?0E7F)
1970 // Lao (0E80?0EFF)
1971 // Tibetan (0F00?0FFF)
1972 // Myanmar (1000?109F)
1973 name: 'brahmic',
1974 blocks: [[0x0900, 0x109F]]
1975}, {
1976 name: 'georgian',
1977 blocks: [[0x10A0, 0x10ff]]
1978}, {
1979 // Chinese and Japanese.
1980 // The "k" in cjk is for Korean, but we've separated Korean out
1981 name: "cjk",
1982 blocks: [[0x3000, 0x30FF], // CJK symbols and punctuation, Hiragana, Katakana
1983 [0x4E00, 0x9FAF], // CJK ideograms
1984 [0xFF00, 0xFF60]]
1985}, {
1986 // Korean
1987 name: 'hangul',
1988 blocks: [[0xAC00, 0xD7AF]]
1989}];
1990
1991/**
1992 * Given a codepoint, return the name of the script or script family
1993 * it is from, or null if it is not part of a known block
1994 */
1995
1996
1997/*
1998 * This file defines the Unicode scripts and script families that we
1999 * support. To add new scripts or families, just add a new entry to the
2000 * scriptData array below. Adding scripts to the scriptData array allows
2001 * characters from that script to appear in \text{} environments.
2002 */
2003
2004/**
2005 * Each script or script family has a name and an array of blocks.
2006 * Each block is an array of two numbers which specify the start and
2007 * end points (inclusive) of a block of Unicode codepoints.
2008 */
2009function scriptFromCodepoint(codepoint) {
2010 var _iteratorNormalCompletion = true;
2011 var _didIteratorError = false;
2012 var _iteratorError = undefined;
2013
2014 try {
2015 for (var _iterator = get_iterator_default()(scriptData), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
2016 var script = _step.value;
2017 var _iteratorNormalCompletion2 = true;
2018 var _didIteratorError2 = false;
2019 var _iteratorError2 = undefined;
2020
2021 try {
2022 for (var _iterator2 = get_iterator_default()(script.blocks), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
2023 var block = _step2.value;
2024
2025 if (codepoint >= block[0] && codepoint <= block[1]) {
2026 return script.name;
2027 }
2028 }
2029 } catch (err) {
2030 _didIteratorError2 = true;
2031 _iteratorError2 = err;
2032 } finally {
2033 try {
2034 if (!_iteratorNormalCompletion2 && _iterator2.return) {
2035 _iterator2.return();
2036 }
2037 } finally {
2038 if (_didIteratorError2) {
2039 throw _iteratorError2;
2040 }
2041 }
2042 }
2043 }
2044 } catch (err) {
2045 _didIteratorError = true;
2046 _iteratorError = err;
2047 } finally {
2048 try {
2049 if (!_iteratorNormalCompletion && _iterator.return) {
2050 _iterator.return();
2051 }
2052 } finally {
2053 if (_didIteratorError) {
2054 throw _iteratorError;
2055 }
2056 }
2057 }
2058
2059 return null;
2060}
2061
2062/**
2063 * A flattened version of all the supported blocks in a single array.
2064 * This is an optimization to make supportedCodepoint() fast.
2065 */
2066var allBlocks = [];
2067scriptData.forEach(function (s) {
2068 return s.blocks.forEach(function (b) {
2069 return allBlocks.push.apply(allBlocks, toConsumableArray_default()(b));
2070 });
2071});
2072
2073/**
2074 * Given a codepoint, return true if it falls within one of the
2075 * scripts or script families defined above and false otherwise.
2076 *
2077 * Micro benchmarks shows that this is faster than
2078 * /[\u3000-\u30FF\u4E00-\u9FAF\uFF00-\uFF60\uAC00-\uD7AF\u0900-\u109F]/.test()
2079 * in Firefox, Chrome and Node.
2080 */
2081function supportedCodepoint(codepoint) {
2082 for (var i = 0; i < allBlocks.length; i += 2) {
2083 if (codepoint >= allBlocks[i] && codepoint <= allBlocks[i + 1]) {
2084 return true;
2085 }
2086 }
2087 return false;
2088}
2089// CONCATENATED MODULE: ./src/svgGeometry.js
2090
2091/**
2092 * This file provides support to domTree.js
2093 * It's a storehouse of path geometry for SVG images.
2094 */
2095
2096// In all paths below, the viewBox-to-em scale is 1000:1.
2097
2098var hLinePad = 80; // padding above a sqrt viniculum.
2099
2100var svgGeometry_path = {
2101 // sqrtMain path geometry is from glyph U221A in the font KaTeX Main
2102 // All surds have 80 units padding above the viniculumn.
2103 sqrtMain: "M95," + (622 + hLinePad) + "c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,\n-10,-9.5,-14c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54c44.2,-33.3,65.8,\n-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10s173,378,173,378c0.7,0,\n35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429c69,-144,104.5,-217.7,106.5,\n-221c5.3,-9.3,12,-14,20,-14H400000v40H845.2724s-225.272,467,-225.272,467\ns-235,486,-235,486c-2.7,4.7,-9,7,-19,7c-6,0,-10,-1,-12,-3s-194,-422,-194,-422\ns-65,47,-65,47z M834 " + hLinePad + "H400000v40H845z",
2104
2105 // size1 is from glyph U221A in the font KaTeX_Size1-Regular
2106 sqrtSize1: "M263," + (601 + hLinePad) + "c0.7,0,18,39.7,52,119c34,79.3,68.167,\n158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120c340,-704.7,510.7,-1060.3,512,-1067\nc4.7,-7.3,11,-11,19,-11H40000v40H1012.3s-271.3,567,-271.3,567c-38.7,80.7,-84,\n175,-136,283c-52,108,-89.167,185.3,-111.5,232c-22.3,46.7,-33.8,70.3,-34.5,71\nc-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1s-109,-253,-109,-253c-72.7,-168,-109.3,\n-252,-110,-252c-10.7,8,-22,16.7,-34,26c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26\ns76,-59,76,-59s76,-60,76,-60z M1001 " + hLinePad + "H40000v40H1012z",
2107
2108 // size2 is from glyph U221A in the font KaTeX_Size2-Regular
2109 // The 80 units padding is most obvious here. Note start node at M1001 80.
2110 sqrtSize2: "M1001," + hLinePad + "H400000v40H1013.1s-83.4,268,-264.1,840c-180.7,\n572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,\n-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744c-10,12,-21,25,-33,39s-32,39,-32,39\nc-6,-5.3,-15,-14,-27,-26s25,-30,25,-30c26.7,-32.7,52,-63,76,-91s52,-60,52,-60\ns208,722,208,722c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,\n-658.5c53.7,-170.3,84.5,-266.8,92.5,-289.5c4,-6.7,10,-10,18,-10z\nM1001 " + hLinePad + "H400000v40H1013z",
2111
2112 // size3 is from glyph U221A in the font KaTeX_Size3-Regular
2113 sqrtSize3: "M424," + (2398 + hLinePad) + "c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,\n-342,-109.8,-513.3,-110.5,-514c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,\n25c-5.7,9.3,-9.8,16,-12.5,20s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,\n-13s76,-122,76,-122s77,-121,77,-121s209,968,209,968c0,-2,84.7,-361.7,254,-1079\nc169.3,-717.3,254.7,-1077.7,256,-1081c4,-6.7,10,-10,18,-10H400000v40H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M1001 " + hLinePad + "H400000v40H1014z",
2114
2115 // size4 is from glyph U221A in the font KaTeX_Size4-Regular
2116 sqrtSize4: "M473," + (2713 + hLinePad) + "c339.3,-1799.3,509.3,-2700,510,-2702\nc3.3,-7.3,9.3,-11,18,-11H400000v40H1017.7s-90.5,478,-276.2,1466c-185.7,988,\n-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,\n-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200c0,-1.3,-5.3,8.7,-16,30c-10.7,\n21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26s76,-153,76,-153s77,-151,\n77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,606z\nM1001 " + hLinePad + "H400000v40H1017z",
2117
2118 // The doubleleftarrow geometry is from glyph U+21D0 in the font KaTeX Main
2119 doubleleftarrow: "M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",
2120
2121 // doublerightarrow is from glyph U+21D2 in font KaTeX Main
2122 doublerightarrow: "M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",
2123
2124 // leftarrow is from glyph U+2190 in font KaTeX Main
2125 leftarrow: "M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",
2126
2127 // overbrace is from glyphs U+23A9/23A8/23A7 in font KaTeX_Size4-Regular
2128 leftbrace: "M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",
2129
2130 leftbraceunder: "M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",
2131
2132 // overgroup is from the MnSymbol package (public domain)
2133 leftgroup: "M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",
2134
2135 leftgroupunder: "M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",
2136
2137 // Harpoons are from glyph U+21BD in font KaTeX Main
2138 leftharpoon: "M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",
2139
2140 leftharpoonplus: "M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",
2141
2142 leftharpoondown: "M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",
2143
2144 leftharpoondownplus: "M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",
2145
2146 // hook is from glyph U+21A9 in font KaTeX Main
2147 lefthook: "M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",
2148
2149 leftlinesegment: "M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",
2150
2151 leftmapsto: "M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",
2152
2153 // tofrom is from glyph U+21C4 in font KaTeX AMS Regular
2154 leftToFrom: "M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",
2155
2156 longequal: "M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",
2157
2158 midbrace: "M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",
2159
2160 midbraceunder: "M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",
2161
2162 rightarrow: "M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-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\n 11 8 0 13.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\n 39-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\n-40.5-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\n 151.7 139 205zm0 0v40h399900v-40z",
2163
2164 rightbrace: "M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",
2165
2166 rightbraceunder: "M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",
2167
2168 rightgroup: "M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",
2169
2170 rightgroupunder: "M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",
2171
2172 rightharpoon: "M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",
2173
2174 rightharpoonplus: "M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",
2175
2176 rightharpoondown: "M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",
2177
2178 rightharpoondownplus: "M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",
2179
2180 righthook: "M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",
2181
2182 rightlinesegment: "M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",
2183
2184 rightToFrom: "M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",
2185
2186 // twoheadleftarrow is from glyph U+219E in font KaTeX AMS Regular
2187 twoheadleftarrow: "M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",
2188
2189 twoheadrightarrow: "M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",
2190
2191 // tilde1 is a modified version of a glyph from the MnSymbol package
2192 tilde1: "M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",
2193
2194 // ditto tilde2, tilde3, & tilde4
2195 tilde2: "M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",
2196
2197 tilde3: "M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",
2198
2199 tilde4: "M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",
2200
2201 // vec is from glyph U+20D7 in font KaTeX Main
2202 vec: "M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",
2203
2204 // widehat1 is a modified version of a glyph from the MnSymbol package
2205 widehat1: "M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",
2206
2207 // ditto widehat2, widehat3, & widehat4
2208 widehat2: "M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",
2209
2210 widehat3: "M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",
2211
2212 widehat4: "M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",
2213
2214 // widecheck paths are all inverted versions of widehat
2215 widecheck1: "M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",
2216
2217 widecheck2: "M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",
2218
2219 widecheck3: "M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",
2220
2221 widecheck4: "M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",
2222
2223 // baraboveleftarrow is from glyph U+21C4 in font KaTeX AMS Regular
2224 baraboveleftarrow: "M1 500c30.67-18 59-41.833 85-71.5s45-61.17 57-94.5h23\nc15.33 0 23 .33 23 1 0 .67-5.33 12.67-16 36-16.67 34.67-39 67.33-67 98l-10 11\nh39904v40H96l9 10c27.33 30.67 50.67 65 70 103l14 33c0 .67-7.67 1-23 1h-22\nC116.67 596.33 69 540.67 1 500z M96 480 H400000 v40 H96z\nM1 147 H399905 v40 H1z M0 147 H399905 v40 H0z",
2225
2226 // ditto rightarrowabovebar
2227 rightarrowabovebar: "M400000 167c-70.67 42-118 97.67-142 167h-23c-15.33 0\n-23-.33-23-1 0-1.33 5.33-13.67 16-37 18-35.33 41.33-69 70-101l7-8h-39905\nv-40h39905c-389 0 0 0 0 0l-7-8c-28.67-32-52-65.67-70-101-10.67-23.33-16-35.67\n-16-37 0-.67 7.67-1 23-1h23c11.33 33.33 30 64.833 56 94.5s54.67 53.83 86 72.5z\nM0 147 H399905 v40 H0z M96 480 H400000 v40 H0z M96 480 H400000 v40 H0z",
2228
2229 // The next eight paths support reaction arrows from the mhchem package.
2230
2231 // The short left harpoon has 0.5em (i.e. 500 units) kern on the left end.
2232 // Ref from mhchem.sty: \rlap{\raisebox{-.22ex}{$\kern0.5em
2233 baraboveshortleftharpoon: "M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",
2234
2235 rightharpoonaboveshortbar: "M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",
2236
2237 shortbaraboveleftharpoon: "M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",
2238
2239 shortrightharpoonabovebar: "M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"
2240};
2241
2242/* harmony default export */ var svgGeometry = ({ path: svgGeometry_path });
2243// CONCATENATED MODULE: ./src/domTree.js
2244
2245
2246
2247
2248
2249
2250
2251/**
2252 * These objects store the data about the DOM nodes we create, as well as some
2253 * extra data. They can then be transformed into real DOM nodes with the
2254 * `toNode` function or HTML markup using `toMarkup`. They are useful for both
2255 * storing extra properties on the nodes, as well as providing a way to easily
2256 * work with the DOM.
2257 *
2258 * Similar functions for working with MathML nodes exist in mathMLTree.js.
2259 */
2260
2261
2262
2263
2264
2265/**
2266 * Create an HTML className based on a list of classes. In addition to joining
2267 * with spaces, we also remove empty classes.
2268 */
2269var domTree_createClass = function createClass(classes) {
2270 return classes.filter(function (cls) {
2271 return cls;
2272 }).join(" ");
2273};
2274
2275// To ensure that all nodes have compatible signatures for these methods.
2276
2277
2278// Span wrapping other DOM nodes.
2279
2280// Span wrapping an SVG node.
2281
2282
2283var domTree_HtmlDomContainer = function () {
2284 function HtmlDomContainer(classes, children, options, style) {
2285 classCallCheck_default()(this, HtmlDomContainer);
2286
2287 this.classes = classes || [];
2288 this.children = children || [];
2289 this.attributes = {};
2290 this.height = 0;
2291 this.depth = 0;
2292 this.maxFontSize = 0;
2293 this.style = assign_default()({}, style);
2294 if (options) {
2295 if (options.style.isTight()) {
2296 this.classes.push("mtight");
2297 }
2298 var color = options.getColor();
2299 if (color) {
2300 this.style.color = color;
2301 }
2302 }
2303 }
2304
2305 /**
2306 * Sets an arbitrary attribute on the node. Warning: use this wisely. Not
2307 * all browsers support attributes the same, and having too many custom
2308 * attributes is probably bad.
2309 */
2310
2311
2312 createClass_default()(HtmlDomContainer, [{
2313 key: "setAttribute",
2314 value: function setAttribute(attribute, value) {
2315 this.attributes[attribute] = value;
2316 }
2317 }, {
2318 key: "hasClass",
2319 value: function hasClass(className) {
2320 return utils.contains(this.classes, className);
2321 }
2322
2323 /**
2324 * Try to combine with given sibling. Returns true if the sibling has
2325 * been successfully merged into this node, and false otherwise.
2326 * Default behavior fails (returns false).
2327 */
2328
2329 }, {
2330 key: "tryCombine",
2331 value: function tryCombine(sibling) {
2332 return false;
2333 }
2334 }, {
2335 key: "tagName",
2336 value: function tagName() {
2337 throw new Error("use of generic HtmlDomContainer tagName");
2338 }
2339
2340 /**
2341 * Convert into an HTML node
2342 */
2343
2344 }, {
2345 key: "toNode",
2346 value: function toNode() {
2347 var node = document.createElement(this.tagName());
2348
2349 // Apply the class
2350 node.className = domTree_createClass(this.classes);
2351
2352 // Apply inline styles
2353 for (var _style in this.style) {
2354 if (Object.prototype.hasOwnProperty.call(this.style, _style)) {
2355 // $FlowFixMe Flow doesn't seem to understand node.style's type.
2356 node.style[_style] = this.style[_style];
2357 }
2358 }
2359
2360 // Apply attributes
2361 for (var attr in this.attributes) {
2362 if (this.attributes.hasOwnProperty(attr)) {
2363 node.setAttribute(attr, this.attributes[attr]);
2364 }
2365 }
2366
2367 // Append the children, also as HTML nodes
2368 for (var i = 0; i < this.children.length; i++) {
2369 node.appendChild(this.children[i].toNode());
2370 }
2371
2372 return node;
2373 }
2374
2375 /**
2376 * Convert into an HTML markup string
2377 */
2378
2379 }, {
2380 key: "toMarkup",
2381 value: function toMarkup() {
2382 var markup = "<" + this.tagName();
2383
2384 // Add the class
2385 if (this.classes.length) {
2386 markup += " class=\"" + utils.escape(domTree_createClass(this.classes)) + "\"";
2387 }
2388
2389 var styles = "";
2390
2391 // Add the styles, after hyphenation
2392 for (var _style2 in this.style) {
2393 if (this.style.hasOwnProperty(_style2)) {
2394 styles += utils.hyphenate(_style2) + ":" + this.style[_style2] + ";";
2395 }
2396 }
2397
2398 if (styles) {
2399 markup += " style=\"" + utils.escape(styles) + "\"";
2400 }
2401
2402 // Add the attributes
2403 for (var attr in this.attributes) {
2404 if (this.attributes.hasOwnProperty(attr)) {
2405 markup += " " + attr + "=\"";
2406 markup += utils.escape(this.attributes[attr]);
2407 markup += "\"";
2408 }
2409 }
2410
2411 markup += ">";
2412
2413 // Add the markup of the children, also as markup
2414 for (var i = 0; i < this.children.length; i++) {
2415 markup += this.children[i].toMarkup();
2416 }
2417
2418 markup += "</" + this.tagName() + ">";
2419
2420 return markup;
2421 }
2422 }]);
2423
2424 return HtmlDomContainer;
2425}();
2426
2427/**
2428 * This node represents a span node, with a className, a list of children, and
2429 * an inline style. It also contains information about its height, depth, and
2430 * maxFontSize.
2431 *
2432 * Represents two types with different uses: SvgSpan to wrap an SVG and DomSpan
2433 * otherwise. This typesafety is important when HTML builders access a span's
2434 * children.
2435 */
2436
2437var domTree_span = function (_HtmlDomContainer) {
2438 inherits_default()(span, _HtmlDomContainer);
2439
2440 function span(classes, children, options, style) {
2441 classCallCheck_default()(this, span);
2442
2443 return possibleConstructorReturn_default()(this, (span.__proto__ || get_prototype_of_default()(span)).call(this, classes, children, options, style));
2444 }
2445
2446 createClass_default()(span, [{
2447 key: "tagName",
2448 value: function tagName() {
2449 return "span";
2450 }
2451 }]);
2452
2453 return span;
2454}(domTree_HtmlDomContainer);
2455
2456/**
2457 * This node represents an anchor (<a>) element with a hyperlink, a list of classes,
2458 * a list of children, and an inline style. It also contains information about its
2459 * height, depth, and maxFontSize.
2460 */
2461
2462
2463var domTree_anchor = function (_HtmlDomContainer2) {
2464 inherits_default()(anchor, _HtmlDomContainer2);
2465
2466 function anchor(href, classes, children, options) {
2467 classCallCheck_default()(this, anchor);
2468
2469 var _this2 = possibleConstructorReturn_default()(this, (anchor.__proto__ || get_prototype_of_default()(anchor)).call(this, classes, children, options));
2470
2471 _this2.setAttribute('href', href);
2472 return _this2;
2473 }
2474
2475 createClass_default()(anchor, [{
2476 key: "tagName",
2477 value: function tagName() {
2478 return "a";
2479 }
2480 }]);
2481
2482 return anchor;
2483}(domTree_HtmlDomContainer);
2484
2485/**
2486 * This node represents a document fragment, which contains elements, but when
2487 * placed into the DOM doesn't have any representation itself. Thus, it only
2488 * contains children and doesn't have any HTML properties. It also keeps track
2489 * of a height, depth, and maxFontSize.
2490 */
2491
2492
2493var domTree_documentFragment = function () {
2494 function documentFragment(children) {
2495 classCallCheck_default()(this, documentFragment);
2496
2497 this.children = children || [];
2498 this.classes = [];
2499 this.height = 0;
2500 this.depth = 0;
2501 this.maxFontSize = 0;
2502 } // Never used; needed for satisfying interface.
2503
2504
2505 createClass_default()(documentFragment, [{
2506 key: "hasClass",
2507 value: function hasClass(className) {
2508 return utils.contains(this.classes, className);
2509 }
2510 }, {
2511 key: "tryCombine",
2512 value: function tryCombine(sibling) {
2513 return false;
2514 }
2515 }, {
2516 key: "toNode",
2517
2518
2519 /**
2520 * Convert the fragment into a node
2521 */
2522 value: function toNode() {
2523 // Create a fragment
2524 var frag = document.createDocumentFragment();
2525
2526 // Append the children
2527 for (var i = 0; i < this.children.length; i++) {
2528 frag.appendChild(this.children[i].toNode());
2529 }
2530
2531 return frag;
2532 }
2533
2534 /**
2535 * Convert the fragment into HTML markup
2536 */
2537
2538 }, {
2539 key: "toMarkup",
2540 value: function toMarkup() {
2541 var markup = "";
2542
2543 // Simply concatenate the markup for the children together
2544 for (var i = 0; i < this.children.length; i++) {
2545 markup += this.children[i].toMarkup();
2546 }
2547
2548 return markup;
2549 }
2550 }, {
2551 key: "style",
2552 get: function get() {
2553 throw new Error('DocumentFragment does not support style.');
2554 },
2555 set: function set(_) {
2556 throw new Error('DocumentFragment does not support style.');
2557 }
2558 }]);
2559
2560 return documentFragment;
2561}();
2562
2563var iCombinations = {
2564 'î': "\u0131\u0302",
2565 'ï': "\u0131\u0308",
2566 'í': "\u0131\u0301",
2567 // '?': '\u0131\u0304', // enable when we add Extended Latin
2568 'ì': "\u0131\u0300"
2569};
2570
2571/**
2572 * A symbol node contains information about a single symbol. It either renders
2573 * to a single text node, or a span with a single text node in it, depending on
2574 * whether it has CSS classes, styles, or needs italic correction.
2575 */
2576
2577var domTree_symbolNode = function () {
2578 function symbolNode(value, height, depth, italic, skew, width, classes, style) {
2579 classCallCheck_default()(this, symbolNode);
2580
2581 this.value = value;
2582 this.height = height || 0;
2583 this.depth = depth || 0;
2584 this.italic = italic || 0;
2585 this.skew = skew || 0;
2586 this.width = width || 0;
2587 this.classes = classes || [];
2588 this.style = assign_default()({}, style);
2589 this.maxFontSize = 0;
2590
2591 // Mark text from non-Latin scripts with specific classes so that we
2592 // can specify which fonts to use. This allows us to render these
2593 // characters with a serif font in situations where the browser would
2594 // either default to a sans serif or render a placeholder character.
2595 // We use CSS class names like cjk_fallback, hangul_fallback and
2596 // brahmic_fallback. See ./unicodeScripts.js for the set of possible
2597 // script names
2598 var script = scriptFromCodepoint(this.value.charCodeAt(0));
2599 if (script) {
2600 this.classes.push(script + "_fallback");
2601 }
2602
2603 if (/[îïíì]/.test(this.value)) {
2604 // add ? when we add Extended Latin
2605 this.value = iCombinations[this.value];
2606 }
2607 }
2608
2609 createClass_default()(symbolNode, [{
2610 key: "hasClass",
2611 value: function hasClass(className) {
2612 return utils.contains(this.classes, className);
2613 }
2614 }, {
2615 key: "tryCombine",
2616 value: function tryCombine(sibling) {
2617 if (!sibling || !(sibling instanceof symbolNode) || this.italic > 0 || domTree_createClass(this.classes) !== domTree_createClass(sibling.classes) || this.skew !== sibling.skew || this.maxFontSize !== sibling.maxFontSize) {
2618 return false;
2619 }
2620 for (var _style3 in this.style) {
2621 if (this.style.hasOwnProperty(_style3) && this.style[_style3] !== sibling.style[_style3]) {
2622 return false;
2623 }
2624 }
2625 for (var _style4 in sibling.style) {
2626 if (sibling.style.hasOwnProperty(_style4) && this.style[_style4] !== sibling.style[_style4]) {
2627 return false;
2628 }
2629 }
2630 this.value += sibling.value;
2631 this.height = Math.max(this.height, sibling.height);
2632 this.depth = Math.max(this.depth, sibling.depth);
2633 this.italic = sibling.italic;
2634 return true;
2635 }
2636
2637 /**
2638 * Creates a text node or span from a symbol node. Note that a span is only
2639 * created if it is needed.
2640 */
2641
2642 }, {
2643 key: "toNode",
2644 value: function toNode() {
2645 var node = document.createTextNode(this.value);
2646 var span = null;
2647
2648 if (this.italic > 0) {
2649 span = document.createElement("span");
2650 span.style.marginRight = this.italic + "em";
2651 }
2652
2653 if (this.classes.length > 0) {
2654 span = span || document.createElement("span");
2655 span.className = domTree_createClass(this.classes);
2656 }
2657
2658 for (var _style5 in this.style) {
2659 if (this.style.hasOwnProperty(_style5)) {
2660 span = span || document.createElement("span");
2661 // $FlowFixMe Flow doesn't seem to understand span.style's type.
2662 span.style[_style5] = this.style[_style5];
2663 }
2664 }
2665
2666 if (span) {
2667 span.appendChild(node);
2668 return span;
2669 } else {
2670 return node;
2671 }
2672 }
2673
2674 /**
2675 * Creates markup for a symbol node.
2676 */
2677
2678 }, {
2679 key: "toMarkup",
2680 value: function toMarkup() {
2681 // TODO(alpert): More duplication than I'd like from
2682 // span.prototype.toMarkup and symbolNode.prototype.toNode...
2683 var needsSpan = false;
2684
2685 var markup = "<span";
2686
2687 if (this.classes.length) {
2688 needsSpan = true;
2689 markup += " class=\"";
2690 markup += utils.escape(domTree_createClass(this.classes));
2691 markup += "\"";
2692 }
2693
2694 var styles = "";
2695
2696 if (this.italic > 0) {
2697 styles += "margin-right:" + this.italic + "em;";
2698 }
2699 for (var _style6 in this.style) {
2700 if (this.style.hasOwnProperty(_style6)) {
2701 styles += utils.hyphenate(_style6) + ":" + this.style[_style6] + ";";
2702 }
2703 }
2704
2705 if (styles) {
2706 needsSpan = true;
2707 markup += " style=\"" + utils.escape(styles) + "\"";
2708 }
2709
2710 var escaped = utils.escape(this.value);
2711 if (needsSpan) {
2712 markup += ">";
2713 markup += escaped;
2714 markup += "</span>";
2715 return markup;
2716 } else {
2717 return escaped;
2718 }
2719 }
2720 }]);
2721
2722 return symbolNode;
2723}();
2724
2725/**
2726 * SVG nodes are used to render stretchy wide elements.
2727 */
2728
2729
2730var domTree_svgNode = function () {
2731 function svgNode(children, attributes) {
2732 classCallCheck_default()(this, svgNode);
2733
2734 this.children = children || [];
2735 this.attributes = attributes || {};
2736 }
2737
2738 createClass_default()(svgNode, [{
2739 key: "toNode",
2740 value: function toNode() {
2741 var svgNS = "http://www.w3.org/2000/svg";
2742 var node = document.createElementNS(svgNS, "svg");
2743
2744 // Apply attributes
2745 for (var attr in this.attributes) {
2746 if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
2747 node.setAttribute(attr, this.attributes[attr]);
2748 }
2749 }
2750
2751 for (var i = 0; i < this.children.length; i++) {
2752 node.appendChild(this.children[i].toNode());
2753 }
2754 return node;
2755 }
2756 }, {
2757 key: "toMarkup",
2758 value: function toMarkup() {
2759 var markup = "<svg";
2760
2761 // Apply attributes
2762 for (var attr in this.attributes) {
2763 if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
2764 markup += " " + attr + "='" + this.attributes[attr] + "'";
2765 }
2766 }
2767
2768 markup += ">";
2769
2770 for (var i = 0; i < this.children.length; i++) {
2771 markup += this.children[i].toMarkup();
2772 }
2773
2774 markup += "</svg>";
2775
2776 return markup;
2777 }
2778 }]);
2779
2780 return svgNode;
2781}();
2782
2783var domTree_pathNode = function () {
2784 function pathNode(pathName, alternate) {
2785 classCallCheck_default()(this, pathNode);
2786
2787 this.pathName = pathName;
2788 this.alternate = alternate; // Used only for tall \sqrt
2789 }
2790
2791 createClass_default()(pathNode, [{
2792 key: "toNode",
2793 value: function toNode() {
2794 var svgNS = "http://www.w3.org/2000/svg";
2795 var node = document.createElementNS(svgNS, "path");
2796
2797 if (this.alternate) {
2798 node.setAttribute("d", this.alternate);
2799 } else {
2800 node.setAttribute("d", svgGeometry.path[this.pathName]);
2801 }
2802
2803 return node;
2804 }
2805 }, {
2806 key: "toMarkup",
2807 value: function toMarkup() {
2808 if (this.alternate) {
2809 return "<path d='" + this.alternate + "'/>";
2810 } else {
2811 return "<path d='" + svgGeometry.path[this.pathName] + "'/>";
2812 }
2813 }
2814 }]);
2815
2816 return pathNode;
2817}();
2818
2819var domTree_lineNode = function () {
2820 function lineNode(attributes) {
2821 classCallCheck_default()(this, lineNode);
2822
2823 this.attributes = attributes || {};
2824 }
2825
2826 createClass_default()(lineNode, [{
2827 key: "toNode",
2828 value: function toNode() {
2829 var svgNS = "http://www.w3.org/2000/svg";
2830 var node = document.createElementNS(svgNS, "line");
2831
2832 // Apply attributes
2833 for (var attr in this.attributes) {
2834 if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
2835 node.setAttribute(attr, this.attributes[attr]);
2836 }
2837 }
2838
2839 return node;
2840 }
2841 }, {
2842 key: "toMarkup",
2843 value: function toMarkup() {
2844 var markup = "<line";
2845
2846 for (var attr in this.attributes) {
2847 if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
2848 markup += " " + attr + "='" + this.attributes[attr] + "'";
2849 }
2850 }
2851
2852 markup += "/>";
2853
2854 return markup;
2855 }
2856 }]);
2857
2858 return lineNode;
2859}();
2860
2861function assertSymbolDomNode(group) {
2862 if (group instanceof domTree_symbolNode) {
2863 return group;
2864 } else {
2865 throw new Error("Expected symbolNode but got " + String(group) + ".");
2866 }
2867}
2868
2869function assertDomContainer(group) {
2870 if (group instanceof domTree_HtmlDomContainer) {
2871 return group;
2872 } else {
2873 throw new Error("Expected HtmlDomContainer but got " + String(group) + ".");
2874 }
2875}
2876
2877/* harmony default export */ var domTree = ({
2878 span: domTree_span,
2879 anchor: domTree_anchor,
2880 documentFragment: domTree_documentFragment,
2881 symbolNode: domTree_symbolNode,
2882 svgNode: domTree_svgNode,
2883 pathNode: domTree_pathNode,
2884 lineNode: domTree_lineNode
2885});
2886// CONCATENATED MODULE: ./submodules/katex-fonts/fontMetricsData.js
2887// This file is GENERATED by buildMetrics.sh. DO NOT MODIFY.
2888/* harmony default export */ var fontMetricsData = ({
2889 "AMS-Regular": {
2890 "65": [0, 0.68889, 0, 0, 0.72222],
2891 "66": [0, 0.68889, 0, 0, 0.66667],
2892 "67": [0, 0.68889, 0, 0, 0.72222],
2893 "68": [0, 0.68889, 0, 0, 0.72222],
2894 "69": [0, 0.68889, 0, 0, 0.66667],
2895 "70": [0, 0.68889, 0, 0, 0.61111],
2896 "71": [0, 0.68889, 0, 0, 0.77778],
2897 "72": [0, 0.68889, 0, 0, 0.77778],
2898 "73": [0, 0.68889, 0, 0, 0.38889],
2899 "74": [0.16667, 0.68889, 0, 0, 0.5],
2900 "75": [0, 0.68889, 0, 0, 0.77778],
2901 "76": [0, 0.68889, 0, 0, 0.66667],
2902 "77": [0, 0.68889, 0, 0, 0.94445],
2903 "78": [0, 0.68889, 0, 0, 0.72222],
2904 "79": [0.16667, 0.68889, 0, 0, 0.77778],
2905 "80": [0, 0.68889, 0, 0, 0.61111],
2906 "81": [0.16667, 0.68889, 0, 0, 0.77778],
2907 "82": [0, 0.68889, 0, 0, 0.72222],
2908 "83": [0, 0.68889, 0, 0, 0.55556],
2909 "84": [0, 0.68889, 0, 0, 0.66667],
2910 "85": [0, 0.68889, 0, 0, 0.72222],
2911 "86": [0, 0.68889, 0, 0, 0.72222],
2912 "87": [0, 0.68889, 0, 0, 1.0],
2913 "88": [0, 0.68889, 0, 0, 0.72222],
2914 "89": [0, 0.68889, 0, 0, 0.72222],
2915 "90": [0, 0.68889, 0, 0, 0.66667],
2916 "107": [0, 0.68889, 0, 0, 0.55556],
2917 "165": [0, 0.675, 0.025, 0, 0.75],
2918 "174": [0.15559, 0.69224, 0, 0, 0.94666],
2919 "240": [0, 0.68889, 0, 0, 0.55556],
2920 "295": [0, 0.68889, 0, 0, 0.54028],
2921 "710": [0, 0.825, 0, 0, 2.33334],
2922 "732": [0, 0.9, 0, 0, 2.33334],
2923 "770": [0, 0.825, 0, 0, 2.33334],
2924 "771": [0, 0.9, 0, 0, 2.33334],
2925 "989": [0.08167, 0.58167, 0, 0, 0.77778],
2926 "1008": [0, 0.43056, 0.04028, 0, 0.66667],
2927 "8245": [0, 0.54986, 0, 0, 0.275],
2928 "8463": [0, 0.68889, 0, 0, 0.54028],
2929 "8487": [0, 0.68889, 0, 0, 0.72222],
2930 "8498": [0, 0.68889, 0, 0, 0.55556],
2931 "8502": [0, 0.68889, 0, 0, 0.66667],
2932 "8503": [0, 0.68889, 0, 0, 0.44445],
2933 "8504": [0, 0.68889, 0, 0, 0.66667],
2934 "8513": [0, 0.68889, 0, 0, 0.63889],
2935 "8592": [-0.03598, 0.46402, 0, 0, 0.5],
2936 "8594": [-0.03598, 0.46402, 0, 0, 0.5],
2937 "8602": [-0.13313, 0.36687, 0, 0, 1.0],
2938 "8603": [-0.13313, 0.36687, 0, 0, 1.0],
2939 "8606": [0.01354, 0.52239, 0, 0, 1.0],
2940 "8608": [0.01354, 0.52239, 0, 0, 1.0],
2941 "8610": [0.01354, 0.52239, 0, 0, 1.11111],
2942 "8611": [0.01354, 0.52239, 0, 0, 1.11111],
2943 "8619": [0, 0.54986, 0, 0, 1.0],
2944 "8620": [0, 0.54986, 0, 0, 1.0],
2945 "8621": [-0.13313, 0.37788, 0, 0, 1.38889],
2946 "8622": [-0.13313, 0.36687, 0, 0, 1.0],
2947 "8624": [0, 0.69224, 0, 0, 0.5],
2948 "8625": [0, 0.69224, 0, 0, 0.5],
2949 "8630": [0, 0.43056, 0, 0, 1.0],
2950 "8631": [0, 0.43056, 0, 0, 1.0],
2951 "8634": [0.08198, 0.58198, 0, 0, 0.77778],
2952 "8635": [0.08198, 0.58198, 0, 0, 0.77778],
2953 "8638": [0.19444, 0.69224, 0, 0, 0.41667],
2954 "8639": [0.19444, 0.69224, 0, 0, 0.41667],
2955 "8642": [0.19444, 0.69224, 0, 0, 0.41667],
2956 "8643": [0.19444, 0.69224, 0, 0, 0.41667],
2957 "8644": [0.1808, 0.675, 0, 0, 1.0],
2958 "8646": [0.1808, 0.675, 0, 0, 1.0],
2959 "8647": [0.1808, 0.675, 0, 0, 1.0],
2960 "8648": [0.19444, 0.69224, 0, 0, 0.83334],
2961 "8649": [0.1808, 0.675, 0, 0, 1.0],
2962 "8650": [0.19444, 0.69224, 0, 0, 0.83334],
2963 "8651": [0.01354, 0.52239, 0, 0, 1.0],
2964 "8652": [0.01354, 0.52239, 0, 0, 1.0],
2965 "8653": [-0.13313, 0.36687, 0, 0, 1.0],
2966 "8654": [-0.13313, 0.36687, 0, 0, 1.0],
2967 "8655": [-0.13313, 0.36687, 0, 0, 1.0],
2968 "8666": [0.13667, 0.63667, 0, 0, 1.0],
2969 "8667": [0.13667, 0.63667, 0, 0, 1.0],
2970 "8669": [-0.13313, 0.37788, 0, 0, 1.0],
2971 "8672": [-0.064, 0.437, 0, 0, 1.334],
2972 "8674": [-0.064, 0.437, 0, 0, 1.334],
2973 "8705": [0, 0.825, 0, 0, 0.5],
2974 "8708": [0, 0.68889, 0, 0, 0.55556],
2975 "8709": [0.08167, 0.58167, 0, 0, 0.77778],
2976 "8717": [0, 0.43056, 0, 0, 0.42917],
2977 "8722": [-0.03598, 0.46402, 0, 0, 0.5],
2978 "8724": [0.08198, 0.69224, 0, 0, 0.77778],
2979 "8726": [0.08167, 0.58167, 0, 0, 0.77778],
2980 "8733": [0, 0.69224, 0, 0, 0.77778],
2981 "8736": [0, 0.69224, 0, 0, 0.72222],
2982 "8737": [0, 0.69224, 0, 0, 0.72222],
2983 "8738": [0.03517, 0.52239, 0, 0, 0.72222],
2984 "8739": [0.08167, 0.58167, 0, 0, 0.22222],
2985 "8740": [0.25142, 0.74111, 0, 0, 0.27778],
2986 "8741": [0.08167, 0.58167, 0, 0, 0.38889],
2987 "8742": [0.25142, 0.74111, 0, 0, 0.5],
2988 "8756": [0, 0.69224, 0, 0, 0.66667],
2989 "8757": [0, 0.69224, 0, 0, 0.66667],
2990 "8764": [-0.13313, 0.36687, 0, 0, 0.77778],
2991 "8765": [-0.13313, 0.37788, 0, 0, 0.77778],
2992 "8769": [-0.13313, 0.36687, 0, 0, 0.77778],
2993 "8770": [-0.03625, 0.46375, 0, 0, 0.77778],
2994 "8774": [0.30274, 0.79383, 0, 0, 0.77778],
2995 "8776": [-0.01688, 0.48312, 0, 0, 0.77778],
2996 "8778": [0.08167, 0.58167, 0, 0, 0.77778],
2997 "8782": [0.06062, 0.54986, 0, 0, 0.77778],
2998 "8783": [0.06062, 0.54986, 0, 0, 0.77778],
2999 "8785": [0.08198, 0.58198, 0, 0, 0.77778],
3000 "8786": [0.08198, 0.58198, 0, 0, 0.77778],
3001 "8787": [0.08198, 0.58198, 0, 0, 0.77778],
3002 "8790": [0, 0.69224, 0, 0, 0.77778],
3003 "8791": [0.22958, 0.72958, 0, 0, 0.77778],
3004 "8796": [0.08198, 0.91667, 0, 0, 0.77778],
3005 "8806": [0.25583, 0.75583, 0, 0, 0.77778],
3006 "8807": [0.25583, 0.75583, 0, 0, 0.77778],
3007 "8808": [0.25142, 0.75726, 0, 0, 0.77778],
3008 "8809": [0.25142, 0.75726, 0, 0, 0.77778],
3009 "8812": [0.25583, 0.75583, 0, 0, 0.5],
3010 "8814": [0.20576, 0.70576, 0, 0, 0.77778],
3011 "8815": [0.20576, 0.70576, 0, 0, 0.77778],
3012 "8816": [0.30274, 0.79383, 0, 0, 0.77778],
3013 "8817": [0.30274, 0.79383, 0, 0, 0.77778],
3014 "8818": [0.22958, 0.72958, 0, 0, 0.77778],
3015 "8819": [0.22958, 0.72958, 0, 0, 0.77778],
3016 "8822": [0.1808, 0.675, 0, 0, 0.77778],
3017 "8823": [0.1808, 0.675, 0, 0, 0.77778],
3018 "8828": [0.13667, 0.63667, 0, 0, 0.77778],
3019 "8829": [0.13667, 0.63667, 0, 0, 0.77778],
3020 "8830": [0.22958, 0.72958, 0, 0, 0.77778],
3021 "8831": [0.22958, 0.72958, 0, 0, 0.77778],
3022 "8832": [0.20576, 0.70576, 0, 0, 0.77778],
3023 "8833": [0.20576, 0.70576, 0, 0, 0.77778],
3024 "8840": [0.30274, 0.79383, 0, 0, 0.77778],
3025 "8841": [0.30274, 0.79383, 0, 0, 0.77778],
3026 "8842": [0.13597, 0.63597, 0, 0, 0.77778],
3027 "8843": [0.13597, 0.63597, 0, 0, 0.77778],
3028 "8847": [0.03517, 0.54986, 0, 0, 0.77778],
3029 "8848": [0.03517, 0.54986, 0, 0, 0.77778],
3030 "8858": [0.08198, 0.58198, 0, 0, 0.77778],
3031 "8859": [0.08198, 0.58198, 0, 0, 0.77778],
3032 "8861": [0.08198, 0.58198, 0, 0, 0.77778],
3033 "8862": [0, 0.675, 0, 0, 0.77778],
3034 "8863": [0, 0.675, 0, 0, 0.77778],
3035 "8864": [0, 0.675, 0, 0, 0.77778],
3036 "8865": [0, 0.675, 0, 0, 0.77778],
3037 "8872": [0, 0.69224, 0, 0, 0.61111],
3038 "8873": [0, 0.69224, 0, 0, 0.72222],
3039 "8874": [0, 0.69224, 0, 0, 0.88889],
3040 "8876": [0, 0.68889, 0, 0, 0.61111],
3041 "8877": [0, 0.68889, 0, 0, 0.61111],
3042 "8878": [0, 0.68889, 0, 0, 0.72222],
3043 "8879": [0, 0.68889, 0, 0, 0.72222],
3044 "8882": [0.03517, 0.54986, 0, 0, 0.77778],
3045 "8883": [0.03517, 0.54986, 0, 0, 0.77778],
3046 "8884": [0.13667, 0.63667, 0, 0, 0.77778],
3047 "8885": [0.13667, 0.63667, 0, 0, 0.77778],
3048 "8888": [0, 0.54986, 0, 0, 1.11111],
3049 "8890": [0.19444, 0.43056, 0, 0, 0.55556],
3050 "8891": [0.19444, 0.69224, 0, 0, 0.61111],
3051 "8892": [0.19444, 0.69224, 0, 0, 0.61111],
3052 "8901": [0, 0.54986, 0, 0, 0.27778],
3053 "8903": [0.08167, 0.58167, 0, 0, 0.77778],
3054 "8905": [0.08167, 0.58167, 0, 0, 0.77778],
3055 "8906": [0.08167, 0.58167, 0, 0, 0.77778],
3056 "8907": [0, 0.69224, 0, 0, 0.77778],
3057 "8908": [0, 0.69224, 0, 0, 0.77778],
3058 "8909": [-0.03598, 0.46402, 0, 0, 0.77778],
3059 "8910": [0, 0.54986, 0, 0, 0.76042],
3060 "8911": [0, 0.54986, 0, 0, 0.76042],
3061 "8912": [0.03517, 0.54986, 0, 0, 0.77778],
3062 "8913": [0.03517, 0.54986, 0, 0, 0.77778],
3063 "8914": [0, 0.54986, 0, 0, 0.66667],
3064 "8915": [0, 0.54986, 0, 0, 0.66667],
3065 "8916": [0, 0.69224, 0, 0, 0.66667],
3066 "8918": [0.0391, 0.5391, 0, 0, 0.77778],
3067 "8919": [0.0391, 0.5391, 0, 0, 0.77778],
3068 "8920": [0.03517, 0.54986, 0, 0, 1.33334],
3069 "8921": [0.03517, 0.54986, 0, 0, 1.33334],
3070 "8922": [0.38569, 0.88569, 0, 0, 0.77778],
3071 "8923": [0.38569, 0.88569, 0, 0, 0.77778],
3072 "8926": [0.13667, 0.63667, 0, 0, 0.77778],
3073 "8927": [0.13667, 0.63667, 0, 0, 0.77778],
3074 "8928": [0.30274, 0.79383, 0, 0, 0.77778],
3075 "8929": [0.30274, 0.79383, 0, 0, 0.77778],
3076 "8934": [0.23222, 0.74111, 0, 0, 0.77778],
3077 "8935": [0.23222, 0.74111, 0, 0, 0.77778],
3078 "8936": [0.23222, 0.74111, 0, 0, 0.77778],
3079 "8937": [0.23222, 0.74111, 0, 0, 0.77778],
3080 "8938": [0.20576, 0.70576, 0, 0, 0.77778],
3081 "8939": [0.20576, 0.70576, 0, 0, 0.77778],
3082 "8940": [0.30274, 0.79383, 0, 0, 0.77778],
3083 "8941": [0.30274, 0.79383, 0, 0, 0.77778],
3084 "8994": [0.19444, 0.69224, 0, 0, 0.77778],
3085 "8995": [0.19444, 0.69224, 0, 0, 0.77778],
3086 "9416": [0.15559, 0.69224, 0, 0, 0.90222],
3087 "9484": [0, 0.69224, 0, 0, 0.5],
3088 "9488": [0, 0.69224, 0, 0, 0.5],
3089 "9492": [0, 0.37788, 0, 0, 0.5],
3090 "9496": [0, 0.37788, 0, 0, 0.5],
3091 "9585": [0.19444, 0.68889, 0, 0, 0.88889],
3092 "9586": [0.19444, 0.74111, 0, 0, 0.88889],
3093 "9632": [0, 0.675, 0, 0, 0.77778],
3094 "9633": [0, 0.675, 0, 0, 0.77778],
3095 "9650": [0, 0.54986, 0, 0, 0.72222],
3096 "9651": [0, 0.54986, 0, 0, 0.72222],
3097 "9654": [0.03517, 0.54986, 0, 0, 0.77778],
3098 "9660": [0, 0.54986, 0, 0, 0.72222],
3099 "9661": [0, 0.54986, 0, 0, 0.72222],
3100 "9664": [0.03517, 0.54986, 0, 0, 0.77778],
3101 "9674": [0.11111, 0.69224, 0, 0, 0.66667],
3102 "9733": [0.19444, 0.69224, 0, 0, 0.94445],
3103 "10003": [0, 0.69224, 0, 0, 0.83334],
3104 "10016": [0, 0.69224, 0, 0, 0.83334],
3105 "10731": [0.11111, 0.69224, 0, 0, 0.66667],
3106 "10846": [0.19444, 0.75583, 0, 0, 0.61111],
3107 "10877": [0.13667, 0.63667, 0, 0, 0.77778],
3108 "10878": [0.13667, 0.63667, 0, 0, 0.77778],
3109 "10885": [0.25583, 0.75583, 0, 0, 0.77778],
3110 "10886": [0.25583, 0.75583, 0, 0, 0.77778],
3111 "10887": [0.13597, 0.63597, 0, 0, 0.77778],
3112 "10888": [0.13597, 0.63597, 0, 0, 0.77778],
3113 "10889": [0.26167, 0.75726, 0, 0, 0.77778],
3114 "10890": [0.26167, 0.75726, 0, 0, 0.77778],
3115 "10891": [0.48256, 0.98256, 0, 0, 0.77778],
3116 "10892": [0.48256, 0.98256, 0, 0, 0.77778],
3117 "10901": [0.13667, 0.63667, 0, 0, 0.77778],
3118 "10902": [0.13667, 0.63667, 0, 0, 0.77778],
3119 "10933": [0.25142, 0.75726, 0, 0, 0.77778],
3120 "10934": [0.25142, 0.75726, 0, 0, 0.77778],
3121 "10935": [0.26167, 0.75726, 0, 0, 0.77778],
3122 "10936": [0.26167, 0.75726, 0, 0, 0.77778],
3123 "10937": [0.26167, 0.75726, 0, 0, 0.77778],
3124 "10938": [0.26167, 0.75726, 0, 0, 0.77778],
3125 "10949": [0.25583, 0.75583, 0, 0, 0.77778],
3126 "10950": [0.25583, 0.75583, 0, 0, 0.77778],
3127 "10955": [0.28481, 0.79383, 0, 0, 0.77778],
3128 "10956": [0.28481, 0.79383, 0, 0, 0.77778],
3129 "57350": [0.08167, 0.58167, 0, 0, 0.22222],
3130 "57351": [0.08167, 0.58167, 0, 0, 0.38889],
3131 "57352": [0.08167, 0.58167, 0, 0, 0.77778],
3132 "57353": [0, 0.43056, 0.04028, 0, 0.66667],
3133 "57356": [0.25142, 0.75726, 0, 0, 0.77778],
3134 "57357": [0.25142, 0.75726, 0, 0, 0.77778],
3135 "57358": [0.41951, 0.91951, 0, 0, 0.77778],
3136 "57359": [0.30274, 0.79383, 0, 0, 0.77778],
3137 "57360": [0.30274, 0.79383, 0, 0, 0.77778],
3138 "57361": [0.41951, 0.91951, 0, 0, 0.77778],
3139 "57366": [0.25142, 0.75726, 0, 0, 0.77778],
3140 "57367": [0.25142, 0.75726, 0, 0, 0.77778],
3141 "57368": [0.25142, 0.75726, 0, 0, 0.77778],
3142 "57369": [0.25142, 0.75726, 0, 0, 0.77778],
3143 "57370": [0.13597, 0.63597, 0, 0, 0.77778],
3144 "57371": [0.13597, 0.63597, 0, 0, 0.77778]
3145 },
3146 "Caligraphic-Regular": {
3147 "48": [0, 0.43056, 0, 0, 0.5],
3148 "49": [0, 0.43056, 0, 0, 0.5],
3149 "50": [0, 0.43056, 0, 0, 0.5],
3150 "51": [0.19444, 0.43056, 0, 0, 0.5],
3151 "52": [0.19444, 0.43056, 0, 0, 0.5],
3152 "53": [0.19444, 0.43056, 0, 0, 0.5],
3153 "54": [0, 0.64444, 0, 0, 0.5],
3154 "55": [0.19444, 0.43056, 0, 0, 0.5],
3155 "56": [0, 0.64444, 0, 0, 0.5],
3156 "57": [0.19444, 0.43056, 0, 0, 0.5],
3157 "65": [0, 0.68333, 0, 0.19445, 0.79847],
3158 "66": [0, 0.68333, 0.03041, 0.13889, 0.65681],
3159 "67": [0, 0.68333, 0.05834, 0.13889, 0.52653],
3160 "68": [0, 0.68333, 0.02778, 0.08334, 0.77139],
3161 "69": [0, 0.68333, 0.08944, 0.11111, 0.52778],
3162 "70": [0, 0.68333, 0.09931, 0.11111, 0.71875],
3163 "71": [0.09722, 0.68333, 0.0593, 0.11111, 0.59487],
3164 "72": [0, 0.68333, 0.00965, 0.11111, 0.84452],
3165 "73": [0, 0.68333, 0.07382, 0, 0.54452],
3166 "74": [0.09722, 0.68333, 0.18472, 0.16667, 0.67778],
3167 "75": [0, 0.68333, 0.01445, 0.05556, 0.76195],
3168 "76": [0, 0.68333, 0, 0.13889, 0.68972],
3169 "77": [0, 0.68333, 0, 0.13889, 1.2009],
3170 "78": [0, 0.68333, 0.14736, 0.08334, 0.82049],
3171 "79": [0, 0.68333, 0.02778, 0.11111, 0.79611],
3172 "80": [0, 0.68333, 0.08222, 0.08334, 0.69556],
3173 "81": [0.09722, 0.68333, 0, 0.11111, 0.81667],
3174 "82": [0, 0.68333, 0, 0.08334, 0.8475],
3175 "83": [0, 0.68333, 0.075, 0.13889, 0.60556],
3176 "84": [0, 0.68333, 0.25417, 0, 0.54464],
3177 "85": [0, 0.68333, 0.09931, 0.08334, 0.62583],
3178 "86": [0, 0.68333, 0.08222, 0, 0.61278],
3179 "87": [0, 0.68333, 0.08222, 0.08334, 0.98778],
3180 "88": [0, 0.68333, 0.14643, 0.13889, 0.7133],
3181 "89": [0.09722, 0.68333, 0.08222, 0.08334, 0.66834],
3182 "90": [0, 0.68333, 0.07944, 0.13889, 0.72473]
3183 },
3184 "Fraktur-Regular": {
3185 "33": [0, 0.69141, 0, 0, 0.29574],
3186 "34": [0, 0.69141, 0, 0, 0.21471],
3187 "38": [0, 0.69141, 0, 0, 0.73786],
3188 "39": [0, 0.69141, 0, 0, 0.21201],
3189 "40": [0.24982, 0.74947, 0, 0, 0.38865],
3190 "41": [0.24982, 0.74947, 0, 0, 0.38865],
3191 "42": [0, 0.62119, 0, 0, 0.27764],
3192 "43": [0.08319, 0.58283, 0, 0, 0.75623],
3193 "44": [0, 0.10803, 0, 0, 0.27764],
3194 "45": [0.08319, 0.58283, 0, 0, 0.75623],
3195 "46": [0, 0.10803, 0, 0, 0.27764],
3196 "47": [0.24982, 0.74947, 0, 0, 0.50181],
3197 "48": [0, 0.47534, 0, 0, 0.50181],
3198 "49": [0, 0.47534, 0, 0, 0.50181],
3199 "50": [0, 0.47534, 0, 0, 0.50181],
3200 "51": [0.18906, 0.47534, 0, 0, 0.50181],
3201 "52": [0.18906, 0.47534, 0, 0, 0.50181],
3202 "53": [0.18906, 0.47534, 0, 0, 0.50181],
3203 "54": [0, 0.69141, 0, 0, 0.50181],
3204 "55": [0.18906, 0.47534, 0, 0, 0.50181],
3205 "56": [0, 0.69141, 0, 0, 0.50181],
3206 "57": [0.18906, 0.47534, 0, 0, 0.50181],
3207 "58": [0, 0.47534, 0, 0, 0.21606],
3208 "59": [0.12604, 0.47534, 0, 0, 0.21606],
3209 "61": [-0.13099, 0.36866, 0, 0, 0.75623],
3210 "63": [0, 0.69141, 0, 0, 0.36245],
3211 "65": [0, 0.69141, 0, 0, 0.7176],
3212 "66": [0, 0.69141, 0, 0, 0.88397],
3213 "67": [0, 0.69141, 0, 0, 0.61254],
3214 "68": [0, 0.69141, 0, 0, 0.83158],
3215 "69": [0, 0.69141, 0, 0, 0.66278],
3216 "70": [0.12604, 0.69141, 0, 0, 0.61119],
3217 "71": [0, 0.69141, 0, 0, 0.78539],
3218 "72": [0.06302, 0.69141, 0, 0, 0.7203],
3219 "73": [0, 0.69141, 0, 0, 0.55448],
3220 "74": [0.12604, 0.69141, 0, 0, 0.55231],
3221 "75": [0, 0.69141, 0, 0, 0.66845],
3222 "76": [0, 0.69141, 0, 0, 0.66602],
3223 "77": [0, 0.69141, 0, 0, 1.04953],
3224 "78": [0, 0.69141, 0, 0, 0.83212],
3225 "79": [0, 0.69141, 0, 0, 0.82699],
3226 "80": [0.18906, 0.69141, 0, 0, 0.82753],
3227 "81": [0.03781, 0.69141, 0, 0, 0.82699],
3228 "82": [0, 0.69141, 0, 0, 0.82807],
3229 "83": [0, 0.69141, 0, 0, 0.82861],
3230 "84": [0, 0.69141, 0, 0, 0.66899],
3231 "85": [0, 0.69141, 0, 0, 0.64576],
3232 "86": [0, 0.69141, 0, 0, 0.83131],
3233 "87": [0, 0.69141, 0, 0, 1.04602],
3234 "88": [0, 0.69141, 0, 0, 0.71922],
3235 "89": [0.18906, 0.69141, 0, 0, 0.83293],
3236 "90": [0.12604, 0.69141, 0, 0, 0.60201],
3237 "91": [0.24982, 0.74947, 0, 0, 0.27764],
3238 "93": [0.24982, 0.74947, 0, 0, 0.27764],
3239 "94": [0, 0.69141, 0, 0, 0.49965],
3240 "97": [0, 0.47534, 0, 0, 0.50046],
3241 "98": [0, 0.69141, 0, 0, 0.51315],
3242 "99": [0, 0.47534, 0, 0, 0.38946],
3243 "100": [0, 0.62119, 0, 0, 0.49857],
3244 "101": [0, 0.47534, 0, 0, 0.40053],
3245 "102": [0.18906, 0.69141, 0, 0, 0.32626],
3246 "103": [0.18906, 0.47534, 0, 0, 0.5037],
3247 "104": [0.18906, 0.69141, 0, 0, 0.52126],
3248 "105": [0, 0.69141, 0, 0, 0.27899],
3249 "106": [0, 0.69141, 0, 0, 0.28088],
3250 "107": [0, 0.69141, 0, 0, 0.38946],
3251 "108": [0, 0.69141, 0, 0, 0.27953],
3252 "109": [0, 0.47534, 0, 0, 0.76676],
3253 "110": [0, 0.47534, 0, 0, 0.52666],
3254 "111": [0, 0.47534, 0, 0, 0.48885],
3255 "112": [0.18906, 0.52396, 0, 0, 0.50046],
3256 "113": [0.18906, 0.47534, 0, 0, 0.48912],
3257 "114": [0, 0.47534, 0, 0, 0.38919],
3258 "115": [0, 0.47534, 0, 0, 0.44266],
3259 "116": [0, 0.62119, 0, 0, 0.33301],
3260 "117": [0, 0.47534, 0, 0, 0.5172],
3261 "118": [0, 0.52396, 0, 0, 0.5118],
3262 "119": [0, 0.52396, 0, 0, 0.77351],
3263 "120": [0.18906, 0.47534, 0, 0, 0.38865],
3264 "121": [0.18906, 0.47534, 0, 0, 0.49884],
3265 "122": [0.18906, 0.47534, 0, 0, 0.39054],
3266 "8216": [0, 0.69141, 0, 0, 0.21471],
3267 "8217": [0, 0.69141, 0, 0, 0.21471],
3268 "58112": [0, 0.62119, 0, 0, 0.49749],
3269 "58113": [0, 0.62119, 0, 0, 0.4983],
3270 "58114": [0.18906, 0.69141, 0, 0, 0.33328],
3271 "58115": [0.18906, 0.69141, 0, 0, 0.32923],
3272 "58116": [0.18906, 0.47534, 0, 0, 0.50343],
3273 "58117": [0, 0.69141, 0, 0, 0.33301],
3274 "58118": [0, 0.62119, 0, 0, 0.33409],
3275 "58119": [0, 0.47534, 0, 0, 0.50073]
3276 },
3277 "Main-Bold": {
3278 "33": [0, 0.69444, 0, 0, 0.35],
3279 "34": [0, 0.69444, 0, 0, 0.60278],
3280 "35": [0.19444, 0.69444, 0, 0, 0.95833],
3281 "36": [0.05556, 0.75, 0, 0, 0.575],
3282 "37": [0.05556, 0.75, 0, 0, 0.95833],
3283 "38": [0, 0.69444, 0, 0, 0.89444],
3284 "39": [0, 0.69444, 0, 0, 0.31944],
3285 "40": [0.25, 0.75, 0, 0, 0.44722],
3286 "41": [0.25, 0.75, 0, 0, 0.44722],
3287 "42": [0, 0.75, 0, 0, 0.575],
3288 "43": [0.13333, 0.63333, 0, 0, 0.89444],
3289 "44": [0.19444, 0.15556, 0, 0, 0.31944],
3290 "45": [0, 0.44444, 0, 0, 0.38333],
3291 "46": [0, 0.15556, 0, 0, 0.31944],
3292 "47": [0.25, 0.75, 0, 0, 0.575],
3293 "48": [0, 0.64444, 0, 0, 0.575],
3294 "49": [0, 0.64444, 0, 0, 0.575],
3295 "50": [0, 0.64444, 0, 0, 0.575],
3296 "51": [0, 0.64444, 0, 0, 0.575],
3297 "52": [0, 0.64444, 0, 0, 0.575],
3298 "53": [0, 0.64444, 0, 0, 0.575],
3299 "54": [0, 0.64444, 0, 0, 0.575],
3300 "55": [0, 0.64444, 0, 0, 0.575],
3301 "56": [0, 0.64444, 0, 0, 0.575],
3302 "57": [0, 0.64444, 0, 0, 0.575],
3303 "58": [0, 0.44444, 0, 0, 0.31944],
3304 "59": [0.19444, 0.44444, 0, 0, 0.31944],
3305 "60": [0.08556, 0.58556, 0, 0, 0.89444],
3306 "61": [-0.10889, 0.39111, 0, 0, 0.89444],
3307 "62": [0.08556, 0.58556, 0, 0, 0.89444],
3308 "63": [0, 0.69444, 0, 0, 0.54305],
3309 "64": [0, 0.69444, 0, 0, 0.89444],
3310 "65": [0, 0.68611, 0, 0, 0.86944],
3311 "66": [0, 0.68611, 0, 0, 0.81805],
3312 "67": [0, 0.68611, 0, 0, 0.83055],
3313 "68": [0, 0.68611, 0, 0, 0.88194],
3314 "69": [0, 0.68611, 0, 0, 0.75555],
3315 "70": [0, 0.68611, 0, 0, 0.72361],
3316 "71": [0, 0.68611, 0, 0, 0.90416],
3317 "72": [0, 0.68611, 0, 0, 0.9],
3318 "73": [0, 0.68611, 0, 0, 0.43611],
3319 "74": [0, 0.68611, 0, 0, 0.59444],
3320 "75": [0, 0.68611, 0, 0, 0.90138],
3321 "76": [0, 0.68611, 0, 0, 0.69166],
3322 "77": [0, 0.68611, 0, 0, 1.09166],
3323 "78": [0, 0.68611, 0, 0, 0.9],
3324 "79": [0, 0.68611, 0, 0, 0.86388],
3325 "80": [0, 0.68611, 0, 0, 0.78611],
3326 "81": [0.19444, 0.68611, 0, 0, 0.86388],
3327 "82": [0, 0.68611, 0, 0, 0.8625],
3328 "83": [0, 0.68611, 0, 0, 0.63889],
3329 "84": [0, 0.68611, 0, 0, 0.8],
3330 "85": [0, 0.68611, 0, 0, 0.88472],
3331 "86": [0, 0.68611, 0.01597, 0, 0.86944],
3332 "87": [0, 0.68611, 0.01597, 0, 1.18888],
3333 "88": [0, 0.68611, 0, 0, 0.86944],
3334 "89": [0, 0.68611, 0.02875, 0, 0.86944],
3335 "90": [0, 0.68611, 0, 0, 0.70277],
3336 "91": [0.25, 0.75, 0, 0, 0.31944],
3337 "92": [0.25, 0.75, 0, 0, 0.575],
3338 "93": [0.25, 0.75, 0, 0, 0.31944],
3339 "94": [0, 0.69444, 0, 0, 0.575],
3340 "95": [0.31, 0.13444, 0.03194, 0, 0.575],
3341 "97": [0, 0.44444, 0, 0, 0.55902],
3342 "98": [0, 0.69444, 0, 0, 0.63889],
3343 "99": [0, 0.44444, 0, 0, 0.51111],
3344 "100": [0, 0.69444, 0, 0, 0.63889],
3345 "101": [0, 0.44444, 0, 0, 0.52708],
3346 "102": [0, 0.69444, 0.10903, 0, 0.35139],
3347 "103": [0.19444, 0.44444, 0.01597, 0, 0.575],
3348 "104": [0, 0.69444, 0, 0, 0.63889],
3349 "105": [0, 0.69444, 0, 0, 0.31944],
3350 "106": [0.19444, 0.69444, 0, 0, 0.35139],
3351 "107": [0, 0.69444, 0, 0, 0.60694],
3352 "108": [0, 0.69444, 0, 0, 0.31944],
3353 "109": [0, 0.44444, 0, 0, 0.95833],
3354 "110": [0, 0.44444, 0, 0, 0.63889],
3355 "111": [0, 0.44444, 0, 0, 0.575],
3356 "112": [0.19444, 0.44444, 0, 0, 0.63889],
3357 "113": [0.19444, 0.44444, 0, 0, 0.60694],
3358 "114": [0, 0.44444, 0, 0, 0.47361],
3359 "115": [0, 0.44444, 0, 0, 0.45361],
3360 "116": [0, 0.63492, 0, 0, 0.44722],
3361 "117": [0, 0.44444, 0, 0, 0.63889],
3362 "118": [0, 0.44444, 0.01597, 0, 0.60694],
3363 "119": [0, 0.44444, 0.01597, 0, 0.83055],
3364 "120": [0, 0.44444, 0, 0, 0.60694],
3365 "121": [0.19444, 0.44444, 0.01597, 0, 0.60694],
3366 "122": [0, 0.44444, 0, 0, 0.51111],
3367 "123": [0.25, 0.75, 0, 0, 0.575],
3368 "124": [0.25, 0.75, 0, 0, 0.31944],
3369 "125": [0.25, 0.75, 0, 0, 0.575],
3370 "126": [0.35, 0.34444, 0, 0, 0.575],
3371 "168": [0, 0.69444, 0, 0, 0.575],
3372 "172": [0, 0.44444, 0, 0, 0.76666],
3373 "176": [0, 0.69444, 0, 0, 0.86944],
3374 "177": [0.13333, 0.63333, 0, 0, 0.89444],
3375 "184": [0.17014, 0, 0, 0, 0.51111],
3376 "198": [0, 0.68611, 0, 0, 1.04166],
3377 "215": [0.13333, 0.63333, 0, 0, 0.89444],
3378 "216": [0.04861, 0.73472, 0, 0, 0.89444],
3379 "223": [0, 0.69444, 0, 0, 0.59722],
3380 "230": [0, 0.44444, 0, 0, 0.83055],
3381 "247": [0.13333, 0.63333, 0, 0, 0.89444],
3382 "248": [0.09722, 0.54167, 0, 0, 0.575],
3383 "305": [0, 0.44444, 0, 0, 0.31944],
3384 "338": [0, 0.68611, 0, 0, 1.16944],
3385 "339": [0, 0.44444, 0, 0, 0.89444],
3386 "567": [0.19444, 0.44444, 0, 0, 0.35139],
3387 "710": [0, 0.69444, 0, 0, 0.575],
3388 "711": [0, 0.63194, 0, 0, 0.575],
3389 "713": [0, 0.59611, 0, 0, 0.575],
3390 "714": [0, 0.69444, 0, 0, 0.575],
3391 "715": [0, 0.69444, 0, 0, 0.575],
3392 "728": [0, 0.69444, 0, 0, 0.575],
3393 "729": [0, 0.69444, 0, 0, 0.31944],
3394 "730": [0, 0.69444, 0, 0, 0.86944],
3395 "732": [0, 0.69444, 0, 0, 0.575],
3396 "733": [0, 0.69444, 0, 0, 0.575],
3397 "824": [0.19444, 0.69444, 0, 0, 0],
3398 "915": [0, 0.68611, 0, 0, 0.69166],
3399 "916": [0, 0.68611, 0, 0, 0.95833],
3400 "920": [0, 0.68611, 0, 0, 0.89444],
3401 "923": [0, 0.68611, 0, 0, 0.80555],
3402 "926": [0, 0.68611, 0, 0, 0.76666],
3403 "928": [0, 0.68611, 0, 0, 0.9],
3404 "931": [0, 0.68611, 0, 0, 0.83055],
3405 "933": [0, 0.68611, 0, 0, 0.89444],
3406 "934": [0, 0.68611, 0, 0, 0.83055],
3407 "936": [0, 0.68611, 0, 0, 0.89444],
3408 "937": [0, 0.68611, 0, 0, 0.83055],
3409 "8211": [0, 0.44444, 0.03194, 0, 0.575],
3410 "8212": [0, 0.44444, 0.03194, 0, 1.14999],
3411 "8216": [0, 0.69444, 0, 0, 0.31944],
3412 "8217": [0, 0.69444, 0, 0, 0.31944],
3413 "8220": [0, 0.69444, 0, 0, 0.60278],
3414 "8221": [0, 0.69444, 0, 0, 0.60278],
3415 "8224": [0.19444, 0.69444, 0, 0, 0.51111],
3416 "8225": [0.19444, 0.69444, 0, 0, 0.51111],
3417 "8242": [0, 0.55556, 0, 0, 0.34444],
3418 "8407": [0, 0.72444, 0.15486, 0, 0.575],
3419 "8463": [0, 0.69444, 0, 0, 0.66759],
3420 "8465": [0, 0.69444, 0, 0, 0.83055],
3421 "8467": [0, 0.69444, 0, 0, 0.47361],
3422 "8472": [0.19444, 0.44444, 0, 0, 0.74027],
3423 "8476": [0, 0.69444, 0, 0, 0.83055],
3424 "8501": [0, 0.69444, 0, 0, 0.70277],
3425 "8592": [-0.10889, 0.39111, 0, 0, 1.14999],
3426 "8593": [0.19444, 0.69444, 0, 0, 0.575],
3427 "8594": [-0.10889, 0.39111, 0, 0, 1.14999],
3428 "8595": [0.19444, 0.69444, 0, 0, 0.575],
3429 "8596": [-0.10889, 0.39111, 0, 0, 1.14999],
3430 "8597": [0.25, 0.75, 0, 0, 0.575],
3431 "8598": [0.19444, 0.69444, 0, 0, 1.14999],
3432 "8599": [0.19444, 0.69444, 0, 0, 1.14999],
3433 "8600": [0.19444, 0.69444, 0, 0, 1.14999],
3434 "8601": [0.19444, 0.69444, 0, 0, 1.14999],
3435 "8636": [-0.10889, 0.39111, 0, 0, 1.14999],
3436 "8637": [-0.10889, 0.39111, 0, 0, 1.14999],
3437 "8640": [-0.10889, 0.39111, 0, 0, 1.14999],
3438 "8641": [-0.10889, 0.39111, 0, 0, 1.14999],
3439 "8656": [-0.10889, 0.39111, 0, 0, 1.14999],
3440 "8657": [0.19444, 0.69444, 0, 0, 0.70277],
3441 "8658": [-0.10889, 0.39111, 0, 0, 1.14999],
3442 "8659": [0.19444, 0.69444, 0, 0, 0.70277],
3443 "8660": [-0.10889, 0.39111, 0, 0, 1.14999],
3444 "8661": [0.25, 0.75, 0, 0, 0.70277],
3445 "8704": [0, 0.69444, 0, 0, 0.63889],
3446 "8706": [0, 0.69444, 0.06389, 0, 0.62847],
3447 "8707": [0, 0.69444, 0, 0, 0.63889],
3448 "8709": [0.05556, 0.75, 0, 0, 0.575],
3449 "8711": [0, 0.68611, 0, 0, 0.95833],
3450 "8712": [0.08556, 0.58556, 0, 0, 0.76666],
3451 "8715": [0.08556, 0.58556, 0, 0, 0.76666],
3452 "8722": [0.13333, 0.63333, 0, 0, 0.89444],
3453 "8723": [0.13333, 0.63333, 0, 0, 0.89444],
3454 "8725": [0.25, 0.75, 0, 0, 0.575],
3455 "8726": [0.25, 0.75, 0, 0, 0.575],
3456 "8727": [-0.02778, 0.47222, 0, 0, 0.575],
3457 "8728": [-0.02639, 0.47361, 0, 0, 0.575],
3458 "8729": [-0.02639, 0.47361, 0, 0, 0.575],
3459 "8730": [0.18, 0.82, 0, 0, 0.95833],
3460 "8733": [0, 0.44444, 0, 0, 0.89444],
3461 "8734": [0, 0.44444, 0, 0, 1.14999],
3462 "8736": [0, 0.69224, 0, 0, 0.72222],
3463 "8739": [0.25, 0.75, 0, 0, 0.31944],
3464 "8741": [0.25, 0.75, 0, 0, 0.575],
3465 "8743": [0, 0.55556, 0, 0, 0.76666],
3466 "8744": [0, 0.55556, 0, 0, 0.76666],
3467 "8745": [0, 0.55556, 0, 0, 0.76666],
3468 "8746": [0, 0.55556, 0, 0, 0.76666],
3469 "8747": [0.19444, 0.69444, 0.12778, 0, 0.56875],
3470 "8764": [-0.10889, 0.39111, 0, 0, 0.89444],
3471 "8768": [0.19444, 0.69444, 0, 0, 0.31944],
3472 "8771": [0.00222, 0.50222, 0, 0, 0.89444],
3473 "8776": [0.02444, 0.52444, 0, 0, 0.89444],
3474 "8781": [0.00222, 0.50222, 0, 0, 0.89444],
3475 "8801": [0.00222, 0.50222, 0, 0, 0.89444],
3476 "8804": [0.19667, 0.69667, 0, 0, 0.89444],
3477 "8805": [0.19667, 0.69667, 0, 0, 0.89444],
3478 "8810": [0.08556, 0.58556, 0, 0, 1.14999],
3479 "8811": [0.08556, 0.58556, 0, 0, 1.14999],
3480 "8826": [0.08556, 0.58556, 0, 0, 0.89444],
3481 "8827": [0.08556, 0.58556, 0, 0, 0.89444],
3482 "8834": [0.08556, 0.58556, 0, 0, 0.89444],
3483 "8835": [0.08556, 0.58556, 0, 0, 0.89444],
3484 "8838": [0.19667, 0.69667, 0, 0, 0.89444],
3485 "8839": [0.19667, 0.69667, 0, 0, 0.89444],
3486 "8846": [0, 0.55556, 0, 0, 0.76666],
3487 "8849": [0.19667, 0.69667, 0, 0, 0.89444],
3488 "8850": [0.19667, 0.69667, 0, 0, 0.89444],
3489 "8851": [0, 0.55556, 0, 0, 0.76666],
3490 "8852": [0, 0.55556, 0, 0, 0.76666],
3491 "8853": [0.13333, 0.63333, 0, 0, 0.89444],
3492 "8854": [0.13333, 0.63333, 0, 0, 0.89444],
3493 "8855": [0.13333, 0.63333, 0, 0, 0.89444],
3494 "8856": [0.13333, 0.63333, 0, 0, 0.89444],
3495 "8857": [0.13333, 0.63333, 0, 0, 0.89444],
3496 "8866": [0, 0.69444, 0, 0, 0.70277],
3497 "8867": [0, 0.69444, 0, 0, 0.70277],
3498 "8868": [0, 0.69444, 0, 0, 0.89444],
3499 "8869": [0, 0.69444, 0, 0, 0.89444],
3500 "8900": [-0.02639, 0.47361, 0, 0, 0.575],
3501 "8901": [-0.02639, 0.47361, 0, 0, 0.31944],
3502 "8902": [-0.02778, 0.47222, 0, 0, 0.575],
3503 "8968": [0.25, 0.75, 0, 0, 0.51111],
3504 "8969": [0.25, 0.75, 0, 0, 0.51111],
3505 "8970": [0.25, 0.75, 0, 0, 0.51111],
3506 "8971": [0.25, 0.75, 0, 0, 0.51111],
3507 "8994": [-0.13889, 0.36111, 0, 0, 1.14999],
3508 "8995": [-0.13889, 0.36111, 0, 0, 1.14999],
3509 "9651": [0.19444, 0.69444, 0, 0, 1.02222],
3510 "9657": [-0.02778, 0.47222, 0, 0, 0.575],
3511 "9661": [0.19444, 0.69444, 0, 0, 1.02222],
3512 "9667": [-0.02778, 0.47222, 0, 0, 0.575],
3513 "9711": [0.19444, 0.69444, 0, 0, 1.14999],
3514 "9824": [0.12963, 0.69444, 0, 0, 0.89444],
3515 "9825": [0.12963, 0.69444, 0, 0, 0.89444],
3516 "9826": [0.12963, 0.69444, 0, 0, 0.89444],
3517 "9827": [0.12963, 0.69444, 0, 0, 0.89444],
3518 "9837": [0, 0.75, 0, 0, 0.44722],
3519 "9838": [0.19444, 0.69444, 0, 0, 0.44722],
3520 "9839": [0.19444, 0.69444, 0, 0, 0.44722],
3521 "10216": [0.25, 0.75, 0, 0, 0.44722],
3522 "10217": [0.25, 0.75, 0, 0, 0.44722],
3523 "10815": [0, 0.68611, 0, 0, 0.9],
3524 "10927": [0.19667, 0.69667, 0, 0, 0.89444],
3525 "10928": [0.19667, 0.69667, 0, 0, 0.89444]
3526 },
3527 "Main-BoldItalic": {
3528 "33": [0, 0.69444, 0.11417, 0, 0.38611],
3529 "34": [0, 0.69444, 0.07939, 0, 0.62055],
3530 "35": [0.19444, 0.69444, 0.06833, 0, 0.94444],
3531 "37": [0.05556, 0.75, 0.12861, 0, 0.94444],
3532 "38": [0, 0.69444, 0.08528, 0, 0.88555],
3533 "39": [0, 0.69444, 0.12945, 0, 0.35555],
3534 "40": [0.25, 0.75, 0.15806, 0, 0.47333],
3535 "41": [0.25, 0.75, 0.03306, 0, 0.47333],
3536 "42": [0, 0.75, 0.14333, 0, 0.59111],
3537 "43": [0.10333, 0.60333, 0.03306, 0, 0.88555],
3538 "44": [0.19444, 0.14722, 0, 0, 0.35555],
3539 "45": [0, 0.44444, 0.02611, 0, 0.41444],
3540 "46": [0, 0.14722, 0, 0, 0.35555],
3541 "47": [0.25, 0.75, 0.15806, 0, 0.59111],
3542 "48": [0, 0.64444, 0.13167, 0, 0.59111],
3543 "49": [0, 0.64444, 0.13167, 0, 0.59111],
3544 "50": [0, 0.64444, 0.13167, 0, 0.59111],
3545 "51": [0, 0.64444, 0.13167, 0, 0.59111],
3546 "52": [0.19444, 0.64444, 0.13167, 0, 0.59111],
3547 "53": [0, 0.64444, 0.13167, 0, 0.59111],
3548 "54": [0, 0.64444, 0.13167, 0, 0.59111],
3549 "55": [0.19444, 0.64444, 0.13167, 0, 0.59111],
3550 "56": [0, 0.64444, 0.13167, 0, 0.59111],
3551 "57": [0, 0.64444, 0.13167, 0, 0.59111],
3552 "58": [0, 0.44444, 0.06695, 0, 0.35555],
3553 "59": [0.19444, 0.44444, 0.06695, 0, 0.35555],
3554 "61": [-0.10889, 0.39111, 0.06833, 0, 0.88555],
3555 "63": [0, 0.69444, 0.11472, 0, 0.59111],
3556 "64": [0, 0.69444, 0.09208, 0, 0.88555],
3557 "65": [0, 0.68611, 0, 0, 0.86555],
3558 "66": [0, 0.68611, 0.0992, 0, 0.81666],
3559 "67": [0, 0.68611, 0.14208, 0, 0.82666],
3560 "68": [0, 0.68611, 0.09062, 0, 0.87555],
3561 "69": [0, 0.68611, 0.11431, 0, 0.75666],
3562 "70": [0, 0.68611, 0.12903, 0, 0.72722],
3563 "71": [0, 0.68611, 0.07347, 0, 0.89527],
3564 "72": [0, 0.68611, 0.17208, 0, 0.8961],
3565 "73": [0, 0.68611, 0.15681, 0, 0.47166],
3566 "74": [0, 0.68611, 0.145, 0, 0.61055],
3567 "75": [0, 0.68611, 0.14208, 0, 0.89499],
3568 "76": [0, 0.68611, 0, 0, 0.69777],
3569 "77": [0, 0.68611, 0.17208, 0, 1.07277],
3570 "78": [0, 0.68611, 0.17208, 0, 0.8961],
3571 "79": [0, 0.68611, 0.09062, 0, 0.85499],
3572 "80": [0, 0.68611, 0.0992, 0, 0.78721],
3573 "81": [0.19444, 0.68611, 0.09062, 0, 0.85499],
3574 "82": [0, 0.68611, 0.02559, 0, 0.85944],
3575 "83": [0, 0.68611, 0.11264, 0, 0.64999],
3576 "84": [0, 0.68611, 0.12903, 0, 0.7961],
3577 "85": [0, 0.68611, 0.17208, 0, 0.88083],
3578 "86": [0, 0.68611, 0.18625, 0, 0.86555],
3579 "87": [0, 0.68611, 0.18625, 0, 1.15999],
3580 "88": [0, 0.68611, 0.15681, 0, 0.86555],
3581 "89": [0, 0.68611, 0.19803, 0, 0.86555],
3582 "90": [0, 0.68611, 0.14208, 0, 0.70888],
3583 "91": [0.25, 0.75, 0.1875, 0, 0.35611],
3584 "93": [0.25, 0.75, 0.09972, 0, 0.35611],
3585 "94": [0, 0.69444, 0.06709, 0, 0.59111],
3586 "95": [0.31, 0.13444, 0.09811, 0, 0.59111],
3587 "97": [0, 0.44444, 0.09426, 0, 0.59111],
3588 "98": [0, 0.69444, 0.07861, 0, 0.53222],
3589 "99": [0, 0.44444, 0.05222, 0, 0.53222],
3590 "100": [0, 0.69444, 0.10861, 0, 0.59111],
3591 "101": [0, 0.44444, 0.085, 0, 0.53222],
3592 "102": [0.19444, 0.69444, 0.21778, 0, 0.4],
3593 "103": [0.19444, 0.44444, 0.105, 0, 0.53222],
3594 "104": [0, 0.69444, 0.09426, 0, 0.59111],
3595 "105": [0, 0.69326, 0.11387, 0, 0.35555],
3596 "106": [0.19444, 0.69326, 0.1672, 0, 0.35555],
3597 "107": [0, 0.69444, 0.11111, 0, 0.53222],
3598 "108": [0, 0.69444, 0.10861, 0, 0.29666],
3599 "109": [0, 0.44444, 0.09426, 0, 0.94444],
3600 "110": [0, 0.44444, 0.09426, 0, 0.64999],
3601 "111": [0, 0.44444, 0.07861, 0, 0.59111],
3602 "112": [0.19444, 0.44444, 0.07861, 0, 0.59111],
3603 "113": [0.19444, 0.44444, 0.105, 0, 0.53222],
3604 "114": [0, 0.44444, 0.11111, 0, 0.50167],
3605 "115": [0, 0.44444, 0.08167, 0, 0.48694],
3606 "116": [0, 0.63492, 0.09639, 0, 0.385],
3607 "117": [0, 0.44444, 0.09426, 0, 0.62055],
3608 "118": [0, 0.44444, 0.11111, 0, 0.53222],
3609 "119": [0, 0.44444, 0.11111, 0, 0.76777],
3610 "120": [0, 0.44444, 0.12583, 0, 0.56055],
3611 "121": [0.19444, 0.44444, 0.105, 0, 0.56166],
3612 "122": [0, 0.44444, 0.13889, 0, 0.49055],
3613 "126": [0.35, 0.34444, 0.11472, 0, 0.59111],
3614 "163": [0, 0.69444, 0, 0, 0.86853],
3615 "168": [0, 0.69444, 0.11473, 0, 0.59111],
3616 "176": [0, 0.69444, 0, 0, 0.94888],
3617 "184": [0.17014, 0, 0, 0, 0.53222],
3618 "198": [0, 0.68611, 0.11431, 0, 1.02277],
3619 "216": [0.04861, 0.73472, 0.09062, 0, 0.88555],
3620 "223": [0.19444, 0.69444, 0.09736, 0, 0.665],
3621 "230": [0, 0.44444, 0.085, 0, 0.82666],
3622 "248": [0.09722, 0.54167, 0.09458, 0, 0.59111],
3623 "305": [0, 0.44444, 0.09426, 0, 0.35555],
3624 "338": [0, 0.68611, 0.11431, 0, 1.14054],
3625 "339": [0, 0.44444, 0.085, 0, 0.82666],
3626 "567": [0.19444, 0.44444, 0.04611, 0, 0.385],
3627 "710": [0, 0.69444, 0.06709, 0, 0.59111],
3628 "711": [0, 0.63194, 0.08271, 0, 0.59111],
3629 "713": [0, 0.59444, 0.10444, 0, 0.59111],
3630 "714": [0, 0.69444, 0.08528, 0, 0.59111],
3631 "715": [0, 0.69444, 0, 0, 0.59111],
3632 "728": [0, 0.69444, 0.10333, 0, 0.59111],
3633 "729": [0, 0.69444, 0.12945, 0, 0.35555],
3634 "730": [0, 0.69444, 0, 0, 0.94888],
3635 "732": [0, 0.69444, 0.11472, 0, 0.59111],
3636 "733": [0, 0.69444, 0.11472, 0, 0.59111],
3637 "915": [0, 0.68611, 0.12903, 0, 0.69777],
3638 "916": [0, 0.68611, 0, 0, 0.94444],
3639 "920": [0, 0.68611, 0.09062, 0, 0.88555],
3640 "923": [0, 0.68611, 0, 0, 0.80666],
3641 "926": [0, 0.68611, 0.15092, 0, 0.76777],
3642 "928": [0, 0.68611, 0.17208, 0, 0.8961],
3643 "931": [0, 0.68611, 0.11431, 0, 0.82666],
3644 "933": [0, 0.68611, 0.10778, 0, 0.88555],
3645 "934": [0, 0.68611, 0.05632, 0, 0.82666],
3646 "936": [0, 0.68611, 0.10778, 0, 0.88555],
3647 "937": [0, 0.68611, 0.0992, 0, 0.82666],
3648 "8211": [0, 0.44444, 0.09811, 0, 0.59111],
3649 "8212": [0, 0.44444, 0.09811, 0, 1.18221],
3650 "8216": [0, 0.69444, 0.12945, 0, 0.35555],
3651 "8217": [0, 0.69444, 0.12945, 0, 0.35555],
3652 "8220": [0, 0.69444, 0.16772, 0, 0.62055],
3653 "8221": [0, 0.69444, 0.07939, 0, 0.62055]
3654 },
3655 "Main-Italic": {
3656 "33": [0, 0.69444, 0.12417, 0, 0.30667],
3657 "34": [0, 0.69444, 0.06961, 0, 0.51444],
3658 "35": [0.19444, 0.69444, 0.06616, 0, 0.81777],
3659 "37": [0.05556, 0.75, 0.13639, 0, 0.81777],
3660 "38": [0, 0.69444, 0.09694, 0, 0.76666],
3661 "39": [0, 0.69444, 0.12417, 0, 0.30667],
3662 "40": [0.25, 0.75, 0.16194, 0, 0.40889],
3663 "41": [0.25, 0.75, 0.03694, 0, 0.40889],
3664 "42": [0, 0.75, 0.14917, 0, 0.51111],
3665 "43": [0.05667, 0.56167, 0.03694, 0, 0.76666],
3666 "44": [0.19444, 0.10556, 0, 0, 0.30667],
3667 "45": [0, 0.43056, 0.02826, 0, 0.35778],
3668 "46": [0, 0.10556, 0, 0, 0.30667],
3669 "47": [0.25, 0.75, 0.16194, 0, 0.51111],
3670 "48": [0, 0.64444, 0.13556, 0, 0.51111],
3671 "49": [0, 0.64444, 0.13556, 0, 0.51111],
3672 "50": [0, 0.64444, 0.13556, 0, 0.51111],
3673 "51": [0, 0.64444, 0.13556, 0, 0.51111],
3674 "52": [0.19444, 0.64444, 0.13556, 0, 0.51111],
3675 "53": [0, 0.64444, 0.13556, 0, 0.51111],
3676 "54": [0, 0.64444, 0.13556, 0, 0.51111],
3677 "55": [0.19444, 0.64444, 0.13556, 0, 0.51111],
3678 "56": [0, 0.64444, 0.13556, 0, 0.51111],
3679 "57": [0, 0.64444, 0.13556, 0, 0.51111],
3680 "58": [0, 0.43056, 0.0582, 0, 0.30667],
3681 "59": [0.19444, 0.43056, 0.0582, 0, 0.30667],
3682 "61": [-0.13313, 0.36687, 0.06616, 0, 0.76666],
3683 "63": [0, 0.69444, 0.1225, 0, 0.51111],
3684 "64": [0, 0.69444, 0.09597, 0, 0.76666],
3685 "65": [0, 0.68333, 0, 0, 0.74333],
3686 "66": [0, 0.68333, 0.10257, 0, 0.70389],
3687 "67": [0, 0.68333, 0.14528, 0, 0.71555],
3688 "68": [0, 0.68333, 0.09403, 0, 0.755],
3689 "69": [0, 0.68333, 0.12028, 0, 0.67833],
3690 "70": [0, 0.68333, 0.13305, 0, 0.65277],
3691 "71": [0, 0.68333, 0.08722, 0, 0.77361],
3692 "72": [0, 0.68333, 0.16389, 0, 0.74333],
3693 "73": [0, 0.68333, 0.15806, 0, 0.38555],
3694 "74": [0, 0.68333, 0.14028, 0, 0.525],
3695 "75": [0, 0.68333, 0.14528, 0, 0.76888],
3696 "76": [0, 0.68333, 0, 0, 0.62722],
3697 "77": [0, 0.68333, 0.16389, 0, 0.89666],
3698 "78": [0, 0.68333, 0.16389, 0, 0.74333],
3699 "79": [0, 0.68333, 0.09403, 0, 0.76666],
3700 "80": [0, 0.68333, 0.10257, 0, 0.67833],
3701 "81": [0.19444, 0.68333, 0.09403, 0, 0.76666],
3702 "82": [0, 0.68333, 0.03868, 0, 0.72944],
3703 "83": [0, 0.68333, 0.11972, 0, 0.56222],
3704 "84": [0, 0.68333, 0.13305, 0, 0.71555],
3705 "85": [0, 0.68333, 0.16389, 0, 0.74333],
3706 "86": [0, 0.68333, 0.18361, 0, 0.74333],
3707 "87": [0, 0.68333, 0.18361, 0, 0.99888],
3708 "88": [0, 0.68333, 0.15806, 0, 0.74333],
3709 "89": [0, 0.68333, 0.19383, 0, 0.74333],
3710 "90": [0, 0.68333, 0.14528, 0, 0.61333],
3711 "91": [0.25, 0.75, 0.1875, 0, 0.30667],
3712 "93": [0.25, 0.75, 0.10528, 0, 0.30667],
3713 "94": [0, 0.69444, 0.06646, 0, 0.51111],
3714 "95": [0.31, 0.12056, 0.09208, 0, 0.51111],
3715 "97": [0, 0.43056, 0.07671, 0, 0.51111],
3716 "98": [0, 0.69444, 0.06312, 0, 0.46],
3717 "99": [0, 0.43056, 0.05653, 0, 0.46],
3718 "100": [0, 0.69444, 0.10333, 0, 0.51111],
3719 "101": [0, 0.43056, 0.07514, 0, 0.46],
3720 "102": [0.19444, 0.69444, 0.21194, 0, 0.30667],
3721 "103": [0.19444, 0.43056, 0.08847, 0, 0.46],
3722 "104": [0, 0.69444, 0.07671, 0, 0.51111],
3723 "105": [0, 0.65536, 0.1019, 0, 0.30667],
3724 "106": [0.19444, 0.65536, 0.14467, 0, 0.30667],
3725 "107": [0, 0.69444, 0.10764, 0, 0.46],
3726 "108": [0, 0.69444, 0.10333, 0, 0.25555],
3727 "109": [0, 0.43056, 0.07671, 0, 0.81777],
3728 "110": [0, 0.43056, 0.07671, 0, 0.56222],
3729 "111": [0, 0.43056, 0.06312, 0, 0.51111],
3730 "112": [0.19444, 0.43056, 0.06312, 0, 0.51111],
3731 "113": [0.19444, 0.43056, 0.08847, 0, 0.46],
3732 "114": [0, 0.43056, 0.10764, 0, 0.42166],
3733 "115": [0, 0.43056, 0.08208, 0, 0.40889],
3734 "116": [0, 0.61508, 0.09486, 0, 0.33222],
3735 "117": [0, 0.43056, 0.07671, 0, 0.53666],
3736 "118": [0, 0.43056, 0.10764, 0, 0.46],
3737 "119": [0, 0.43056, 0.10764, 0, 0.66444],
3738 "120": [0, 0.43056, 0.12042, 0, 0.46389],
3739 "121": [0.19444, 0.43056, 0.08847, 0, 0.48555],
3740 "122": [0, 0.43056, 0.12292, 0, 0.40889],
3741 "126": [0.35, 0.31786, 0.11585, 0, 0.51111],
3742 "163": [0, 0.69444, 0, 0, 0.76909],
3743 "168": [0, 0.66786, 0.10474, 0, 0.51111],
3744 "176": [0, 0.69444, 0, 0, 0.83129],
3745 "184": [0.17014, 0, 0, 0, 0.46],
3746 "198": [0, 0.68333, 0.12028, 0, 0.88277],
3747 "216": [0.04861, 0.73194, 0.09403, 0, 0.76666],
3748 "223": [0.19444, 0.69444, 0.10514, 0, 0.53666],
3749 "230": [0, 0.43056, 0.07514, 0, 0.71555],
3750 "248": [0.09722, 0.52778, 0.09194, 0, 0.51111],
3751 "305": [0, 0.43056, 0, 0.02778, 0.32246],
3752 "338": [0, 0.68333, 0.12028, 0, 0.98499],
3753 "339": [0, 0.43056, 0.07514, 0, 0.71555],
3754 "567": [0.19444, 0.43056, 0, 0.08334, 0.38403],
3755 "710": [0, 0.69444, 0.06646, 0, 0.51111],
3756 "711": [0, 0.62847, 0.08295, 0, 0.51111],
3757 "713": [0, 0.56167, 0.10333, 0, 0.51111],
3758 "714": [0, 0.69444, 0.09694, 0, 0.51111],
3759 "715": [0, 0.69444, 0, 0, 0.51111],
3760 "728": [0, 0.69444, 0.10806, 0, 0.51111],
3761 "729": [0, 0.66786, 0.11752, 0, 0.30667],
3762 "730": [0, 0.69444, 0, 0, 0.83129],
3763 "732": [0, 0.66786, 0.11585, 0, 0.51111],
3764 "733": [0, 0.69444, 0.1225, 0, 0.51111],
3765 "915": [0, 0.68333, 0.13305, 0, 0.62722],
3766 "916": [0, 0.68333, 0, 0, 0.81777],
3767 "920": [0, 0.68333, 0.09403, 0, 0.76666],
3768 "923": [0, 0.68333, 0, 0, 0.69222],
3769 "926": [0, 0.68333, 0.15294, 0, 0.66444],
3770 "928": [0, 0.68333, 0.16389, 0, 0.74333],
3771 "931": [0, 0.68333, 0.12028, 0, 0.71555],
3772 "933": [0, 0.68333, 0.11111, 0, 0.76666],
3773 "934": [0, 0.68333, 0.05986, 0, 0.71555],
3774 "936": [0, 0.68333, 0.11111, 0, 0.76666],
3775 "937": [0, 0.68333, 0.10257, 0, 0.71555],
3776 "8211": [0, 0.43056, 0.09208, 0, 0.51111],
3777 "8212": [0, 0.43056, 0.09208, 0, 1.02222],
3778 "8216": [0, 0.69444, 0.12417, 0, 0.30667],
3779 "8217": [0, 0.69444, 0.12417, 0, 0.30667],
3780 "8220": [0, 0.69444, 0.1685, 0, 0.51444],
3781 "8221": [0, 0.69444, 0.06961, 0, 0.51444],
3782 "8463": [0, 0.68889, 0, 0, 0.54028]
3783 },
3784 "Main-Regular": {
3785 "32": [0, 0, 0, 0, 0.25],
3786 "33": [0, 0.69444, 0, 0, 0.27778],
3787 "34": [0, 0.69444, 0, 0, 0.5],
3788 "35": [0.19444, 0.69444, 0, 0, 0.83334],
3789 "36": [0.05556, 0.75, 0, 0, 0.5],
3790 "37": [0.05556, 0.75, 0, 0, 0.83334],
3791 "38": [0, 0.69444, 0, 0, 0.77778],
3792 "39": [0, 0.69444, 0, 0, 0.27778],
3793 "40": [0.25, 0.75, 0, 0, 0.38889],
3794 "41": [0.25, 0.75, 0, 0, 0.38889],
3795 "42": [0, 0.75, 0, 0, 0.5],
3796 "43": [0.08333, 0.58333, 0, 0, 0.77778],
3797 "44": [0.19444, 0.10556, 0, 0, 0.27778],
3798 "45": [0, 0.43056, 0, 0, 0.33333],
3799 "46": [0, 0.10556, 0, 0, 0.27778],
3800 "47": [0.25, 0.75, 0, 0, 0.5],
3801 "48": [0, 0.64444, 0, 0, 0.5],
3802 "49": [0, 0.64444, 0, 0, 0.5],
3803 "50": [0, 0.64444, 0, 0, 0.5],
3804 "51": [0, 0.64444, 0, 0, 0.5],
3805 "52": [0, 0.64444, 0, 0, 0.5],
3806 "53": [0, 0.64444, 0, 0, 0.5],
3807 "54": [0, 0.64444, 0, 0, 0.5],
3808 "55": [0, 0.64444, 0, 0, 0.5],
3809 "56": [0, 0.64444, 0, 0, 0.5],
3810 "57": [0, 0.64444, 0, 0, 0.5],
3811 "58": [0, 0.43056, 0, 0, 0.27778],
3812 "59": [0.19444, 0.43056, 0, 0, 0.27778],
3813 "60": [0.0391, 0.5391, 0, 0, 0.77778],
3814 "61": [-0.13313, 0.36687, 0, 0, 0.77778],
3815 "62": [0.0391, 0.5391, 0, 0, 0.77778],
3816 "63": [0, 0.69444, 0, 0, 0.47222],
3817 "64": [0, 0.69444, 0, 0, 0.77778],
3818 "65": [0, 0.68333, 0, 0, 0.75],
3819 "66": [0, 0.68333, 0, 0, 0.70834],
3820 "67": [0, 0.68333, 0, 0, 0.72222],
3821 "68": [0, 0.68333, 0, 0, 0.76389],
3822 "69": [0, 0.68333, 0, 0, 0.68056],
3823 "70": [0, 0.68333, 0, 0, 0.65278],
3824 "71": [0, 0.68333, 0, 0, 0.78472],
3825 "72": [0, 0.68333, 0, 0, 0.75],
3826 "73": [0, 0.68333, 0, 0, 0.36111],
3827 "74": [0, 0.68333, 0, 0, 0.51389],
3828 "75": [0, 0.68333, 0, 0, 0.77778],
3829 "76": [0, 0.68333, 0, 0, 0.625],
3830 "77": [0, 0.68333, 0, 0, 0.91667],
3831 "78": [0, 0.68333, 0, 0, 0.75],
3832 "79": [0, 0.68333, 0, 0, 0.77778],
3833 "80": [0, 0.68333, 0, 0, 0.68056],
3834 "81": [0.19444, 0.68333, 0, 0, 0.77778],
3835 "82": [0, 0.68333, 0, 0, 0.73611],
3836 "83": [0, 0.68333, 0, 0, 0.55556],
3837 "84": [0, 0.68333, 0, 0, 0.72222],
3838 "85": [0, 0.68333, 0, 0, 0.75],
3839 "86": [0, 0.68333, 0.01389, 0, 0.75],
3840 "87": [0, 0.68333, 0.01389, 0, 1.02778],
3841 "88": [0, 0.68333, 0, 0, 0.75],
3842 "89": [0, 0.68333, 0.025, 0, 0.75],
3843 "90": [0, 0.68333, 0, 0, 0.61111],
3844 "91": [0.25, 0.75, 0, 0, 0.27778],
3845 "92": [0.25, 0.75, 0, 0, 0.5],
3846 "93": [0.25, 0.75, 0, 0, 0.27778],
3847 "94": [0, 0.69444, 0, 0, 0.5],
3848 "95": [0.31, 0.12056, 0.02778, 0, 0.5],
3849 "97": [0, 0.43056, 0, 0, 0.5],
3850 "98": [0, 0.69444, 0, 0, 0.55556],
3851 "99": [0, 0.43056, 0, 0, 0.44445],
3852 "100": [0, 0.69444, 0, 0, 0.55556],
3853 "101": [0, 0.43056, 0, 0, 0.44445],
3854 "102": [0, 0.69444, 0.07778, 0, 0.30556],
3855 "103": [0.19444, 0.43056, 0.01389, 0, 0.5],
3856 "104": [0, 0.69444, 0, 0, 0.55556],
3857 "105": [0, 0.66786, 0, 0, 0.27778],
3858 "106": [0.19444, 0.66786, 0, 0, 0.30556],
3859 "107": [0, 0.69444, 0, 0, 0.52778],
3860 "108": [0, 0.69444, 0, 0, 0.27778],
3861 "109": [0, 0.43056, 0, 0, 0.83334],
3862 "110": [0, 0.43056, 0, 0, 0.55556],
3863 "111": [0, 0.43056, 0, 0, 0.5],
3864 "112": [0.19444, 0.43056, 0, 0, 0.55556],
3865 "113": [0.19444, 0.43056, 0, 0, 0.52778],
3866 "114": [0, 0.43056, 0, 0, 0.39167],
3867 "115": [0, 0.43056, 0, 0, 0.39445],
3868 "116": [0, 0.61508, 0, 0, 0.38889],
3869 "117": [0, 0.43056, 0, 0, 0.55556],
3870 "118": [0, 0.43056, 0.01389, 0, 0.52778],
3871 "119": [0, 0.43056, 0.01389, 0, 0.72222],
3872 "120": [0, 0.43056, 0, 0, 0.52778],
3873 "121": [0.19444, 0.43056, 0.01389, 0, 0.52778],
3874 "122": [0, 0.43056, 0, 0, 0.44445],
3875 "123": [0.25, 0.75, 0, 0, 0.5],
3876 "124": [0.25, 0.75, 0, 0, 0.27778],
3877 "125": [0.25, 0.75, 0, 0, 0.5],
3878 "126": [0.35, 0.31786, 0, 0, 0.5],
3879 "160": [0, 0, 0, 0, 0.25],
3880 "167": [0.19444, 0.69444, 0, 0, 0.44445],
3881 "168": [0, 0.66786, 0, 0, 0.5],
3882 "172": [0, 0.43056, 0, 0, 0.66667],
3883 "176": [0, 0.69444, 0, 0, 0.75],
3884 "177": [0.08333, 0.58333, 0, 0, 0.77778],
3885 "182": [0.19444, 0.69444, 0, 0, 0.61111],
3886 "184": [0.17014, 0, 0, 0, 0.44445],
3887 "198": [0, 0.68333, 0, 0, 0.90278],
3888 "215": [0.08333, 0.58333, 0, 0, 0.77778],
3889 "216": [0.04861, 0.73194, 0, 0, 0.77778],
3890 "223": [0, 0.69444, 0, 0, 0.5],
3891 "230": [0, 0.43056, 0, 0, 0.72222],
3892 "247": [0.08333, 0.58333, 0, 0, 0.77778],
3893 "248": [0.09722, 0.52778, 0, 0, 0.5],
3894 "305": [0, 0.43056, 0, 0, 0.27778],
3895 "338": [0, 0.68333, 0, 0, 1.01389],
3896 "339": [0, 0.43056, 0, 0, 0.77778],
3897 "567": [0.19444, 0.43056, 0, 0, 0.30556],
3898 "710": [0, 0.69444, 0, 0, 0.5],
3899 "711": [0, 0.62847, 0, 0, 0.5],
3900 "713": [0, 0.56778, 0, 0, 0.5],
3901 "714": [0, 0.69444, 0, 0, 0.5],
3902 "715": [0, 0.69444, 0, 0, 0.5],
3903 "728": [0, 0.69444, 0, 0, 0.5],
3904 "729": [0, 0.66786, 0, 0, 0.27778],
3905 "730": [0, 0.69444, 0, 0, 0.75],
3906 "732": [0, 0.66786, 0, 0, 0.5],
3907 "733": [0, 0.69444, 0, 0, 0.5],
3908 "824": [0.19444, 0.69444, 0, 0, 0],
3909 "915": [0, 0.68333, 0, 0, 0.625],
3910 "916": [0, 0.68333, 0, 0, 0.83334],
3911 "920": [0, 0.68333, 0, 0, 0.77778],
3912 "923": [0, 0.68333, 0, 0, 0.69445],
3913 "926": [0, 0.68333, 0, 0, 0.66667],
3914 "928": [0, 0.68333, 0, 0, 0.75],
3915 "931": [0, 0.68333, 0, 0, 0.72222],
3916 "933": [0, 0.68333, 0, 0, 0.77778],
3917 "934": [0, 0.68333, 0, 0, 0.72222],
3918 "936": [0, 0.68333, 0, 0, 0.77778],
3919 "937": [0, 0.68333, 0, 0, 0.72222],
3920 "8211": [0, 0.43056, 0.02778, 0, 0.5],
3921 "8212": [0, 0.43056, 0.02778, 0, 1.0],
3922 "8216": [0, 0.69444, 0, 0, 0.27778],
3923 "8217": [0, 0.69444, 0, 0, 0.27778],
3924 "8220": [0, 0.69444, 0, 0, 0.5],
3925 "8221": [0, 0.69444, 0, 0, 0.5],
3926 "8224": [0.19444, 0.69444, 0, 0, 0.44445],
3927 "8225": [0.19444, 0.69444, 0, 0, 0.44445],
3928 "8230": [0, 0.12, 0, 0, 1.172],
3929 "8242": [0, 0.55556, 0, 0, 0.275],
3930 "8407": [0, 0.71444, 0.15382, 0, 0.5],
3931 "8463": [0, 0.68889, 0, 0, 0.54028],
3932 "8465": [0, 0.69444, 0, 0, 0.72222],
3933 "8467": [0, 0.69444, 0, 0.11111, 0.41667],
3934 "8472": [0.19444, 0.43056, 0, 0.11111, 0.63646],
3935 "8476": [0, 0.69444, 0, 0, 0.72222],
3936 "8501": [0, 0.69444, 0, 0, 0.61111],
3937 "8592": [-0.13313, 0.36687, 0, 0, 1.0],
3938 "8593": [0.19444, 0.69444, 0, 0, 0.5],
3939 "8594": [-0.13313, 0.36687, 0, 0, 1.0],
3940 "8595": [0.19444, 0.69444, 0, 0, 0.5],
3941 "8596": [-0.13313, 0.36687, 0, 0, 1.0],
3942 "8597": [0.25, 0.75, 0, 0, 0.5],
3943 "8598": [0.19444, 0.69444, 0, 0, 1.0],
3944 "8599": [0.19444, 0.69444, 0, 0, 1.0],
3945 "8600": [0.19444, 0.69444, 0, 0, 1.0],
3946 "8601": [0.19444, 0.69444, 0, 0, 1.0],
3947 "8614": [0.011, 0.511, 0, 0, 1.0],
3948 "8617": [0.011, 0.511, 0, 0, 1.126],
3949 "8618": [0.011, 0.511, 0, 0, 1.126],
3950 "8636": [-0.13313, 0.36687, 0, 0, 1.0],
3951 "8637": [-0.13313, 0.36687, 0, 0, 1.0],
3952 "8640": [-0.13313, 0.36687, 0, 0, 1.0],
3953 "8641": [-0.13313, 0.36687, 0, 0, 1.0],
3954 "8652": [0.011, 0.671, 0, 0, 1.0],
3955 "8656": [-0.13313, 0.36687, 0, 0, 1.0],
3956 "8657": [0.19444, 0.69444, 0, 0, 0.61111],
3957 "8658": [-0.13313, 0.36687, 0, 0, 1.0],
3958 "8659": [0.19444, 0.69444, 0, 0, 0.61111],
3959 "8660": [-0.13313, 0.36687, 0, 0, 1.0],
3960 "8661": [0.25, 0.75, 0, 0, 0.61111],
3961 "8704": [0, 0.69444, 0, 0, 0.55556],
3962 "8706": [0, 0.69444, 0.05556, 0.08334, 0.5309],
3963 "8707": [0, 0.69444, 0, 0, 0.55556],
3964 "8709": [0.05556, 0.75, 0, 0, 0.5],
3965 "8711": [0, 0.68333, 0, 0, 0.83334],
3966 "8712": [0.0391, 0.5391, 0, 0, 0.66667],
3967 "8715": [0.0391, 0.5391, 0, 0, 0.66667],
3968 "8722": [0.08333, 0.58333, 0, 0, 0.77778],
3969 "8723": [0.08333, 0.58333, 0, 0, 0.77778],
3970 "8725": [0.25, 0.75, 0, 0, 0.5],
3971 "8726": [0.25, 0.75, 0, 0, 0.5],
3972 "8727": [-0.03472, 0.46528, 0, 0, 0.5],
3973 "8728": [-0.05555, 0.44445, 0, 0, 0.5],
3974 "8729": [-0.05555, 0.44445, 0, 0, 0.5],
3975 "8730": [0.2, 0.8, 0, 0, 0.83334],
3976 "8733": [0, 0.43056, 0, 0, 0.77778],
3977 "8734": [0, 0.43056, 0, 0, 1.0],
3978 "8736": [0, 0.69224, 0, 0, 0.72222],
3979 "8739": [0.25, 0.75, 0, 0, 0.27778],
3980 "8741": [0.25, 0.75, 0, 0, 0.5],
3981 "8743": [0, 0.55556, 0, 0, 0.66667],
3982 "8744": [0, 0.55556, 0, 0, 0.66667],
3983 "8745": [0, 0.55556, 0, 0, 0.66667],
3984 "8746": [0, 0.55556, 0, 0, 0.66667],
3985 "8747": [0.19444, 0.69444, 0.11111, 0, 0.41667],
3986 "8764": [-0.13313, 0.36687, 0, 0, 0.77778],
3987 "8768": [0.19444, 0.69444, 0, 0, 0.27778],
3988 "8771": [-0.03625, 0.46375, 0, 0, 0.77778],
3989 "8773": [-0.022, 0.589, 0, 0, 1.0],
3990 "8776": [-0.01688, 0.48312, 0, 0, 0.77778],
3991 "8781": [-0.03625, 0.46375, 0, 0, 0.77778],
3992 "8784": [-0.133, 0.67, 0, 0, 0.778],
3993 "8800": [0.215, 0.716, 0, 0, 0.778],
3994 "8801": [-0.03625, 0.46375, 0, 0, 0.77778],
3995 "8804": [0.13597, 0.63597, 0, 0, 0.77778],
3996 "8805": [0.13597, 0.63597, 0, 0, 0.77778],
3997 "8810": [0.0391, 0.5391, 0, 0, 1.0],
3998 "8811": [0.0391, 0.5391, 0, 0, 1.0],
3999 "8826": [0.0391, 0.5391, 0, 0, 0.77778],
4000 "8827": [0.0391, 0.5391, 0, 0, 0.77778],
4001 "8834": [0.0391, 0.5391, 0, 0, 0.77778],
4002 "8835": [0.0391, 0.5391, 0, 0, 0.77778],
4003 "8838": [0.13597, 0.63597, 0, 0, 0.77778],
4004 "8839": [0.13597, 0.63597, 0, 0, 0.77778],
4005 "8846": [0, 0.55556, 0, 0, 0.66667],
4006 "8849": [0.13597, 0.63597, 0, 0, 0.77778],
4007 "8850": [0.13597, 0.63597, 0, 0, 0.77778],
4008 "8851": [0, 0.55556, 0, 0, 0.66667],
4009 "8852": [0, 0.55556, 0, 0, 0.66667],
4010 "8853": [0.08333, 0.58333, 0, 0, 0.77778],
4011 "8854": [0.08333, 0.58333, 0, 0, 0.77778],
4012 "8855": [0.08333, 0.58333, 0, 0, 0.77778],
4013 "8856": [0.08333, 0.58333, 0, 0, 0.77778],
4014 "8857": [0.08333, 0.58333, 0, 0, 0.77778],
4015 "8866": [0, 0.69444, 0, 0, 0.61111],
4016 "8867": [0, 0.69444, 0, 0, 0.61111],
4017 "8868": [0, 0.69444, 0, 0, 0.77778],
4018 "8869": [0, 0.69444, 0, 0, 0.77778],
4019 "8872": [0.249, 0.75, 0, 0, 0.867],
4020 "8900": [-0.05555, 0.44445, 0, 0, 0.5],
4021 "8901": [-0.05555, 0.44445, 0, 0, 0.27778],
4022 "8902": [-0.03472, 0.46528, 0, 0, 0.5],
4023 "8904": [0.005, 0.505, 0, 0, 0.9],
4024 "8942": [0.03, 0.9, 0, 0, 0.278],
4025 "8943": [-0.19, 0.31, 0, 0, 1.172],
4026 "8945": [-0.1, 0.82, 0, 0, 1.282],
4027 "8968": [0.25, 0.75, 0, 0, 0.44445],
4028 "8969": [0.25, 0.75, 0, 0, 0.44445],
4029 "8970": [0.25, 0.75, 0, 0, 0.44445],
4030 "8971": [0.25, 0.75, 0, 0, 0.44445],
4031 "8994": [-0.14236, 0.35764, 0, 0, 1.0],
4032 "8995": [-0.14236, 0.35764, 0, 0, 1.0],
4033 "9136": [0.244, 0.744, 0, 0, 0.412],
4034 "9137": [0.244, 0.744, 0, 0, 0.412],
4035 "9651": [0.19444, 0.69444, 0, 0, 0.88889],
4036 "9657": [-0.03472, 0.46528, 0, 0, 0.5],
4037 "9661": [0.19444, 0.69444, 0, 0, 0.88889],
4038 "9667": [-0.03472, 0.46528, 0, 0, 0.5],
4039 "9711": [0.19444, 0.69444, 0, 0, 1.0],
4040 "9824": [0.12963, 0.69444, 0, 0, 0.77778],
4041 "9825": [0.12963, 0.69444, 0, 0, 0.77778],
4042 "9826": [0.12963, 0.69444, 0, 0, 0.77778],
4043 "9827": [0.12963, 0.69444, 0, 0, 0.77778],
4044 "9837": [0, 0.75, 0, 0, 0.38889],
4045 "9838": [0.19444, 0.69444, 0, 0, 0.38889],
4046 "9839": [0.19444, 0.69444, 0, 0, 0.38889],
4047 "10216": [0.25, 0.75, 0, 0, 0.38889],
4048 "10217": [0.25, 0.75, 0, 0, 0.38889],
4049 "10222": [0.244, 0.744, 0, 0, 0.412],
4050 "10223": [0.244, 0.744, 0, 0, 0.412],
4051 "10229": [0.011, 0.511, 0, 0, 1.609],
4052 "10230": [0.011, 0.511, 0, 0, 1.638],
4053 "10231": [0.011, 0.511, 0, 0, 1.859],
4054 "10232": [0.024, 0.525, 0, 0, 1.609],
4055 "10233": [0.024, 0.525, 0, 0, 1.638],
4056 "10234": [0.024, 0.525, 0, 0, 1.858],
4057 "10236": [0.011, 0.511, 0, 0, 1.638],
4058 "10815": [0, 0.68333, 0, 0, 0.75],
4059 "10927": [0.13597, 0.63597, 0, 0, 0.77778],
4060 "10928": [0.13597, 0.63597, 0, 0, 0.77778]
4061 },
4062 "Math-BoldItalic": {
4063 "47": [0.19444, 0.69444, 0, 0, 0],
4064 "65": [0, 0.68611, 0, 0, 0.86944],
4065 "66": [0, 0.68611, 0.04835, 0, 0.8664],
4066 "67": [0, 0.68611, 0.06979, 0, 0.81694],
4067 "68": [0, 0.68611, 0.03194, 0, 0.93812],
4068 "69": [0, 0.68611, 0.05451, 0, 0.81007],
4069 "70": [0, 0.68611, 0.15972, 0, 0.68889],
4070 "71": [0, 0.68611, 0, 0, 0.88673],
4071 "72": [0, 0.68611, 0.08229, 0, 0.98229],
4072 "73": [0, 0.68611, 0.07778, 0, 0.51111],
4073 "74": [0, 0.68611, 0.10069, 0, 0.63125],
4074 "75": [0, 0.68611, 0.06979, 0, 0.97118],
4075 "76": [0, 0.68611, 0, 0, 0.75555],
4076 "77": [0, 0.68611, 0.11424, 0, 1.14201],
4077 "78": [0, 0.68611, 0.11424, 0, 0.95034],
4078 "79": [0, 0.68611, 0.03194, 0, 0.83666],
4079 "80": [0, 0.68611, 0.15972, 0, 0.72309],
4080 "81": [0.19444, 0.68611, 0, 0, 0.86861],
4081 "82": [0, 0.68611, 0.00421, 0, 0.87235],
4082 "83": [0, 0.68611, 0.05382, 0, 0.69271],
4083 "84": [0, 0.68611, 0.15972, 0, 0.63663],
4084 "85": [0, 0.68611, 0.11424, 0, 0.80027],
4085 "86": [0, 0.68611, 0.25555, 0, 0.67778],
4086 "87": [0, 0.68611, 0.15972, 0, 1.09305],
4087 "88": [0, 0.68611, 0.07778, 0, 0.94722],
4088 "89": [0, 0.68611, 0.25555, 0, 0.67458],
4089 "90": [0, 0.68611, 0.06979, 0, 0.77257],
4090 "97": [0, 0.44444, 0, 0, 0.63287],
4091 "98": [0, 0.69444, 0, 0, 0.52083],
4092 "99": [0, 0.44444, 0, 0, 0.51342],
4093 "100": [0, 0.69444, 0, 0, 0.60972],
4094 "101": [0, 0.44444, 0, 0, 0.55361],
4095 "102": [0.19444, 0.69444, 0.11042, 0, 0.56806],
4096 "103": [0.19444, 0.44444, 0.03704, 0, 0.5449],
4097 "104": [0, 0.69444, 0, 0, 0.66759],
4098 "105": [0, 0.69326, 0, 0, 0.4048],
4099 "106": [0.19444, 0.69326, 0.0622, 0, 0.47083],
4100 "107": [0, 0.69444, 0.01852, 0, 0.6037],
4101 "108": [0, 0.69444, 0.0088, 0, 0.34815],
4102 "109": [0, 0.44444, 0, 0, 1.0324],
4103 "110": [0, 0.44444, 0, 0, 0.71296],
4104 "111": [0, 0.44444, 0, 0, 0.58472],
4105 "112": [0.19444, 0.44444, 0, 0, 0.60092],
4106 "113": [0.19444, 0.44444, 0.03704, 0, 0.54213],
4107 "114": [0, 0.44444, 0.03194, 0, 0.5287],
4108 "115": [0, 0.44444, 0, 0, 0.53125],
4109 "116": [0, 0.63492, 0, 0, 0.41528],
4110 "117": [0, 0.44444, 0, 0, 0.68102],
4111 "118": [0, 0.44444, 0.03704, 0, 0.56666],
4112 "119": [0, 0.44444, 0.02778, 0, 0.83148],
4113 "120": [0, 0.44444, 0, 0, 0.65903],
4114 "121": [0.19444, 0.44444, 0.03704, 0, 0.59028],
4115 "122": [0, 0.44444, 0.04213, 0, 0.55509],
4116 "915": [0, 0.68611, 0.15972, 0, 0.65694],
4117 "916": [0, 0.68611, 0, 0, 0.95833],
4118 "920": [0, 0.68611, 0.03194, 0, 0.86722],
4119 "923": [0, 0.68611, 0, 0, 0.80555],
4120 "926": [0, 0.68611, 0.07458, 0, 0.84125],
4121 "928": [0, 0.68611, 0.08229, 0, 0.98229],
4122 "931": [0, 0.68611, 0.05451, 0, 0.88507],
4123 "933": [0, 0.68611, 0.15972, 0, 0.67083],
4124 "934": [0, 0.68611, 0, 0, 0.76666],
4125 "936": [0, 0.68611, 0.11653, 0, 0.71402],
4126 "937": [0, 0.68611, 0.04835, 0, 0.8789],
4127 "945": [0, 0.44444, 0, 0, 0.76064],
4128 "946": [0.19444, 0.69444, 0.03403, 0, 0.65972],
4129 "947": [0.19444, 0.44444, 0.06389, 0, 0.59003],
4130 "948": [0, 0.69444, 0.03819, 0, 0.52222],
4131 "949": [0, 0.44444, 0, 0, 0.52882],
4132 "950": [0.19444, 0.69444, 0.06215, 0, 0.50833],
4133 "951": [0.19444, 0.44444, 0.03704, 0, 0.6],
4134 "952": [0, 0.69444, 0.03194, 0, 0.5618],
4135 "953": [0, 0.44444, 0, 0, 0.41204],
4136 "954": [0, 0.44444, 0, 0, 0.66759],
4137 "955": [0, 0.69444, 0, 0, 0.67083],
4138 "956": [0.19444, 0.44444, 0, 0, 0.70787],
4139 "957": [0, 0.44444, 0.06898, 0, 0.57685],
4140 "958": [0.19444, 0.69444, 0.03021, 0, 0.50833],
4141 "959": [0, 0.44444, 0, 0, 0.58472],
4142 "960": [0, 0.44444, 0.03704, 0, 0.68241],
4143 "961": [0.19444, 0.44444, 0, 0, 0.6118],
4144 "962": [0.09722, 0.44444, 0.07917, 0, 0.42361],
4145 "963": [0, 0.44444, 0.03704, 0, 0.68588],
4146 "964": [0, 0.44444, 0.13472, 0, 0.52083],
4147 "965": [0, 0.44444, 0.03704, 0, 0.63055],
4148 "966": [0.19444, 0.44444, 0, 0, 0.74722],
4149 "967": [0.19444, 0.44444, 0, 0, 0.71805],
4150 "968": [0.19444, 0.69444, 0.03704, 0, 0.75833],
4151 "969": [0, 0.44444, 0.03704, 0, 0.71782],
4152 "977": [0, 0.69444, 0, 0, 0.69155],
4153 "981": [0.19444, 0.69444, 0, 0, 0.7125],
4154 "982": [0, 0.44444, 0.03194, 0, 0.975],
4155 "1009": [0.19444, 0.44444, 0, 0, 0.6118],
4156 "1013": [0, 0.44444, 0, 0, 0.48333]
4157 },
4158 "Math-Italic": {
4159 "47": [0.19444, 0.69444, 0, 0, 0],
4160 "65": [0, 0.68333, 0, 0.13889, 0.75],
4161 "66": [0, 0.68333, 0.05017, 0.08334, 0.75851],
4162 "67": [0, 0.68333, 0.07153, 0.08334, 0.71472],
4163 "68": [0, 0.68333, 0.02778, 0.05556, 0.82792],
4164 "69": [0, 0.68333, 0.05764, 0.08334, 0.7382],
4165 "70": [0, 0.68333, 0.13889, 0.08334, 0.64306],
4166 "71": [0, 0.68333, 0, 0.08334, 0.78625],
4167 "72": [0, 0.68333, 0.08125, 0.05556, 0.83125],
4168 "73": [0, 0.68333, 0.07847, 0.11111, 0.43958],
4169 "74": [0, 0.68333, 0.09618, 0.16667, 0.55451],
4170 "75": [0, 0.68333, 0.07153, 0.05556, 0.84931],
4171 "76": [0, 0.68333, 0, 0.02778, 0.68056],
4172 "77": [0, 0.68333, 0.10903, 0.08334, 0.97014],
4173 "78": [0, 0.68333, 0.10903, 0.08334, 0.80347],
4174 "79": [0, 0.68333, 0.02778, 0.08334, 0.76278],
4175 "80": [0, 0.68333, 0.13889, 0.08334, 0.64201],
4176 "81": [0.19444, 0.68333, 0, 0.08334, 0.79056],
4177 "82": [0, 0.68333, 0.00773, 0.08334, 0.75929],
4178 "83": [0, 0.68333, 0.05764, 0.08334, 0.6132],
4179 "84": [0, 0.68333, 0.13889, 0.08334, 0.58438],
4180 "85": [0, 0.68333, 0.10903, 0.02778, 0.68278],
4181 "86": [0, 0.68333, 0.22222, 0, 0.58333],
4182 "87": [0, 0.68333, 0.13889, 0, 0.94445],
4183 "88": [0, 0.68333, 0.07847, 0.08334, 0.82847],
4184 "89": [0, 0.68333, 0.22222, 0, 0.58056],
4185 "90": [0, 0.68333, 0.07153, 0.08334, 0.68264],
4186 "97": [0, 0.43056, 0, 0, 0.52859],
4187 "98": [0, 0.69444, 0, 0, 0.42917],
4188 "99": [0, 0.43056, 0, 0.05556, 0.43276],
4189 "100": [0, 0.69444, 0, 0.16667, 0.52049],
4190 "101": [0, 0.43056, 0, 0.05556, 0.46563],
4191 "102": [0.19444, 0.69444, 0.10764, 0.16667, 0.48959],
4192 "103": [0.19444, 0.43056, 0.03588, 0.02778, 0.47697],
4193 "104": [0, 0.69444, 0, 0, 0.57616],
4194 "105": [0, 0.65952, 0, 0, 0.34451],
4195 "106": [0.19444, 0.65952, 0.05724, 0, 0.41181],
4196 "107": [0, 0.69444, 0.03148, 0, 0.5206],
4197 "108": [0, 0.69444, 0.01968, 0.08334, 0.29838],
4198 "109": [0, 0.43056, 0, 0, 0.87801],
4199 "110": [0, 0.43056, 0, 0, 0.60023],
4200 "111": [0, 0.43056, 0, 0.05556, 0.48472],
4201 "112": [0.19444, 0.43056, 0, 0.08334, 0.50313],
4202 "113": [0.19444, 0.43056, 0.03588, 0.08334, 0.44641],
4203 "114": [0, 0.43056, 0.02778, 0.05556, 0.45116],
4204 "115": [0, 0.43056, 0, 0.05556, 0.46875],
4205 "116": [0, 0.61508, 0, 0.08334, 0.36111],
4206 "117": [0, 0.43056, 0, 0.02778, 0.57246],
4207 "118": [0, 0.43056, 0.03588, 0.02778, 0.48472],
4208 "119": [0, 0.43056, 0.02691, 0.08334, 0.71592],
4209 "120": [0, 0.43056, 0, 0.02778, 0.57153],
4210 "121": [0.19444, 0.43056, 0.03588, 0.05556, 0.49028],
4211 "122": [0, 0.43056, 0.04398, 0.05556, 0.46505],
4212 "915": [0, 0.68333, 0.13889, 0.08334, 0.61528],
4213 "916": [0, 0.68333, 0, 0.16667, 0.83334],
4214 "920": [0, 0.68333, 0.02778, 0.08334, 0.76278],
4215 "923": [0, 0.68333, 0, 0.16667, 0.69445],
4216 "926": [0, 0.68333, 0.07569, 0.08334, 0.74236],
4217 "928": [0, 0.68333, 0.08125, 0.05556, 0.83125],
4218 "931": [0, 0.68333, 0.05764, 0.08334, 0.77986],
4219 "933": [0, 0.68333, 0.13889, 0.05556, 0.58333],
4220 "934": [0, 0.68333, 0, 0.08334, 0.66667],
4221 "936": [0, 0.68333, 0.11, 0.05556, 0.61222],
4222 "937": [0, 0.68333, 0.05017, 0.08334, 0.7724],
4223 "945": [0, 0.43056, 0.0037, 0.02778, 0.6397],
4224 "946": [0.19444, 0.69444, 0.05278, 0.08334, 0.56563],
4225 "947": [0.19444, 0.43056, 0.05556, 0, 0.51773],
4226 "948": [0, 0.69444, 0.03785, 0.05556, 0.44444],
4227 "949": [0, 0.43056, 0, 0.08334, 0.46632],
4228 "950": [0.19444, 0.69444, 0.07378, 0.08334, 0.4375],
4229 "951": [0.19444, 0.43056, 0.03588, 0.05556, 0.49653],
4230 "952": [0, 0.69444, 0.02778, 0.08334, 0.46944],
4231 "953": [0, 0.43056, 0, 0.05556, 0.35394],
4232 "954": [0, 0.43056, 0, 0, 0.57616],
4233 "955": [0, 0.69444, 0, 0, 0.58334],
4234 "956": [0.19444, 0.43056, 0, 0.02778, 0.60255],
4235 "957": [0, 0.43056, 0.06366, 0.02778, 0.49398],
4236 "958": [0.19444, 0.69444, 0.04601, 0.11111, 0.4375],
4237 "959": [0, 0.43056, 0, 0.05556, 0.48472],
4238 "960": [0, 0.43056, 0.03588, 0, 0.57003],
4239 "961": [0.19444, 0.43056, 0, 0.08334, 0.51702],
4240 "962": [0.09722, 0.43056, 0.07986, 0.08334, 0.36285],
4241 "963": [0, 0.43056, 0.03588, 0, 0.57141],
4242 "964": [0, 0.43056, 0.1132, 0.02778, 0.43715],
4243 "965": [0, 0.43056, 0.03588, 0.02778, 0.54028],
4244 "966": [0.19444, 0.43056, 0, 0.08334, 0.65417],
4245 "967": [0.19444, 0.43056, 0, 0.05556, 0.62569],
4246 "968": [0.19444, 0.69444, 0.03588, 0.11111, 0.65139],
4247 "969": [0, 0.43056, 0.03588, 0, 0.62245],
4248 "977": [0, 0.69444, 0, 0.08334, 0.59144],
4249 "981": [0.19444, 0.69444, 0, 0.08334, 0.59583],
4250 "982": [0, 0.43056, 0.02778, 0, 0.82813],
4251 "1009": [0.19444, 0.43056, 0, 0.08334, 0.51702],
4252 "1013": [0, 0.43056, 0, 0.05556, 0.4059]
4253 },
4254 "Math-Regular": {
4255 "65": [0, 0.68333, 0, 0.13889, 0.75],
4256 "66": [0, 0.68333, 0.05017, 0.08334, 0.75851],
4257 "67": [0, 0.68333, 0.07153, 0.08334, 0.71472],
4258 "68": [0, 0.68333, 0.02778, 0.05556, 0.82792],
4259 "69": [0, 0.68333, 0.05764, 0.08334, 0.7382],
4260 "70": [0, 0.68333, 0.13889, 0.08334, 0.64306],
4261 "71": [0, 0.68333, 0, 0.08334, 0.78625],
4262 "72": [0, 0.68333, 0.08125, 0.05556, 0.83125],
4263 "73": [0, 0.68333, 0.07847, 0.11111, 0.43958],
4264 "74": [0, 0.68333, 0.09618, 0.16667, 0.55451],
4265 "75": [0, 0.68333, 0.07153, 0.05556, 0.84931],
4266 "76": [0, 0.68333, 0, 0.02778, 0.68056],
4267 "77": [0, 0.68333, 0.10903, 0.08334, 0.97014],
4268 "78": [0, 0.68333, 0.10903, 0.08334, 0.80347],
4269 "79": [0, 0.68333, 0.02778, 0.08334, 0.76278],
4270 "80": [0, 0.68333, 0.13889, 0.08334, 0.64201],
4271 "81": [0.19444, 0.68333, 0, 0.08334, 0.79056],
4272 "82": [0, 0.68333, 0.00773, 0.08334, 0.75929],
4273 "83": [0, 0.68333, 0.05764, 0.08334, 0.6132],
4274 "84": [0, 0.68333, 0.13889, 0.08334, 0.58438],
4275 "85": [0, 0.68333, 0.10903, 0.02778, 0.68278],
4276 "86": [0, 0.68333, 0.22222, 0, 0.58333],
4277 "87": [0, 0.68333, 0.13889, 0, 0.94445],
4278 "88": [0, 0.68333, 0.07847, 0.08334, 0.82847],
4279 "89": [0, 0.68333, 0.22222, 0, 0.58056],
4280 "90": [0, 0.68333, 0.07153, 0.08334, 0.68264],
4281 "97": [0, 0.43056, 0, 0, 0.52859],
4282 "98": [0, 0.69444, 0, 0, 0.42917],
4283 "99": [0, 0.43056, 0, 0.05556, 0.43276],
4284 "100": [0, 0.69444, 0, 0.16667, 0.52049],
4285 "101": [0, 0.43056, 0, 0.05556, 0.46563],
4286 "102": [0.19444, 0.69444, 0.10764, 0.16667, 0.48959],
4287 "103": [0.19444, 0.43056, 0.03588, 0.02778, 0.47697],
4288 "104": [0, 0.69444, 0, 0, 0.57616],
4289 "105": [0, 0.65952, 0, 0, 0.34451],
4290 "106": [0.19444, 0.65952, 0.05724, 0, 0.41181],
4291 "107": [0, 0.69444, 0.03148, 0, 0.5206],
4292 "108": [0, 0.69444, 0.01968, 0.08334, 0.29838],
4293 "109": [0, 0.43056, 0, 0, 0.87801],
4294 "110": [0, 0.43056, 0, 0, 0.60023],
4295 "111": [0, 0.43056, 0, 0.05556, 0.48472],
4296 "112": [0.19444, 0.43056, 0, 0.08334, 0.50313],
4297 "113": [0.19444, 0.43056, 0.03588, 0.08334, 0.44641],
4298 "114": [0, 0.43056, 0.02778, 0.05556, 0.45116],
4299 "115": [0, 0.43056, 0, 0.05556, 0.46875],
4300 "116": [0, 0.61508, 0, 0.08334, 0.36111],
4301 "117": [0, 0.43056, 0, 0.02778, 0.57246],
4302 "118": [0, 0.43056, 0.03588, 0.02778, 0.48472],
4303 "119": [0, 0.43056, 0.02691, 0.08334, 0.71592],
4304 "120": [0, 0.43056, 0, 0.02778, 0.57153],
4305 "121": [0.19444, 0.43056, 0.03588, 0.05556, 0.49028],
4306 "122": [0, 0.43056, 0.04398, 0.05556, 0.46505],
4307 "915": [0, 0.68333, 0.13889, 0.08334, 0.61528],
4308 "916": [0, 0.68333, 0, 0.16667, 0.83334],
4309 "920": [0, 0.68333, 0.02778, 0.08334, 0.76278],
4310 "923": [0, 0.68333, 0, 0.16667, 0.69445],
4311 "926": [0, 0.68333, 0.07569, 0.08334, 0.74236],
4312 "928": [0, 0.68333, 0.08125, 0.05556, 0.83125],
4313 "931": [0, 0.68333, 0.05764, 0.08334, 0.77986],
4314 "933": [0, 0.68333, 0.13889, 0.05556, 0.58333],
4315 "934": [0, 0.68333, 0, 0.08334, 0.66667],
4316 "936": [0, 0.68333, 0.11, 0.05556, 0.61222],
4317 "937": [0, 0.68333, 0.05017, 0.08334, 0.7724],
4318 "945": [0, 0.43056, 0.0037, 0.02778, 0.6397],
4319 "946": [0.19444, 0.69444, 0.05278, 0.08334, 0.56563],
4320 "947": [0.19444, 0.43056, 0.05556, 0, 0.51773],
4321 "948": [0, 0.69444, 0.03785, 0.05556, 0.44444],
4322 "949": [0, 0.43056, 0, 0.08334, 0.46632],
4323 "950": [0.19444, 0.69444, 0.07378, 0.08334, 0.4375],
4324 "951": [0.19444, 0.43056, 0.03588, 0.05556, 0.49653],
4325 "952": [0, 0.69444, 0.02778, 0.08334, 0.46944],
4326 "953": [0, 0.43056, 0, 0.05556, 0.35394],
4327 "954": [0, 0.43056, 0, 0, 0.57616],
4328 "955": [0, 0.69444, 0, 0, 0.58334],
4329 "956": [0.19444, 0.43056, 0, 0.02778, 0.60255],
4330 "957": [0, 0.43056, 0.06366, 0.02778, 0.49398],
4331 "958": [0.19444, 0.69444, 0.04601, 0.11111, 0.4375],
4332 "959": [0, 0.43056, 0, 0.05556, 0.48472],
4333 "960": [0, 0.43056, 0.03588, 0, 0.57003],
4334 "961": [0.19444, 0.43056, 0, 0.08334, 0.51702],
4335 "962": [0.09722, 0.43056, 0.07986, 0.08334, 0.36285],
4336 "963": [0, 0.43056, 0.03588, 0, 0.57141],
4337 "964": [0, 0.43056, 0.1132, 0.02778, 0.43715],
4338 "965": [0, 0.43056, 0.03588, 0.02778, 0.54028],
4339 "966": [0.19444, 0.43056, 0, 0.08334, 0.65417],
4340 "967": [0.19444, 0.43056, 0, 0.05556, 0.62569],
4341 "968": [0.19444, 0.69444, 0.03588, 0.11111, 0.65139],
4342 "969": [0, 0.43056, 0.03588, 0, 0.62245],
4343 "977": [0, 0.69444, 0, 0.08334, 0.59144],
4344 "981": [0.19444, 0.69444, 0, 0.08334, 0.59583],
4345 "982": [0, 0.43056, 0.02778, 0, 0.82813],
4346 "1009": [0.19444, 0.43056, 0, 0.08334, 0.51702],
4347 "1013": [0, 0.43056, 0, 0.05556, 0.4059]
4348 },
4349 "SansSerif-Bold": {
4350 "33": [0, 0.69444, 0, 0, 0.36667],
4351 "34": [0, 0.69444, 0, 0, 0.55834],
4352 "35": [0.19444, 0.69444, 0, 0, 0.91667],
4353 "36": [0.05556, 0.75, 0, 0, 0.55],
4354 "37": [0.05556, 0.75, 0, 0, 1.02912],
4355 "38": [0, 0.69444, 0, 0, 0.83056],
4356 "39": [0, 0.69444, 0, 0, 0.30556],
4357 "40": [0.25, 0.75, 0, 0, 0.42778],
4358 "41": [0.25, 0.75, 0, 0, 0.42778],
4359 "42": [0, 0.75, 0, 0, 0.55],
4360 "43": [0.11667, 0.61667, 0, 0, 0.85556],
4361 "44": [0.10556, 0.13056, 0, 0, 0.30556],
4362 "45": [0, 0.45833, 0, 0, 0.36667],
4363 "46": [0, 0.13056, 0, 0, 0.30556],
4364 "47": [0.25, 0.75, 0, 0, 0.55],
4365 "48": [0, 0.69444, 0, 0, 0.55],
4366 "49": [0, 0.69444, 0, 0, 0.55],
4367 "50": [0, 0.69444, 0, 0, 0.55],
4368 "51": [0, 0.69444, 0, 0, 0.55],
4369 "52": [0, 0.69444, 0, 0, 0.55],
4370 "53": [0, 0.69444, 0, 0, 0.55],
4371 "54": [0, 0.69444, 0, 0, 0.55],
4372 "55": [0, 0.69444, 0, 0, 0.55],
4373 "56": [0, 0.69444, 0, 0, 0.55],
4374 "57": [0, 0.69444, 0, 0, 0.55],
4375 "58": [0, 0.45833, 0, 0, 0.30556],
4376 "59": [0.10556, 0.45833, 0, 0, 0.30556],
4377 "61": [-0.09375, 0.40625, 0, 0, 0.85556],
4378 "63": [0, 0.69444, 0, 0, 0.51945],
4379 "64": [0, 0.69444, 0, 0, 0.73334],
4380 "65": [0, 0.69444, 0, 0, 0.73334],
4381 "66": [0, 0.69444, 0, 0, 0.73334],
4382 "67": [0, 0.69444, 0, 0, 0.70278],
4383 "68": [0, 0.69444, 0, 0, 0.79445],
4384 "69": [0, 0.69444, 0, 0, 0.64167],
4385 "70": [0, 0.69444, 0, 0, 0.61111],
4386 "71": [0, 0.69444, 0, 0, 0.73334],
4387 "72": [0, 0.69444, 0, 0, 0.79445],
4388 "73": [0, 0.69444, 0, 0, 0.33056],
4389 "74": [0, 0.69444, 0, 0, 0.51945],
4390 "75": [0, 0.69444, 0, 0, 0.76389],
4391 "76": [0, 0.69444, 0, 0, 0.58056],
4392 "77": [0, 0.69444, 0, 0, 0.97778],
4393 "78": [0, 0.69444, 0, 0, 0.79445],
4394 "79": [0, 0.69444, 0, 0, 0.79445],
4395 "80": [0, 0.69444, 0, 0, 0.70278],
4396 "81": [0.10556, 0.69444, 0, 0, 0.79445],
4397 "82": [0, 0.69444, 0, 0, 0.70278],
4398 "83": [0, 0.69444, 0, 0, 0.61111],
4399 "84": [0, 0.69444, 0, 0, 0.73334],
4400 "85": [0, 0.69444, 0, 0, 0.76389],
4401 "86": [0, 0.69444, 0.01528, 0, 0.73334],
4402 "87": [0, 0.69444, 0.01528, 0, 1.03889],
4403 "88": [0, 0.69444, 0, 0, 0.73334],
4404 "89": [0, 0.69444, 0.0275, 0, 0.73334],
4405 "90": [0, 0.69444, 0, 0, 0.67223],
4406 "91": [0.25, 0.75, 0, 0, 0.34306],
4407 "93": [0.25, 0.75, 0, 0, 0.34306],
4408 "94": [0, 0.69444, 0, 0, 0.55],
4409 "95": [0.35, 0.10833, 0.03056, 0, 0.55],
4410 "97": [0, 0.45833, 0, 0, 0.525],
4411 "98": [0, 0.69444, 0, 0, 0.56111],
4412 "99": [0, 0.45833, 0, 0, 0.48889],
4413 "100": [0, 0.69444, 0, 0, 0.56111],
4414 "101": [0, 0.45833, 0, 0, 0.51111],
4415 "102": [0, 0.69444, 0.07639, 0, 0.33611],
4416 "103": [0.19444, 0.45833, 0.01528, 0, 0.55],
4417 "104": [0, 0.69444, 0, 0, 0.56111],
4418 "105": [0, 0.69444, 0, 0, 0.25556],
4419 "106": [0.19444, 0.69444, 0, 0, 0.28611],
4420 "107": [0, 0.69444, 0, 0, 0.53056],
4421 "108": [0, 0.69444, 0, 0, 0.25556],
4422 "109": [0, 0.45833, 0, 0, 0.86667],
4423 "110": [0, 0.45833, 0, 0, 0.56111],
4424 "111": [0, 0.45833, 0, 0, 0.55],
4425 "112": [0.19444, 0.45833, 0, 0, 0.56111],
4426 "113": [0.19444, 0.45833, 0, 0, 0.56111],
4427 "114": [0, 0.45833, 0.01528, 0, 0.37222],
4428 "115": [0, 0.45833, 0, 0, 0.42167],
4429 "116": [0, 0.58929, 0, 0, 0.40417],
4430 "117": [0, 0.45833, 0, 0, 0.56111],
4431 "118": [0, 0.45833, 0.01528, 0, 0.5],
4432 "119": [0, 0.45833, 0.01528, 0, 0.74445],
4433 "120": [0, 0.45833, 0, 0, 0.5],
4434 "121": [0.19444, 0.45833, 0.01528, 0, 0.5],
4435 "122": [0, 0.45833, 0, 0, 0.47639],
4436 "126": [0.35, 0.34444, 0, 0, 0.55],
4437 "168": [0, 0.69444, 0, 0, 0.55],
4438 "176": [0, 0.69444, 0, 0, 0.73334],
4439 "180": [0, 0.69444, 0, 0, 0.55],
4440 "184": [0.17014, 0, 0, 0, 0.48889],
4441 "305": [0, 0.45833, 0, 0, 0.25556],
4442 "567": [0.19444, 0.45833, 0, 0, 0.28611],
4443 "710": [0, 0.69444, 0, 0, 0.55],
4444 "711": [0, 0.63542, 0, 0, 0.55],
4445 "713": [0, 0.63778, 0, 0, 0.55],
4446 "728": [0, 0.69444, 0, 0, 0.55],
4447 "729": [0, 0.69444, 0, 0, 0.30556],
4448 "730": [0, 0.69444, 0, 0, 0.73334],
4449 "732": [0, 0.69444, 0, 0, 0.55],
4450 "733": [0, 0.69444, 0, 0, 0.55],
4451 "915": [0, 0.69444, 0, 0, 0.58056],
4452 "916": [0, 0.69444, 0, 0, 0.91667],
4453 "920": [0, 0.69444, 0, 0, 0.85556],
4454 "923": [0, 0.69444, 0, 0, 0.67223],
4455 "926": [0, 0.69444, 0, 0, 0.73334],
4456 "928": [0, 0.69444, 0, 0, 0.79445],
4457 "931": [0, 0.69444, 0, 0, 0.79445],
4458 "933": [0, 0.69444, 0, 0, 0.85556],
4459 "934": [0, 0.69444, 0, 0, 0.79445],
4460 "936": [0, 0.69444, 0, 0, 0.85556],
4461 "937": [0, 0.69444, 0, 0, 0.79445],
4462 "8211": [0, 0.45833, 0.03056, 0, 0.55],
4463 "8212": [0, 0.45833, 0.03056, 0, 1.10001],
4464 "8216": [0, 0.69444, 0, 0, 0.30556],
4465 "8217": [0, 0.69444, 0, 0, 0.30556],
4466 "8220": [0, 0.69444, 0, 0, 0.55834],
4467 "8221": [0, 0.69444, 0, 0, 0.55834]
4468 },
4469 "SansSerif-Italic": {
4470 "33": [0, 0.69444, 0.05733, 0, 0.31945],
4471 "34": [0, 0.69444, 0.00316, 0, 0.5],
4472 "35": [0.19444, 0.69444, 0.05087, 0, 0.83334],
4473 "36": [0.05556, 0.75, 0.11156, 0, 0.5],
4474 "37": [0.05556, 0.75, 0.03126, 0, 0.83334],
4475 "38": [0, 0.69444, 0.03058, 0, 0.75834],
4476 "39": [0, 0.69444, 0.07816, 0, 0.27778],
4477 "40": [0.25, 0.75, 0.13164, 0, 0.38889],
4478 "41": [0.25, 0.75, 0.02536, 0, 0.38889],
4479 "42": [0, 0.75, 0.11775, 0, 0.5],
4480 "43": [0.08333, 0.58333, 0.02536, 0, 0.77778],
4481 "44": [0.125, 0.08333, 0, 0, 0.27778],
4482 "45": [0, 0.44444, 0.01946, 0, 0.33333],
4483 "46": [0, 0.08333, 0, 0, 0.27778],
4484 "47": [0.25, 0.75, 0.13164, 0, 0.5],
4485 "48": [0, 0.65556, 0.11156, 0, 0.5],
4486 "49": [0, 0.65556, 0.11156, 0, 0.5],
4487 "50": [0, 0.65556, 0.11156, 0, 0.5],
4488 "51": [0, 0.65556, 0.11156, 0, 0.5],
4489 "52": [0, 0.65556, 0.11156, 0, 0.5],
4490 "53": [0, 0.65556, 0.11156, 0, 0.5],
4491 "54": [0, 0.65556, 0.11156, 0, 0.5],
4492 "55": [0, 0.65556, 0.11156, 0, 0.5],
4493 "56": [0, 0.65556, 0.11156, 0, 0.5],
4494 "57": [0, 0.65556, 0.11156, 0, 0.5],
4495 "58": [0, 0.44444, 0.02502, 0, 0.27778],
4496 "59": [0.125, 0.44444, 0.02502, 0, 0.27778],
4497 "61": [-0.13, 0.37, 0.05087, 0, 0.77778],
4498 "63": [0, 0.69444, 0.11809, 0, 0.47222],
4499 "64": [0, 0.69444, 0.07555, 0, 0.66667],
4500 "65": [0, 0.69444, 0, 0, 0.66667],
4501 "66": [0, 0.69444, 0.08293, 0, 0.66667],
4502 "67": [0, 0.69444, 0.11983, 0, 0.63889],
4503 "68": [0, 0.69444, 0.07555, 0, 0.72223],
4504 "69": [0, 0.69444, 0.11983, 0, 0.59722],
4505 "70": [0, 0.69444, 0.13372, 0, 0.56945],
4506 "71": [0, 0.69444, 0.11983, 0, 0.66667],
4507 "72": [0, 0.69444, 0.08094, 0, 0.70834],
4508 "73": [0, 0.69444, 0.13372, 0, 0.27778],
4509 "74": [0, 0.69444, 0.08094, 0, 0.47222],
4510 "75": [0, 0.69444, 0.11983, 0, 0.69445],
4511 "76": [0, 0.69444, 0, 0, 0.54167],
4512 "77": [0, 0.69444, 0.08094, 0, 0.875],
4513 "78": [0, 0.69444, 0.08094, 0, 0.70834],
4514 "79": [0, 0.69444, 0.07555, 0, 0.73611],
4515 "80": [0, 0.69444, 0.08293, 0, 0.63889],
4516 "81": [0.125, 0.69444, 0.07555, 0, 0.73611],
4517 "82": [0, 0.69444, 0.08293, 0, 0.64584],
4518 "83": [0, 0.69444, 0.09205, 0, 0.55556],
4519 "84": [0, 0.69444, 0.13372, 0, 0.68056],
4520 "85": [0, 0.69444, 0.08094, 0, 0.6875],
4521 "86": [0, 0.69444, 0.1615, 0, 0.66667],
4522 "87": [0, 0.69444, 0.1615, 0, 0.94445],
4523 "88": [0, 0.69444, 0.13372, 0, 0.66667],
4524 "89": [0, 0.69444, 0.17261, 0, 0.66667],
4525 "90": [0, 0.69444, 0.11983, 0, 0.61111],
4526 "91": [0.25, 0.75, 0.15942, 0, 0.28889],
4527 "93": [0.25, 0.75, 0.08719, 0, 0.28889],
4528 "94": [0, 0.69444, 0.0799, 0, 0.5],
4529 "95": [0.35, 0.09444, 0.08616, 0, 0.5],
4530 "97": [0, 0.44444, 0.00981, 0, 0.48056],
4531 "98": [0, 0.69444, 0.03057, 0, 0.51667],
4532 "99": [0, 0.44444, 0.08336, 0, 0.44445],
4533 "100": [0, 0.69444, 0.09483, 0, 0.51667],
4534 "101": [0, 0.44444, 0.06778, 0, 0.44445],
4535 "102": [0, 0.69444, 0.21705, 0, 0.30556],
4536 "103": [0.19444, 0.44444, 0.10836, 0, 0.5],
4537 "104": [0, 0.69444, 0.01778, 0, 0.51667],
4538 "105": [0, 0.67937, 0.09718, 0, 0.23889],
4539 "106": [0.19444, 0.67937, 0.09162, 0, 0.26667],
4540 "107": [0, 0.69444, 0.08336, 0, 0.48889],
4541 "108": [0, 0.69444, 0.09483, 0, 0.23889],
4542 "109": [0, 0.44444, 0.01778, 0, 0.79445],
4543 "110": [0, 0.44444, 0.01778, 0, 0.51667],
4544 "111": [0, 0.44444, 0.06613, 0, 0.5],
4545 "112": [0.19444, 0.44444, 0.0389, 0, 0.51667],
4546 "113": [0.19444, 0.44444, 0.04169, 0, 0.51667],
4547 "114": [0, 0.44444, 0.10836, 0, 0.34167],
4548 "115": [0, 0.44444, 0.0778, 0, 0.38333],
4549 "116": [0, 0.57143, 0.07225, 0, 0.36111],
4550 "117": [0, 0.44444, 0.04169, 0, 0.51667],
4551 "118": [0, 0.44444, 0.10836, 0, 0.46111],
4552 "119": [0, 0.44444, 0.10836, 0, 0.68334],
4553 "120": [0, 0.44444, 0.09169, 0, 0.46111],
4554 "121": [0.19444, 0.44444, 0.10836, 0, 0.46111],
4555 "122": [0, 0.44444, 0.08752, 0, 0.43472],
4556 "126": [0.35, 0.32659, 0.08826, 0, 0.5],
4557 "168": [0, 0.67937, 0.06385, 0, 0.5],
4558 "176": [0, 0.69444, 0, 0, 0.73752],
4559 "184": [0.17014, 0, 0, 0, 0.44445],
4560 "305": [0, 0.44444, 0.04169, 0, 0.23889],
4561 "567": [0.19444, 0.44444, 0.04169, 0, 0.26667],
4562 "710": [0, 0.69444, 0.0799, 0, 0.5],
4563 "711": [0, 0.63194, 0.08432, 0, 0.5],
4564 "713": [0, 0.60889, 0.08776, 0, 0.5],
4565 "714": [0, 0.69444, 0.09205, 0, 0.5],
4566 "715": [0, 0.69444, 0, 0, 0.5],
4567 "728": [0, 0.69444, 0.09483, 0, 0.5],
4568 "729": [0, 0.67937, 0.07774, 0, 0.27778],
4569 "730": [0, 0.69444, 0, 0, 0.73752],
4570 "732": [0, 0.67659, 0.08826, 0, 0.5],
4571 "733": [0, 0.69444, 0.09205, 0, 0.5],
4572 "915": [0, 0.69444, 0.13372, 0, 0.54167],
4573 "916": [0, 0.69444, 0, 0, 0.83334],
4574 "920": [0, 0.69444, 0.07555, 0, 0.77778],
4575 "923": [0, 0.69444, 0, 0, 0.61111],
4576 "926": [0, 0.69444, 0.12816, 0, 0.66667],
4577 "928": [0, 0.69444, 0.08094, 0, 0.70834],
4578 "931": [0, 0.69444, 0.11983, 0, 0.72222],
4579 "933": [0, 0.69444, 0.09031, 0, 0.77778],
4580 "934": [0, 0.69444, 0.04603, 0, 0.72222],
4581 "936": [0, 0.69444, 0.09031, 0, 0.77778],
4582 "937": [0, 0.69444, 0.08293, 0, 0.72222],
4583 "8211": [0, 0.44444, 0.08616, 0, 0.5],
4584 "8212": [0, 0.44444, 0.08616, 0, 1.0],
4585 "8216": [0, 0.69444, 0.07816, 0, 0.27778],
4586 "8217": [0, 0.69444, 0.07816, 0, 0.27778],
4587 "8220": [0, 0.69444, 0.14205, 0, 0.5],
4588 "8221": [0, 0.69444, 0.00316, 0, 0.5]
4589 },
4590 "SansSerif-Regular": {
4591 "33": [0, 0.69444, 0, 0, 0.31945],
4592 "34": [0, 0.69444, 0, 0, 0.5],
4593 "35": [0.19444, 0.69444, 0, 0, 0.83334],
4594 "36": [0.05556, 0.75, 0, 0, 0.5],
4595 "37": [0.05556, 0.75, 0, 0, 0.83334],
4596 "38": [0, 0.69444, 0, 0, 0.75834],
4597 "39": [0, 0.69444, 0, 0, 0.27778],
4598 "40": [0.25, 0.75, 0, 0, 0.38889],
4599 "41": [0.25, 0.75, 0, 0, 0.38889],
4600 "42": [0, 0.75, 0, 0, 0.5],
4601 "43": [0.08333, 0.58333, 0, 0, 0.77778],
4602 "44": [0.125, 0.08333, 0, 0, 0.27778],
4603 "45": [0, 0.44444, 0, 0, 0.33333],
4604 "46": [0, 0.08333, 0, 0, 0.27778],
4605 "47": [0.25, 0.75, 0, 0, 0.5],
4606 "48": [0, 0.65556, 0, 0, 0.5],
4607 "49": [0, 0.65556, 0, 0, 0.5],
4608 "50": [0, 0.65556, 0, 0, 0.5],
4609 "51": [0, 0.65556, 0, 0, 0.5],
4610 "52": [0, 0.65556, 0, 0, 0.5],
4611 "53": [0, 0.65556, 0, 0, 0.5],
4612 "54": [0, 0.65556, 0, 0, 0.5],
4613 "55": [0, 0.65556, 0, 0, 0.5],
4614 "56": [0, 0.65556, 0, 0, 0.5],
4615 "57": [0, 0.65556, 0, 0, 0.5],
4616 "58": [0, 0.44444, 0, 0, 0.27778],
4617 "59": [0.125, 0.44444, 0, 0, 0.27778],
4618 "61": [-0.13, 0.37, 0, 0, 0.77778],
4619 "63": [0, 0.69444, 0, 0, 0.47222],
4620 "64": [0, 0.69444, 0, 0, 0.66667],
4621 "65": [0, 0.69444, 0, 0, 0.66667],
4622 "66": [0, 0.69444, 0, 0, 0.66667],
4623 "67": [0, 0.69444, 0, 0, 0.63889],
4624 "68": [0, 0.69444, 0, 0, 0.72223],
4625 "69": [0, 0.69444, 0, 0, 0.59722],
4626 "70": [0, 0.69444, 0, 0, 0.56945],
4627 "71": [0, 0.69444, 0, 0, 0.66667],
4628 "72": [0, 0.69444, 0, 0, 0.70834],
4629 "73": [0, 0.69444, 0, 0, 0.27778],
4630 "74": [0, 0.69444, 0, 0, 0.47222],
4631 "75": [0, 0.69444, 0, 0, 0.69445],
4632 "76": [0, 0.69444, 0, 0, 0.54167],
4633 "77": [0, 0.69444, 0, 0, 0.875],
4634 "78": [0, 0.69444, 0, 0, 0.70834],
4635 "79": [0, 0.69444, 0, 0, 0.73611],
4636 "80": [0, 0.69444, 0, 0, 0.63889],
4637 "81": [0.125, 0.69444, 0, 0, 0.73611],
4638 "82": [0, 0.69444, 0, 0, 0.64584],
4639 "83": [0, 0.69444, 0, 0, 0.55556],
4640 "84": [0, 0.69444, 0, 0, 0.68056],
4641 "85": [0, 0.69444, 0, 0, 0.6875],
4642 "86": [0, 0.69444, 0.01389, 0, 0.66667],
4643 "87": [0, 0.69444, 0.01389, 0, 0.94445],
4644 "88": [0, 0.69444, 0, 0, 0.66667],
4645 "89": [0, 0.69444, 0.025, 0, 0.66667],
4646 "90": [0, 0.69444, 0, 0, 0.61111],
4647 "91": [0.25, 0.75, 0, 0, 0.28889],
4648 "93": [0.25, 0.75, 0, 0, 0.28889],
4649 "94": [0, 0.69444, 0, 0, 0.5],
4650 "95": [0.35, 0.09444, 0.02778, 0, 0.5],
4651 "97": [0, 0.44444, 0, 0, 0.48056],
4652 "98": [0, 0.69444, 0, 0, 0.51667],
4653 "99": [0, 0.44444, 0, 0, 0.44445],
4654 "100": [0, 0.69444, 0, 0, 0.51667],
4655 "101": [0, 0.44444, 0, 0, 0.44445],
4656 "102": [0, 0.69444, 0.06944, 0, 0.30556],
4657 "103": [0.19444, 0.44444, 0.01389, 0, 0.5],
4658 "104": [0, 0.69444, 0, 0, 0.51667],
4659 "105": [0, 0.67937, 0, 0, 0.23889],
4660 "106": [0.19444, 0.67937, 0, 0, 0.26667],
4661 "107": [0, 0.69444, 0, 0, 0.48889],
4662 "108": [0, 0.69444, 0, 0, 0.23889],
4663 "109": [0, 0.44444, 0, 0, 0.79445],
4664 "110": [0, 0.44444, 0, 0, 0.51667],
4665 "111": [0, 0.44444, 0, 0, 0.5],
4666 "112": [0.19444, 0.44444, 0, 0, 0.51667],
4667 "113": [0.19444, 0.44444, 0, 0, 0.51667],
4668 "114": [0, 0.44444, 0.01389, 0, 0.34167],
4669 "115": [0, 0.44444, 0, 0, 0.38333],
4670 "116": [0, 0.57143, 0, 0, 0.36111],
4671 "117": [0, 0.44444, 0, 0, 0.51667],
4672 "118": [0, 0.44444, 0.01389, 0, 0.46111],
4673 "119": [0, 0.44444, 0.01389, 0, 0.68334],
4674 "120": [0, 0.44444, 0, 0, 0.46111],
4675 "121": [0.19444, 0.44444, 0.01389, 0, 0.46111],
4676 "122": [0, 0.44444, 0, 0, 0.43472],
4677 "126": [0.35, 0.32659, 0, 0, 0.5],
4678 "168": [0, 0.67937, 0, 0, 0.5],
4679 "176": [0, 0.69444, 0, 0, 0.66667],
4680 "184": [0.17014, 0, 0, 0, 0.44445],
4681 "305": [0, 0.44444, 0, 0, 0.23889],
4682 "567": [0.19444, 0.44444, 0, 0, 0.26667],
4683 "710": [0, 0.69444, 0, 0, 0.5],
4684 "711": [0, 0.63194, 0, 0, 0.5],
4685 "713": [0, 0.60889, 0, 0, 0.5],
4686 "714": [0, 0.69444, 0, 0, 0.5],
4687 "715": [0, 0.69444, 0, 0, 0.5],
4688 "728": [0, 0.69444, 0, 0, 0.5],
4689 "729": [0, 0.67937, 0, 0, 0.27778],
4690 "730": [0, 0.69444, 0, 0, 0.66667],
4691 "732": [0, 0.67659, 0, 0, 0.5],
4692 "733": [0, 0.69444, 0, 0, 0.5],
4693 "915": [0, 0.69444, 0, 0, 0.54167],
4694 "916": [0, 0.69444, 0, 0, 0.83334],
4695 "920": [0, 0.69444, 0, 0, 0.77778],
4696 "923": [0, 0.69444, 0, 0, 0.61111],
4697 "926": [0, 0.69444, 0, 0, 0.66667],
4698 "928": [0, 0.69444, 0, 0, 0.70834],
4699 "931": [0, 0.69444, 0, 0, 0.72222],
4700 "933": [0, 0.69444, 0, 0, 0.77778],
4701 "934": [0, 0.69444, 0, 0, 0.72222],
4702 "936": [0, 0.69444, 0, 0, 0.77778],
4703 "937": [0, 0.69444, 0, 0, 0.72222],
4704 "8211": [0, 0.44444, 0.02778, 0, 0.5],
4705 "8212": [0, 0.44444, 0.02778, 0, 1.0],
4706 "8216": [0, 0.69444, 0, 0, 0.27778],
4707 "8217": [0, 0.69444, 0, 0, 0.27778],
4708 "8220": [0, 0.69444, 0, 0, 0.5],
4709 "8221": [0, 0.69444, 0, 0, 0.5]
4710 },
4711 "Script-Regular": {
4712 "65": [0, 0.7, 0.22925, 0, 0.80253],
4713 "66": [0, 0.7, 0.04087, 0, 0.90757],
4714 "67": [0, 0.7, 0.1689, 0, 0.66619],
4715 "68": [0, 0.7, 0.09371, 0, 0.77443],
4716 "69": [0, 0.7, 0.18583, 0, 0.56162],
4717 "70": [0, 0.7, 0.13634, 0, 0.89544],
4718 "71": [0, 0.7, 0.17322, 0, 0.60961],
4719 "72": [0, 0.7, 0.29694, 0, 0.96919],
4720 "73": [0, 0.7, 0.19189, 0, 0.80907],
4721 "74": [0.27778, 0.7, 0.19189, 0, 1.05159],
4722 "75": [0, 0.7, 0.31259, 0, 0.91364],
4723 "76": [0, 0.7, 0.19189, 0, 0.87373],
4724 "77": [0, 0.7, 0.15981, 0, 1.08031],
4725 "78": [0, 0.7, 0.3525, 0, 0.9015],
4726 "79": [0, 0.7, 0.08078, 0, 0.73787],
4727 "80": [0, 0.7, 0.08078, 0, 1.01262],
4728 "81": [0, 0.7, 0.03305, 0, 0.88282],
4729 "82": [0, 0.7, 0.06259, 0, 0.85],
4730 "83": [0, 0.7, 0.19189, 0, 0.86767],
4731 "84": [0, 0.7, 0.29087, 0, 0.74697],
4732 "85": [0, 0.7, 0.25815, 0, 0.79996],
4733 "86": [0, 0.7, 0.27523, 0, 0.62204],
4734 "87": [0, 0.7, 0.27523, 0, 0.80532],
4735 "88": [0, 0.7, 0.26006, 0, 0.94445],
4736 "89": [0, 0.7, 0.2939, 0, 0.70961],
4737 "90": [0, 0.7, 0.24037, 0, 0.8212]
4738 },
4739 "Size1-Regular": {
4740 "40": [0.35001, 0.85, 0, 0, 0.45834],
4741 "41": [0.35001, 0.85, 0, 0, 0.45834],
4742 "47": [0.35001, 0.85, 0, 0, 0.57778],
4743 "91": [0.35001, 0.85, 0, 0, 0.41667],
4744 "92": [0.35001, 0.85, 0, 0, 0.57778],
4745 "93": [0.35001, 0.85, 0, 0, 0.41667],
4746 "123": [0.35001, 0.85, 0, 0, 0.58334],
4747 "125": [0.35001, 0.85, 0, 0, 0.58334],
4748 "710": [0, 0.72222, 0, 0, 0.55556],
4749 "732": [0, 0.72222, 0, 0, 0.55556],
4750 "770": [0, 0.72222, 0, 0, 0.55556],
4751 "771": [0, 0.72222, 0, 0, 0.55556],
4752 "8214": [-0.00099, 0.601, 0, 0, 0.77778],
4753 "8593": [1e-05, 0.6, 0, 0, 0.66667],
4754 "8595": [1e-05, 0.6, 0, 0, 0.66667],
4755 "8657": [1e-05, 0.6, 0, 0, 0.77778],
4756 "8659": [1e-05, 0.6, 0, 0, 0.77778],
4757 "8719": [0.25001, 0.75, 0, 0, 0.94445],
4758 "8720": [0.25001, 0.75, 0, 0, 0.94445],
4759 "8721": [0.25001, 0.75, 0, 0, 1.05556],
4760 "8730": [0.35001, 0.85, 0, 0, 1.0],
4761 "8739": [-0.00599, 0.606, 0, 0, 0.33333],
4762 "8741": [-0.00599, 0.606, 0, 0, 0.55556],
4763 "8747": [0.30612, 0.805, 0.19445, 0, 0.47222],
4764 "8748": [0.306, 0.805, 0.19445, 0, 0.47222],
4765 "8749": [0.306, 0.805, 0.19445, 0, 0.47222],
4766 "8750": [0.30612, 0.805, 0.19445, 0, 0.47222],
4767 "8896": [0.25001, 0.75, 0, 0, 0.83334],
4768 "8897": [0.25001, 0.75, 0, 0, 0.83334],
4769 "8898": [0.25001, 0.75, 0, 0, 0.83334],
4770 "8899": [0.25001, 0.75, 0, 0, 0.83334],
4771 "8968": [0.35001, 0.85, 0, 0, 0.47222],
4772 "8969": [0.35001, 0.85, 0, 0, 0.47222],
4773 "8970": [0.35001, 0.85, 0, 0, 0.47222],
4774 "8971": [0.35001, 0.85, 0, 0, 0.47222],
4775 "9168": [-0.00099, 0.601, 0, 0, 0.66667],
4776 "10216": [0.35001, 0.85, 0, 0, 0.47222],
4777 "10217": [0.35001, 0.85, 0, 0, 0.47222],
4778 "10752": [0.25001, 0.75, 0, 0, 1.11111],
4779 "10753": [0.25001, 0.75, 0, 0, 1.11111],
4780 "10754": [0.25001, 0.75, 0, 0, 1.11111],
4781 "10756": [0.25001, 0.75, 0, 0, 0.83334],
4782 "10758": [0.25001, 0.75, 0, 0, 0.83334]
4783 },
4784 "Size2-Regular": {
4785 "40": [0.65002, 1.15, 0, 0, 0.59722],
4786 "41": [0.65002, 1.15, 0, 0, 0.59722],
4787 "47": [0.65002, 1.15, 0, 0, 0.81111],
4788 "91": [0.65002, 1.15, 0, 0, 0.47222],
4789 "92": [0.65002, 1.15, 0, 0, 0.81111],
4790 "93": [0.65002, 1.15, 0, 0, 0.47222],
4791 "123": [0.65002, 1.15, 0, 0, 0.66667],
4792 "125": [0.65002, 1.15, 0, 0, 0.66667],
4793 "710": [0, 0.75, 0, 0, 1.0],
4794 "732": [0, 0.75, 0, 0, 1.0],
4795 "770": [0, 0.75, 0, 0, 1.0],
4796 "771": [0, 0.75, 0, 0, 1.0],
4797 "8719": [0.55001, 1.05, 0, 0, 1.27778],
4798 "8720": [0.55001, 1.05, 0, 0, 1.27778],
4799 "8721": [0.55001, 1.05, 0, 0, 1.44445],
4800 "8730": [0.65002, 1.15, 0, 0, 1.0],
4801 "8747": [0.86225, 1.36, 0.44445, 0, 0.55556],
4802 "8748": [0.862, 1.36, 0.44445, 0, 0.55556],
4803 "8749": [0.862, 1.36, 0.44445, 0, 0.55556],
4804 "8750": [0.86225, 1.36, 0.44445, 0, 0.55556],
4805 "8896": [0.55001, 1.05, 0, 0, 1.11111],
4806 "8897": [0.55001, 1.05, 0, 0, 1.11111],
4807 "8898": [0.55001, 1.05, 0, 0, 1.11111],
4808 "8899": [0.55001, 1.05, 0, 0, 1.11111],
4809 "8968": [0.65002, 1.15, 0, 0, 0.52778],
4810 "8969": [0.65002, 1.15, 0, 0, 0.52778],
4811 "8970": [0.65002, 1.15, 0, 0, 0.52778],
4812 "8971": [0.65002, 1.15, 0, 0, 0.52778],
4813 "10216": [0.65002, 1.15, 0, 0, 0.61111],
4814 "10217": [0.65002, 1.15, 0, 0, 0.61111],
4815 "10752": [0.55001, 1.05, 0, 0, 1.51112],
4816 "10753": [0.55001, 1.05, 0, 0, 1.51112],
4817 "10754": [0.55001, 1.05, 0, 0, 1.51112],
4818 "10756": [0.55001, 1.05, 0, 0, 1.11111],
4819 "10758": [0.55001, 1.05, 0, 0, 1.11111]
4820 },
4821 "Size3-Regular": {
4822 "40": [0.95003, 1.45, 0, 0, 0.73611],
4823 "41": [0.95003, 1.45, 0, 0, 0.73611],
4824 "47": [0.95003, 1.45, 0, 0, 1.04445],
4825 "91": [0.95003, 1.45, 0, 0, 0.52778],
4826 "92": [0.95003, 1.45, 0, 0, 1.04445],
4827 "93": [0.95003, 1.45, 0, 0, 0.52778],
4828 "123": [0.95003, 1.45, 0, 0, 0.75],
4829 "125": [0.95003, 1.45, 0, 0, 0.75],
4830 "710": [0, 0.75, 0, 0, 1.44445],
4831 "732": [0, 0.75, 0, 0, 1.44445],
4832 "770": [0, 0.75, 0, 0, 1.44445],
4833 "771": [0, 0.75, 0, 0, 1.44445],
4834 "8730": [0.95003, 1.45, 0, 0, 1.0],
4835 "8968": [0.95003, 1.45, 0, 0, 0.58334],
4836 "8969": [0.95003, 1.45, 0, 0, 0.58334],
4837 "8970": [0.95003, 1.45, 0, 0, 0.58334],
4838 "8971": [0.95003, 1.45, 0, 0, 0.58334],
4839 "10216": [0.95003, 1.45, 0, 0, 0.75],
4840 "10217": [0.95003, 1.45, 0, 0, 0.75]
4841 },
4842 "Size4-Regular": {
4843 "40": [1.25003, 1.75, 0, 0, 0.79167],
4844 "41": [1.25003, 1.75, 0, 0, 0.79167],
4845 "47": [1.25003, 1.75, 0, 0, 1.27778],
4846 "91": [1.25003, 1.75, 0, 0, 0.58334],
4847 "92": [1.25003, 1.75, 0, 0, 1.27778],
4848 "93": [1.25003, 1.75, 0, 0, 0.58334],
4849 "123": [1.25003, 1.75, 0, 0, 0.80556],
4850 "125": [1.25003, 1.75, 0, 0, 0.80556],
4851 "710": [0, 0.825, 0, 0, 1.8889],
4852 "732": [0, 0.825, 0, 0, 1.8889],
4853 "770": [0, 0.825, 0, 0, 1.8889],
4854 "771": [0, 0.825, 0, 0, 1.8889],
4855 "8730": [1.25003, 1.75, 0, 0, 1.0],
4856 "8968": [1.25003, 1.75, 0, 0, 0.63889],
4857 "8969": [1.25003, 1.75, 0, 0, 0.63889],
4858 "8970": [1.25003, 1.75, 0, 0, 0.63889],
4859 "8971": [1.25003, 1.75, 0, 0, 0.63889],
4860 "9115": [0.64502, 1.155, 0, 0, 0.875],
4861 "9116": [1e-05, 0.6, 0, 0, 0.875],
4862 "9117": [0.64502, 1.155, 0, 0, 0.875],
4863 "9118": [0.64502, 1.155, 0, 0, 0.875],
4864 "9119": [1e-05, 0.6, 0, 0, 0.875],
4865 "9120": [0.64502, 1.155, 0, 0, 0.875],
4866 "9121": [0.64502, 1.155, 0, 0, 0.66667],
4867 "9122": [-0.00099, 0.601, 0, 0, 0.66667],
4868 "9123": [0.64502, 1.155, 0, 0, 0.66667],
4869 "9124": [0.64502, 1.155, 0, 0, 0.66667],
4870 "9125": [-0.00099, 0.601, 0, 0, 0.66667],
4871 "9126": [0.64502, 1.155, 0, 0, 0.66667],
4872 "9127": [1e-05, 0.9, 0, 0, 0.88889],
4873 "9128": [0.65002, 1.15, 0, 0, 0.88889],
4874 "9129": [0.90001, 0, 0, 0, 0.88889],
4875 "9130": [0, 0.3, 0, 0, 0.88889],
4876 "9131": [1e-05, 0.9, 0, 0, 0.88889],
4877 "9132": [0.65002, 1.15, 0, 0, 0.88889],
4878 "9133": [0.90001, 0, 0, 0, 0.88889],
4879 "9143": [0.88502, 0.915, 0, 0, 1.05556],
4880 "10216": [1.25003, 1.75, 0, 0, 0.80556],
4881 "10217": [1.25003, 1.75, 0, 0, 0.80556],
4882 "57344": [-0.00499, 0.605, 0, 0, 1.05556],
4883 "57345": [-0.00499, 0.605, 0, 0, 1.05556],
4884 "57680": [0, 0.12, 0, 0, 0.45],
4885 "57681": [0, 0.12, 0, 0, 0.45],
4886 "57682": [0, 0.12, 0, 0, 0.45],
4887 "57683": [0, 0.12, 0, 0, 0.45]
4888 },
4889 "Typewriter-Regular": {
4890 "32": [0, 0, 0, 0, 0.525],
4891 "33": [0, 0.61111, 0, 0, 0.525],
4892 "34": [0, 0.61111, 0, 0, 0.525],
4893 "35": [0, 0.61111, 0, 0, 0.525],
4894 "36": [0.08333, 0.69444, 0, 0, 0.525],
4895 "37": [0.08333, 0.69444, 0, 0, 0.525],
4896 "38": [0, 0.61111, 0, 0, 0.525],
4897 "39": [0, 0.61111, 0, 0, 0.525],
4898 "40": [0.08333, 0.69444, 0, 0, 0.525],
4899 "41": [0.08333, 0.69444, 0, 0, 0.525],
4900 "42": [0, 0.52083, 0, 0, 0.525],
4901 "43": [-0.08056, 0.53055, 0, 0, 0.525],
4902 "44": [0.13889, 0.125, 0, 0, 0.525],
4903 "45": [-0.08056, 0.53055, 0, 0, 0.525],
4904 "46": [0, 0.125, 0, 0, 0.525],
4905 "47": [0.08333, 0.69444, 0, 0, 0.525],
4906 "48": [0, 0.61111, 0, 0, 0.525],
4907 "49": [0, 0.61111, 0, 0, 0.525],
4908 "50": [0, 0.61111, 0, 0, 0.525],
4909 "51": [0, 0.61111, 0, 0, 0.525],
4910 "52": [0, 0.61111, 0, 0, 0.525],
4911 "53": [0, 0.61111, 0, 0, 0.525],
4912 "54": [0, 0.61111, 0, 0, 0.525],
4913 "55": [0, 0.61111, 0, 0, 0.525],
4914 "56": [0, 0.61111, 0, 0, 0.525],
4915 "57": [0, 0.61111, 0, 0, 0.525],
4916 "58": [0, 0.43056, 0, 0, 0.525],
4917 "59": [0.13889, 0.43056, 0, 0, 0.525],
4918 "60": [-0.05556, 0.55556, 0, 0, 0.525],
4919 "61": [-0.19549, 0.41562, 0, 0, 0.525],
4920 "62": [-0.05556, 0.55556, 0, 0, 0.525],
4921 "63": [0, 0.61111, 0, 0, 0.525],
4922 "64": [0, 0.61111, 0, 0, 0.525],
4923 "65": [0, 0.61111, 0, 0, 0.525],
4924 "66": [0, 0.61111, 0, 0, 0.525],
4925 "67": [0, 0.61111, 0, 0, 0.525],
4926 "68": [0, 0.61111, 0, 0, 0.525],
4927 "69": [0, 0.61111, 0, 0, 0.525],
4928 "70": [0, 0.61111, 0, 0, 0.525],
4929 "71": [0, 0.61111, 0, 0, 0.525],
4930 "72": [0, 0.61111, 0, 0, 0.525],
4931 "73": [0, 0.61111, 0, 0, 0.525],
4932 "74": [0, 0.61111, 0, 0, 0.525],
4933 "75": [0, 0.61111, 0, 0, 0.525],
4934 "76": [0, 0.61111, 0, 0, 0.525],
4935 "77": [0, 0.61111, 0, 0, 0.525],
4936 "78": [0, 0.61111, 0, 0, 0.525],
4937 "79": [0, 0.61111, 0, 0, 0.525],
4938 "80": [0, 0.61111, 0, 0, 0.525],
4939 "81": [0.13889, 0.61111, 0, 0, 0.525],
4940 "82": [0, 0.61111, 0, 0, 0.525],
4941 "83": [0, 0.61111, 0, 0, 0.525],
4942 "84": [0, 0.61111, 0, 0, 0.525],
4943 "85": [0, 0.61111, 0, 0, 0.525],
4944 "86": [0, 0.61111, 0, 0, 0.525],
4945 "87": [0, 0.61111, 0, 0, 0.525],
4946 "88": [0, 0.61111, 0, 0, 0.525],
4947 "89": [0, 0.61111, 0, 0, 0.525],
4948 "90": [0, 0.61111, 0, 0, 0.525],
4949 "91": [0.08333, 0.69444, 0, 0, 0.525],
4950 "92": [0.08333, 0.69444, 0, 0, 0.525],
4951 "93": [0.08333, 0.69444, 0, 0, 0.525],
4952 "94": [0, 0.61111, 0, 0, 0.525],
4953 "95": [0.09514, 0, 0, 0, 0.525],
4954 "96": [0, 0.61111, 0, 0, 0.525],
4955 "97": [0, 0.43056, 0, 0, 0.525],
4956 "98": [0, 0.61111, 0, 0, 0.525],
4957 "99": [0, 0.43056, 0, 0, 0.525],
4958 "100": [0, 0.61111, 0, 0, 0.525],
4959 "101": [0, 0.43056, 0, 0, 0.525],
4960 "102": [0, 0.61111, 0, 0, 0.525],
4961 "103": [0.22222, 0.43056, 0, 0, 0.525],
4962 "104": [0, 0.61111, 0, 0, 0.525],
4963 "105": [0, 0.61111, 0, 0, 0.525],
4964 "106": [0.22222, 0.61111, 0, 0, 0.525],
4965 "107": [0, 0.61111, 0, 0, 0.525],
4966 "108": [0, 0.61111, 0, 0, 0.525],
4967 "109": [0, 0.43056, 0, 0, 0.525],
4968 "110": [0, 0.43056, 0, 0, 0.525],
4969 "111": [0, 0.43056, 0, 0, 0.525],
4970 "112": [0.22222, 0.43056, 0, 0, 0.525],
4971 "113": [0.22222, 0.43056, 0, 0, 0.525],
4972 "114": [0, 0.43056, 0, 0, 0.525],
4973 "115": [0, 0.43056, 0, 0, 0.525],
4974 "116": [0, 0.55358, 0, 0, 0.525],
4975 "117": [0, 0.43056, 0, 0, 0.525],
4976 "118": [0, 0.43056, 0, 0, 0.525],
4977 "119": [0, 0.43056, 0, 0, 0.525],
4978 "120": [0, 0.43056, 0, 0, 0.525],
4979 "121": [0.22222, 0.43056, 0, 0, 0.525],
4980 "122": [0, 0.43056, 0, 0, 0.525],
4981 "123": [0.08333, 0.69444, 0, 0, 0.525],
4982 "124": [0.08333, 0.69444, 0, 0, 0.525],
4983 "125": [0.08333, 0.69444, 0, 0, 0.525],
4984 "126": [0, 0.61111, 0, 0, 0.525],
4985 "127": [0, 0.61111, 0, 0, 0.525],
4986 "160": [0, 0, 0, 0, 0.525],
4987 "176": [0, 0.61111, 0, 0, 0.525],
4988 "184": [0.19445, 0, 0, 0, 0.525],
4989 "305": [0, 0.43056, 0, 0, 0.525],
4990 "567": [0.22222, 0.43056, 0, 0, 0.525],
4991 "711": [0, 0.56597, 0, 0, 0.525],
4992 "713": [0, 0.56555, 0, 0, 0.525],
4993 "714": [0, 0.61111, 0, 0, 0.525],
4994 "715": [0, 0.61111, 0, 0, 0.525],
4995 "728": [0, 0.61111, 0, 0, 0.525],
4996 "730": [0, 0.61111, 0, 0, 0.525],
4997 "770": [0, 0.61111, 0, 0, 0.525],
4998 "771": [0, 0.61111, 0, 0, 0.525],
4999 "776": [0, 0.61111, 0, 0, 0.525],
5000 "915": [0, 0.61111, 0, 0, 0.525],
5001 "916": [0, 0.61111, 0, 0, 0.525],
5002 "920": [0, 0.61111, 0, 0, 0.525],
5003 "923": [0, 0.61111, 0, 0, 0.525],
5004 "926": [0, 0.61111, 0, 0, 0.525],
5005 "928": [0, 0.61111, 0, 0, 0.525],
5006 "931": [0, 0.61111, 0, 0, 0.525],
5007 "933": [0, 0.61111, 0, 0, 0.525],
5008 "934": [0, 0.61111, 0, 0, 0.525],
5009 "936": [0, 0.61111, 0, 0, 0.525],
5010 "937": [0, 0.61111, 0, 0, 0.525],
5011 "8216": [0, 0.61111, 0, 0, 0.525],
5012 "8217": [0, 0.61111, 0, 0, 0.525],
5013 "8242": [0, 0.61111, 0, 0, 0.525],
5014 "9251": [0.11111, 0.21944, 0, 0, 0.525]
5015 }
5016});
5017// CONCATENATED MODULE: ./src/fontMetrics.js
5018
5019
5020/**
5021 * This file contains metrics regarding fonts and individual symbols. The sigma
5022 * and xi variables, as well as the metricMap map contain data extracted from
5023 * TeX, TeX font metrics, and the TTF files. These data are then exposed via the
5024 * `metrics` variable and the getCharacterMetrics function.
5025 */
5026
5027// In TeX, there are actually three sets of dimensions, one for each of
5028// textstyle (size index 5 and higher: >=9pt), scriptstyle (size index 3 and 4:
5029// 7-8pt), and scriptscriptstyle (size index 1 and 2: 5-6pt). These are
5030// provided in the the arrays below, in that order.
5031//
5032// The font metrics are stored in fonts cmsy10, cmsy7, and cmsy5 respsectively.
5033// This was determined by running the following script:
5034//
5035// latex -interaction=nonstopmode \
5036// '\documentclass{article}\usepackage{amsmath}\begin{document}' \
5037// '$a$ \expandafter\show\the\textfont2' \
5038// '\expandafter\show\the\scriptfont2' \
5039// '\expandafter\show\the\scriptscriptfont2' \
5040// '\stop'
5041//
5042// The metrics themselves were retreived using the following commands:
5043//
5044// tftopl cmsy10
5045// tftopl cmsy7
5046// tftopl cmsy5
5047//
5048// The output of each of these commands is quite lengthy. The only part we
5049// care about is the FONTDIMEN section. Each value is measured in EMs.
5050var sigmasAndXis = {
5051 slant: [0.250, 0.250, 0.250], // sigma1
5052 space: [0.000, 0.000, 0.000], // sigma2
5053 stretch: [0.000, 0.000, 0.000], // sigma3
5054 shrink: [0.000, 0.000, 0.000], // sigma4
5055 xHeight: [0.431, 0.431, 0.431], // sigma5
5056 quad: [1.000, 1.171, 1.472], // sigma6
5057 extraSpace: [0.000, 0.000, 0.000], // sigma7
5058 num1: [0.677, 0.732, 0.925], // sigma8
5059 num2: [0.394, 0.384, 0.387], // sigma9
5060 num3: [0.444, 0.471, 0.504], // sigma10
5061 denom1: [0.686, 0.752, 1.025], // sigma11
5062 denom2: [0.345, 0.344, 0.532], // sigma12
5063 sup1: [0.413, 0.503, 0.504], // sigma13
5064 sup2: [0.363, 0.431, 0.404], // sigma14
5065 sup3: [0.289, 0.286, 0.294], // sigma15
5066 sub1: [0.150, 0.143, 0.200], // sigma16
5067 sub2: [0.247, 0.286, 0.400], // sigma17
5068 supDrop: [0.386, 0.353, 0.494], // sigma18
5069 subDrop: [0.050, 0.071, 0.100], // sigma19
5070 delim1: [2.390, 1.700, 1.980], // sigma20
5071 delim2: [1.010, 1.157, 1.420], // sigma21
5072 axisHeight: [0.250, 0.250, 0.250], // sigma22
5073
5074 // These font metrics are extracted from TeX by using tftopl on cmex10.tfm;
5075 // they correspond to the font parameters of the extension fonts (family 3).
5076 // See the TeXbook, page 441. In AMSTeX, the extension fonts scale; to
5077 // match cmex7, we'd use cmex7.tfm values for script and scriptscript
5078 // values.
5079 defaultRuleThickness: [0.04, 0.049, 0.049], // xi8; cmex7: 0.049
5080 bigOpSpacing1: [0.111, 0.111, 0.111], // xi9
5081 bigOpSpacing2: [0.166, 0.166, 0.166], // xi10
5082 bigOpSpacing3: [0.2, 0.2, 0.2], // xi11
5083 bigOpSpacing4: [0.6, 0.611, 0.611], // xi12; cmex7: 0.611
5084 bigOpSpacing5: [0.1, 0.143, 0.143], // xi13; cmex7: 0.143
5085
5086 // The \sqrt rule width is taken from the height of the surd character.
5087 // Since we use the same font at all sizes, this thickness doesn't scale.
5088 sqrtRuleThickness: [0.04, 0.04, 0.04],
5089
5090 // This value determines how large a pt is, for metrics which are defined
5091 // in terms of pts.
5092 // This value is also used in katex.less; if you change it make sure the
5093 // values match.
5094 ptPerEm: [10.0, 10.0, 10.0],
5095
5096 // The space between adjacent `|` columns in an array definition. From
5097 // `\showthe\doublerulesep` in LaTeX. Equals 2.0 / ptPerEm.
5098 doubleRuleSep: [0.2, 0.2, 0.2]
5099};
5100
5101// This map contains a mapping from font name and character code to character
5102// metrics, including height, depth, italic correction, and skew (kern from the
5103// character to the corresponding \skewchar)
5104// This map is generated via `make metrics`. It should not be changed manually.
5105
5106
5107// These are very rough approximations. We default to Times New Roman which
5108// should have Latin-1 and Cyrillic characters, but may not depending on the
5109// operating system. The metrics do not account for extra height from the
5110// accents. In the case of Cyrillic characters which have both ascenders and
5111// descenders we prefer approximations with ascenders, primarily to prevent
5112// the fraction bar or root line from intersecting the glyph.
5113// TODO(kevinb) allow union of multiple glyph metrics for better accuracy.
5114var extraCharacterMap = {
5115 // Latin-1
5116 'Å': 'A',
5117 'Ç': 'C',
5118 'Ð': 'D',
5119 'Þ': 'o',
5120 'å': 'a',
5121 'ç': 'c',
5122 'ð': 'd',
5123 'þ': 'o',
5124
5125 // Cyrillic
5126 '?': 'A',
5127 '?': 'B',
5128 '?': 'B',
5129 '?': 'F',
5130 '?': 'A',
5131 '?': 'E',
5132 '?': 'K',
5133 '?': '3',
5134 '?': 'N',
5135 '?': 'N',
5136 '?': 'K',
5137 '?': 'N',
5138 '?': 'M',
5139 '?': 'H',
5140 '?': 'O',
5141 '?': 'N',
5142 '?': 'P',
5143 '?': 'C',
5144 '?': 'T',
5145 '?': 'y',
5146 '?': 'O',
5147 '?': 'X',
5148 '?': 'U',
5149 '?': 'h',
5150 '?': 'W',
5151 '?': 'W',
5152 '?': 'B',
5153 '?': 'X',
5154 '?': 'B',
5155 '?': '3',
5156 '?': 'X',
5157 '?': 'R',
5158 '?': 'a',
5159 '?': 'b',
5160 '?': 'a',
5161 '?': 'r',
5162 '?': 'y',
5163 '?': 'e',
5164 '?': 'm',
5165 '?': 'e',
5166 '?': 'n',
5167 '?': 'n',
5168 '?': 'n',
5169 '?': 'n',
5170 '?': 'm',
5171 '?': 'n',
5172 '?': 'o',
5173 '?': 'n',
5174 '?': 'p',
5175 '?': 'c',
5176 '?': 'o',
5177 '?': 'y',
5178 '?': 'b',
5179 '?': 'x',
5180 '?': 'n',
5181 '?': 'n',
5182 '?': 'w',
5183 '?': 'w',
5184 '?': 'a',
5185 '?': 'm',
5186 '?': 'a',
5187 '?': 'e',
5188 '?': 'm',
5189 '?': 'r'
5190};
5191
5192/**
5193 * This function adds new font metrics to default metricMap
5194 * It can also override existing metrics
5195 */
5196function setFontMetrics(fontName, metrics) {
5197 fontMetricsData[fontName] = metrics;
5198}
5199
5200/**
5201 * This function is a convenience function for looking up information in the
5202 * metricMap table. It takes a character as a string, and a font.
5203 *
5204 * Note: the `width` property may be undefined if fontMetricsData.js wasn't
5205 * built using `Make extended_metrics`.
5206 */
5207function getCharacterMetrics(character, font, mode) {
5208 if (!fontMetricsData[font]) {
5209 throw new Error("Font metrics not found for font: " + font + ".");
5210 }
5211 var ch = character.charCodeAt(0);
5212 if (character[0] in extraCharacterMap) {
5213 ch = extraCharacterMap[character[0]].charCodeAt(0);
5214 }
5215 var metrics = fontMetricsData[font][ch];
5216
5217 if (!metrics && mode === 'text') {
5218 // We don't typically have font metrics for Asian scripts.
5219 // But since we support them in text mode, we need to return
5220 // some sort of metrics.
5221 // So if the character is in a script we support but we
5222 // don't have metrics for it, just use the metrics for
5223 // the Latin capital letter M. This is close enough because
5224 // we (currently) only care about the height of the glpyh
5225 // not its width.
5226 if (supportedCodepoint(ch)) {
5227 metrics = fontMetricsData[font][77]; // 77 is the charcode for 'M'
5228 }
5229 }
5230
5231 if (metrics) {
5232 return {
5233 depth: metrics[0],
5234 height: metrics[1],
5235 italic: metrics[2],
5236 skew: metrics[3],
5237 width: metrics[4]
5238 };
5239 }
5240}
5241
5242var fontMetricsBySizeIndex = {};
5243
5244/**
5245 * Get the font metrics for a given size.
5246 */
5247function getGlobalMetrics(size) {
5248 var sizeIndex = void 0;
5249 if (size >= 5) {
5250 sizeIndex = 0;
5251 } else if (size >= 3) {
5252 sizeIndex = 1;
5253 } else {
5254 sizeIndex = 2;
5255 }
5256 if (!fontMetricsBySizeIndex[sizeIndex]) {
5257 var metrics = fontMetricsBySizeIndex[sizeIndex] = {
5258 cssEmPerMu: sigmasAndXis.quad[sizeIndex] / 18
5259 };
5260 for (var key in sigmasAndXis) {
5261 if (sigmasAndXis.hasOwnProperty(key)) {
5262 metrics[key] = sigmasAndXis[key][sizeIndex];
5263 }
5264 }
5265 }
5266 return fontMetricsBySizeIndex[sizeIndex];
5267}
5268// CONCATENATED MODULE: ./src/symbols.js
5269
5270// Some of these have a "-token" suffix since these are also used as `ParseNode`
5271// types for raw text tokens, and we want to avoid conflicts with higher-level
5272// `ParseNode` types. These `ParseNode`s are constructed within `Parser` by
5273// looking up the `symbols` map.
5274
5275/**
5276 * This file holds a list of all no-argument functions and single-character
5277 * symbols (like 'a' or ';').
5278 *
5279 * For each of the symbols, there are three properties they can have:
5280 * - font (required): the font to be used for this symbol. Either "main" (the
5281 normal font), or "ams" (the ams fonts).
5282 * - group (required): the ParseNode group type the symbol should have (i.e.
5283 "textord", "mathord", etc).
5284 See https://github.com/Khan/KaTeX/wiki/Examining-TeX#group-types
5285 * - replace: the character that this symbol or function should be
5286 * replaced with (i.e. "\phi" has a replace value of "\u03d5", the phi
5287 * character in the main font).
5288 *
5289 * The outermost map in the table indicates what mode the symbols should be
5290 * accepted in (e.g. "math" or "text").
5291 */
5292
5293var GROUPS = { // Set of all the groups.
5294 "accent-token": 1,
5295 "bin": 1,
5296 "close": 1,
5297 "inner": 1,
5298 "mathord": 1,
5299 "op-token": 1,
5300 "open": 1,
5301 "punct": 1,
5302 "rel": 1,
5303 "spacing": 1,
5304 "textord": 1
5305};
5306
5307
5308var symbols = {
5309 "math": {},
5310 "text": {}
5311};
5312/* harmony default export */ var src_symbols = (symbols);
5313
5314/** `acceptUnicodeChar = true` is only applicable if `replace` is set. */
5315function defineSymbol(mode, font, group, replace, name, acceptUnicodeChar) {
5316 symbols[mode][name] = { font: font, group: group, replace: replace };
5317
5318 if (acceptUnicodeChar && replace) {
5319 symbols[mode][replace] = symbols[mode][name];
5320 }
5321}
5322
5323// Some abbreviations for commonly used strings.
5324// This helps minify the code, and also spotting typos using jshint.
5325
5326// modes:
5327var symbols_math = "math";
5328var symbols_text = "text";
5329
5330// fonts:
5331var main = "main";
5332var ams = "ams";
5333
5334// groups:
5335var symbols_accent = "accent-token";
5336var bin = "bin";
5337var symbols_close = "close";
5338var symbols_inner = "inner";
5339var mathord = "mathord";
5340var op = "op-token";
5341var symbols_open = "open";
5342var punct = "punct";
5343var rel = "rel";
5344var spacing = "spacing";
5345var symbols_textord = "textord";
5346
5347// Now comes the symbol table
5348
5349// Relation Symbols
5350defineSymbol(symbols_math, main, rel, "\u2261", "\\equiv", true);
5351defineSymbol(symbols_math, main, rel, "\u227A", "\\prec", true);
5352defineSymbol(symbols_math, main, rel, "\u227B", "\\succ", true);
5353defineSymbol(symbols_math, main, rel, "\u223C", "\\sim", true);
5354defineSymbol(symbols_math, main, rel, "\u22A5", "\\perp");
5355defineSymbol(symbols_math, main, rel, "\u2AAF", "\\preceq", true);
5356defineSymbol(symbols_math, main, rel, "\u2AB0", "\\succeq", true);
5357defineSymbol(symbols_math, main, rel, "\u2243", "\\simeq", true);
5358defineSymbol(symbols_math, main, rel, "\u2223", "\\mid", true);
5359defineSymbol(symbols_math, main, rel, "\u226A", "\\ll", true);
5360defineSymbol(symbols_math, main, rel, "\u226B", "\\gg", true);
5361defineSymbol(symbols_math, main, rel, "\u224D", "\\asymp", true);
5362defineSymbol(symbols_math, main, rel, "\u2225", "\\parallel");
5363defineSymbol(symbols_math, main, rel, "\u22C8", "\\bowtie", true);
5364defineSymbol(symbols_math, main, rel, "\u2323", "\\smile", true);
5365defineSymbol(symbols_math, main, rel, "\u2291", "\\sqsubseteq", true);
5366defineSymbol(symbols_math, main, rel, "\u2292", "\\sqsupseteq", true);
5367defineSymbol(symbols_math, main, rel, "\u2250", "\\doteq", true);
5368defineSymbol(symbols_math, main, rel, "\u2322", "\\frown", true);
5369defineSymbol(symbols_math, main, rel, "\u220B", "\\ni", true);
5370defineSymbol(symbols_math, main, rel, "\u221D", "\\propto", true);
5371defineSymbol(symbols_math, main, rel, "\u22A2", "\\vdash", true);
5372defineSymbol(symbols_math, main, rel, "\u22A3", "\\dashv", true);
5373defineSymbol(symbols_math, main, rel, "\u220B", "\\owns");
5374
5375// Punctuation
5376defineSymbol(symbols_math, main, punct, ".", "\\ldotp");
5377defineSymbol(symbols_math, main, punct, "\u22C5", "\\cdotp");
5378
5379// Misc Symbols
5380defineSymbol(symbols_math, main, symbols_textord, "#", "\\#");
5381defineSymbol(symbols_text, main, symbols_textord, "#", "\\#");
5382defineSymbol(symbols_math, main, symbols_textord, "&", "\\&");
5383defineSymbol(symbols_text, main, symbols_textord, "&", "\\&");
5384defineSymbol(symbols_math, main, symbols_textord, "\u2135", "\\aleph", true);
5385defineSymbol(symbols_math, main, symbols_textord, "\u2200", "\\forall", true);
5386defineSymbol(symbols_math, main, symbols_textord, "\u210F", "\\hbar", true);
5387defineSymbol(symbols_math, main, symbols_textord, "\u2203", "\\exists", true);
5388defineSymbol(symbols_math, main, symbols_textord, "\u2207", "\\nabla", true);
5389defineSymbol(symbols_math, main, symbols_textord, "\u266D", "\\flat", true);
5390defineSymbol(symbols_math, main, symbols_textord, "\u2113", "\\ell", true);
5391defineSymbol(symbols_math, main, symbols_textord, "\u266E", "\\natural", true);
5392defineSymbol(symbols_math, main, symbols_textord, "\u2663", "\\clubsuit", true);
5393defineSymbol(symbols_math, main, symbols_textord, "\u2118", "\\wp", true);
5394defineSymbol(symbols_math, main, symbols_textord, "\u266F", "\\sharp", true);
5395defineSymbol(symbols_math, main, symbols_textord, "\u2662", "\\diamondsuit", true);
5396defineSymbol(symbols_math, main, symbols_textord, "\u211C", "\\Re", true);
5397defineSymbol(symbols_math, main, symbols_textord, "\u2661", "\\heartsuit", true);
5398defineSymbol(symbols_math, main, symbols_textord, "\u2111", "\\Im", true);
5399defineSymbol(symbols_math, main, symbols_textord, "\u2660", "\\spadesuit", true);
5400defineSymbol(symbols_text, main, symbols_textord, "\xA7", "\\S", true);
5401defineSymbol(symbols_text, main, symbols_textord, "\xB6", "\\P", true);
5402
5403// Math and Text
5404defineSymbol(symbols_math, main, symbols_textord, "\u2020", "\\dag");
5405defineSymbol(symbols_text, main, symbols_textord, "\u2020", "\\dag");
5406defineSymbol(symbols_text, main, symbols_textord, "\u2020", "\\textdagger");
5407defineSymbol(symbols_math, main, symbols_textord, "\u2021", "\\ddag");
5408defineSymbol(symbols_text, main, symbols_textord, "\u2021", "\\ddag");
5409defineSymbol(symbols_text, main, symbols_textord, "\u2020", "\\textdaggerdbl");
5410
5411// Large Delimiters
5412defineSymbol(symbols_math, main, symbols_close, "\u23B1", "\\rmoustache", true);
5413defineSymbol(symbols_math, main, symbols_open, "\u23B0", "\\lmoustache", true);
5414defineSymbol(symbols_math, main, symbols_close, "\u27EF", "\\rgroup", true);
5415defineSymbol(symbols_math, main, symbols_open, "\u27EE", "\\lgroup", true);
5416
5417// Binary Operators
5418defineSymbol(symbols_math, main, bin, "\u2213", "\\mp", true);
5419defineSymbol(symbols_math, main, bin, "\u2296", "\\ominus", true);
5420defineSymbol(symbols_math, main, bin, "\u228E", "\\uplus", true);
5421defineSymbol(symbols_math, main, bin, "\u2293", "\\sqcap", true);
5422defineSymbol(symbols_math, main, bin, "\u2217", "\\ast");
5423defineSymbol(symbols_math, main, bin, "\u2294", "\\sqcup", true);
5424defineSymbol(symbols_math, main, bin, "\u25EF", "\\bigcirc");
5425defineSymbol(symbols_math, main, bin, "\u2219", "\\bullet");
5426defineSymbol(symbols_math, main, bin, "\u2021", "\\ddagger");
5427defineSymbol(symbols_math, main, bin, "\u2240", "\\wr", true);
5428defineSymbol(symbols_math, main, bin, "\u2A3F", "\\amalg");
5429defineSymbol(symbols_math, main, bin, "&", "\\And"); // from amsmath
5430
5431// Arrow Symbols
5432defineSymbol(symbols_math, main, rel, "\u27F5", "\\longleftarrow", true);
5433defineSymbol(symbols_math, main, rel, "\u21D0", "\\Leftarrow", true);
5434defineSymbol(symbols_math, main, rel, "\u27F8", "\\Longleftarrow", true);
5435defineSymbol(symbols_math, main, rel, "\u27F6", "\\longrightarrow", true);
5436defineSymbol(symbols_math, main, rel, "\u21D2", "\\Rightarrow", true);
5437defineSymbol(symbols_math, main, rel, "\u27F9", "\\Longrightarrow", true);
5438defineSymbol(symbols_math, main, rel, "\u2194", "\\leftrightarrow", true);
5439defineSymbol(symbols_math, main, rel, "\u27F7", "\\longleftrightarrow", true);
5440defineSymbol(symbols_math, main, rel, "\u21D4", "\\Leftrightarrow", true);
5441defineSymbol(symbols_math, main, rel, "\u27FA", "\\Longleftrightarrow", true);
5442defineSymbol(symbols_math, main, rel, "\u21A6", "\\mapsto", true);
5443defineSymbol(symbols_math, main, rel, "\u27FC", "\\longmapsto", true);
5444defineSymbol(symbols_math, main, rel, "\u2197", "\\nearrow", true);
5445defineSymbol(symbols_math, main, rel, "\u21A9", "\\hookleftarrow", true);
5446defineSymbol(symbols_math, main, rel, "\u21AA", "\\hookrightarrow", true);
5447defineSymbol(symbols_math, main, rel, "\u2198", "\\searrow", true);
5448defineSymbol(symbols_math, main, rel, "\u21BC", "\\leftharpoonup", true);
5449defineSymbol(symbols_math, main, rel, "\u21C0", "\\rightharpoonup", true);
5450defineSymbol(symbols_math, main, rel, "\u2199", "\\swarrow", true);
5451defineSymbol(symbols_math, main, rel, "\u21BD", "\\leftharpoondown", true);
5452defineSymbol(symbols_math, main, rel, "\u21C1", "\\rightharpoondown", true);
5453defineSymbol(symbols_math, main, rel, "\u2196", "\\nwarrow", true);
5454defineSymbol(symbols_math, main, rel, "\u21CC", "\\rightleftharpoons", true);
5455
5456// AMS Negated Binary Relations
5457defineSymbol(symbols_math, ams, rel, "\u226E", "\\nless", true);
5458defineSymbol(symbols_math, ams, rel, "\uE010", "\\nleqslant");
5459defineSymbol(symbols_math, ams, rel, "\uE011", "\\nleqq");
5460defineSymbol(symbols_math, ams, rel, "\u2A87", "\\lneq", true);
5461defineSymbol(symbols_math, ams, rel, "\u2268", "\\lneqq", true);
5462defineSymbol(symbols_math, ams, rel, "\uE00C", "\\lvertneqq");
5463defineSymbol(symbols_math, ams, rel, "\u22E6", "\\lnsim", true);
5464defineSymbol(symbols_math, ams, rel, "\u2A89", "\\lnapprox", true);
5465defineSymbol(symbols_math, ams, rel, "\u2280", "\\nprec", true);
5466// unicode-math maps \u22e0 to \npreccurlyeq. We'll use the AMS synonym.
5467defineSymbol(symbols_math, ams, rel, "\u22E0", "\\npreceq", true);
5468defineSymbol(symbols_math, ams, rel, "\u22E8", "\\precnsim", true);
5469defineSymbol(symbols_math, ams, rel, "\u2AB9", "\\precnapprox", true);
5470defineSymbol(symbols_math, ams, rel, "\u2241", "\\nsim", true);
5471defineSymbol(symbols_math, ams, rel, "\uE006", "\\nshortmid");
5472defineSymbol(symbols_math, ams, rel, "\u2224", "\\nmid", true);
5473defineSymbol(symbols_math, ams, rel, "\u22AC", "\\nvdash", true);
5474defineSymbol(symbols_math, ams, rel, "\u22AD", "\\nvDash", true);
5475defineSymbol(symbols_math, ams, rel, "\u22EA", "\\ntriangleleft");
5476defineSymbol(symbols_math, ams, rel, "\u22EC", "\\ntrianglelefteq", true);
5477defineSymbol(symbols_math, ams, rel, "\u228A", "\\subsetneq", true);
5478defineSymbol(symbols_math, ams, rel, "\uE01A", "\\varsubsetneq");
5479defineSymbol(symbols_math, ams, rel, "\u2ACB", "\\subsetneqq", true);
5480defineSymbol(symbols_math, ams, rel, "\uE017", "\\varsubsetneqq");
5481defineSymbol(symbols_math, ams, rel, "\u226F", "\\ngtr", true);
5482defineSymbol(symbols_math, ams, rel, "\uE00F", "\\ngeqslant");
5483defineSymbol(symbols_math, ams, rel, "\uE00E", "\\ngeqq");
5484defineSymbol(symbols_math, ams, rel, "\u2A88", "\\gneq", true);
5485defineSymbol(symbols_math, ams, rel, "\u2269", "\\gneqq", true);
5486defineSymbol(symbols_math, ams, rel, "\uE00D", "\\gvertneqq");
5487defineSymbol(symbols_math, ams, rel, "\u22E7", "\\gnsim", true);
5488defineSymbol(symbols_math, ams, rel, "\u2A8A", "\\gnapprox", true);
5489defineSymbol(symbols_math, ams, rel, "\u2281", "\\nsucc", true);
5490// unicode-math maps \u22e1 to \nsucccurlyeq. We'll use the AMS synonym.
5491defineSymbol(symbols_math, ams, rel, "\u22E1", "\\nsucceq", true);
5492defineSymbol(symbols_math, ams, rel, "\u22E9", "\\succnsim", true);
5493defineSymbol(symbols_math, ams, rel, "\u2ABA", "\\succnapprox", true);
5494// unicode-math maps \u2246 to \simneqq. We'll use the AMS synonym.
5495defineSymbol(symbols_math, ams, rel, "\u2246", "\\ncong", true);
5496defineSymbol(symbols_math, ams, rel, "\uE007", "\\nshortparallel");
5497defineSymbol(symbols_math, ams, rel, "\u2226", "\\nparallel", true);
5498defineSymbol(symbols_math, ams, rel, "\u22AF", "\\nVDash", true);
5499defineSymbol(symbols_math, ams, rel, "\u22EB", "\\ntriangleright");
5500defineSymbol(symbols_math, ams, rel, "\u22ED", "\\ntrianglerighteq", true);
5501defineSymbol(symbols_math, ams, rel, "\uE018", "\\nsupseteqq");
5502defineSymbol(symbols_math, ams, rel, "\u228B", "\\supsetneq", true);
5503defineSymbol(symbols_math, ams, rel, "\uE01B", "\\varsupsetneq");
5504defineSymbol(symbols_math, ams, rel, "\u2ACC", "\\supsetneqq", true);
5505defineSymbol(symbols_math, ams, rel, "\uE019", "\\varsupsetneqq");
5506defineSymbol(symbols_math, ams, rel, "\u22AE", "\\nVdash", true);
5507defineSymbol(symbols_math, ams, rel, "\u2AB5", "\\precneqq", true);
5508defineSymbol(symbols_math, ams, rel, "\u2AB6", "\\succneqq", true);
5509defineSymbol(symbols_math, ams, rel, "\uE016", "\\nsubseteqq");
5510defineSymbol(symbols_math, ams, bin, "\u22B4", "\\unlhd");
5511defineSymbol(symbols_math, ams, bin, "\u22B5", "\\unrhd");
5512
5513// AMS Negated Arrows
5514defineSymbol(symbols_math, ams, rel, "\u219A", "\\nleftarrow", true);
5515defineSymbol(symbols_math, ams, rel, "\u219B", "\\nrightarrow", true);
5516defineSymbol(symbols_math, ams, rel, "\u21CD", "\\nLeftarrow", true);
5517defineSymbol(symbols_math, ams, rel, "\u21CF", "\\nRightarrow", true);
5518defineSymbol(symbols_math, ams, rel, "\u21AE", "\\nleftrightarrow", true);
5519defineSymbol(symbols_math, ams, rel, "\u21CE", "\\nLeftrightarrow", true);
5520
5521// AMS Misc
5522defineSymbol(symbols_math, ams, rel, "\u25B3", "\\vartriangle");
5523defineSymbol(symbols_math, ams, symbols_textord, "\u210F", "\\hslash");
5524defineSymbol(symbols_math, ams, symbols_textord, "\u25BD", "\\triangledown");
5525defineSymbol(symbols_math, ams, symbols_textord, "\u25CA", "\\lozenge");
5526defineSymbol(symbols_math, ams, symbols_textord, "\u24C8", "\\circledS");
5527defineSymbol(symbols_math, ams, symbols_textord, "\xAE", "\\circledR");
5528defineSymbol(symbols_text, ams, symbols_textord, "\xAE", "\\circledR");
5529defineSymbol(symbols_math, ams, symbols_textord, "\u2221", "\\measuredangle", true);
5530defineSymbol(symbols_math, ams, symbols_textord, "\u2204", "\\nexists");
5531defineSymbol(symbols_math, ams, symbols_textord, "\u2127", "\\mho");
5532defineSymbol(symbols_math, ams, symbols_textord, "\u2132", "\\Finv", true);
5533defineSymbol(symbols_math, ams, symbols_textord, "\u2141", "\\Game", true);
5534defineSymbol(symbols_math, ams, symbols_textord, "k", "\\Bbbk");
5535defineSymbol(symbols_math, ams, symbols_textord, "\u2035", "\\backprime");
5536defineSymbol(symbols_math, ams, symbols_textord, "\u25B2", "\\blacktriangle");
5537defineSymbol(symbols_math, ams, symbols_textord, "\u25BC", "\\blacktriangledown");
5538defineSymbol(symbols_math, ams, symbols_textord, "\u25A0", "\\blacksquare");
5539defineSymbol(symbols_math, ams, symbols_textord, "\u29EB", "\\blacklozenge");
5540defineSymbol(symbols_math, ams, symbols_textord, "\u2605", "\\bigstar");
5541defineSymbol(symbols_math, ams, symbols_textord, "\u2222", "\\sphericalangle", true);
5542defineSymbol(symbols_math, ams, symbols_textord, "\u2201", "\\complement", true);
5543// unicode-math maps U+F0 (ð) to \matheth. We map to AMS function \eth
5544defineSymbol(symbols_math, ams, symbols_textord, "\xF0", "\\eth", true);
5545defineSymbol(symbols_math, ams, symbols_textord, "\u2571", "\\diagup");
5546defineSymbol(symbols_math, ams, symbols_textord, "\u2572", "\\diagdown");
5547defineSymbol(symbols_math, ams, symbols_textord, "\u25A1", "\\square");
5548defineSymbol(symbols_math, ams, symbols_textord, "\u25A1", "\\Box");
5549defineSymbol(symbols_math, ams, symbols_textord, "\u25CA", "\\Diamond");
5550// unicode-math maps U+A5 to \mathyen. We map to AMS function \yen
5551defineSymbol(symbols_math, ams, symbols_textord, "\xA5", "\\yen", true);
5552defineSymbol(symbols_text, ams, symbols_textord, "\xA5", "\\yen", true);
5553defineSymbol(symbols_math, ams, symbols_textord, "\u2713", "\\checkmark", true);
5554defineSymbol(symbols_text, ams, symbols_textord, "\u2713", "\\checkmark");
5555
5556// AMS Hebrew
5557defineSymbol(symbols_math, ams, symbols_textord, "\u2136", "\\beth", true);
5558defineSymbol(symbols_math, ams, symbols_textord, "\u2138", "\\daleth", true);
5559defineSymbol(symbols_math, ams, symbols_textord, "\u2137", "\\gimel", true);
5560
5561// AMS Greek
5562defineSymbol(symbols_math, ams, symbols_textord, "\u03DD", "\\digamma");
5563defineSymbol(symbols_math, ams, symbols_textord, "\u03F0", "\\varkappa");
5564
5565// AMS Delimiters
5566defineSymbol(symbols_math, ams, symbols_open, "\u250C", "\\ulcorner", true);
5567defineSymbol(symbols_math, ams, symbols_close, "\u2510", "\\urcorner", true);
5568defineSymbol(symbols_math, ams, symbols_open, "\u2514", "\\llcorner", true);
5569defineSymbol(symbols_math, ams, symbols_close, "\u2518", "\\lrcorner", true);
5570
5571// AMS Binary Relations
5572defineSymbol(symbols_math, ams, rel, "\u2266", "\\leqq", true);
5573defineSymbol(symbols_math, ams, rel, "\u2A7D", "\\leqslant", true);
5574defineSymbol(symbols_math, ams, rel, "\u2A95", "\\eqslantless", true);
5575defineSymbol(symbols_math, ams, rel, "\u2272", "\\lesssim", true);
5576defineSymbol(symbols_math, ams, rel, "\u2A85", "\\lessapprox", true);
5577defineSymbol(symbols_math, ams, rel, "\u224A", "\\approxeq", true);
5578defineSymbol(symbols_math, ams, bin, "\u22D6", "\\lessdot");
5579defineSymbol(symbols_math, ams, rel, "\u22D8", "\\lll", true);
5580defineSymbol(symbols_math, ams, rel, "\u2276", "\\lessgtr", true);
5581defineSymbol(symbols_math, ams, rel, "\u22DA", "\\lesseqgtr", true);
5582defineSymbol(symbols_math, ams, rel, "\u2A8B", "\\lesseqqgtr", true);
5583defineSymbol(symbols_math, ams, rel, "\u2251", "\\doteqdot");
5584defineSymbol(symbols_math, ams, rel, "\u2253", "\\risingdotseq", true);
5585defineSymbol(symbols_math, ams, rel, "\u2252", "\\fallingdotseq", true);
5586defineSymbol(symbols_math, ams, rel, "\u223D", "\\backsim", true);
5587defineSymbol(symbols_math, ams, rel, "\u22CD", "\\backsimeq", true);
5588defineSymbol(symbols_math, ams, rel, "\u2AC5", "\\subseteqq", true);
5589defineSymbol(symbols_math, ams, rel, "\u22D0", "\\Subset", true);
5590defineSymbol(symbols_math, ams, rel, "\u228F", "\\sqsubset", true);
5591defineSymbol(symbols_math, ams, rel, "\u227C", "\\preccurlyeq", true);
5592defineSymbol(symbols_math, ams, rel, "\u22DE", "\\curlyeqprec", true);
5593defineSymbol(symbols_math, ams, rel, "\u227E", "\\precsim", true);
5594defineSymbol(symbols_math, ams, rel, "\u2AB7", "\\precapprox", true);
5595defineSymbol(symbols_math, ams, rel, "\u22B2", "\\vartriangleleft");
5596defineSymbol(symbols_math, ams, rel, "\u22B4", "\\trianglelefteq");
5597defineSymbol(symbols_math, ams, rel, "\u22A8", "\\vDash", true);
5598defineSymbol(symbols_math, ams, rel, "\u22AA", "\\Vvdash", true);
5599defineSymbol(symbols_math, ams, rel, "\u2323", "\\smallsmile");
5600defineSymbol(symbols_math, ams, rel, "\u2322", "\\smallfrown");
5601defineSymbol(symbols_math, ams, rel, "\u224F", "\\bumpeq", true);
5602defineSymbol(symbols_math, ams, rel, "\u224E", "\\Bumpeq", true);
5603defineSymbol(symbols_math, ams, rel, "\u2267", "\\geqq", true);
5604defineSymbol(symbols_math, ams, rel, "\u2A7E", "\\geqslant", true);
5605defineSymbol(symbols_math, ams, rel, "\u2A96", "\\eqslantgtr", true);
5606defineSymbol(symbols_math, ams, rel, "\u2273", "\\gtrsim", true);
5607defineSymbol(symbols_math, ams, rel, "\u2A86", "\\gtrapprox", true);
5608defineSymbol(symbols_math, ams, bin, "\u22D7", "\\gtrdot");
5609defineSymbol(symbols_math, ams, rel, "\u22D9", "\\ggg", true);
5610defineSymbol(symbols_math, ams, rel, "\u2277", "\\gtrless", true);
5611defineSymbol(symbols_math, ams, rel, "\u22DB", "\\gtreqless", true);
5612defineSymbol(symbols_math, ams, rel, "\u2A8C", "\\gtreqqless", true);
5613defineSymbol(symbols_math, ams, rel, "\u2256", "\\eqcirc", true);
5614defineSymbol(symbols_math, ams, rel, "\u2257", "\\circeq", true);
5615defineSymbol(symbols_math, ams, rel, "\u225C", "\\triangleq", true);
5616defineSymbol(symbols_math, ams, rel, "\u223C", "\\thicksim");
5617defineSymbol(symbols_math, ams, rel, "\u2248", "\\thickapprox");
5618defineSymbol(symbols_math, ams, rel, "\u2AC6", "\\supseteqq", true);
5619defineSymbol(symbols_math, ams, rel, "\u22D1", "\\Supset", true);
5620defineSymbol(symbols_math, ams, rel, "\u2290", "\\sqsupset", true);
5621defineSymbol(symbols_math, ams, rel, "\u227D", "\\succcurlyeq", true);
5622defineSymbol(symbols_math, ams, rel, "\u22DF", "\\curlyeqsucc", true);
5623defineSymbol(symbols_math, ams, rel, "\u227F", "\\succsim", true);
5624defineSymbol(symbols_math, ams, rel, "\u2AB8", "\\succapprox", true);
5625defineSymbol(symbols_math, ams, rel, "\u22B3", "\\vartriangleright");
5626defineSymbol(symbols_math, ams, rel, "\u22B5", "\\trianglerighteq");
5627defineSymbol(symbols_math, ams, rel, "\u22A9", "\\Vdash", true);
5628defineSymbol(symbols_math, ams, rel, "\u2223", "\\shortmid");
5629defineSymbol(symbols_math, ams, rel, "\u2225", "\\shortparallel");
5630defineSymbol(symbols_math, ams, rel, "\u226C", "\\between", true);
5631defineSymbol(symbols_math, ams, rel, "\u22D4", "\\pitchfork", true);
5632defineSymbol(symbols_math, ams, rel, "\u221D", "\\varpropto");
5633defineSymbol(symbols_math, ams, rel, "\u25C0", "\\blacktriangleleft");
5634// unicode-math says that \therefore is a mathord atom.
5635// We kept the amssymb atom type, which is rel.
5636defineSymbol(symbols_math, ams, rel, "\u2234", "\\therefore", true);
5637defineSymbol(symbols_math, ams, rel, "\u220D", "\\backepsilon");
5638defineSymbol(symbols_math, ams, rel, "\u25B6", "\\blacktriangleright");
5639// unicode-math says that \because is a mathord atom.
5640// We kept the amssymb atom type, which is rel.
5641defineSymbol(symbols_math, ams, rel, "\u2235", "\\because", true);
5642defineSymbol(symbols_math, ams, rel, "\u22D8", "\\llless");
5643defineSymbol(symbols_math, ams, rel, "\u22D9", "\\gggtr");
5644defineSymbol(symbols_math, ams, bin, "\u22B2", "\\lhd");
5645defineSymbol(symbols_math, ams, bin, "\u22B3", "\\rhd");
5646defineSymbol(symbols_math, ams, rel, "\u2242", "\\eqsim", true);
5647defineSymbol(symbols_math, main, rel, "\u22C8", "\\Join");
5648defineSymbol(symbols_math, ams, rel, "\u2251", "\\Doteq", true);
5649
5650// AMS Binary Operators
5651defineSymbol(symbols_math, ams, bin, "\u2214", "\\dotplus", true);
5652defineSymbol(symbols_math, ams, bin, "\u2216", "\\smallsetminus");
5653defineSymbol(symbols_math, ams, bin, "\u22D2", "\\Cap", true);
5654defineSymbol(symbols_math, ams, bin, "\u22D3", "\\Cup", true);
5655defineSymbol(symbols_math, ams, bin, "\u2A5E", "\\doublebarwedge", true);
5656defineSymbol(symbols_math, ams, bin, "\u229F", "\\boxminus", true);
5657defineSymbol(symbols_math, ams, bin, "\u229E", "\\boxplus", true);
5658defineSymbol(symbols_math, ams, bin, "\u22C7", "\\divideontimes", true);
5659defineSymbol(symbols_math, ams, bin, "\u22C9", "\\ltimes", true);
5660defineSymbol(symbols_math, ams, bin, "\u22CA", "\\rtimes", true);
5661defineSymbol(symbols_math, ams, bin, "\u22CB", "\\leftthreetimes", true);
5662defineSymbol(symbols_math, ams, bin, "\u22CC", "\\rightthreetimes", true);
5663defineSymbol(symbols_math, ams, bin, "\u22CF", "\\curlywedge", true);
5664defineSymbol(symbols_math, ams, bin, "\u22CE", "\\curlyvee", true);
5665defineSymbol(symbols_math, ams, bin, "\u229D", "\\circleddash", true);
5666defineSymbol(symbols_math, ams, bin, "\u229B", "\\circledast", true);
5667defineSymbol(symbols_math, ams, bin, "\u22C5", "\\centerdot");
5668defineSymbol(symbols_math, ams, bin, "\u22BA", "\\intercal", true);
5669defineSymbol(symbols_math, ams, bin, "\u22D2", "\\doublecap");
5670defineSymbol(symbols_math, ams, bin, "\u22D3", "\\doublecup");
5671defineSymbol(symbols_math, ams, bin, "\u22A0", "\\boxtimes", true);
5672
5673// AMS Arrows
5674// Note: unicode-math maps \u21e2 to their own function \rightdasharrow.
5675// We'll map it to AMS function \dashrightarrow. It produces the same atom.
5676defineSymbol(symbols_math, ams, rel, "\u21E2", "\\dashrightarrow", true);
5677// unicode-math maps \u21e0 to \leftdasharrow. We'll use the AMS synonym.
5678defineSymbol(symbols_math, ams, rel, "\u21E0", "\\dashleftarrow", true);
5679defineSymbol(symbols_math, ams, rel, "\u21C7", "\\leftleftarrows", true);
5680defineSymbol(symbols_math, ams, rel, "\u21C6", "\\leftrightarrows", true);
5681defineSymbol(symbols_math, ams, rel, "\u21DA", "\\Lleftarrow", true);
5682defineSymbol(symbols_math, ams, rel, "\u219E", "\\twoheadleftarrow", true);
5683defineSymbol(symbols_math, ams, rel, "\u21A2", "\\leftarrowtail", true);
5684defineSymbol(symbols_math, ams, rel, "\u21AB", "\\looparrowleft", true);
5685defineSymbol(symbols_math, ams, rel, "\u21CB", "\\leftrightharpoons", true);
5686defineSymbol(symbols_math, ams, rel, "\u21B6", "\\curvearrowleft", true);
5687// unicode-math maps \u21ba to \acwopencirclearrow. We'll use the AMS synonym.
5688defineSymbol(symbols_math, ams, rel, "\u21BA", "\\circlearrowleft", true);
5689defineSymbol(symbols_math, ams, rel, "\u21B0", "\\Lsh", true);
5690defineSymbol(symbols_math, ams, rel, "\u21C8", "\\upuparrows", true);
5691defineSymbol(symbols_math, ams, rel, "\u21BF", "\\upharpoonleft", true);
5692defineSymbol(symbols_math, ams, rel, "\u21C3", "\\downharpoonleft", true);
5693defineSymbol(symbols_math, ams, rel, "\u22B8", "\\multimap", true);
5694defineSymbol(symbols_math, ams, rel, "\u21AD", "\\leftrightsquigarrow", true);
5695defineSymbol(symbols_math, ams, rel, "\u21C9", "\\rightrightarrows", true);
5696defineSymbol(symbols_math, ams, rel, "\u21C4", "\\rightleftarrows", true);
5697defineSymbol(symbols_math, ams, rel, "\u21A0", "\\twoheadrightarrow", true);
5698defineSymbol(symbols_math, ams, rel, "\u21A3", "\\rightarrowtail", true);
5699defineSymbol(symbols_math, ams, rel, "\u21AC", "\\looparrowright", true);
5700defineSymbol(symbols_math, ams, rel, "\u21B7", "\\curvearrowright", true);
5701// unicode-math maps \u21bb to \cwopencirclearrow. We'll use the AMS synonym.
5702defineSymbol(symbols_math, ams, rel, "\u21BB", "\\circlearrowright", true);
5703defineSymbol(symbols_math, ams, rel, "\u21B1", "\\Rsh", true);
5704defineSymbol(symbols_math, ams, rel, "\u21CA", "\\downdownarrows", true);
5705defineSymbol(symbols_math, ams, rel, "\u21BE", "\\upharpoonright", true);
5706defineSymbol(symbols_math, ams, rel, "\u21C2", "\\downharpoonright", true);
5707defineSymbol(symbols_math, ams, rel, "\u21DD", "\\rightsquigarrow", true);
5708defineSymbol(symbols_math, ams, rel, "\u21DD", "\\leadsto");
5709defineSymbol(symbols_math, ams, rel, "\u21DB", "\\Rrightarrow", true);
5710defineSymbol(symbols_math, ams, rel, "\u21BE", "\\restriction");
5711
5712defineSymbol(symbols_math, main, symbols_textord, "\u2018", "`");
5713defineSymbol(symbols_math, main, symbols_textord, "$", "\\$");
5714defineSymbol(symbols_text, main, symbols_textord, "$", "\\$");
5715defineSymbol(symbols_text, main, symbols_textord, "$", "\\textdollar");
5716defineSymbol(symbols_math, main, symbols_textord, "%", "\\%");
5717defineSymbol(symbols_text, main, symbols_textord, "%", "\\%");
5718defineSymbol(symbols_math, main, symbols_textord, "_", "\\_");
5719defineSymbol(symbols_text, main, symbols_textord, "_", "\\_");
5720defineSymbol(symbols_text, main, symbols_textord, "_", "\\textunderscore");
5721defineSymbol(symbols_math, main, symbols_textord, "\u2220", "\\angle", true);
5722defineSymbol(symbols_math, main, symbols_textord, "\u221E", "\\infty", true);
5723defineSymbol(symbols_math, main, symbols_textord, "\u2032", "\\prime");
5724defineSymbol(symbols_math, main, symbols_textord, "\u25B3", "\\triangle");
5725defineSymbol(symbols_math, main, symbols_textord, "\u0393", "\\Gamma", true);
5726defineSymbol(symbols_math, main, symbols_textord, "\u0394", "\\Delta", true);
5727defineSymbol(symbols_math, main, symbols_textord, "\u0398", "\\Theta", true);
5728defineSymbol(symbols_math, main, symbols_textord, "\u039B", "\\Lambda", true);
5729defineSymbol(symbols_math, main, symbols_textord, "\u039E", "\\Xi", true);
5730defineSymbol(symbols_math, main, symbols_textord, "\u03A0", "\\Pi", true);
5731defineSymbol(symbols_math, main, symbols_textord, "\u03A3", "\\Sigma", true);
5732defineSymbol(symbols_math, main, symbols_textord, "\u03A5", "\\Upsilon", true);
5733defineSymbol(symbols_math, main, symbols_textord, "\u03A6", "\\Phi", true);
5734defineSymbol(symbols_math, main, symbols_textord, "\u03A8", "\\Psi", true);
5735defineSymbol(symbols_math, main, symbols_textord, "\u03A9", "\\Omega", true);
5736defineSymbol(symbols_math, main, symbols_textord, "A", "\u0391");
5737defineSymbol(symbols_math, main, symbols_textord, "B", "\u0392");
5738defineSymbol(symbols_math, main, symbols_textord, "E", "\u0395");
5739defineSymbol(symbols_math, main, symbols_textord, "Z", "\u0396");
5740defineSymbol(symbols_math, main, symbols_textord, "H", "\u0397");
5741defineSymbol(symbols_math, main, symbols_textord, "I", "\u0399");
5742defineSymbol(symbols_math, main, symbols_textord, "K", "\u039A");
5743defineSymbol(symbols_math, main, symbols_textord, "M", "\u039C");
5744defineSymbol(symbols_math, main, symbols_textord, "N", "\u039D");
5745defineSymbol(symbols_math, main, symbols_textord, "O", "\u039F");
5746defineSymbol(symbols_math, main, symbols_textord, "P", "\u03A1");
5747defineSymbol(symbols_math, main, symbols_textord, "T", "\u03A4");
5748defineSymbol(symbols_math, main, symbols_textord, "X", "\u03A7");
5749defineSymbol(symbols_math, main, symbols_textord, "\xAC", "\\neg", true);
5750defineSymbol(symbols_math, main, symbols_textord, "\xAC", "\\lnot");
5751defineSymbol(symbols_math, main, symbols_textord, "\u22A4", "\\top");
5752defineSymbol(symbols_math, main, symbols_textord, "\u22A5", "\\bot");
5753defineSymbol(symbols_math, main, symbols_textord, "\u2205", "\\emptyset");
5754defineSymbol(symbols_math, ams, symbols_textord, "\u2205", "\\varnothing");
5755defineSymbol(symbols_math, main, mathord, "\u03B1", "\\alpha", true);
5756defineSymbol(symbols_math, main, mathord, "\u03B2", "\\beta", true);
5757defineSymbol(symbols_math, main, mathord, "\u03B3", "\\gamma", true);
5758defineSymbol(symbols_math, main, mathord, "\u03B4", "\\delta", true);
5759defineSymbol(symbols_math, main, mathord, "\u03F5", "\\epsilon", true);
5760defineSymbol(symbols_math, main, mathord, "\u03B6", "\\zeta", true);
5761defineSymbol(symbols_math, main, mathord, "\u03B7", "\\eta", true);
5762defineSymbol(symbols_math, main, mathord, "\u03B8", "\\theta", true);
5763defineSymbol(symbols_math, main, mathord, "\u03B9", "\\iota", true);
5764defineSymbol(symbols_math, main, mathord, "\u03BA", "\\kappa", true);
5765defineSymbol(symbols_math, main, mathord, "\u03BB", "\\lambda", true);
5766defineSymbol(symbols_math, main, mathord, "\u03BC", "\\mu", true);
5767defineSymbol(symbols_math, main, mathord, "\u03BD", "\\nu", true);
5768defineSymbol(symbols_math, main, mathord, "\u03BE", "\\xi", true);
5769defineSymbol(symbols_math, main, mathord, "\u03BF", "\\omicron", true);
5770defineSymbol(symbols_math, main, mathord, "\u03C0", "\\pi", true);
5771defineSymbol(symbols_math, main, mathord, "\u03C1", "\\rho", true);
5772defineSymbol(symbols_math, main, mathord, "\u03C3", "\\sigma", true);
5773defineSymbol(symbols_math, main, mathord, "\u03C4", "\\tau", true);
5774defineSymbol(symbols_math, main, mathord, "\u03C5", "\\upsilon", true);
5775defineSymbol(symbols_math, main, mathord, "\u03D5", "\\phi", true);
5776defineSymbol(symbols_math, main, mathord, "\u03C7", "\\chi", true);
5777defineSymbol(symbols_math, main, mathord, "\u03C8", "\\psi", true);
5778defineSymbol(symbols_math, main, mathord, "\u03C9", "\\omega", true);
5779defineSymbol(symbols_math, main, mathord, "\u03B5", "\\varepsilon", true);
5780defineSymbol(symbols_math, main, mathord, "\u03D1", "\\vartheta", true);
5781defineSymbol(symbols_math, main, mathord, "\u03D6", "\\varpi", true);
5782defineSymbol(symbols_math, main, mathord, "\u03F1", "\\varrho", true);
5783defineSymbol(symbols_math, main, mathord, "\u03C2", "\\varsigma", true);
5784defineSymbol(symbols_math, main, mathord, "\u03C6", "\\varphi", true);
5785defineSymbol(symbols_math, main, bin, "\u2217", "*");
5786defineSymbol(symbols_math, main, bin, "+", "+");
5787defineSymbol(symbols_math, main, bin, "\u2212", "-");
5788defineSymbol(symbols_math, main, bin, "\u22C5", "\\cdot", true);
5789defineSymbol(symbols_math, main, bin, "\u2218", "\\circ");
5790defineSymbol(symbols_math, main, bin, "\xF7", "\\div", true);
5791defineSymbol(symbols_math, main, bin, "\xB1", "\\pm", true);
5792defineSymbol(symbols_math, main, bin, "\xD7", "\\times", true);
5793defineSymbol(symbols_math, main, bin, "\u2229", "\\cap", true);
5794defineSymbol(symbols_math, main, bin, "\u222A", "\\cup", true);
5795defineSymbol(symbols_math, main, bin, "\u2216", "\\setminus");
5796defineSymbol(symbols_math, main, bin, "\u2227", "\\land");
5797defineSymbol(symbols_math, main, bin, "\u2228", "\\lor");
5798defineSymbol(symbols_math, main, bin, "\u2227", "\\wedge", true);
5799defineSymbol(symbols_math, main, bin, "\u2228", "\\vee", true);
5800defineSymbol(symbols_math, main, symbols_textord, "\u221A", "\\surd");
5801defineSymbol(symbols_math, main, symbols_open, "(", "(");
5802defineSymbol(symbols_math, main, symbols_open, "[", "[");
5803defineSymbol(symbols_math, main, symbols_open, "\u27E8", "\\langle", true);
5804defineSymbol(symbols_math, main, symbols_open, "\u2223", "\\lvert");
5805defineSymbol(symbols_math, main, symbols_open, "\u2225", "\\lVert");
5806defineSymbol(symbols_math, main, symbols_close, ")", ")");
5807defineSymbol(symbols_math, main, symbols_close, "]", "]");
5808defineSymbol(symbols_math, main, symbols_close, "?", "?");
5809defineSymbol(symbols_math, main, symbols_close, "!", "!");
5810defineSymbol(symbols_math, main, symbols_close, "\u27E9", "\\rangle", true);
5811defineSymbol(symbols_math, main, symbols_close, "\u2223", "\\rvert");
5812defineSymbol(symbols_math, main, symbols_close, "\u2225", "\\rVert");
5813defineSymbol(symbols_math, main, rel, "=", "=");
5814defineSymbol(symbols_math, main, rel, "<", "<");
5815defineSymbol(symbols_math, main, rel, ">", ">");
5816defineSymbol(symbols_math, main, rel, ":", ":");
5817defineSymbol(symbols_math, main, rel, "\u2248", "\\approx", true);
5818defineSymbol(symbols_math, main, rel, "\u2245", "\\cong", true);
5819defineSymbol(symbols_math, main, rel, "\u2265", "\\ge");
5820defineSymbol(symbols_math, main, rel, "\u2265", "\\geq", true);
5821defineSymbol(symbols_math, main, rel, "\u2190", "\\gets");
5822defineSymbol(symbols_math, main, rel, ">", "\\gt");
5823defineSymbol(symbols_math, main, rel, "\u2208", "\\in", true);
5824defineSymbol(symbols_math, main, rel, "\u0338", "\\not");
5825defineSymbol(symbols_math, main, rel, "\u2282", "\\subset", true);
5826defineSymbol(symbols_math, main, rel, "\u2283", "\\supset", true);
5827defineSymbol(symbols_math, main, rel, "\u2286", "\\subseteq", true);
5828defineSymbol(symbols_math, main, rel, "\u2287", "\\supseteq", true);
5829defineSymbol(symbols_math, ams, rel, "\u2288", "\\nsubseteq", true);
5830defineSymbol(symbols_math, ams, rel, "\u2289", "\\nsupseteq", true);
5831defineSymbol(symbols_math, main, rel, "\u22A8", "\\models");
5832defineSymbol(symbols_math, main, rel, "\u2190", "\\leftarrow", true);
5833defineSymbol(symbols_math, main, rel, "\u2264", "\\le");
5834defineSymbol(symbols_math, main, rel, "\u2264", "\\leq", true);
5835defineSymbol(symbols_math, main, rel, "<", "\\lt");
5836defineSymbol(symbols_math, main, rel, "\u2192", "\\rightarrow", true);
5837defineSymbol(symbols_math, main, rel, "\u2192", "\\to");
5838defineSymbol(symbols_math, ams, rel, "\u2271", "\\ngeq", true);
5839defineSymbol(symbols_math, ams, rel, "\u2270", "\\nleq", true);
5840defineSymbol(symbols_math, main, spacing, "\xA0", "\\ ");
5841defineSymbol(symbols_math, main, spacing, "\xA0", "~");
5842defineSymbol(symbols_math, main, spacing, "\xA0", "\\space");
5843// Ref: LaTeX Source 2e: \DeclareRobustCommand{\nobreakspace}{%
5844defineSymbol(symbols_math, main, spacing, "\xA0", "\\nobreakspace");
5845defineSymbol(symbols_text, main, spacing, "\xA0", "\\ ");
5846defineSymbol(symbols_text, main, spacing, "\xA0", "~");
5847defineSymbol(symbols_text, main, spacing, "\xA0", "\\space");
5848defineSymbol(symbols_text, main, spacing, "\xA0", "\\nobreakspace");
5849defineSymbol(symbols_math, main, spacing, null, "\\nobreak");
5850defineSymbol(symbols_math, main, spacing, null, "\\allowbreak");
5851defineSymbol(symbols_math, main, punct, ",", ",");
5852defineSymbol(symbols_math, main, punct, ";", ";");
5853defineSymbol(symbols_math, ams, bin, "\u22BC", "\\barwedge", true);
5854defineSymbol(symbols_math, ams, bin, "\u22BB", "\\veebar", true);
5855defineSymbol(symbols_math, main, bin, "\u2299", "\\odot", true);
5856defineSymbol(symbols_math, main, bin, "\u2295", "\\oplus", true);
5857defineSymbol(symbols_math, main, bin, "\u2297", "\\otimes", true);
5858defineSymbol(symbols_math, main, symbols_textord, "\u2202", "\\partial", true);
5859defineSymbol(symbols_math, main, bin, "\u2298", "\\oslash", true);
5860defineSymbol(symbols_math, ams, bin, "\u229A", "\\circledcirc", true);
5861defineSymbol(symbols_math, ams, bin, "\u22A1", "\\boxdot", true);
5862defineSymbol(symbols_math, main, bin, "\u25B3", "\\bigtriangleup");
5863defineSymbol(symbols_math, main, bin, "\u25BD", "\\bigtriangledown");
5864defineSymbol(symbols_math, main, bin, "\u2020", "\\dagger");
5865defineSymbol(symbols_math, main, bin, "\u22C4", "\\diamond");
5866defineSymbol(symbols_math, main, bin, "\u22C6", "\\star");
5867defineSymbol(symbols_math, main, bin, "\u25C3", "\\triangleleft");
5868defineSymbol(symbols_math, main, bin, "\u25B9", "\\triangleright");
5869defineSymbol(symbols_math, main, symbols_open, "{", "\\{");
5870defineSymbol(symbols_text, main, symbols_textord, "{", "\\{");
5871defineSymbol(symbols_text, main, symbols_textord, "{", "\\textbraceleft");
5872defineSymbol(symbols_math, main, symbols_close, "}", "\\}");
5873defineSymbol(symbols_text, main, symbols_textord, "}", "\\}");
5874defineSymbol(symbols_text, main, symbols_textord, "}", "\\textbraceright");
5875defineSymbol(symbols_math, main, symbols_open, "{", "\\lbrace");
5876defineSymbol(symbols_math, main, symbols_close, "}", "\\rbrace");
5877defineSymbol(symbols_math, main, symbols_open, "[", "\\lbrack");
5878defineSymbol(symbols_text, main, symbols_textord, "[", "\\lbrack");
5879defineSymbol(symbols_math, main, symbols_close, "]", "\\rbrack");
5880defineSymbol(symbols_text, main, symbols_textord, "]", "\\rbrack");
5881defineSymbol(symbols_text, main, symbols_textord, "<", "\\textless"); // in T1 fontenc
5882defineSymbol(symbols_text, main, symbols_textord, ">", "\\textgreater"); // in T1 fontenc
5883defineSymbol(symbols_math, main, symbols_open, "\u230A", "\\lfloor", true);
5884defineSymbol(symbols_math, main, symbols_close, "\u230B", "\\rfloor", true);
5885defineSymbol(symbols_math, main, symbols_open, "\u2308", "\\lceil", true);
5886defineSymbol(symbols_math, main, symbols_close, "\u2309", "\\rceil", true);
5887defineSymbol(symbols_math, main, symbols_textord, "\\", "\\backslash");
5888defineSymbol(symbols_math, main, symbols_textord, "\u2223", "|");
5889defineSymbol(symbols_math, main, symbols_textord, "\u2223", "\\vert");
5890defineSymbol(symbols_text, main, symbols_textord, "|", "\\textbar"); // in T1 fontenc
5891defineSymbol(symbols_math, main, symbols_textord, "\u2225", "\\|");
5892defineSymbol(symbols_math, main, symbols_textord, "\u2225", "\\Vert");
5893defineSymbol(symbols_text, main, symbols_textord, "\u2225", "\\textbardbl");
5894defineSymbol(symbols_text, main, symbols_textord, "~", "\\textasciitilde");
5895defineSymbol(symbols_math, main, rel, "\u2191", "\\uparrow", true);
5896defineSymbol(symbols_math, main, rel, "\u21D1", "\\Uparrow", true);
5897defineSymbol(symbols_math, main, rel, "\u2193", "\\downarrow", true);
5898defineSymbol(symbols_math, main, rel, "\u21D3", "\\Downarrow", true);
5899defineSymbol(symbols_math, main, rel, "\u2195", "\\updownarrow", true);
5900defineSymbol(symbols_math, main, rel, "\u21D5", "\\Updownarrow", true);
5901defineSymbol(symbols_math, main, op, "\u2210", "\\coprod");
5902defineSymbol(symbols_math, main, op, "\u22C1", "\\bigvee");
5903defineSymbol(symbols_math, main, op, "\u22C0", "\\bigwedge");
5904defineSymbol(symbols_math, main, op, "\u2A04", "\\biguplus");
5905defineSymbol(symbols_math, main, op, "\u22C2", "\\bigcap");
5906defineSymbol(symbols_math, main, op, "\u22C3", "\\bigcup");
5907defineSymbol(symbols_math, main, op, "\u222B", "\\int");
5908defineSymbol(symbols_math, main, op, "\u222B", "\\intop");
5909defineSymbol(symbols_math, main, op, "\u222C", "\\iint");
5910defineSymbol(symbols_math, main, op, "\u222D", "\\iiint");
5911defineSymbol(symbols_math, main, op, "\u220F", "\\prod");
5912defineSymbol(symbols_math, main, op, "\u2211", "\\sum");
5913defineSymbol(symbols_math, main, op, "\u2A02", "\\bigotimes");
5914defineSymbol(symbols_math, main, op, "\u2A01", "\\bigoplus");
5915defineSymbol(symbols_math, main, op, "\u2A00", "\\bigodot");
5916defineSymbol(symbols_math, main, op, "\u222E", "\\oint");
5917defineSymbol(symbols_math, main, op, "\u2A06", "\\bigsqcup");
5918defineSymbol(symbols_math, main, op, "\u222B", "\\smallint");
5919defineSymbol(symbols_text, main, symbols_inner, "\u2026", "\\textellipsis");
5920defineSymbol(symbols_math, main, symbols_inner, "\u2026", "\\mathellipsis");
5921defineSymbol(symbols_text, main, symbols_inner, "\u2026", "\\ldots", true);
5922defineSymbol(symbols_math, main, symbols_inner, "\u2026", "\\ldots", true);
5923defineSymbol(symbols_math, main, symbols_inner, "\u22EF", "\\@cdots", true);
5924defineSymbol(symbols_math, main, symbols_inner, "\u22F1", "\\ddots", true);
5925defineSymbol(symbols_math, main, symbols_textord, "\u22EE", "\\varvdots"); // \vdots is a macro
5926defineSymbol(symbols_math, main, symbols_accent, "\u02CA", "\\acute");
5927defineSymbol(symbols_math, main, symbols_accent, "\u02CB", "\\grave");
5928defineSymbol(symbols_math, main, symbols_accent, "\xA8", "\\ddot");
5929defineSymbol(symbols_math, main, symbols_accent, "~", "\\tilde");
5930defineSymbol(symbols_math, main, symbols_accent, "\u02C9", "\\bar");
5931defineSymbol(symbols_math, main, symbols_accent, "\u02D8", "\\breve");
5932defineSymbol(symbols_math, main, symbols_accent, "\u02C7", "\\check");
5933defineSymbol(symbols_math, main, symbols_accent, "^", "\\hat");
5934defineSymbol(symbols_math, main, symbols_accent, "\u20D7", "\\vec");
5935defineSymbol(symbols_math, main, symbols_accent, "\u02D9", "\\dot");
5936defineSymbol(symbols_math, main, symbols_accent, "\u02DA", "\\mathring");
5937defineSymbol(symbols_math, main, mathord, "\u0131", "\\imath", true);
5938defineSymbol(symbols_math, main, mathord, "\u0237", "\\jmath", true);
5939defineSymbol(symbols_text, main, symbols_textord, "\u0131", "\\i", true);
5940defineSymbol(symbols_text, main, symbols_textord, "\u0237", "\\j", true);
5941defineSymbol(symbols_text, main, symbols_textord, "\xDF", "\\ss", true);
5942defineSymbol(symbols_text, main, symbols_textord, "\xE6", "\\ae", true);
5943defineSymbol(symbols_text, main, symbols_textord, "\xE6", "\\ae", true);
5944defineSymbol(symbols_text, main, symbols_textord, "\u0153", "\\oe", true);
5945defineSymbol(symbols_text, main, symbols_textord, "\xF8", "\\o", true);
5946defineSymbol(symbols_text, main, symbols_textord, "\xC6", "\\AE", true);
5947defineSymbol(symbols_text, main, symbols_textord, "\u0152", "\\OE", true);
5948defineSymbol(symbols_text, main, symbols_textord, "\xD8", "\\O", true);
5949defineSymbol(symbols_text, main, symbols_accent, "\u02CA", "\\'"); // acute
5950defineSymbol(symbols_text, main, symbols_accent, "\u02CB", "\\`"); // grave
5951defineSymbol(symbols_text, main, symbols_accent, "\u02C6", "\\^"); // circumflex
5952defineSymbol(symbols_text, main, symbols_accent, "\u02DC", "\\~"); // tilde
5953defineSymbol(symbols_text, main, symbols_accent, "\u02C9", "\\="); // macron
5954defineSymbol(symbols_text, main, symbols_accent, "\u02D8", "\\u"); // breve
5955defineSymbol(symbols_text, main, symbols_accent, "\u02D9", "\\."); // dot above
5956defineSymbol(symbols_text, main, symbols_accent, "\u02DA", "\\r"); // ring above
5957defineSymbol(symbols_text, main, symbols_accent, "\u02C7", "\\v"); // caron
5958defineSymbol(symbols_text, main, symbols_accent, "\xA8", '\\"'); // diaresis
5959defineSymbol(symbols_text, main, symbols_accent, "\u02DD", "\\H"); // double acute
5960defineSymbol(symbols_text, main, symbols_accent, "\u25EF", "\\textcircled"); // \bigcirc glyph
5961
5962// These ligatures are detected and created in Parser.js's `formLigatures`.
5963var ligatures = {
5964 "--": true,
5965 "---": true,
5966 "``": true,
5967 "''": true
5968};
5969
5970defineSymbol(symbols_text, main, symbols_textord, "\u2013", "--");
5971defineSymbol(symbols_text, main, symbols_textord, "\u2013", "\\textendash");
5972defineSymbol(symbols_text, main, symbols_textord, "\u2014", "---");
5973defineSymbol(symbols_text, main, symbols_textord, "\u2014", "\\textemdash");
5974defineSymbol(symbols_text, main, symbols_textord, "\u2018", "`");
5975defineSymbol(symbols_text, main, symbols_textord, "\u2018", "\\textquoteleft");
5976defineSymbol(symbols_text, main, symbols_textord, "\u2019", "'");
5977defineSymbol(symbols_text, main, symbols_textord, "\u2019", "\\textquoteright");
5978defineSymbol(symbols_text, main, symbols_textord, "\u201C", "``");
5979defineSymbol(symbols_text, main, symbols_textord, "\u201C", "\\textquotedblleft");
5980defineSymbol(symbols_text, main, symbols_textord, "\u201D", "''");
5981defineSymbol(symbols_text, main, symbols_textord, "\u201D", "\\textquotedblright");
5982// \degree from gensymb package
5983defineSymbol(symbols_math, main, symbols_textord, "\xB0", "\\degree", true);
5984defineSymbol(symbols_text, main, symbols_textord, "\xB0", "\\degree");
5985// \textdegree from inputenc package
5986defineSymbol(symbols_text, main, symbols_textord, "\xB0", "\\textdegree", true);
5987// TODO: In LaTeX, \pounds can generate a different character in text and math
5988// mode, but among our fonts, only Main-Italic defines this character "163".
5989defineSymbol(symbols_math, main, mathord, "\xA3", "\\pounds");
5990defineSymbol(symbols_math, main, mathord, "\xA3", "\\mathsterling", true);
5991defineSymbol(symbols_text, main, mathord, "\xA3", "\\pounds");
5992defineSymbol(symbols_text, main, mathord, "\xA3", "\\textsterling", true);
5993defineSymbol(symbols_math, ams, symbols_textord, "\u2720", "\\maltese");
5994defineSymbol(symbols_text, ams, symbols_textord, "\u2720", "\\maltese");
5995
5996defineSymbol(symbols_text, main, spacing, "\xA0", "\\ ");
5997defineSymbol(symbols_text, main, spacing, "\xA0", " ");
5998defineSymbol(symbols_text, main, spacing, "\xA0", "~");
5999
6000// There are lots of symbols which are the same, so we add them in afterwards.
6001// All of these are textords in math mode
6002var mathTextSymbols = "0123456789/@.\"";
6003for (var symbols_i = 0; symbols_i < mathTextSymbols.length; symbols_i++) {
6004 var symbols_ch = mathTextSymbols.charAt(symbols_i);
6005 defineSymbol(symbols_math, main, symbols_textord, symbols_ch, symbols_ch);
6006}
6007
6008// All of these are textords in text mode
6009var textSymbols = "0123456789!@*()-=+[]<>|\";:?/.,";
6010for (var src_symbols_i = 0; src_symbols_i < textSymbols.length; src_symbols_i++) {
6011 var _ch = textSymbols.charAt(src_symbols_i);
6012 defineSymbol(symbols_text, main, symbols_textord, _ch, _ch);
6013}
6014
6015// All of these are textords in text mode, and mathords in math mode
6016var letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
6017for (var symbols_i2 = 0; symbols_i2 < letters.length; symbols_i2++) {
6018 var _ch2 = letters.charAt(symbols_i2);
6019 defineSymbol(symbols_math, main, mathord, _ch2, _ch2);
6020 defineSymbol(symbols_text, main, symbols_textord, _ch2, _ch2);
6021}
6022
6023// The next loop loads wide (surrogate pair) characters.
6024// We support some letters in the Unicode range U+1D400 to U+1D7FF,
6025// Mathematical Alphanumeric Symbols.
6026// Some editors do not deal well with wide characters. So don't write the
6027// string into this file. Instead, create the string from the surrogate pair.
6028var symbols_wideChar = "";
6029for (var symbols_i3 = 0; symbols_i3 < letters.length; symbols_i3++) {
6030 var _ch3 = letters.charAt(symbols_i3);
6031
6032 // The hex numbers in the next line are a surrogate pair.
6033 // 0xD835 is the high surrogate for all letters in the range we support.
6034 // 0xDC00 is the low surrogate for bold A.
6035 symbols_wideChar = String.fromCharCode(0xD835, 0xDC00 + symbols_i3); // A-Z a-z bold
6036 defineSymbol(symbols_math, main, mathord, _ch3, symbols_wideChar);
6037 defineSymbol(symbols_text, main, symbols_textord, _ch3, symbols_wideChar);
6038
6039 symbols_wideChar = String.fromCharCode(0xD835, 0xDC34 + symbols_i3); // A-Z a-z italic
6040 defineSymbol(symbols_math, main, mathord, _ch3, symbols_wideChar);
6041 defineSymbol(symbols_text, main, symbols_textord, _ch3, symbols_wideChar);
6042
6043 symbols_wideChar = String.fromCharCode(0xD835, 0xDC68 + symbols_i3); // A-Z a-z bold italic
6044 defineSymbol(symbols_math, main, mathord, _ch3, symbols_wideChar);
6045 defineSymbol(symbols_text, main, symbols_textord, _ch3, symbols_wideChar);
6046
6047 symbols_wideChar = String.fromCharCode(0xD835, 0xDD04 + symbols_i3); // A-Z a-z Fractur
6048 defineSymbol(symbols_math, main, mathord, _ch3, symbols_wideChar);
6049 defineSymbol(symbols_text, main, symbols_textord, _ch3, symbols_wideChar);
6050
6051 symbols_wideChar = String.fromCharCode(0xD835, 0xDDA0 + symbols_i3); // A-Z a-z sans-serif
6052 defineSymbol(symbols_math, main, mathord, _ch3, symbols_wideChar);
6053 defineSymbol(symbols_text, main, symbols_textord, _ch3, symbols_wideChar);
6054
6055 symbols_wideChar = String.fromCharCode(0xD835, 0xDDD4 + symbols_i3); // A-Z a-z sans bold
6056 defineSymbol(symbols_math, main, mathord, _ch3, symbols_wideChar);
6057 defineSymbol(symbols_text, main, symbols_textord, _ch3, symbols_wideChar);
6058
6059 symbols_wideChar = String.fromCharCode(0xD835, 0xDE08 + symbols_i3); // A-Z a-z sans italic
6060 defineSymbol(symbols_math, main, mathord, _ch3, symbols_wideChar);
6061 defineSymbol(symbols_text, main, symbols_textord, _ch3, symbols_wideChar);
6062
6063 symbols_wideChar = String.fromCharCode(0xD835, 0xDE70 + symbols_i3); // A-Z a-z monospace
6064 defineSymbol(symbols_math, main, mathord, _ch3, symbols_wideChar);
6065 defineSymbol(symbols_text, main, symbols_textord, _ch3, symbols_wideChar);
6066
6067 if (symbols_i3 < 26) {
6068 // KaTeX fonts have only capital letters for blackboard bold and script.
6069 // See exception for k below.
6070 symbols_wideChar = String.fromCharCode(0xD835, 0xDD38 + symbols_i3); // A-Z double struck
6071 defineSymbol(symbols_math, main, mathord, _ch3, symbols_wideChar);
6072 defineSymbol(symbols_text, main, symbols_textord, _ch3, symbols_wideChar);
6073
6074 symbols_wideChar = String.fromCharCode(0xD835, 0xDC9C + symbols_i3); // A-Z script
6075 defineSymbol(symbols_math, main, mathord, _ch3, symbols_wideChar);
6076 defineSymbol(symbols_text, main, symbols_textord, _ch3, symbols_wideChar);
6077 }
6078
6079 // TODO: Add bold script when it is supported by a KaTeX font.
6080}
6081// "k" is the only double struck lower case letter in the KaTeX fonts.
6082symbols_wideChar = String.fromCharCode(0xD835, 0xDD5C); // k double struck
6083defineSymbol(symbols_math, main, mathord, "k", symbols_wideChar);
6084defineSymbol(symbols_text, main, symbols_textord, "k", symbols_wideChar);
6085
6086// Next, some wide character numerals
6087for (var _i4 = 0; _i4 < 10; _i4++) {
6088 var _ch4 = letters.charAt(_i4);
6089
6090 symbols_wideChar = String.fromCharCode(0xD835, 0xDFCE + _i4); // 0-9 bold
6091 defineSymbol(symbols_math, main, mathord, _ch4, symbols_wideChar);
6092 defineSymbol(symbols_text, main, symbols_textord, _ch4, symbols_wideChar);
6093
6094 symbols_wideChar = String.fromCharCode(0xD835, 0xDFE2 + _i4); // 0-9 sans serif
6095 defineSymbol(symbols_math, main, mathord, _ch4, symbols_wideChar);
6096 defineSymbol(symbols_text, main, symbols_textord, _ch4, symbols_wideChar);
6097
6098 symbols_wideChar = String.fromCharCode(0xD835, 0xDFEC + _i4); // 0-9 bold sans
6099 defineSymbol(symbols_math, main, mathord, _ch4, symbols_wideChar);
6100 defineSymbol(symbols_text, main, symbols_textord, _ch4, symbols_wideChar);
6101
6102 symbols_wideChar = String.fromCharCode(0xD835, 0xDFF6 + _i4); // 0-9 monospace
6103 defineSymbol(symbols_math, main, mathord, _ch4, symbols_wideChar);
6104 defineSymbol(symbols_text, main, symbols_textord, _ch4, symbols_wideChar);
6105}
6106
6107// We add these Latin-1 letters as symbols for backwards-compatibility,
6108// but they are not actually in the font, nor are they supported by the
6109// Unicode accent mechanism, so they fall back to Times font and look ugly.
6110// TODO(edemaine): Fix this.
6111var extraLatin = "ÇÐÞçþ";
6112for (var _i5 = 0; _i5 < extraLatin.length; _i5++) {
6113 var _ch5 = extraLatin.charAt(_i5);
6114 defineSymbol(symbols_math, main, mathord, _ch5, _ch5);
6115 defineSymbol(symbols_text, main, symbols_textord, _ch5, _ch5);
6116}
6117defineSymbol(symbols_text, main, symbols_textord, "ð", "ð");
6118
6119// Unicode versions of existing characters
6120defineSymbol(symbols_text, main, symbols_textord, "\u2013", "?");
6121defineSymbol(symbols_text, main, symbols_textord, "\u2014", "?");
6122defineSymbol(symbols_text, main, symbols_textord, "\u2018", "?");
6123defineSymbol(symbols_text, main, symbols_textord, "\u2019", "?");
6124defineSymbol(symbols_text, main, symbols_textord, "\u201C", "?");
6125defineSymbol(symbols_text, main, symbols_textord, "\u201D", "?");
6126// CONCATENATED MODULE: ./src/wide-character.js
6127
6128
6129
6130/**
6131 * Data below is from https://www.unicode.org/charts/PDF/U1D400.pdf
6132 * That document sorts characters into groups by font type, say bold or italic.
6133 *
6134 * In the arrays below, each subarray consists three elements:
6135 * * The CSS class of that group when in math mode.
6136 * * The CSS class of that group when in text mode.
6137 * * The font name, so that KaTeX can get font metrics.
6138 */
6139
6140/**
6141 * This file provides support for Unicode range U+1D400 to U+1D7FF,
6142 * Mathematical Alphanumeric Symbols.
6143 *
6144 * Function wideCharacterFont takes a wide character as input and returns
6145 * the font information necessary to render it properly.
6146 */
6147
6148var wideLatinLetterData = [["mathbf", "textbf", "Main-Bold"], // A-Z bold upright
6149["mathbf", "textbf", "Main-Bold"], // a-z bold upright
6150
6151["mathit", "textit", "Math-Italic"], // A-Z italic
6152["mathit", "textit", "Math-Italic"], // a-z italic
6153
6154["boldsymbol", "boldsymbol", "Main-BoldItalic"], // A-Z bold italic
6155["boldsymbol", "boldsymbol", "Main-BoldItalic"], // a-z bold italic
6156
6157// Map fancy A-Z letters to script, not calligraphic.
6158// This aligns with unicode-math and math fonts (except Cambria Math).
6159["mathscr", "textscr", "Script-Regular"], // A-Z script
6160["", "", ""], // a-z script. No font
6161
6162["", "", ""], // A-Z bold script. No font
6163["", "", ""], // a-z bold script. No font
6164
6165["mathfrak", "textfrak", "Fraktur-Regular"], // A-Z Fraktur
6166["mathfrak", "textfrak", "Fraktur-Regular"], // a-z Fraktur
6167
6168["mathbb", "textbb", "AMS-Regular"], // A-Z double-struck
6169["mathbb", "textbb", "AMS-Regular"], // k double-struck
6170
6171["", "", ""], // A-Z bold Fraktur No font metrics
6172["", "", ""], // a-z bold Fraktur. No font.
6173
6174["mathsf", "textsf", "SansSerif-Regular"], // A-Z sans-serif
6175["mathsf", "textsf", "SansSerif-Regular"], // a-z sans-serif
6176
6177["mathboldsf", "textboldsf", "SansSerif-Bold"], // A-Z bold sans-serif
6178["mathboldsf", "textboldsf", "SansSerif-Bold"], // a-z bold sans-serif
6179
6180["mathitsf", "textitsf", "SansSerif-Italic"], // A-Z italic sans-serif
6181["mathitsf", "textitsf", "SansSerif-Italic"], // a-z italic sans-serif
6182
6183["", "", ""], // A-Z bold italic sans. No font
6184["", "", ""], // a-z bold italic sans. No font
6185
6186["mathtt", "texttt", "Typewriter-Regular"], // A-Z monospace
6187["mathtt", "texttt", "Typewriter-Regular"]];
6188
6189var wideNumeralData = [["mathbf", "textbf", "Main-Bold"], // 0-9 bold
6190["", "", ""], // 0-9 double-struck. No KaTeX font.
6191["mathsf", "textsf", "SansSerif-Regular"], // 0-9 sans-serif
6192["mathboldsf", "textboldsf", "SansSerif-Bold"], // 0-9 bold sans-serif
6193["mathtt", "texttt", "Typewriter-Regular"]];
6194
6195var wide_character_wideCharacterFont = function wideCharacterFont(wideChar, mode) {
6196
6197 // IE doesn't support codePointAt(). So work with the surrogate pair.
6198 var H = wideChar.charCodeAt(0); // high surrogate
6199 var L = wideChar.charCodeAt(1); // low surrogate
6200 var codePoint = (H - 0xD800) * 0x400 + (L - 0xDC00) + 0x10000;
6201
6202 var j = mode === "math" ? 0 : 1; // column index for CSS class.
6203
6204 if (0x1D400 <= codePoint && codePoint < 0x1D6A4) {
6205 // wideLatinLetterData contains exactly 26 chars on each row.
6206 // So we can calculate the relevant row. No traverse necessary.
6207 var i = Math.floor((codePoint - 0x1D400) / 26);
6208 return [wideLatinLetterData[i][2], wideLatinLetterData[i][j]];
6209 } else if (0x1D7CE <= codePoint && codePoint <= 0x1D7FF) {
6210 // Numerals, ten per row.
6211 var _i = Math.floor((codePoint - 0x1D7CE) / 10);
6212 return [wideNumeralData[_i][2], wideNumeralData[_i][j]];
6213 } else if (codePoint === 0x1D6A5 || codePoint === 0x1D6A6) {
6214 // dotless i or j
6215 return [wideLatinLetterData[0][2], wideLatinLetterData[0][j]];
6216 } else if (0x1D6A6 < codePoint && codePoint < 0x1D7CE) {
6217 // Greek letters. Not supported, yet.
6218 return ["", ""];
6219 } else {
6220 // We don't support any wide characters outside 1D400?1D7FF.
6221 throw new src_ParseError("Unsupported character: " + wideChar);
6222 }
6223};
6224// CONCATENATED MODULE: ./src/Options.js
6225
6226
6227
6228/**
6229 * This file contains information about the options that the Parser carries
6230 * around with it while parsing. Data is held in an `Options` object, and when
6231 * recursing, a new `Options` object can be created with the `.with*` and
6232 * `.reset` functions.
6233 */
6234
6235
6236
6237
6238var sizeStyleMap = [
6239// Each element contains [textsize, scriptsize, scriptscriptsize].
6240// The size mappings are taken from TeX with \normalsize=10pt.
6241[1, 1, 1], // size1: [5, 5, 5] \tiny
6242[2, 1, 1], // size2: [6, 5, 5]
6243[3, 1, 1], // size3: [7, 5, 5] \scriptsize
6244[4, 2, 1], // size4: [8, 6, 5] \footnotesize
6245[5, 2, 1], // size5: [9, 6, 5] \small
6246[6, 3, 1], // size6: [10, 7, 5] \normalsize
6247[7, 4, 2], // size7: [12, 8, 6] \large
6248[8, 6, 3], // size8: [14.4, 10, 7] \Large
6249[9, 7, 6], // size9: [17.28, 12, 10] \LARGE
6250[10, 8, 7], // size10: [20.74, 14.4, 12] \huge
6251[11, 10, 9]];
6252
6253var sizeMultipliers = [
6254// fontMetrics.js:getGlobalMetrics also uses size indexes, so if
6255// you change size indexes, change that function.
62560.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.44, 1.728, 2.074, 2.488];
6257
6258var sizeAtStyle = function sizeAtStyle(size, style) {
6259 return style.size < 2 ? size : sizeStyleMap[size - 1][style.size - 1];
6260};
6261
6262/**
6263 * This is the main options class. It contains the current style, size, color,
6264 * and font.
6265 *
6266 * Options objects should not be modified. To create a new Options with
6267 * different properties, call a `.having*` method.
6268 */
6269var Options_Options = function () {
6270 // A font family applies to a group of fonts (i.e. SansSerif), while a font
6271 // represents a specific font (i.e. SansSerif Bold).
6272 // See: https://tex.stackexchange.com/questions/22350/difference-between-textrm-and-mathrm
6273 function Options(data) {
6274 classCallCheck_default()(this, Options);
6275
6276 this.style = data.style;
6277 this.color = data.color;
6278 this.size = data.size || Options.BASESIZE;
6279 this.textSize = data.textSize || this.size;
6280 this.phantom = !!data.phantom;
6281 this.font = data.font || "";
6282 this.fontFamily = data.fontFamily || "";
6283 this.fontWeight = data.fontWeight || '';
6284 this.fontShape = data.fontShape || '';
6285 this.sizeMultiplier = sizeMultipliers[this.size - 1];
6286 this.maxSize = data.maxSize;
6287 this._fontMetrics = undefined;
6288 }
6289
6290 /**
6291 * Returns a new options object with the same properties as "this". Properties
6292 * from "extension" will be copied to the new options object.
6293 */
6294
6295
6296 /**
6297 * The base size index.
6298 */
6299
6300
6301 createClass_default()(Options, [{
6302 key: "extend",
6303 value: function extend(extension) {
6304 var data = {
6305 style: this.style,
6306 size: this.size,
6307 textSize: this.textSize,
6308 color: this.color,
6309 phantom: this.phantom,
6310 font: this.font,
6311 fontFamily: this.fontFamily,
6312 fontWeight: this.fontWeight,
6313 fontShape: this.fontShape,
6314 maxSize: this.maxSize
6315 };
6316
6317 for (var key in extension) {
6318 if (extension.hasOwnProperty(key)) {
6319 data[key] = extension[key];
6320 }
6321 }
6322
6323 return new Options(data);
6324 }
6325
6326 /**
6327 * Return an options object with the given style. If `this.style === style`,
6328 * returns `this`.
6329 */
6330
6331 }, {
6332 key: "havingStyle",
6333 value: function havingStyle(style) {
6334 if (this.style === style) {
6335 return this;
6336 } else {
6337 return this.extend({
6338 style: style,
6339 size: sizeAtStyle(this.textSize, style)
6340 });
6341 }
6342 }
6343
6344 /**
6345 * Return an options object with a cramped version of the current style. If
6346 * the current style is cramped, returns `this`.
6347 */
6348
6349 }, {
6350 key: "havingCrampedStyle",
6351 value: function havingCrampedStyle() {
6352 return this.havingStyle(this.style.cramp());
6353 }
6354
6355 /**
6356 * Return an options object with the given size and in at least `\textstyle`.
6357 * Returns `this` if appropriate.
6358 */
6359
6360 }, {
6361 key: "havingSize",
6362 value: function havingSize(size) {
6363 if (this.size === size && this.textSize === size) {
6364 return this;
6365 } else {
6366 return this.extend({
6367 style: this.style.text(),
6368 size: size,
6369 textSize: size,
6370 sizeMultiplier: sizeMultipliers[size - 1]
6371 });
6372 }
6373 }
6374
6375 /**
6376 * Like `this.havingSize(BASESIZE).havingStyle(style)`. If `style` is omitted,
6377 * changes to at least `\textstyle`.
6378 */
6379
6380 }, {
6381 key: "havingBaseStyle",
6382 value: function havingBaseStyle(style) {
6383 style = style || this.style.text();
6384 var wantSize = sizeAtStyle(Options.BASESIZE, style);
6385 if (this.size === wantSize && this.textSize === Options.BASESIZE && this.style === style) {
6386 return this;
6387 } else {
6388 return this.extend({
6389 style: style,
6390 size: wantSize
6391 });
6392 }
6393 }
6394
6395 /**
6396 * Create a new options object with the given color.
6397 */
6398
6399 }, {
6400 key: "withColor",
6401 value: function withColor(color) {
6402 return this.extend({
6403 color: color
6404 });
6405 }
6406
6407 /**
6408 * Create a new options object with "phantom" set to true.
6409 */
6410
6411 }, {
6412 key: "withPhantom",
6413 value: function withPhantom() {
6414 return this.extend({
6415 phantom: true
6416 });
6417 }
6418
6419 /**
6420 * Creates a new options object with the given math font or old text font.
6421 * @type {[type]}
6422 */
6423
6424 }, {
6425 key: "withFont",
6426 value: function withFont(font) {
6427 return this.extend({
6428 font: font
6429 });
6430 }
6431
6432 /**
6433 * Create a new options objects with the given fontFamily.
6434 */
6435
6436 }, {
6437 key: "withTextFontFamily",
6438 value: function withTextFontFamily(fontFamily) {
6439 return this.extend({
6440 fontFamily: fontFamily,
6441 font: ""
6442 });
6443 }
6444
6445 /**
6446 * Creates a new options object with the given font weight
6447 */
6448
6449 }, {
6450 key: "withTextFontWeight",
6451 value: function withTextFontWeight(fontWeight) {
6452 return this.extend({
6453 fontWeight: fontWeight,
6454 font: ""
6455 });
6456 }
6457
6458 /**
6459 * Creates a new options object with the given font weight
6460 */
6461
6462 }, {
6463 key: "withTextFontShape",
6464 value: function withTextFontShape(fontShape) {
6465 return this.extend({
6466 fontShape: fontShape,
6467 font: ""
6468 });
6469 }
6470
6471 /**
6472 * Return the CSS sizing classes required to switch from enclosing options
6473 * `oldOptions` to `this`. Returns an array of classes.
6474 */
6475
6476 }, {
6477 key: "sizingClasses",
6478 value: function sizingClasses(oldOptions) {
6479 if (oldOptions.size !== this.size) {
6480 return ["sizing", "reset-size" + oldOptions.size, "size" + this.size];
6481 } else {
6482 return [];
6483 }
6484 }
6485
6486 /**
6487 * Return the CSS sizing classes required to switch to the base size. Like
6488 * `this.havingSize(BASESIZE).sizingClasses(this)`.
6489 */
6490
6491 }, {
6492 key: "baseSizingClasses",
6493 value: function baseSizingClasses() {
6494 if (this.size !== Options.BASESIZE) {
6495 return ["sizing", "reset-size" + this.size, "size" + Options.BASESIZE];
6496 } else {
6497 return [];
6498 }
6499 }
6500
6501 /**
6502 * Return the font metrics for this size.
6503 */
6504
6505 }, {
6506 key: "fontMetrics",
6507 value: function fontMetrics() {
6508 if (!this._fontMetrics) {
6509 this._fontMetrics = getGlobalMetrics(this.size);
6510 }
6511 return this._fontMetrics;
6512 }
6513
6514 /**
6515 * A map of color names to CSS colors.
6516 * TODO(emily): Remove this when we have real macros
6517 */
6518
6519 }, {
6520 key: "getColor",
6521
6522
6523 /**
6524 * Gets the CSS color of the current options object, accounting for the
6525 * `colorMap`.
6526 */
6527 value: function getColor() {
6528 if (this.phantom) {
6529 return "transparent";
6530 } else if (this.color != null && Options.colorMap.hasOwnProperty(this.color)) {
6531 return Options.colorMap[this.color];
6532 } else {
6533 return this.color;
6534 }
6535 }
6536 }]);
6537
6538 return Options;
6539}();
6540
6541Options_Options.BASESIZE = 6;
6542Options_Options.colorMap = {
6543 "katex-blue": "#6495ed",
6544 "katex-orange": "#ffa500",
6545 "katex-pink": "#ff00af",
6546 "katex-red": "#df0030",
6547 "katex-green": "#28ae7b",
6548 "katex-gray": "gray",
6549 "katex-purple": "#9d38bd",
6550 "katex-blueA": "#ccfaff",
6551 "katex-blueB": "#80f6ff",
6552 "katex-blueC": "#63d9ea",
6553 "katex-blueD": "#11accd",
6554 "katex-blueE": "#0c7f99",
6555 "katex-tealA": "#94fff5",
6556 "katex-tealB": "#26edd5",
6557 "katex-tealC": "#01d1c1",
6558 "katex-tealD": "#01a995",
6559 "katex-tealE": "#208170",
6560 "katex-greenA": "#b6ffb0",
6561 "katex-greenB": "#8af281",
6562 "katex-greenC": "#74cf70",
6563 "katex-greenD": "#1fab54",
6564 "katex-greenE": "#0d923f",
6565 "katex-goldA": "#ffd0a9",
6566 "katex-goldB": "#ffbb71",
6567 "katex-goldC": "#ff9c39",
6568 "katex-goldD": "#e07d10",
6569 "katex-goldE": "#a75a05",
6570 "katex-redA": "#fca9a9",
6571 "katex-redB": "#ff8482",
6572 "katex-redC": "#f9685d",
6573 "katex-redD": "#e84d39",
6574 "katex-redE": "#bc2612",
6575 "katex-maroonA": "#ffbde0",
6576 "katex-maroonB": "#ff92c6",
6577 "katex-maroonC": "#ed5fa6",
6578 "katex-maroonD": "#ca337c",
6579 "katex-maroonE": "#9e034e",
6580 "katex-purpleA": "#ddd7ff",
6581 "katex-purpleB": "#c6b9fc",
6582 "katex-purpleC": "#aa87ff",
6583 "katex-purpleD": "#7854ab",
6584 "katex-purpleE": "#543b78",
6585 "katex-mintA": "#f5f9e8",
6586 "katex-mintB": "#edf2df",
6587 "katex-mintC": "#e0e5cc",
6588 "katex-grayA": "#f6f7f7",
6589 "katex-grayB": "#f0f1f2",
6590 "katex-grayC": "#e3e5e6",
6591 "katex-grayD": "#d6d8da",
6592 "katex-grayE": "#babec2",
6593 "katex-grayF": "#888d93",
6594 "katex-grayG": "#626569",
6595 "katex-grayH": "#3b3e40",
6596 "katex-grayI": "#21242c",
6597 "katex-kaBlue": "#314453",
6598 "katex-kaGreen": "#71B307"
6599};
6600
6601
6602/* harmony default export */ var src_Options = (Options_Options);
6603// CONCATENATED MODULE: ./src/units.js
6604
6605
6606/**
6607 * This file does conversion between units. In particular, it provides
6608 * calculateSize to convert other units into ems.
6609 */
6610
6611
6612
6613
6614// This table gives the number of TeX pts in one of each *absolute* TeX unit.
6615// Thus, multiplying a length by this number converts the length from units
6616// into pts. Dividing the result by ptPerEm gives the number of ems
6617// *assuming* a font size of ptPerEm (normal size, normal style).
6618var ptPerUnit = {
6619 // https://en.wikibooks.org/wiki/LaTeX/Lengths and
6620 // https://tex.stackexchange.com/a/8263
6621 "pt": 1, // TeX point
6622 "mm": 7227 / 2540, // millimeter
6623 "cm": 7227 / 254, // centimeter
6624 "in": 72.27, // inch
6625 "bp": 803 / 800, // big (PostScript) points
6626 "pc": 12, // pica
6627 "dd": 1238 / 1157, // didot
6628 "cc": 14856 / 1157, // cicero (12 didot)
6629 "nd": 685 / 642, // new didot
6630 "nc": 1370 / 107, // new cicero (12 new didot)
6631 "sp": 1 / 65536, // scaled point (TeX's internal smallest unit)
6632 // https://tex.stackexchange.com/a/41371
6633 "px": 803 / 800 // \pdfpxdimen defaults to 1 bp in pdfTeX and LuaTeX
6634};
6635
6636// Dictionary of relative units, for fast validity testing.
6637var relativeUnit = {
6638 "ex": true,
6639 "em": true,
6640 "mu": true
6641};
6642
6643/**
6644 * Determine whether the specified unit (either a string defining the unit
6645 * or a "size" parse node containing a unit field) is valid.
6646 */
6647var validUnit = function validUnit(unit) {
6648 if (typeof unit !== "string") {
6649 unit = unit.unit;
6650 }
6651 return unit in ptPerUnit || unit in relativeUnit || unit === "ex";
6652};
6653
6654/*
6655 * Convert a "size" parse node (with numeric "number" and string "unit" fields,
6656 * as parsed by functions.js argType "size") into a CSS em value for the
6657 * current style/scale. `options` gives the current options.
6658 */
6659var units_calculateSize = function calculateSize(sizeValue, options) {
6660 var scale = void 0;
6661 if (sizeValue.unit in ptPerUnit) {
6662 // Absolute units
6663 scale = ptPerUnit[sizeValue.unit] // Convert unit to pt
6664 / options.fontMetrics().ptPerEm // Convert pt to CSS em
6665 / options.sizeMultiplier; // Unscale to make absolute units
6666 } else if (sizeValue.unit === "mu") {
6667 // `mu` units scale with scriptstyle/scriptscriptstyle.
6668 scale = options.fontMetrics().cssEmPerMu;
6669 } else {
6670 // Other relative units always refer to the *textstyle* font
6671 // in the current size.
6672 var unitOptions = void 0;
6673 if (options.style.isTight()) {
6674 // isTight() means current style is script/scriptscript.
6675 unitOptions = options.havingStyle(options.style.text());
6676 } else {
6677 unitOptions = options;
6678 }
6679 // TODO: In TeX these units are relative to the quad of the current
6680 // *text* font, e.g. cmr10. KaTeX instead uses values from the
6681 // comparably-sized *Computer Modern symbol* font. At 10pt, these
6682 // match. At 7pt and 5pt, they differ: cmr7=1.138894, cmsy7=1.170641;
6683 // cmr5=1.361133, cmsy5=1.472241. Consider $\scriptsize a\kern1emb$.
6684 // TeX \showlists shows a kern of 1.13889 * fontsize;
6685 // KaTeX shows a kern of 1.171 * fontsize.
6686 if (sizeValue.unit === "ex") {
6687 scale = unitOptions.fontMetrics().xHeight;
6688 } else if (sizeValue.unit === "em") {
6689 scale = unitOptions.fontMetrics().quad;
6690 } else {
6691 throw new src_ParseError("Invalid unit: '" + sizeValue.unit + "'");
6692 }
6693 if (unitOptions !== options) {
6694 scale *= unitOptions.sizeMultiplier / options.sizeMultiplier;
6695 }
6696 }
6697 return Math.min(sizeValue.number * scale, options.maxSize);
6698};
6699// CONCATENATED MODULE: ./src/buildCommon.js
6700
6701
6702
6703/* eslint no-console:0 */
6704/**
6705 * This module contains general functions that can be used for building
6706 * different kinds of domTree nodes in a consistent manner.
6707 */
6708
6709
6710
6711
6712
6713
6714
6715
6716// The following have to be loaded from Main-Italic font, using class mainit
6717var mainitLetters = ["\\imath", "?", // dotless i
6718"\\jmath", "?", // dotless j
6719"\\pounds", "\\mathsterling", "\\textsterling", "£"];
6720
6721/**
6722 * Looks up the given symbol in fontMetrics, after applying any symbol
6723 * replacements defined in symbol.js
6724 */
6725var buildCommon_lookupSymbol = function lookupSymbol(value,
6726// TODO(#963): Use a union type for this.
6727fontName, mode) {
6728 // Replace the value with its replaced value from symbol.js
6729 if (src_symbols[mode][value] && src_symbols[mode][value].replace) {
6730 value = src_symbols[mode][value].replace;
6731 }
6732 return {
6733 value: value,
6734 metrics: getCharacterMetrics(value, fontName, mode)
6735 };
6736};
6737
6738/**
6739 * Makes a symbolNode after translation via the list of symbols in symbols.js.
6740 * Correctly pulls out metrics for the character, and optionally takes a list of
6741 * classes to be attached to the node.
6742 *
6743 * TODO: make argument order closer to makeSpan
6744 * TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which
6745 * should if present come first in `classes`.
6746 * TODO(#953): Make `options` mandatory and always pass it in.
6747 */
6748var buildCommon_makeSymbol = function makeSymbol(value, fontName, mode, options, classes) {
6749 var lookup = buildCommon_lookupSymbol(value, fontName, mode);
6750 var metrics = lookup.metrics;
6751 value = lookup.value;
6752
6753 var symbolNode = void 0;
6754 if (metrics) {
6755 var italic = metrics.italic;
6756 if (mode === "text") {
6757 italic = 0;
6758 }
6759 symbolNode = new domTree.symbolNode(value, metrics.height, metrics.depth, italic, metrics.skew, metrics.width, classes);
6760 } else {
6761 // TODO(emily): Figure out a good way to only print this in development
6762 typeof console !== "undefined" && console.warn("No character metrics for '" + value + "' in style '" + fontName + "'");
6763 symbolNode = new domTree.symbolNode(value, 0, 0, 0, 0, 0, classes);
6764 }
6765
6766 if (options) {
6767 symbolNode.maxFontSize = options.sizeMultiplier;
6768 if (options.style.isTight()) {
6769 symbolNode.classes.push("mtight");
6770 }
6771 var color = options.getColor();
6772 if (color) {
6773 symbolNode.style.color = color;
6774 }
6775 }
6776
6777 return symbolNode;
6778};
6779
6780/**
6781 * Makes a symbol in Main-Regular or AMS-Regular.
6782 * Used for rel, bin, open, close, inner, and punct.
6783 *
6784 * TODO(#953): Make `options` mandatory and always pass it in.
6785 */
6786var buildCommon_mathsym = function mathsym(value, mode, options) {
6787 var classes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
6788
6789 // Decide what font to render the symbol in by its entry in the symbols
6790 // table.
6791 // Have a special case for when the value = \ because the \ is used as a
6792 // textord in unsupported command errors but cannot be parsed as a regular
6793 // text ordinal and is therefore not present as a symbol in the symbols
6794 // table for text, as well as a special case for boldsymbol because it
6795 // can be used for bold + and -
6796 if (options && options.font && options.font === "boldsymbol" && buildCommon_lookupSymbol(value, "Main-Bold", mode).metrics) {
6797 return buildCommon_makeSymbol(value, "Main-Bold", mode, options, classes.concat(["mathbf"]));
6798 } else if (value === "\\" || src_symbols[mode][value].font === "main") {
6799 return buildCommon_makeSymbol(value, "Main-Regular", mode, options, classes);
6800 } else {
6801 return buildCommon_makeSymbol(value, "AMS-Regular", mode, options, classes.concat(["amsrm"]));
6802 }
6803};
6804
6805/**
6806 * Makes a symbol in the default font for mathords and textords.
6807 */
6808var buildCommon_mathDefault = function mathDefault(value, mode, options, classes, type) {
6809 if (type === "mathord") {
6810 var fontLookup = buildCommon_mathit(value, mode, options, classes);
6811 return buildCommon_makeSymbol(value, fontLookup.fontName, mode, options, classes.concat([fontLookup.fontClass]));
6812 } else if (type === "textord") {
6813 var font = src_symbols[mode][value] && src_symbols[mode][value].font;
6814 if (font === "ams") {
6815 var _fontName = retrieveTextFontName("amsrm", options.fontWeight, options.fontShape);
6816 return buildCommon_makeSymbol(value, _fontName, mode, options, classes.concat("amsrm", options.fontWeight, options.fontShape));
6817 } else if (font === "main" || !font) {
6818 var _fontName2 = retrieveTextFontName("textrm", options.fontWeight, options.fontShape);
6819 return buildCommon_makeSymbol(value, _fontName2, mode, options, classes.concat(options.fontWeight, options.fontShape));
6820 } else {
6821 // fonts added by plugins
6822 var _fontName3 = retrieveTextFontName(font, options.fontWeight, options.fontShape);
6823 // We add font name as a css class
6824 return buildCommon_makeSymbol(value, _fontName3, mode, options, classes.concat(_fontName3, options.fontWeight, options.fontShape));
6825 }
6826 } else {
6827 throw new Error("unexpected type: " + type + " in mathDefault");
6828 }
6829};
6830
6831/**
6832 * Determines which of the two font names (Main-Italic and Math-Italic) and
6833 * corresponding style tags (mainit or mathit) to use for font "mathit",
6834 * depending on the symbol. Use this function instead of fontMap for font
6835 * "mathit".
6836 */
6837var buildCommon_mathit = function mathit(value, mode, options, classes) {
6838 if (/[0-9]/.test(value.charAt(0)) ||
6839 // glyphs for \imath and \jmath do not exist in Math-Italic so we
6840 // need to use Main-Italic instead
6841 utils.contains(mainitLetters, value)) {
6842 return {
6843 fontName: "Main-Italic",
6844 fontClass: "mainit"
6845 };
6846 } else {
6847 return {
6848 fontName: "Math-Italic",
6849 fontClass: "mathit"
6850 };
6851 }
6852};
6853
6854/**
6855 * Determines which of the two font names (Main-Bold and Math-BoldItalic) and
6856 * corresponding style tags (mathbf or boldsymbol) to use for font "boldsymbol",
6857 * depending on the symbol. Use this function instead of fontMap for font
6858 * "boldsymbol".
6859 */
6860var boldsymbol = function boldsymbol(value, mode, options, classes) {
6861 if (buildCommon_lookupSymbol(value, "Math-BoldItalic", mode).metrics) {
6862 return {
6863 fontName: "Math-BoldItalic",
6864 fontClass: "boldsymbol"
6865 };
6866 } else {
6867 // Some glyphs do not exist in Math-BoldItalic so we need to use
6868 // Main-Bold instead.
6869 return {
6870 fontName: "Main-Bold",
6871 fontClass: "mathbf"
6872 };
6873 }
6874};
6875
6876/**
6877 * Makes either a mathord or textord in the correct font and color.
6878 */
6879var buildCommon_makeOrd = function makeOrd(group, options, type) {
6880 var mode = group.mode;
6881 var value = group.value;
6882
6883 var classes = ["mord"];
6884
6885 // Math mode or Old font (i.e. \rm)
6886 var isFont = mode === "math" || mode === "text" && options.font;
6887 var fontOrFamily = isFont ? options.font : options.fontFamily;
6888 if (value.charCodeAt(0) === 0xD835) {
6889 // surrogate pairs get special treatment
6890 var _wideCharacterFont = wide_character_wideCharacterFont(value, mode),
6891 _wideCharacterFont2 = slicedToArray_default()(_wideCharacterFont, 2),
6892 wideFontName = _wideCharacterFont2[0],
6893 wideFontClass = _wideCharacterFont2[1];
6894
6895 return buildCommon_makeSymbol(value, wideFontName, mode, options, classes.concat(wideFontClass));
6896 } else if (fontOrFamily) {
6897 var _fontName4 = void 0;
6898 var fontClasses = void 0;
6899 if (fontOrFamily === "boldsymbol") {
6900 var fontData = boldsymbol(value, mode, options, classes);
6901 _fontName4 = fontData.fontName;
6902 fontClasses = [fontData.fontClass];
6903 } else if (fontOrFamily === "mathit" || utils.contains(mainitLetters, value)) {
6904 var _fontData = buildCommon_mathit(value, mode, options, classes);
6905 _fontName4 = _fontData.fontName;
6906 fontClasses = [_fontData.fontClass];
6907 } else if (isFont) {
6908 _fontName4 = fontMap[fontOrFamily].fontName;
6909 fontClasses = [fontOrFamily];
6910 } else {
6911 _fontName4 = retrieveTextFontName(fontOrFamily, options.fontWeight, options.fontShape);
6912 fontClasses = [fontOrFamily, options.fontWeight, options.fontShape];
6913 }
6914
6915 if (buildCommon_lookupSymbol(value, _fontName4, mode).metrics) {
6916 return buildCommon_makeSymbol(value, _fontName4, mode, options, classes.concat(fontClasses));
6917 } else if (ligatures.hasOwnProperty(value) && _fontName4.substr(0, 10) === "Typewriter") {
6918 // Deconstruct ligatures in monospace fonts (\texttt, \tt).
6919 var parts = [];
6920 for (var i = 0; i < value.length; i++) {
6921 parts.push(buildCommon_makeSymbol(value[i], _fontName4, mode, options, classes.concat(fontClasses)));
6922 }
6923 return buildCommon_makeFragment(parts);
6924 } else {
6925 return buildCommon_mathDefault(value, mode, options, classes, type);
6926 }
6927 } else {
6928 return buildCommon_mathDefault(value, mode, options, classes, type);
6929 }
6930};
6931
6932/**
6933 * Combine as many characters as possible in the given array of characters
6934 * via their tryCombine method.
6935 */
6936var tryCombineChars = function tryCombineChars(chars) {
6937 for (var i = 0; i < chars.length - 1; i++) {
6938 if (chars[i].tryCombine(chars[i + 1])) {
6939 chars.splice(i + 1, 1);
6940 i--;
6941 }
6942 }
6943 return chars;
6944};
6945
6946/**
6947 * Calculate the height, depth, and maxFontSize of an element based on its
6948 * children.
6949 */
6950var buildCommon_sizeElementFromChildren = function sizeElementFromChildren(elem) {
6951 var height = 0;
6952 var depth = 0;
6953 var maxFontSize = 0;
6954
6955 var _iteratorNormalCompletion = true;
6956 var _didIteratorError = false;
6957 var _iteratorError = undefined;
6958
6959 try {
6960 for (var _iterator = get_iterator_default()(elem.children), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
6961 var child = _step.value;
6962
6963 if (child.height > height) {
6964 height = child.height;
6965 }
6966 if (child.depth > depth) {
6967 depth = child.depth;
6968 }
6969 if (child.maxFontSize > maxFontSize) {
6970 maxFontSize = child.maxFontSize;
6971 }
6972 }
6973 } catch (err) {
6974 _didIteratorError = true;
6975 _iteratorError = err;
6976 } finally {
6977 try {
6978 if (!_iteratorNormalCompletion && _iterator.return) {
6979 _iterator.return();
6980 }
6981 } finally {
6982 if (_didIteratorError) {
6983 throw _iteratorError;
6984 }
6985 }
6986 }
6987
6988 elem.height = height;
6989 elem.depth = depth;
6990 elem.maxFontSize = maxFontSize;
6991};
6992
6993/**
6994 * Makes a span with the given list of classes, list of children, and options.
6995 *
6996 * TODO(#953): Ensure that `options` is always provided (currently some call
6997 * sites don't pass it) and make the type below mandatory.
6998 * TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which
6999 * should if present come first in `classes`.
7000 */
7001var buildCommon_makeSpan = function makeSpan(classes, children, options, style) {
7002 var span = new domTree.span(classes, children, options, style);
7003
7004 buildCommon_sizeElementFromChildren(span);
7005
7006 return span;
7007};
7008
7009// SVG one is simpler -- doesn't require height, depth, max-font setting.
7010// This is also a separate method for typesafety.
7011var buildCommon_makeSvgSpan = function makeSvgSpan(classes, children, options, style) {
7012 return new domTree.span(classes, children, options, style);
7013};
7014
7015var makeLineSpan = function makeLineSpan(className, options, thickness) {
7016 var line = buildCommon_makeSpan([className], [], options);
7017 line.height = thickness || options.fontMetrics().defaultRuleThickness;
7018 line.style.borderBottomWidth = line.height + "em";
7019 line.maxFontSize = 1.0;
7020 return line;
7021};
7022
7023/**
7024 * Makes an anchor with the given href, list of classes, list of children,
7025 * and options.
7026 */
7027var buildCommon_makeAnchor = function makeAnchor(href, classes, children, options) {
7028 var anchor = new domTree.anchor(href, classes, children, options);
7029
7030 buildCommon_sizeElementFromChildren(anchor);
7031
7032 return anchor;
7033};
7034
7035/**
7036 * Makes a document fragment with the given list of children.
7037 */
7038var buildCommon_makeFragment = function makeFragment(children) {
7039 var fragment = new domTree.documentFragment(children);
7040
7041 buildCommon_sizeElementFromChildren(fragment);
7042
7043 return fragment;
7044};
7045
7046// These are exact object types to catch typos in the names of the optional fields.
7047
7048
7049// A list of child or kern nodes to be stacked on top of each other (i.e. the
7050// first element will be at the bottom, and the last at the top).
7051
7052
7053// Computes the updated `children` list and the overall depth.
7054//
7055// This helper function for makeVList makes it easier to enforce type safety by
7056// allowing early exits (returns) in the logic.
7057var buildCommon_getVListChildrenAndDepth = function getVListChildrenAndDepth(params) {
7058 if (params.positionType === "individualShift") {
7059 var oldChildren = params.children;
7060 var _children = [oldChildren[0]];
7061
7062 // Add in kerns to the list of params.children to get each element to be
7063 // shifted to the correct specified shift
7064 var _depth = -oldChildren[0].shift - oldChildren[0].elem.depth;
7065 var currPos = _depth;
7066 for (var i = 1; i < oldChildren.length; i++) {
7067 var diff = -oldChildren[i].shift - currPos - oldChildren[i].elem.depth;
7068 var _size = diff - (oldChildren[i - 1].elem.height + oldChildren[i - 1].elem.depth);
7069
7070 currPos = currPos + diff;
7071
7072 _children.push({ type: "kern", size: _size });
7073 _children.push(oldChildren[i]);
7074 }
7075
7076 return { children: _children, depth: _depth };
7077 }
7078
7079 var depth = void 0;
7080 if (params.positionType === "top") {
7081 // We always start at the bottom, so calculate the bottom by adding up
7082 // all the sizes
7083 var bottom = params.positionData;
7084 var _iteratorNormalCompletion2 = true;
7085 var _didIteratorError2 = false;
7086 var _iteratorError2 = undefined;
7087
7088 try {
7089 for (var _iterator2 = get_iterator_default()(params.children), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
7090 var child = _step2.value;
7091
7092 bottom -= child.type === "kern" ? child.size : child.elem.height + child.elem.depth;
7093 }
7094 } catch (err) {
7095 _didIteratorError2 = true;
7096 _iteratorError2 = err;
7097 } finally {
7098 try {
7099 if (!_iteratorNormalCompletion2 && _iterator2.return) {
7100 _iterator2.return();
7101 }
7102 } finally {
7103 if (_didIteratorError2) {
7104 throw _iteratorError2;
7105 }
7106 }
7107 }
7108
7109 depth = bottom;
7110 } else if (params.positionType === "bottom") {
7111 depth = -params.positionData;
7112 } else {
7113 var firstChild = params.children[0];
7114 if (firstChild.type !== "elem") {
7115 throw new Error('First child must have type "elem".');
7116 }
7117 if (params.positionType === "shift") {
7118 depth = -firstChild.elem.depth - params.positionData;
7119 } else if (params.positionType === "firstBaseline") {
7120 depth = -firstChild.elem.depth;
7121 } else {
7122 throw new Error("Invalid positionType " + params.positionType + ".");
7123 }
7124 }
7125 return { children: params.children, depth: depth };
7126};
7127
7128/**
7129 * Makes a vertical list by stacking elements and kerns on top of each other.
7130 * Allows for many different ways of specifying the positioning method.
7131 *
7132 * See VListParam documentation above.
7133 */
7134var buildCommon_makeVList = function makeVList(params, options) {
7135 var _getVListChildrenAndD = buildCommon_getVListChildrenAndDepth(params),
7136 children = _getVListChildrenAndD.children,
7137 depth = _getVListChildrenAndD.depth;
7138
7139 // Create a strut that is taller than any list item. The strut is added to
7140 // each item, where it will determine the item's baseline. Since it has
7141 // `overflow:hidden`, the strut's top edge will sit on the item's line box's
7142 // top edge and the strut's bottom edge will sit on the item's baseline,
7143 // with no additional line-height spacing. This allows the item baseline to
7144 // be positioned precisely without worrying about font ascent and
7145 // line-height.
7146
7147
7148 var pstrutSize = 0;
7149 var _iteratorNormalCompletion3 = true;
7150 var _didIteratorError3 = false;
7151 var _iteratorError3 = undefined;
7152
7153 try {
7154 for (var _iterator3 = get_iterator_default()(children), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
7155 var child = _step3.value;
7156
7157 if (child.type === "elem") {
7158 var _elem = child.elem;
7159 pstrutSize = Math.max(pstrutSize, _elem.maxFontSize, _elem.height);
7160 }
7161 }
7162 } catch (err) {
7163 _didIteratorError3 = true;
7164 _iteratorError3 = err;
7165 } finally {
7166 try {
7167 if (!_iteratorNormalCompletion3 && _iterator3.return) {
7168 _iterator3.return();
7169 }
7170 } finally {
7171 if (_didIteratorError3) {
7172 throw _iteratorError3;
7173 }
7174 }
7175 }
7176
7177 pstrutSize += 2;
7178 var pstrut = buildCommon_makeSpan(["pstrut"], []);
7179 pstrut.style.height = pstrutSize + "em";
7180
7181 // Create a new list of actual children at the correct offsets
7182 var realChildren = [];
7183 var minPos = depth;
7184 var maxPos = depth;
7185 var currPos = depth;
7186 var _iteratorNormalCompletion4 = true;
7187 var _didIteratorError4 = false;
7188 var _iteratorError4 = undefined;
7189
7190 try {
7191 for (var _iterator4 = get_iterator_default()(children), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
7192 var _child = _step4.value;
7193
7194 if (_child.type === "kern") {
7195 currPos += _child.size;
7196 } else {
7197 var _elem2 = _child.elem;
7198 var classes = _child.wrapperClasses || [];
7199 var style = _child.wrapperStyle || {};
7200
7201 var childWrap = buildCommon_makeSpan(classes, [pstrut, _elem2], undefined, style);
7202 childWrap.style.top = -pstrutSize - currPos - _elem2.depth + "em";
7203 if (_child.marginLeft) {
7204 childWrap.style.marginLeft = _child.marginLeft;
7205 }
7206 if (_child.marginRight) {
7207 childWrap.style.marginRight = _child.marginRight;
7208 }
7209
7210 realChildren.push(childWrap);
7211 currPos += _elem2.height + _elem2.depth;
7212 }
7213 minPos = Math.min(minPos, currPos);
7214 maxPos = Math.max(maxPos, currPos);
7215 }
7216
7217 // The vlist contents go in a table-cell with `vertical-align:bottom`.
7218 // This cell's bottom edge will determine the containing table's baseline
7219 // without overly expanding the containing line-box.
7220 } catch (err) {
7221 _didIteratorError4 = true;
7222 _iteratorError4 = err;
7223 } finally {
7224 try {
7225 if (!_iteratorNormalCompletion4 && _iterator4.return) {
7226 _iterator4.return();
7227 }
7228 } finally {
7229 if (_didIteratorError4) {
7230 throw _iteratorError4;
7231 }
7232 }
7233 }
7234
7235 var vlist = buildCommon_makeSpan(["vlist"], realChildren);
7236 vlist.style.height = maxPos + "em";
7237
7238 // A second row is used if necessary to represent the vlist's depth.
7239 var rows = void 0;
7240 if (minPos < 0) {
7241 // We will define depth in an empty span with display: table-cell.
7242 // It should render with the height that we define. But Chrome, in
7243 // contenteditable mode only, treats that span as if it contains some
7244 // text content. And that min-height over-rides our desired height.
7245 // So we put another empty span inside the depth strut span.
7246 var emptySpan = buildCommon_makeSpan([], []);
7247 var depthStrut = buildCommon_makeSpan(["vlist"], [emptySpan]);
7248 depthStrut.style.height = -minPos + "em";
7249
7250 // Safari wants the first row to have inline content; otherwise it
7251 // puts the bottom of the *second* row on the baseline.
7252 var topStrut = buildCommon_makeSpan(["vlist-s"], [new domTree.symbolNode("\u200B")]);
7253
7254 rows = [buildCommon_makeSpan(["vlist-r"], [vlist, topStrut]), buildCommon_makeSpan(["vlist-r"], [depthStrut])];
7255 } else {
7256 rows = [buildCommon_makeSpan(["vlist-r"], [vlist])];
7257 }
7258
7259 var vtable = buildCommon_makeSpan(["vlist-t"], rows);
7260 if (rows.length === 2) {
7261 vtable.classes.push("vlist-t2");
7262 }
7263 vtable.height = maxPos;
7264 vtable.depth = -minPos;
7265 return vtable;
7266};
7267
7268// Converts verb group into body string, dealing with \verb* form
7269var makeVerb = function makeVerb(group, options) {
7270 var text = group.value.body;
7271 if (group.value.star) {
7272 text = text.replace(/ /g, "\u2423"); // Open Box
7273 } else {
7274 text = text.replace(/ /g, '\xA0'); // No-Break Space
7275 // (so that, in particular, spaces don't coalesce)
7276 }
7277 return text;
7278};
7279
7280// Glue is a concept from TeX which is a flexible space between elements in
7281// either a vertical or horizontal list. In KaTeX, at least for now, it's
7282// static space between elements in a horizontal layout.
7283var buildCommon_makeGlue = function makeGlue(measurement, options) {
7284 // Make an empty span for the space
7285 var rule = buildCommon_makeSpan(["mspace"], [], options);
7286 var size = units_calculateSize(measurement, options);
7287 rule.style.marginRight = size + "em";
7288 return rule;
7289};
7290
7291// Takes font options, and returns the appropriate fontLookup name
7292var retrieveTextFontName = function retrieveTextFontName(fontFamily, fontWeight, fontShape) {
7293 var baseFontName = "";
7294 switch (fontFamily) {
7295 case "amsrm":
7296 baseFontName = "AMS";
7297 break;
7298 case "textrm":
7299 baseFontName = "Main";
7300 break;
7301 case "textsf":
7302 baseFontName = "SansSerif";
7303 break;
7304 case "texttt":
7305 baseFontName = "Typewriter";
7306 break;
7307 default:
7308 baseFontName = fontFamily; // use fonts added by a plugin
7309 }
7310
7311 var fontStylesName = void 0;
7312 if (fontWeight === "textbf" && fontShape === "textit") {
7313 fontStylesName = "BoldItalic";
7314 } else if (fontWeight === "textbf") {
7315 fontStylesName = "Bold";
7316 } else if (fontWeight === "textit") {
7317 fontStylesName = "Italic";
7318 } else {
7319 fontStylesName = "Regular";
7320 }
7321
7322 return baseFontName + "-" + fontStylesName;
7323};
7324
7325// A map of CSS-based spacing functions to their CSS class.
7326var cssSpace = {
7327 "\\nobreak": "nobreak",
7328 "\\allowbreak": "allowbreak"
7329};
7330
7331// A lookup table to determine whether a spacing function/symbol should be
7332// treated like a regular space character. If a symbol or command is a key
7333// in this table, then it should be a regular space character. Furthermore,
7334// the associated value may have a `className` specifying an extra CSS class
7335// to add to the created `span`.
7336var regularSpace = {
7337 " ": {},
7338 "\\ ": {},
7339 "~": {
7340 className: "nobreak"
7341 },
7342 "\\space": {},
7343 "\\nobreakspace": {
7344 className: "nobreak"
7345 }
7346};
7347
7348/**
7349 * Maps TeX font commands to objects containing:
7350 * - variant: string used for "mathvariant" attribute in buildMathML.js
7351 * - fontName: the "style" parameter to fontMetrics.getCharacterMetrics
7352 */
7353// A map between tex font commands an MathML mathvariant attribute values
7354var fontMap = {
7355 // styles
7356 "mathbf": {
7357 variant: "bold",
7358 fontName: "Main-Bold"
7359 },
7360 "mathrm": {
7361 variant: "normal",
7362 fontName: "Main-Regular"
7363 },
7364 "textit": {
7365 variant: "italic",
7366 fontName: "Main-Italic"
7367 },
7368
7369 // "mathit" and "boldsymbol" are missing because they require the use of two
7370 // fonts: Main-Italic and Math-Italic for "mathit", and Math-BoldItalic and
7371 // Main-Bold for "boldsymbol". This is handled by a special case in makeOrd
7372 // which ends up calling mathit and boldsymbol.
7373
7374 // families
7375 "mathbb": {
7376 variant: "double-struck",
7377 fontName: "AMS-Regular"
7378 },
7379 "mathcal": {
7380 variant: "script",
7381 fontName: "Caligraphic-Regular"
7382 },
7383 "mathfrak": {
7384 variant: "fraktur",
7385 fontName: "Fraktur-Regular"
7386 },
7387 "mathscr": {
7388 variant: "script",
7389 fontName: "Script-Regular"
7390 },
7391 "mathsf": {
7392 variant: "sans-serif",
7393 fontName: "SansSerif-Regular"
7394 },
7395 "mathtt": {
7396 variant: "monospace",
7397 fontName: "Typewriter-Regular"
7398 }
7399};
7400
7401var svgData = {
7402 // path, width, height
7403 vec: ["vec", 0.471, 0.714] // values from the font glyph
7404};
7405
7406var buildCommon_staticSvg = function staticSvg(value, options) {
7407 // Create a span with inline SVG for the element.
7408 var _svgData$value = slicedToArray_default()(svgData[value], 3),
7409 pathName = _svgData$value[0],
7410 width = _svgData$value[1],
7411 height = _svgData$value[2];
7412
7413 var path = new domTree.pathNode(pathName);
7414 var svgNode = new domTree.svgNode([path], {
7415 "width": width + "em",
7416 "height": height + "em",
7417 // Override CSS rule `.katex svg { width: 100% }`
7418 "style": "width:" + width + "em",
7419 "viewBox": "0 0 " + 1000 * width + " " + 1000 * height,
7420 "preserveAspectRatio": "xMinYMin"
7421 });
7422 var span = buildCommon_makeSvgSpan(["overlay"], [svgNode], options);
7423 span.height = height;
7424 span.style.height = height + "em";
7425 span.style.width = width + "em";
7426 return span;
7427};
7428
7429/* harmony default export */ var buildCommon = ({
7430 fontMap: fontMap,
7431 makeSymbol: buildCommon_makeSymbol,
7432 mathsym: buildCommon_mathsym,
7433 makeSpan: buildCommon_makeSpan,
7434 makeSvgSpan: buildCommon_makeSvgSpan,
7435 makeLineSpan: makeLineSpan,
7436 makeAnchor: buildCommon_makeAnchor,
7437 makeFragment: buildCommon_makeFragment,
7438 makeVList: buildCommon_makeVList,
7439 makeOrd: buildCommon_makeOrd,
7440 makeVerb: makeVerb,
7441 makeGlue: buildCommon_makeGlue,
7442 staticSvg: buildCommon_staticSvg,
7443 svgData: svgData,
7444 tryCombineChars: tryCombineChars,
7445 cssSpace: cssSpace,
7446 regularSpace: regularSpace
7447});
7448// CONCATENATED MODULE: ./src/ParseNode.js
7449
7450
7451
7452
7453/**
7454 * The resulting parse tree nodes of the parse tree.
7455 *
7456 * It is possible to provide position information, so that a `ParseNode` can
7457 * fulfill a role similar to a `Token` in error reporting.
7458 * For details on the corresponding properties see `Token` constructor.
7459 * Providing such information can lead to better error reporting.
7460 */
7461var ParseNode_ParseNode = function ParseNode(type, // type of node, like e.g. "ordgroup"
7462value, // type-specific representation of the node
7463mode, // parse mode in action for this node, "math" or "text"
7464first, // first token or node of the input for
7465last) // last token or node of the input for this
7466// node, will default to firstToken if unset
7467{
7468 classCallCheck_default()(this, ParseNode);
7469
7470 this.type = type;
7471 this.value = value;
7472 this.mode = mode;
7473 this.loc = src_SourceLocation.range(first, last);
7474};
7475
7476/* harmony default export */ var src_ParseNode = (ParseNode_ParseNode);
7477
7478// ParseNode's corresponding to Symbol `Group`s in symbols.js.
7479
7480
7481// Union of all possible `ParseNode<>` types.
7482// Unable to derive this directly from `ParseNodeTypes` due to
7483// https://github.com/facebook/flow/issues/6369.
7484// Cannot use `ParseNode<NodeType>` since `ParseNode` is not strictly co-variant
7485// w.r.t. its type parameter due to the way the value type is computed.
7486
7487
7488// Map from `type` field value to corresponding `value` type.
7489
7490/**
7491 * Asserts that the node is of the given type and returns it with stricter
7492 * typing. Throws if the node's type does not match.
7493 */
7494function assertNodeType(node, type) {
7495 var typedNode = checkNodeType(node, type);
7496 if (!typedNode) {
7497 throw new Error("Expected node of type " + type + ", but got " + (node ? "node of type " + node.type : String(node)));
7498 }
7499 return typedNode;
7500}
7501
7502/**
7503 * Returns the node more strictly typed iff it is of the given type. Otherwise,
7504 * returns null.
7505 */
7506function checkNodeType(node, type) {
7507 if (node && node.type === type) {
7508 // $FlowFixMe: Inference not sophisticated enough to figure this out.
7509 return node;
7510 }
7511 return null;
7512}
7513
7514/**
7515 * Returns the node more strictly typed iff it is of the given type. Otherwise,
7516 * returns null.
7517 */
7518function assertSymbolNodeType(node) {
7519 var typedNode = checkSymbolNodeType(node);
7520 if (!typedNode) {
7521 throw new Error("Expected node of symbol group type, but got " + (node ? "node of type " + node.type : String(node)));
7522 }
7523 return typedNode;
7524}
7525
7526/**
7527 * Returns the node more strictly typed iff it is of the given type. Otherwise,
7528 * returns null.
7529 */
7530function checkSymbolNodeType(node) {
7531 if (node && GROUPS.hasOwnProperty(node.type)) {
7532 // $FlowFixMe
7533 return node;
7534 }
7535 return null;
7536}
7537// CONCATENATED MODULE: ./src/spacingData.js
7538
7539
7540var thinspace = {
7541 number: 3,
7542 unit: "mu"
7543};
7544/**
7545 * Describes spaces between different classes of atoms.
7546 */
7547
7548var mediumspace = {
7549 number: 4,
7550 unit: "mu"
7551};
7552var thickspace = {
7553 number: 5,
7554 unit: "mu"
7555};
7556
7557// Making the type below exact with all optional fields doesn't work due to
7558// - https://github.com/facebook/flow/issues/4582
7559// - https://github.com/facebook/flow/issues/5688
7560// However, since *all* fields are optional, $Shape<> works as suggested in 5688
7561// above.
7562
7563
7564// Spacing relationships for display and text styles
7565var spacings = {
7566 mord: {
7567 mop: thinspace,
7568 mbin: mediumspace,
7569 mrel: thickspace,
7570 minner: thinspace
7571 },
7572 mop: {
7573 mord: thinspace,
7574 mop: thinspace,
7575 mrel: thickspace,
7576 minner: thinspace
7577 },
7578 mbin: {
7579 mord: mediumspace,
7580 mop: mediumspace,
7581 mopen: mediumspace,
7582 minner: mediumspace
7583 },
7584 mrel: {
7585 mord: thickspace,
7586 mop: thickspace,
7587 mopen: thickspace,
7588 minner: thickspace
7589 },
7590 mopen: {},
7591 mclose: {
7592 mop: thinspace,
7593 mbin: mediumspace,
7594 mrel: thickspace,
7595 minner: thinspace
7596 },
7597 mpunct: {
7598 mord: thinspace,
7599 mop: thinspace,
7600 mrel: thickspace,
7601 mopen: thinspace,
7602 mclose: thinspace,
7603 mpunct: thinspace,
7604 minner: thinspace
7605 },
7606 minner: {
7607 mord: thinspace,
7608 mop: thinspace,
7609 mbin: mediumspace,
7610 mrel: thickspace,
7611 mopen: thinspace,
7612 mpunct: thinspace,
7613 minner: thinspace
7614 }
7615};
7616
7617// Spacing relationships for script and scriptscript styles
7618var tightSpacings = {
7619 mord: {
7620 mop: thinspace
7621 },
7622 mop: {
7623 mord: thinspace,
7624 mop: thinspace
7625 },
7626 mbin: {},
7627 mrel: {},
7628 mopen: {},
7629 mclose: {
7630 mop: thinspace
7631 },
7632 mpunct: {},
7633 minner: {
7634 mop: thinspace
7635 }
7636};
7637// CONCATENATED MODULE: ./src/defineFunction.js
7638
7639
7640
7641/** Context provided to function handlers for error messages. */
7642
7643
7644// More general version of `HtmlBuilder` for nodes (e.g. \sum, accent types)
7645// whose presence impacts super/subscripting. In this case, ParseNode<"supsub">
7646// delegates its HTML building to the HtmlBuilder corresponding to these nodes.
7647
7648
7649/**
7650 * Final function spec for use at parse time.
7651 * This is almost identical to `FunctionPropSpec`, except it
7652 * 1. includes the function handler, and
7653 * 2. requires all arguments except argTypes.
7654 * It is generated by `defineFunction()` below.
7655 */
7656
7657
7658/**
7659 * All registered functions.
7660 * `functions.js` just exports this same dictionary again and makes it public.
7661 * `Parser.js` requires this dictionary.
7662 */
7663var _functions = {};
7664
7665/**
7666 * All HTML builders. Should be only used in the `define*` and the `build*ML`
7667 * functions.
7668 */
7669var _htmlGroupBuilders = {};
7670
7671/**
7672 * All MathML builders. Should be only used in the `define*` and the `build*ML`
7673 * functions.
7674 */
7675var _mathmlGroupBuilders = {};
7676
7677function defineFunction(_ref) {
7678 var type = _ref.type,
7679 nodeType = _ref.nodeType,
7680 names = _ref.names,
7681 props = _ref.props,
7682 handler = _ref.handler,
7683 htmlBuilder = _ref.htmlBuilder,
7684 mathmlBuilder = _ref.mathmlBuilder;
7685
7686 // Set default values of functions
7687 var data = {
7688 type: type,
7689 numArgs: props.numArgs,
7690 argTypes: props.argTypes,
7691 greediness: props.greediness === undefined ? 1 : props.greediness,
7692 allowedInText: !!props.allowedInText,
7693 allowedInMath: props.allowedInMath === undefined ? true : props.allowedInMath,
7694 numOptionalArgs: props.numOptionalArgs || 0,
7695 infix: !!props.infix,
7696 consumeMode: props.consumeMode,
7697 handler: handler
7698 };
7699 for (var i = 0; i < names.length; ++i) {
7700 // TODO: The value type of _functions should be a type union of all
7701 // possible `FunctionSpec<>` possibilities instead of `FunctionSpec<*>`,
7702 // which is an existential type.
7703 // $FlowFixMe
7704 _functions[names[i]] = data;
7705 }
7706 if (type) {
7707 if (htmlBuilder) {
7708 _htmlGroupBuilders[type] = htmlBuilder;
7709 }
7710 if (mathmlBuilder) {
7711 _mathmlGroupBuilders[type] = mathmlBuilder;
7712 }
7713 }
7714}
7715
7716/**
7717 * Use this to register only the HTML and MathML builders for a function (e.g.
7718 * if the function's ParseNode is generated in Parser.js rather than via a
7719 * stand-alone handler provided to `defineFunction`).
7720 */
7721function defineFunctionBuilders(_ref2) {
7722 var type = _ref2.type,
7723 htmlBuilder = _ref2.htmlBuilder,
7724 mathmlBuilder = _ref2.mathmlBuilder;
7725
7726 defineFunction({
7727 type: type,
7728 names: [],
7729 props: { numArgs: 0 },
7730 handler: function handler() {
7731 throw new Error('Should never be called.');
7732 },
7733
7734 htmlBuilder: htmlBuilder,
7735 mathmlBuilder: mathmlBuilder
7736 });
7737}
7738
7739// Since the corresponding buildHTML/buildMathML function expects a
7740// list of elements, we normalize for different kinds of arguments
7741var defineFunction_ordargument = function ordargument(arg) {
7742 var node = checkNodeType(arg, "ordgroup");
7743 return node ? node.value : [arg];
7744};
7745// CONCATENATED MODULE: ./src/buildHTML.js
7746
7747
7748
7749/**
7750 * This file does the main work of building a domTree structure from a parse
7751 * tree. The entry point is the `buildHTML` function, which takes a parse tree.
7752 * Then, the buildExpression, buildGroup, and various groupBuilders functions
7753 * are called, to produce a final HTML tree.
7754 */
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765var buildHTML_makeSpan = buildCommon.makeSpan;
7766
7767// Binary atoms (first class `mbin`) change into ordinary atoms (`mord`)
7768// depending on their surroundings. See TeXbook pg. 442-446, Rules 5 and 6,
7769// and the text before Rule 19.
7770var buildHTML_isBinLeftCanceller = function isBinLeftCanceller(node, isRealGroup) {
7771 // TODO: This code assumes that a node's math class is the first element
7772 // of its `classes` array. A later cleanup should ensure this, for
7773 // instance by changing the signature of `makeSpan`.
7774 if (node) {
7775 return utils.contains(["mbin", "mopen", "mrel", "mop", "mpunct"], getTypeOfDomTree(node, "right"));
7776 } else {
7777 return isRealGroup;
7778 }
7779};
7780
7781var buildHTML_isBinRightCanceller = function isBinRightCanceller(node, isRealGroup) {
7782 if (node) {
7783 return utils.contains(["mrel", "mclose", "mpunct"], getTypeOfDomTree(node, "left"));
7784 } else {
7785 return isRealGroup;
7786 }
7787};
7788
7789var buildHTML_styleMap = {
7790 "display": src_Style.DISPLAY,
7791 "text": src_Style.TEXT,
7792 "script": src_Style.SCRIPT,
7793 "scriptscript": src_Style.SCRIPTSCRIPT
7794};
7795
7796var DomEnum = {
7797 mord: "mord",
7798 mop: "mop",
7799 mbin: "mbin",
7800 mrel: "mrel",
7801 mopen: "mopen",
7802 mclose: "mclose",
7803 mpunct: "mpunct",
7804 minner: "minner"
7805};
7806
7807
7808/**
7809 * Take a list of nodes, build them in order, and return a list of the built
7810 * nodes. documentFragments are flattened into their contents, so the
7811 * returned list contains no fragments. `isRealGroup` is true if `expression`
7812 * is a real group (no atoms will be added on either side), as opposed to
7813 * a partial group (e.g. one created by \color). `surrounding` is an array
7814 * consisting type of nodes that will be added to the left and right.
7815 */
7816var buildHTML_buildExpression = function buildExpression(expression, options, isRealGroup) {
7817 var surrounding = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [null, null];
7818
7819 // Parse expressions into `groups`.
7820 var rawGroups = [];
7821 for (var i = 0; i < expression.length; i++) {
7822 var output = buildHTML_buildGroup(expression[i], options);
7823 if (output instanceof domTree.documentFragment) {
7824 var children = output.children;
7825 rawGroups.push.apply(rawGroups, toConsumableArray_default()(children));
7826 } else {
7827 rawGroups.push(output);
7828 }
7829 }
7830 // At this point `rawGroups` consists entirely of `symbolNode`s and `span`s.
7831
7832 // Ignore explicit spaces (e.g., \;, \,) when determining what implicit
7833 // spacing should go between atoms of different classes, and add dummy
7834 // spans for determining spacings between surrounding atoms.
7835 var nonSpaces = [surrounding[0] ? buildHTML_makeSpan([surrounding[0]], [], options) : null].concat(toConsumableArray_default()(rawGroups.filter(function (group) {
7836 return group && group.classes[0] !== "mspace";
7837 })), [surrounding[1] ? buildHTML_makeSpan([surrounding[1]], [], options) : null]);
7838
7839 // Before determining what spaces to insert, perform bin cancellation.
7840 // Binary operators change to ordinary symbols in some contexts.
7841 for (var _i = 1; _i < nonSpaces.length - 1; _i++) {
7842 var nonSpacesI = assert(nonSpaces[_i]);
7843 var left = buildHTML_getOutermostNode(nonSpacesI, "left");
7844 if (left.classes[0] === "mbin" && buildHTML_isBinLeftCanceller(nonSpaces[_i - 1], isRealGroup)) {
7845 left.classes[0] = "mord";
7846 }
7847
7848 var right = buildHTML_getOutermostNode(nonSpacesI, "right");
7849 if (right.classes[0] === "mbin" && buildHTML_isBinRightCanceller(nonSpaces[_i + 1], isRealGroup)) {
7850 right.classes[0] = "mord";
7851 }
7852 }
7853
7854 var groups = [];
7855 var j = 0;
7856 for (var _i2 = 0; _i2 < rawGroups.length; _i2++) {
7857 groups.push(rawGroups[_i2]);
7858
7859 // For any group that is not a space, get the next non-space. Then
7860 // lookup what implicit space should be placed between those atoms and
7861 // add it to groups.
7862 if (rawGroups[_i2].classes[0] !== "mspace" && j < nonSpaces.length - 1) {
7863 // if current non-space node is left dummy span, add a glue before
7864 // first real non-space node
7865 if (j === 0) {
7866 groups.pop();
7867 _i2--;
7868 }
7869
7870 // Get the type of the current non-space node. If it's a document
7871 // fragment, get the type of the rightmost node in the fragment.
7872 var _left = getTypeOfDomTree(nonSpaces[j], "right");
7873
7874 // Get the type of the next non-space node. If it's a document
7875 // fragment, get the type of the leftmost node in the fragment.
7876 var _right = getTypeOfDomTree(nonSpaces[j + 1], "left");
7877
7878 // We use buildExpression inside of sizingGroup, but it returns a
7879 // document fragment of elements. sizingGroup sets `isRealGroup`
7880 // to false to avoid processing spans multiple times.
7881 if (_left && _right && isRealGroup) {
7882 var nonSpacesJp1 = assert(nonSpaces[j + 1]);
7883 var space = isLeftTight(nonSpacesJp1) ? tightSpacings[_left][_right] : spacings[_left][_right];
7884
7885 if (space) {
7886 var glueOptions = options;
7887
7888 if (expression.length === 1) {
7889 var node = checkNodeType(expression[0], "sizing") || checkNodeType(expression[0], "styling");
7890 if (!node) {
7891 // No match.
7892 } else if (node.type === "sizing") {
7893 glueOptions = options.havingSize(node.value.size);
7894 } else if (node.type === "styling") {
7895 glueOptions = options.havingStyle(buildHTML_styleMap[node.value.style]);
7896 }
7897 }
7898
7899 groups.push(buildCommon.makeGlue(space, glueOptions));
7900 }
7901 }
7902 j++;
7903 }
7904 }
7905
7906 // Process \\not commands within the group.
7907 for (var _i3 = 0; _i3 < groups.length; _i3++) {
7908 var group = groups[_i3];
7909 if (group instanceof domTree.symbolNode && group.value === "\u0338") {
7910 group.style.position = "absolute";
7911 // TODO(kevinb) fix this for Safari by switching to a non-combining
7912 // character for \not.
7913 // This value was determined empirically.
7914 // TODO(kevinb) figure out the real math for this value.
7915 group.style.paddingLeft = "0.8em";
7916 }
7917 }
7918
7919 return groups;
7920};
7921
7922// Return the outermost node of a domTree.
7923var buildHTML_getOutermostNode = function getOutermostNode(node, side) {
7924 if (node instanceof domTree.documentFragment || node instanceof domTree.anchor) {
7925 var children = node.children;
7926 if (children.length) {
7927 if (side === "right") {
7928 return getOutermostNode(children[children.length - 1], "right");
7929 } else if (side === "left") {
7930 return getOutermostNode(children[0], "right");
7931 }
7932 }
7933 }
7934 return node;
7935};
7936
7937// Return math atom class (mclass) of a domTree.
7938var getTypeOfDomTree = function getTypeOfDomTree(node, side) {
7939 if (!node) {
7940 return null;
7941 }
7942
7943 node = buildHTML_getOutermostNode(node, side);
7944 // This makes a lot of assumptions as to where the type of atom
7945 // appears. We should do a better job of enforcing this.
7946 return DomEnum[node.classes[0]] || null;
7947};
7948
7949// If `node` is an atom return whether it's been assigned the mtight class.
7950// If `node` is a document fragment, return the value of isLeftTight() for the
7951// leftmost node in the fragment.
7952// 'mtight' indicates that the node is script or scriptscript style.
7953var isLeftTight = function isLeftTight(node) {
7954 node = buildHTML_getOutermostNode(node, "left");
7955 return node.hasClass("mtight");
7956};
7957
7958var makeNullDelimiter = function makeNullDelimiter(options, classes) {
7959 var moreClasses = ["nulldelimiter"].concat(options.baseSizingClasses());
7960 return buildHTML_makeSpan(classes.concat(moreClasses));
7961};
7962
7963/**
7964 * buildGroup is the function that takes a group and calls the correct groupType
7965 * function for it. It also handles the interaction of size and style changes
7966 * between parents and children.
7967 */
7968var buildHTML_buildGroup = function buildGroup(group, options, baseOptions) {
7969 if (!group) {
7970 return buildHTML_makeSpan();
7971 }
7972
7973 if (_htmlGroupBuilders[group.type]) {
7974 // Call the groupBuilders function
7975 var groupNode = _htmlGroupBuilders[group.type](group, options);
7976
7977 // If the size changed between the parent and the current group, account
7978 // for that size difference.
7979 if (baseOptions && options.size !== baseOptions.size) {
7980 groupNode = buildHTML_makeSpan(options.sizingClasses(baseOptions), [groupNode], options);
7981
7982 var multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier;
7983
7984 groupNode.height *= multiplier;
7985 groupNode.depth *= multiplier;
7986 }
7987
7988 return groupNode;
7989 } else {
7990 throw new src_ParseError("Got group of unknown type: '" + group.type + "'");
7991 }
7992};
7993
7994/**
7995 * Combine an array of HTML DOM nodes (e.g., the output of `buildExpression`)
7996 * into an unbreakable HTML node of class .base, with proper struts to
7997 * guarantee correct vertical extent. `buildHTML` calls this repeatedly to
7998 * make up the entire expression as a sequence of unbreakable units.
7999 */
8000function buildHTMLUnbreakable(children, options) {
8001 // Compute height and depth of this chunk.
8002 var body = buildHTML_makeSpan(["base"], children, options);
8003
8004 // Add strut, which ensures that the top of the HTML element falls at
8005 // the height of the expression, and the bottom of the HTML element
8006 // falls at the depth of the expression.
8007 // We used to have separate top and bottom struts, where the bottom strut
8008 // would like to use `vertical-align: top`, but in IE 9 this lowers the
8009 // baseline of the box to the bottom of this strut (instead of staying in
8010 // the normal place) so we use an absolute value for vertical-align instead.
8011 var strut = buildHTML_makeSpan(["strut"]);
8012 strut.style.height = body.height + body.depth + "em";
8013 strut.style.verticalAlign = -body.depth + "em";
8014 body.children.unshift(strut);
8015
8016 return body;
8017}
8018
8019/**
8020 * Take an entire parse tree, and build it into an appropriate set of HTML
8021 * nodes.
8022 */
8023function buildHTML(tree, options) {
8024 // buildExpression is destructive, so we need to make a clone
8025 // of the incoming tree so that it isn't accidentally changed
8026 tree = JSON.parse(stringify_default()(tree));
8027
8028 // Strip off outer tag wrapper for processing below.
8029 var tag = null;
8030 if (tree.length === 1 && tree[0].type === "tag") {
8031 tag = tree[0].value.tag;
8032 tree = tree[0].value.body;
8033 }
8034
8035 // Build the expression contained in the tree
8036 var expression = buildHTML_buildExpression(tree, options, true);
8037
8038 var children = [];
8039
8040 // Create one base node for each chunk between potential line breaks.
8041 // The TeXBook [p.173] says "A formula will be broken only after a
8042 // relation symbol like $=$ or $<$ or $\rightarrow$, or after a binary
8043 // operation symbol like $+$ or $-$ or $\times$, where the relation or
8044 // binary operation is on the ``outer level'' of the formula (i.e., not
8045 // enclosed in {...} and not part of an \over construction)."
8046
8047 var parts = [];
8048 for (var i = 0; i < expression.length; i++) {
8049 parts.push(expression[i]);
8050 if (expression[i].hasClass("mbin") || expression[i].hasClass("mrel") || expression[i].hasClass("allowbreak")) {
8051 // Put any post-operator glue on same line as operator.
8052 // Watch for \nobreak along the way.
8053 var nobreak = false;
8054 while (i < expression.length - 1 && expression[i + 1].hasClass("mspace")) {
8055 i++;
8056 parts.push(expression[i]);
8057 if (expression[i].hasClass("nobreak")) {
8058 nobreak = true;
8059 }
8060 }
8061 // Don't allow break if \nobreak among the post-operator glue.
8062 if (!nobreak) {
8063 children.push(buildHTMLUnbreakable(parts, options));
8064 parts = [];
8065 }
8066 } else if (expression[i].hasClass("newline")) {
8067 // Write the line except the newline
8068 parts.pop();
8069 if (parts.length > 0) {
8070 children.push(buildHTMLUnbreakable(parts, options));
8071 parts = [];
8072 }
8073 // Put the newline at the top level
8074 children.push(expression[i]);
8075 }
8076 }
8077 if (parts.length > 0) {
8078 children.push(buildHTMLUnbreakable(parts, options));
8079 }
8080
8081 // Now, if there was a tag, build it too and append it as a final child.
8082 var tagChild = void 0;
8083 if (tag) {
8084 tagChild = buildHTMLUnbreakable(buildHTML_buildExpression(tag, options, true));
8085 tagChild.classes = ["tag"];
8086 children.push(tagChild);
8087 }
8088
8089 var htmlNode = buildHTML_makeSpan(["katex-html"], children);
8090 htmlNode.setAttribute("aria-hidden", "true");
8091
8092 // Adjust the strut of the tag to be the maximum height of all children
8093 // (the height of the enclosing htmlNode) for proper vertical alignment.
8094 if (tagChild) {
8095 var strut = tagChild.children[0];
8096 strut.style.height = htmlNode.height + htmlNode.depth + "em";
8097 strut.style.verticalAlign = -htmlNode.depth + "em";
8098 }
8099
8100 return htmlNode;
8101}
8102// CONCATENATED MODULE: ./src/mathMLTree.js
8103
8104
8105
8106
8107/**
8108 * These objects store data about MathML nodes. This is the MathML equivalent
8109 * of the types in domTree.js. Since MathML handles its own rendering, and
8110 * since we're mainly using MathML to improve accessibility, we don't manage
8111 * any of the styling state that the plain DOM nodes do.
8112 *
8113 * The `toNode` and `toMarkup` functions work simlarly to how they do in
8114 * domTree.js, creating namespaced DOM nodes and HTML text markup respectively.
8115 */
8116
8117
8118
8119/**
8120 * MathML node types used in KaTeX. For a complete list of MathML nodes, see
8121 * https://developer.mozilla.org/en-US/docs/Web/MathML/Element.
8122 */
8123
8124
8125/**
8126 * This node represents a general purpose MathML node of any type. The
8127 * constructor requires the type of node to create (for example, `"mo"` or
8128 * `"mspace"`, corresponding to `<mo>` and `<mspace>` tags).
8129 */
8130var mathMLTree_MathNode = function () {
8131 function MathNode(type, children) {
8132 classCallCheck_default()(this, MathNode);
8133
8134 this.type = type;
8135 this.attributes = {};
8136 this.children = children || [];
8137 }
8138
8139 /**
8140 * Sets an attribute on a MathML node. MathML depends on attributes to convey a
8141 * semantic content, so this is used heavily.
8142 */
8143
8144
8145 createClass_default()(MathNode, [{
8146 key: "setAttribute",
8147 value: function setAttribute(name, value) {
8148 this.attributes[name] = value;
8149 }
8150
8151 /**
8152 * Gets an attribute on a MathML node.
8153 */
8154
8155 }, {
8156 key: "getAttribute",
8157 value: function getAttribute(name) {
8158 return this.attributes[name];
8159 }
8160
8161 /**
8162 * Converts the math node into a MathML-namespaced DOM element.
8163 */
8164
8165 }, {
8166 key: "toNode",
8167 value: function toNode() {
8168 var node = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type);
8169
8170 for (var attr in this.attributes) {
8171 if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
8172 node.setAttribute(attr, this.attributes[attr]);
8173 }
8174 }
8175
8176 var _iteratorNormalCompletion = true;
8177 var _didIteratorError = false;
8178 var _iteratorError = undefined;
8179
8180 try {
8181 for (var _iterator = get_iterator_default()(this.children), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
8182 var child = _step.value;
8183
8184 node.appendChild(child.toNode());
8185 }
8186 } catch (err) {
8187 _didIteratorError = true;
8188 _iteratorError = err;
8189 } finally {
8190 try {
8191 if (!_iteratorNormalCompletion && _iterator.return) {
8192 _iterator.return();
8193 }
8194 } finally {
8195 if (_didIteratorError) {
8196 throw _iteratorError;
8197 }
8198 }
8199 }
8200
8201 return node;
8202 }
8203
8204 /**
8205 * Converts the math node into an HTML markup string.
8206 */
8207
8208 }, {
8209 key: "toMarkup",
8210 value: function toMarkup() {
8211 var markup = "<" + this.type;
8212
8213 // Add the attributes
8214 for (var attr in this.attributes) {
8215 if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
8216 markup += " " + attr + "=\"";
8217 markup += utils.escape(this.attributes[attr]);
8218 markup += "\"";
8219 }
8220 }
8221
8222 markup += ">";
8223
8224 for (var i = 0; i < this.children.length; i++) {
8225 markup += this.children[i].toMarkup();
8226 }
8227
8228 markup += "</" + this.type + ">";
8229
8230 return markup;
8231 }
8232
8233 /**
8234 * Converts the math node into a string, similar to innerText, but escaped.
8235 */
8236
8237 }, {
8238 key: "toText",
8239 value: function toText() {
8240 return this.children.map(function (child) {
8241 return child.toText();
8242 }).join("");
8243 }
8244 }]);
8245
8246 return MathNode;
8247}();
8248
8249/**
8250 * This node represents a piece of text.
8251 */
8252var mathMLTree_TextNode = function () {
8253 function TextNode(text) {
8254 var needsEscape = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
8255
8256 classCallCheck_default()(this, TextNode);
8257
8258 this.text = text;
8259 this.needsEscape = needsEscape;
8260 }
8261
8262 /**
8263 * Converts the text node into a DOM text node.
8264 */
8265
8266
8267 createClass_default()(TextNode, [{
8268 key: "toNode",
8269 value: function toNode() {
8270 return document.createTextNode(this.toText());
8271 }
8272
8273 /**
8274 * Converts the text node into escaped HTML markup
8275 * (representing the text itself).
8276 */
8277
8278 }, {
8279 key: "toMarkup",
8280 value: function toMarkup() {
8281 return this.toText();
8282 }
8283
8284 /**
8285 * Converts the text node into an escaped string
8286 * (representing the text iteself).
8287 */
8288
8289 }, {
8290 key: "toText",
8291 value: function toText() {
8292 return this.needsEscape ? utils.escape(this.text) : this.text;
8293 }
8294 }]);
8295
8296 return TextNode;
8297}();
8298
8299/**
8300 * This node represents a space, but may render as <mspace.../> or as text,
8301 * depending on the width.
8302 */
8303
8304var mathMLTree_SpaceNode = function () {
8305
8306 /**
8307 * Create a Space node with width given in CSS ems.
8308 */
8309 function SpaceNode(width) {
8310 classCallCheck_default()(this, SpaceNode);
8311
8312 this.width = width;
8313 // See https://www.w3.org/TR/2000/WD-MathML2-20000328/chapter6.html
8314 // for a table of space-like characters. We consistently use the
8315 // &LongNames; because Unicode does not have single characters for
8316 //    (\u2005\u200a) and all negative spaces.
8317 if (width >= 0.05555 && width <= 0.05556) {
8318 this.character = " "; // \u200a
8319 } else if (width >= 0.1666 && width <= 0.1667) {
8320 this.character = " "; // \u2009
8321 } else if (width >= 0.2222 && width <= 0.2223) {
8322 this.character = " "; // \u2005
8323 } else if (width >= 0.2777 && width <= 0.2778) {
8324 this.character = "  "; // \u2005\u200a
8325 } else if (width >= -0.05556 && width <= -0.05555) {
8326 this.character = "​";
8327 } else if (width >= -0.1667 && width <= -0.1666) {
8328 this.character = "​";
8329 } else if (width >= -0.2223 && width <= -0.2222) {
8330 this.character = "​";
8331 } else if (width >= -0.2778 && width <= -0.2777) {
8332 this.character = "​";
8333 } else {
8334 this.character = null;
8335 }
8336 }
8337
8338 /**
8339 * Converts the math node into a MathML-namespaced DOM element.
8340 */
8341
8342
8343 createClass_default()(SpaceNode, [{
8344 key: "toNode",
8345 value: function toNode() {
8346 if (this.character) {
8347 return document.createTextNode(this.character);
8348 } else {
8349 var node = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mspace");
8350 node.setAttribute("width", this.width + "em");
8351 return node;
8352 }
8353 }
8354
8355 /**
8356 * Converts the math node into an HTML markup string.
8357 */
8358
8359 }, {
8360 key: "toMarkup",
8361 value: function toMarkup() {
8362 if (this.character) {
8363 return "<mtext>" + this.character + "</mtext>";
8364 } else {
8365 return "<mspace width=\"" + this.width + "em\"/>";
8366 }
8367 }
8368
8369 /**
8370 * Converts the math node into a string, similar to innerText.
8371 */
8372
8373 }, {
8374 key: "toText",
8375 value: function toText() {
8376 if (this.character) {
8377 return this.character;
8378 } else {
8379 return " ";
8380 }
8381 }
8382 }]);
8383
8384 return SpaceNode;
8385}();
8386
8387/* harmony default export */ var mathMLTree = ({
8388 MathNode: mathMLTree_MathNode,
8389 TextNode: mathMLTree_TextNode,
8390 SpaceNode: mathMLTree_SpaceNode
8391});
8392// CONCATENATED MODULE: ./src/buildMathML.js
8393
8394/**
8395 * This file converts a parse tree into a cooresponding MathML tree. The main
8396 * entry point is the `buildMathML` function, which takes a parse tree from the
8397 * parser.
8398 */
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408/**
8409 * Takes a symbol and converts it into a MathML text node after performing
8410 * optional replacement from symbols.js.
8411 */
8412var buildMathML_makeText = function makeText(text, mode, options) {
8413 if (src_symbols[mode][text] && src_symbols[mode][text].replace && text.charCodeAt(0) !== 0xD835 && !(ligatures.hasOwnProperty(text) && options && (options.fontFamily && options.fontFamily.substr(4, 2) === "tt" || options.font && options.font.substr(4, 2) === "tt"))) {
8414 text = src_symbols[mode][text].replace;
8415 }
8416
8417 return new mathMLTree.TextNode(text);
8418};
8419
8420/**
8421 * Wrap the given array of nodes in an <mrow> node if needed, i.e.,
8422 * unless the array has length 1. Always returns a single node.
8423 */
8424var buildMathML_makeRow = function makeRow(body) {
8425 if (body.length === 1) {
8426 return body[0];
8427 } else {
8428 return new mathMLTree.MathNode("mrow", body);
8429 }
8430};
8431
8432/**
8433 * Returns the math variant as a string or null if none is required.
8434 */
8435var buildMathML_getVariant = function getVariant(group, options) {
8436 // Handle \text... font specifiers as best we can.
8437 // MathML has a limited list of allowable mathvariant specifiers; see
8438 // https://www.w3.org/TR/MathML3/chapter3.html#presm.commatt
8439 if (options.fontFamily === "texttt") {
8440 return "monospace";
8441 } else if (options.fontFamily === "textsf") {
8442 if (options.fontShape === "textit" && options.fontWeight === "textbf") {
8443 return "sans-serif-bold-italic";
8444 } else if (options.fontShape === "textit") {
8445 return "sans-serif-italic";
8446 } else if (options.fontWeight === "textbf") {
8447 return "bold-sans-serif";
8448 } else {
8449 return "sans-serif";
8450 }
8451 } else if (options.fontShape === "textit" && options.fontWeight === "textbf") {
8452 return "bold-italic";
8453 } else if (options.fontShape === "textit") {
8454 return "italic";
8455 } else if (options.fontWeight === "textbf") {
8456 return "bold";
8457 }
8458
8459 var font = options.font;
8460 if (!font) {
8461 return null;
8462 }
8463
8464 var mode = group.mode;
8465 if (font === "mathit") {
8466 return "italic";
8467 } else if (font === "boldsymbol") {
8468 return "bold-italic";
8469 }
8470
8471 var value = group.value;
8472 if (utils.contains(["\\imath", "\\jmath"], value)) {
8473 return null;
8474 }
8475
8476 if (src_symbols[mode][value] && src_symbols[mode][value].replace) {
8477 value = src_symbols[mode][value].replace;
8478 }
8479
8480 var fontName = buildCommon.fontMap[font].fontName;
8481 if (getCharacterMetrics(value, fontName, mode)) {
8482 return buildCommon.fontMap[font].variant;
8483 }
8484
8485 return null;
8486};
8487
8488/**
8489 * Takes a list of nodes, builds them, and returns a list of the generated
8490 * MathML nodes. Also combine consecutive <mtext> outputs into a single
8491 * <mtext> tag.
8492 */
8493var buildMathML_buildExpression = function buildExpression(expression, options) {
8494 var groups = [];
8495 var lastGroup = void 0;
8496 for (var i = 0; i < expression.length; i++) {
8497 var group = buildMathML_buildGroup(expression[i], options);
8498 // Concatenate adjacent <mtext>s
8499 if (group.type === 'mtext' && lastGroup && lastGroup.type === 'mtext' && group.getAttribute('mathvariant') === lastGroup.getAttribute('mathvariant')) {
8500 var _lastGroup$children;
8501
8502 (_lastGroup$children = lastGroup.children).push.apply(_lastGroup$children, toConsumableArray_default()(group.children));
8503 // Concatenate adjacent <mn>s
8504 } else if (group.type === 'mn' && lastGroup && lastGroup.type === 'mn') {
8505 var _lastGroup$children2;
8506
8507 (_lastGroup$children2 = lastGroup.children).push.apply(_lastGroup$children2, toConsumableArray_default()(group.children));
8508 // Concatenate <mn>...</mn> followed by <mi>.</mi>
8509 } else if (group.type === 'mi' && group.children.length === 1 && group.children[0].text === '.' && lastGroup && lastGroup.type === 'mn') {
8510 var _lastGroup$children3;
8511
8512 (_lastGroup$children3 = lastGroup.children).push.apply(_lastGroup$children3, toConsumableArray_default()(group.children));
8513 } else {
8514 groups.push(group);
8515 lastGroup = group;
8516 }
8517 }
8518
8519 // TODO(kevinb): combine \\not with mrels and mords
8520
8521 return groups;
8522};
8523
8524/**
8525 * Equivalent to buildExpression, but wraps the elements in an <mrow>
8526 * if there's more than one. Returns a single node instead of an array.
8527 */
8528var buildExpressionRow = function buildExpressionRow(expression, options) {
8529 return buildMathML_makeRow(buildMathML_buildExpression(expression, options));
8530};
8531
8532/**
8533 * Takes a group from the parser and calls the appropriate groupBuilders function
8534 * on it to produce a MathML node.
8535 */
8536var buildMathML_buildGroup = function buildGroup(group, options) {
8537 if (!group) {
8538 return new mathMLTree.MathNode("mrow");
8539 }
8540
8541 if (_mathmlGroupBuilders[group.type]) {
8542 // Call the groupBuilders function
8543 var result = _mathmlGroupBuilders[group.type](group, options);
8544 return result;
8545 } else {
8546 throw new src_ParseError("Got group of unknown type: '" + group.type + "'");
8547 }
8548};
8549
8550/**
8551 * Takes a full parse tree and settings and builds a MathML representation of
8552 * it. In particular, we put the elements from building the parse tree into a
8553 * <semantics> tag so we can also include that TeX source as an annotation.
8554 *
8555 * Note that we actually return a domTree element with a `<math>` inside it so
8556 * we can do appropriate styling.
8557 */
8558function buildMathML(tree, texExpression, options) {
8559 var expression = buildMathML_buildExpression(tree, options);
8560
8561 // Wrap up the expression in an mrow so it is presented in the semantics
8562 // tag correctly, unless it's a single <mrow> or <mtable>.
8563 var wrapper = void 0;
8564 if (expression.length === 1 && utils.contains(["mrow", "mtable"], expression[0].type)) {
8565 wrapper = expression[0];
8566 } else {
8567 wrapper = new mathMLTree.MathNode("mrow", expression);
8568 }
8569
8570 // Build a TeX annotation of the source
8571 var annotation = new mathMLTree.MathNode("annotation", [new mathMLTree.TextNode(texExpression)]);
8572
8573 annotation.setAttribute("encoding", "application/x-tex");
8574
8575 var semantics = new mathMLTree.MathNode("semantics", [wrapper, annotation]);
8576
8577 var math = new mathMLTree.MathNode("math", [semantics]);
8578
8579 // You can't style <math> nodes, so we wrap the node in a span.
8580 return buildCommon.makeSpan(["katex-mathml"], [math]);
8581}
8582// CONCATENATED MODULE: ./src/buildTree.js
8583
8584
8585
8586
8587
8588
8589
8590var buildTree_optionsFromSettings = function optionsFromSettings(settings) {
8591 return new src_Options({
8592 style: settings.displayMode ? src_Style.DISPLAY : src_Style.TEXT,
8593 maxSize: settings.maxSize
8594 });
8595};
8596
8597var buildTree_buildTree = function buildTree(tree, expression, settings) {
8598 var options = buildTree_optionsFromSettings(settings);
8599 // `buildHTML` sometimes messes with the parse tree (like turning bins ->
8600 // ords), so we build the MathML version first.
8601 var mathMLNode = buildMathML(tree, expression, options);
8602 var htmlNode = buildHTML(tree, options);
8603
8604 var katexNode = buildCommon.makeSpan(["katex"], [mathMLNode, htmlNode]);
8605
8606 if (settings.displayMode) {
8607 return buildCommon.makeSpan(["katex-display"], [katexNode]);
8608 } else {
8609 return katexNode;
8610 }
8611};
8612
8613var buildTree_buildHTMLTree = function buildHTMLTree(tree, expression, settings) {
8614 var options = buildTree_optionsFromSettings(settings);
8615 var htmlNode = buildHTML(tree, options);
8616 var katexNode = buildCommon.makeSpan(["katex"], [htmlNode]);
8617 if (settings.displayMode) {
8618 return buildCommon.makeSpan(["katex-display"], [katexNode]);
8619 } else {
8620 return katexNode;
8621 }
8622};
8623
8624/* harmony default export */ var src_buildTree = (buildTree_buildTree);
8625// CONCATENATED MODULE: ./src/stretchy.js
8626
8627
8628/**
8629 * This file provides support to buildMathML.js and buildHTML.js
8630 * for stretchy wide elements rendered from SVG files
8631 * and other CSS trickery.
8632 */
8633
8634
8635
8636
8637
8638
8639var stretchyCodePoint = {
8640 widehat: "^",
8641 widecheck: "?",
8642 widetilde: "~",
8643 utilde: "~",
8644 overleftarrow: "\u2190",
8645 underleftarrow: "\u2190",
8646 xleftarrow: "\u2190",
8647 overrightarrow: "\u2192",
8648 underrightarrow: "\u2192",
8649 xrightarrow: "\u2192",
8650 underbrace: "\u23B5",
8651 overbrace: "\u23DE",
8652 overleftrightarrow: "\u2194",
8653 underleftrightarrow: "\u2194",
8654 xleftrightarrow: "\u2194",
8655 Overrightarrow: "\u21D2",
8656 xRightarrow: "\u21D2",
8657 overleftharpoon: "\u21BC",
8658 xleftharpoonup: "\u21BC",
8659 overrightharpoon: "\u21C0",
8660 xrightharpoonup: "\u21C0",
8661 xLeftarrow: "\u21D0",
8662 xLeftrightarrow: "\u21D4",
8663 xhookleftarrow: "\u21A9",
8664 xhookrightarrow: "\u21AA",
8665 xmapsto: "\u21A6",
8666 xrightharpoondown: "\u21C1",
8667 xleftharpoondown: "\u21BD",
8668 xrightleftharpoons: "\u21CC",
8669 xleftrightharpoons: "\u21CB",
8670 xtwoheadleftarrow: "\u219E",
8671 xtwoheadrightarrow: "\u21A0",
8672 xlongequal: "=",
8673 xtofrom: "\u21C4",
8674 xrightleftarrows: "\u21C4",
8675 xrightequilibrium: "\u21CC", // Not a perfect match.
8676 xleftequilibrium: "\u21CB" // None better available.
8677};
8678
8679var stretchy_mathMLnode = function mathMLnode(label) {
8680 var node = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(stretchyCodePoint[label.substr(1)])]);
8681 node.setAttribute("stretchy", "true");
8682 return node;
8683};
8684
8685// Many of the KaTeX SVG images have been adapted from glyphs in KaTeX fonts.
8686// Copyright (c) 2009-2010, Design Science, Inc. (<www.mathjax.org>)
8687// Copyright (c) 2014-2017 Khan Academy (<www.khanacademy.org>)
8688// Licensed under the SIL Open Font License, Version 1.1.
8689// See \nhttp://scripts.sil.org/OFL
8690
8691// Very Long SVGs
8692// Many of the KaTeX stretchy wide elements use a long SVG image and an
8693// overflow: hidden tactic to achieve a stretchy image while avoiding
8694// distortion of arrowheads or brace corners.
8695
8696// The SVG typically contains a very long (400 em) arrow.
8697
8698// The SVG is in a container span that has overflow: hidden, so the span
8699// acts like a window that exposes only part of the SVG.
8700
8701// The SVG always has a longer, thinner aspect ratio than the container span.
8702// After the SVG fills 100% of the height of the container span,
8703// there is a long arrow shaft left over. That left-over shaft is not shown.
8704// Instead, it is sliced off because the span's CSS has overflow: hidden.
8705
8706// Thus, the reader sees an arrow that matches the subject matter width
8707// without distortion.
8708
8709// Some functions, such as \cancel, need to vary their aspect ratio. These
8710// functions do not get the overflow SVG treatment.
8711
8712// Second Brush Stroke
8713// Low resolution monitors struggle to display images in fine detail.
8714// So browsers apply anti-aliasing. A long straight arrow shaft therefore
8715// will sometimes appear as if it has a blurred edge.
8716
8717// To mitigate this, these SVG files contain a second "brush-stroke" on the
8718// arrow shafts. That is, a second long thin rectangular SVG path has been
8719// written directly on top of each arrow shaft. This reinforcement causes
8720// some of the screen pixels to display as black instead of the anti-aliased
8721// gray pixel that a single path would generate. So we get arrow shafts
8722// whose edges appear to be sharper.
8723
8724// In the katexImagesData object just below, the dimensions all
8725// correspond to path geometry inside the relevant SVG.
8726// For example, \overrightarrow uses the same arrowhead as glyph U+2192
8727// from the KaTeX Main font. The scaling factor is 1000.
8728// That is, inside the font, that arrowhead is 522 units tall, which
8729// corresponds to 0.522 em inside the document.
8730
8731var katexImagesData = {
8732 // path(s), minWidth, height, align
8733 overrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
8734 overleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
8735 underrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
8736 underleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
8737 xrightarrow: [["rightarrow"], 1.469, 522, "xMaxYMin"],
8738 xleftarrow: [["leftarrow"], 1.469, 522, "xMinYMin"],
8739 Overrightarrow: [["doublerightarrow"], 0.888, 560, "xMaxYMin"],
8740 xRightarrow: [["doublerightarrow"], 1.526, 560, "xMaxYMin"],
8741 xLeftarrow: [["doubleleftarrow"], 1.526, 560, "xMinYMin"],
8742 overleftharpoon: [["leftharpoon"], 0.888, 522, "xMinYMin"],
8743 xleftharpoonup: [["leftharpoon"], 0.888, 522, "xMinYMin"],
8744 xleftharpoondown: [["leftharpoondown"], 0.888, 522, "xMinYMin"],
8745 overrightharpoon: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
8746 xrightharpoonup: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
8747 xrightharpoondown: [["rightharpoondown"], 0.888, 522, "xMaxYMin"],
8748 xlongequal: [["longequal"], 0.888, 334, "xMinYMin"],
8749 xtwoheadleftarrow: [["twoheadleftarrow"], 0.888, 334, "xMinYMin"],
8750 xtwoheadrightarrow: [["twoheadrightarrow"], 0.888, 334, "xMaxYMin"],
8751
8752 overleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522],
8753 overbrace: [["leftbrace", "midbrace", "rightbrace"], 1.6, 548],
8754 underbrace: [["leftbraceunder", "midbraceunder", "rightbraceunder"], 1.6, 548],
8755 underleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522],
8756 xleftrightarrow: [["leftarrow", "rightarrow"], 1.75, 522],
8757 xLeftrightarrow: [["doubleleftarrow", "doublerightarrow"], 1.75, 560],
8758 xrightleftharpoons: [["leftharpoondownplus", "rightharpoonplus"], 1.75, 716],
8759 xleftrightharpoons: [["leftharpoonplus", "rightharpoondownplus"], 1.75, 716],
8760 xhookleftarrow: [["leftarrow", "righthook"], 1.08, 522],
8761 xhookrightarrow: [["lefthook", "rightarrow"], 1.08, 522],
8762 overlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522],
8763 underlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522],
8764 overgroup: [["leftgroup", "rightgroup"], 0.888, 342],
8765 undergroup: [["leftgroupunder", "rightgroupunder"], 0.888, 342],
8766 xmapsto: [["leftmapsto", "rightarrow"], 1.5, 522],
8767 xtofrom: [["leftToFrom", "rightToFrom"], 1.75, 528],
8768
8769 // The next three arrows are from the mhchem package.
8770 // In mhchem.sty, min-length is 2.0em. But these arrows might appear in the
8771 // document as \xrightarrow or \xrightleftharpoons. Those have
8772 // min-length = 1.75em, so we set min-length on these next three to match.
8773 xrightleftarrows: [["baraboveleftarrow", "rightarrowabovebar"], 1.75, 667],
8774 xrightequilibrium: [["baraboveshortleftharpoon", "rightharpoonaboveshortbar"], 1.75, 716],
8775 xleftequilibrium: [["shortbaraboveleftharpoon", "shortrightharpoonabovebar"], 1.75, 716]
8776};
8777
8778var groupLength = function groupLength(arg) {
8779 if (arg.type === "ordgroup") {
8780 return arg.value.length;
8781 } else {
8782 return 1;
8783 }
8784};
8785
8786var stretchy_svgSpan = function svgSpan(group, options) {
8787 // Create a span with inline SVG for the element.
8788 function buildSvgSpan_() {
8789 var viewBoxWidth = 400000; // default
8790 var label = group.value.label.substr(1);
8791 if (utils.contains(["widehat", "widecheck", "widetilde", "utilde"], label)) {
8792 // Each type in the `if` statement corresponds to one of the ParseNode
8793 // types below. This narrowing is required to access `grp.value.base`.
8794 var grp = group;
8795 // There are four SVG images available for each function.
8796 // Choose a taller image when there are more characters.
8797 var numChars = groupLength(grp.value.base);
8798 var viewBoxHeight = void 0;
8799 var pathName = void 0;
8800 var _height = void 0;
8801
8802 if (numChars > 5) {
8803 if (label === "widehat" || label === "widecheck") {
8804 viewBoxHeight = 420;
8805 viewBoxWidth = 2364;
8806 _height = 0.42;
8807 pathName = label + "4";
8808 } else {
8809 viewBoxHeight = 312;
8810 viewBoxWidth = 2340;
8811 _height = 0.34;
8812 pathName = "tilde4";
8813 }
8814 } else {
8815 var imgIndex = [1, 1, 2, 2, 3, 3][numChars];
8816 if (label === "widehat" || label === "widecheck") {
8817 viewBoxWidth = [0, 1062, 2364, 2364, 2364][imgIndex];
8818 viewBoxHeight = [0, 239, 300, 360, 420][imgIndex];
8819 _height = [0, 0.24, 0.3, 0.3, 0.36, 0.42][imgIndex];
8820 pathName = label + imgIndex;
8821 } else {
8822 viewBoxWidth = [0, 600, 1033, 2339, 2340][imgIndex];
8823 viewBoxHeight = [0, 260, 286, 306, 312][imgIndex];
8824 _height = [0, 0.26, 0.286, 0.3, 0.306, 0.34][imgIndex];
8825 pathName = "tilde" + imgIndex;
8826 }
8827 }
8828 var path = new domTree.pathNode(pathName);
8829 var svgNode = new domTree.svgNode([path], {
8830 "width": "100%",
8831 "height": _height + "em",
8832 "viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight,
8833 "preserveAspectRatio": "none"
8834 });
8835 return {
8836 span: buildCommon.makeSvgSpan([], [svgNode], options),
8837 minWidth: 0,
8838 height: _height
8839 };
8840 } else {
8841 var spans = [];
8842
8843 var data = katexImagesData[label];
8844
8845 var _data = slicedToArray_default()(data, 3),
8846 paths = _data[0],
8847 _minWidth = _data[1],
8848 _viewBoxHeight = _data[2];
8849
8850 var _height2 = _viewBoxHeight / 1000;
8851
8852 var numSvgChildren = paths.length;
8853 var widthClasses = void 0;
8854 var aligns = void 0;
8855 if (numSvgChildren === 1) {
8856 // $FlowFixMe: All these cases must be of the 4-tuple type.
8857 var align1 = data[3];
8858 widthClasses = ["hide-tail"];
8859 aligns = [align1];
8860 } else if (numSvgChildren === 2) {
8861 widthClasses = ["halfarrow-left", "halfarrow-right"];
8862 aligns = ["xMinYMin", "xMaxYMin"];
8863 } else if (numSvgChildren === 3) {
8864 widthClasses = ["brace-left", "brace-center", "brace-right"];
8865 aligns = ["xMinYMin", "xMidYMin", "xMaxYMin"];
8866 } else {
8867 throw new Error("Correct katexImagesData or update code here to support\n " + numSvgChildren + " children.");
8868 }
8869
8870 for (var i = 0; i < numSvgChildren; i++) {
8871 var _path = new domTree.pathNode(paths[i]);
8872
8873 var _svgNode = new domTree.svgNode([_path], {
8874 "width": "400em",
8875 "height": _height2 + "em",
8876 "viewBox": "0 0 " + viewBoxWidth + " " + _viewBoxHeight,
8877 "preserveAspectRatio": aligns[i] + " slice"
8878 });
8879
8880 var _span = buildCommon.makeSvgSpan([widthClasses[i]], [_svgNode], options);
8881 if (numSvgChildren === 1) {
8882 return { span: _span, minWidth: _minWidth, height: _height2 };
8883 } else {
8884 _span.style.height = _height2 + "em";
8885 spans.push(_span);
8886 }
8887 }
8888
8889 return {
8890 span: buildCommon.makeSpan(["stretchy"], spans, options),
8891 minWidth: _minWidth,
8892 height: _height2
8893 };
8894 }
8895 } // buildSvgSpan_()
8896
8897 var _buildSvgSpan_ = buildSvgSpan_(),
8898 span = _buildSvgSpan_.span,
8899 minWidth = _buildSvgSpan_.minWidth,
8900 height = _buildSvgSpan_.height;
8901
8902 // Note that we are returning span.depth = 0.
8903 // Any adjustments relative to the baseline must be done in buildHTML.
8904
8905
8906 span.height = height;
8907 span.style.height = height + "em";
8908 if (minWidth > 0) {
8909 span.style.minWidth = minWidth + "em";
8910 }
8911
8912 return span;
8913};
8914
8915var stretchy_encloseSpan = function encloseSpan(inner, label, pad, options) {
8916 // Return an image span for \cancel, \bcancel, \xcancel, or \fbox
8917 var img = void 0;
8918 var totalHeight = inner.height + inner.depth + 2 * pad;
8919
8920 if (/fbox|color/.test(label)) {
8921 img = buildCommon.makeSpan(["stretchy", label], [], options);
8922
8923 if (label === "fbox") {
8924 var color = options.color && options.getColor();
8925 if (color) {
8926 img.style.borderColor = color;
8927 }
8928 }
8929 } else {
8930 // \cancel, \bcancel, or \xcancel
8931 // Since \cancel's SVG is inline and it omits the viewBox attribute,
8932 // its stroke-width will not vary with span area.
8933
8934 var lines = [];
8935 if (/^[bx]cancel$/.test(label)) {
8936 lines.push(new domTree.lineNode({
8937 "x1": "0",
8938 "y1": "0",
8939 "x2": "100%",
8940 "y2": "100%",
8941 "stroke-width": "0.046em"
8942 }));
8943 }
8944
8945 if (/^x?cancel$/.test(label)) {
8946 lines.push(new domTree.lineNode({
8947 "x1": "0",
8948 "y1": "100%",
8949 "x2": "100%",
8950 "y2": "0",
8951 "stroke-width": "0.046em"
8952 }));
8953 }
8954
8955 var svgNode = new domTree.svgNode(lines, {
8956 "width": "100%",
8957 "height": totalHeight + "em"
8958 });
8959
8960 img = buildCommon.makeSvgSpan([], [svgNode], options);
8961 }
8962
8963 img.height = totalHeight;
8964 img.style.height = totalHeight + "em";
8965
8966 return img;
8967};
8968
8969/* harmony default export */ var stretchy = ({
8970 encloseSpan: stretchy_encloseSpan,
8971 mathMLnode: stretchy_mathMLnode,
8972 svgSpan: stretchy_svgSpan
8973});
8974// CONCATENATED MODULE: ./src/functions/accent.js
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986// NOTE: Unlike most `htmlBuilder`s, this one handles not only "accent", but
8987// also "supsub" since an accent can affect super/subscripting.
8988var accent_htmlBuilder = function htmlBuilder(grp, options) {
8989 // Accents are handled in the TeXbook pg. 443, rule 12.
8990 var base = void 0;
8991 var group = void 0;
8992
8993 var supSub = checkNodeType(grp, "supsub");
8994 var supSubGroup = void 0;
8995 if (supSub) {
8996 // If our base is a character box, and we have superscripts and
8997 // subscripts, the supsub will defer to us. In particular, we want
8998 // to attach the superscripts and subscripts to the inner body (so
8999 // that the position of the superscripts and subscripts won't be
9000 // affected by the height of the accent). We accomplish this by
9001 // sticking the base of the accent into the base of the supsub, and
9002 // rendering that, while keeping track of where the accent is.
9003
9004 // The real accent group is the base of the supsub group
9005 group = assertNodeType(supSub.value.base, "accent");
9006 // The character box is the base of the accent group
9007 base = group.value.base;
9008 // Stick the character box into the base of the supsub group
9009 supSub.value.base = base;
9010
9011 // Rerender the supsub group with its new base, and store that
9012 // result.
9013 supSubGroup = assertDomContainer(buildHTML_buildGroup(supSub, options));
9014 } else {
9015 group = assertNodeType(grp, "accent");
9016 base = group.value.base;
9017 }
9018
9019 // Build the base group
9020 var body = buildHTML_buildGroup(base, options.havingCrampedStyle());
9021
9022 // Does the accent need to shift for the skew of a character?
9023 var mustShift = group.value.isShifty && utils.isCharacterBox(base);
9024
9025 // Calculate the skew of the accent. This is based on the line "If the
9026 // nucleus is not a single character, let s = 0; otherwise set s to the
9027 // kern amount for the nucleus followed by the \skewchar of its font."
9028 // Note that our skew metrics are just the kern between each character
9029 // and the skewchar.
9030 var skew = 0;
9031 if (mustShift) {
9032 // If the base is a character box, then we want the skew of the
9033 // innermost character. To do that, we find the innermost character:
9034 var baseChar = utils.getBaseElem(base);
9035 // Then, we render its group to get the symbol inside it
9036 var baseGroup = buildHTML_buildGroup(baseChar, options.havingCrampedStyle());
9037 // Finally, we pull the skew off of the symbol.
9038 skew = assertSymbolDomNode(baseGroup).skew;
9039 // Note that we now throw away baseGroup, because the layers we
9040 // removed with getBaseElem might contain things like \color which
9041 // we can't get rid of.
9042 // TODO(emily): Find a better way to get the skew
9043 }
9044
9045 // calculate the amount of space between the body and the accent
9046 var clearance = Math.min(body.height, options.fontMetrics().xHeight);
9047
9048 // Build the accent
9049 var accentBody = void 0;
9050 if (!group.value.isStretchy) {
9051 var accent = void 0;
9052 var width = void 0;
9053 if (group.value.label === "\\vec") {
9054 // Before version 0.9, \vec used the combining font glyph U+20D7.
9055 // But browsers, especially Safari, are not consistent in how they
9056 // render combining characters when not preceded by a character.
9057 // So now we use an SVG.
9058 // If Safari reforms, we should consider reverting to the glyph.
9059 accent = buildCommon.staticSvg("vec", options);
9060 width = buildCommon.svgData.vec[1];
9061 } else {
9062 accent = buildCommon.makeSymbol(group.value.label, "Main-Regular", group.mode, options);
9063 // Remove the italic correction of the accent, because it only serves to
9064 // shift the accent over to a place we don't want.
9065 accent.italic = 0;
9066 width = accent.width;
9067 }
9068
9069 accentBody = buildCommon.makeSpan(["accent-body"], [accent]);
9070
9071 // "Full" accents expand the width of the resulting symbol to be
9072 // at least the width of the accent, and overlap directly onto the
9073 // character without any vertical offset.
9074 var accentFull = group.value.label === "\\textcircled";
9075 if (accentFull) {
9076 accentBody.classes.push('accent-full');
9077 clearance = body.height;
9078 }
9079
9080 // Shift the accent over by the skew.
9081 var left = skew;
9082
9083 // CSS defines `.katex .accent .accent-body:not(.accent-full) { width: 0 }`
9084 // so that the accent doesn't contribute to the bounding box.
9085 // We need to shift the character by its width (effectively half
9086 // its width) to compensate.
9087 if (!accentFull) {
9088 left -= width / 2;
9089 }
9090
9091 accentBody.style.left = left + "em";
9092
9093 // \textcircled uses the \bigcirc glyph, so it needs some
9094 // vertical adjustment to match LaTeX.
9095 if (group.value.label === "\\textcircled") {
9096 accentBody.style.top = ".2em";
9097 }
9098
9099 accentBody = buildCommon.makeVList({
9100 positionType: "firstBaseline",
9101 children: [{ type: "elem", elem: body }, { type: "kern", size: -clearance }, { type: "elem", elem: accentBody }]
9102 }, options);
9103 } else {
9104 accentBody = stretchy.svgSpan(group, options);
9105
9106 accentBody = buildCommon.makeVList({
9107 positionType: "firstBaseline",
9108 children: [{ type: "elem", elem: body }, {
9109 type: "elem",
9110 elem: accentBody,
9111 wrapperClasses: ["svg-align"],
9112 wrapperStyle: skew > 0 ? {
9113 width: "calc(100% - " + 2 * skew + "em)",
9114 marginLeft: 2 * skew + "em"
9115 } : undefined
9116 }]
9117 }, options);
9118 }
9119
9120 var accentWrap = buildCommon.makeSpan(["mord", "accent"], [accentBody], options);
9121
9122 if (supSubGroup) {
9123 // Here, we replace the "base" child of the supsub with our newly
9124 // generated accent.
9125 supSubGroup.children[0] = accentWrap;
9126
9127 // Since we don't rerun the height calculation after replacing the
9128 // accent, we manually recalculate height.
9129 supSubGroup.height = Math.max(accentWrap.height, supSubGroup.height);
9130
9131 // Accents should always be ords, even when their innards are not.
9132 supSubGroup.classes[0] = "mord";
9133
9134 return supSubGroup;
9135 } else {
9136 return accentWrap;
9137 }
9138};
9139
9140var accent_mathmlBuilder = function mathmlBuilder(group, options) {
9141 var groupValue = group.value;
9142 var accentNode = void 0;
9143 if (groupValue.isStretchy) {
9144 accentNode = stretchy.mathMLnode(groupValue.label);
9145 } else {
9146 accentNode = new mathMLTree.MathNode("mo", [buildMathML_makeText(groupValue.label, group.mode)]);
9147 }
9148
9149 var node = new mathMLTree.MathNode("mover", [buildMathML_buildGroup(groupValue.base, options), accentNode]);
9150
9151 node.setAttribute("accent", "true");
9152
9153 return node;
9154};
9155
9156var NON_STRETCHY_ACCENT_REGEX = new RegExp(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring"].map(function (accent) {
9157 return "\\" + accent;
9158}).join("|"));
9159
9160// Accents
9161defineFunction({
9162 type: "accent",
9163 names: ["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring", "\\widecheck", "\\widehat", "\\widetilde", "\\overrightarrow", "\\overleftarrow", "\\Overrightarrow", "\\overleftrightarrow", "\\overgroup", "\\overlinesegment", "\\overleftharpoon", "\\overrightharpoon"],
9164 props: {
9165 numArgs: 1
9166 },
9167 handler: function handler(context, args) {
9168 var base = args[0];
9169
9170 var isStretchy = !NON_STRETCHY_ACCENT_REGEX.test(context.funcName);
9171 var isShifty = !isStretchy || context.funcName === "\\widehat" || context.funcName === "\\widetilde" || context.funcName === "\\widecheck";
9172
9173 return new src_ParseNode("accent", {
9174 type: "accent",
9175 label: context.funcName,
9176 isStretchy: isStretchy,
9177 isShifty: isShifty,
9178 base: base
9179 }, context.parser.mode);
9180 },
9181 htmlBuilder: accent_htmlBuilder,
9182 mathmlBuilder: accent_mathmlBuilder
9183});
9184
9185// Text-mode accents
9186defineFunction({
9187 type: "accent",
9188 names: ["\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', "\\r", "\\H", "\\v", "\\textcircled"],
9189 props: {
9190 numArgs: 1,
9191 allowedInText: true,
9192 allowedInMath: false
9193 },
9194 handler: function handler(context, args) {
9195 var base = args[0];
9196
9197 return new src_ParseNode("accent", {
9198 type: "accent",
9199 label: context.funcName,
9200 isStretchy: false,
9201 isShifty: true,
9202 base: base
9203 }, context.parser.mode);
9204 },
9205 htmlBuilder: accent_htmlBuilder,
9206 mathmlBuilder: accent_mathmlBuilder
9207});
9208// CONCATENATED MODULE: ./src/functions/accentunder.js
9209
9210// Horizontal overlap functions
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220defineFunction({
9221 type: "accentUnder",
9222 names: ["\\underleftarrow", "\\underrightarrow", "\\underleftrightarrow", "\\undergroup", "\\underlinesegment", "\\utilde"],
9223 props: {
9224 numArgs: 1
9225 },
9226 handler: function handler(_ref, args) {
9227 var parser = _ref.parser,
9228 funcName = _ref.funcName;
9229
9230 var base = args[0];
9231 return new src_ParseNode("accentUnder", {
9232 type: "accentUnder",
9233 label: funcName,
9234 base: base
9235 }, parser.mode);
9236 },
9237 htmlBuilder: function htmlBuilder(group, options) {
9238 // Treat under accents much like underlines.
9239 var innerGroup = buildHTML_buildGroup(group.value.base, options);
9240
9241 var accentBody = stretchy.svgSpan(group, options);
9242 var kern = group.value.label === "\\utilde" ? 0.12 : 0;
9243
9244 // Generate the vlist, with the appropriate kerns
9245 var vlist = buildCommon.makeVList({
9246 positionType: "bottom",
9247 positionData: accentBody.height + kern,
9248 children: [{ type: "elem", elem: accentBody, wrapperClasses: ["svg-align"] }, { type: "kern", size: kern }, { type: "elem", elem: innerGroup }]
9249 }, options);
9250
9251 return buildCommon.makeSpan(["mord", "accentunder"], [vlist], options);
9252 },
9253 mathmlBuilder: function mathmlBuilder(group, options) {
9254 var accentNode = stretchy.mathMLnode(group.value.label);
9255 var node = new mathMLTree.MathNode("munder", [buildMathML_buildGroup(group.value.base, options), accentNode]);
9256 node.setAttribute("accentunder", "true");
9257 return node;
9258 }
9259});
9260// CONCATENATED MODULE: ./src/functions/arrow.js
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270// Stretchy arrows with an optional argument
9271defineFunction({
9272 type: "xArrow",
9273 names: ["\\xleftarrow", "\\xrightarrow", "\\xLeftarrow", "\\xRightarrow", "\\xleftrightarrow", "\\xLeftrightarrow", "\\xhookleftarrow", "\\xhookrightarrow", "\\xmapsto", "\\xrightharpoondown", "\\xrightharpoonup", "\\xleftharpoondown", "\\xleftharpoonup", "\\xrightleftharpoons", "\\xleftrightharpoons", "\\xlongequal", "\\xtwoheadrightarrow", "\\xtwoheadleftarrow", "\\xtofrom",
9274 // The next 3 functions are here to support the mhchem extension.
9275 // Direct use of these functions is discouraged and may break someday.
9276 "\\xrightleftarrows", "\\xrightequilibrium", "\\xleftequilibrium"],
9277 props: {
9278 numArgs: 1,
9279 numOptionalArgs: 1
9280 },
9281 handler: function handler(_ref, args, optArgs) {
9282 var parser = _ref.parser,
9283 funcName = _ref.funcName;
9284
9285 return new src_ParseNode("xArrow", {
9286 type: "xArrow", // x for extensible
9287 label: funcName,
9288 body: args[0],
9289 below: optArgs[0]
9290 }, parser.mode);
9291 },
9292
9293 // Flow is unable to correctly infer the type of `group`, even though it's
9294 // unamibiguously determined from the passed-in `type` above.
9295 htmlBuilder: function htmlBuilder(group, options) {
9296 var style = options.style;
9297
9298 // Build the argument groups in the appropriate style.
9299 // Ref: amsmath.dtx: \hbox{$\scriptstyle\mkern#3mu{#6}\mkern#4mu$}%
9300
9301 var newOptions = options.havingStyle(style.sup());
9302 var upperGroup = buildHTML_buildGroup(group.value.body, newOptions, options);
9303 upperGroup.classes.push("x-arrow-pad");
9304
9305 var lowerGroup = void 0;
9306 if (group.value.below) {
9307 // Build the lower group
9308 newOptions = options.havingStyle(style.sub());
9309 lowerGroup = buildHTML_buildGroup(group.value.below, newOptions, options);
9310 lowerGroup.classes.push("x-arrow-pad");
9311 }
9312
9313 var arrowBody = stretchy.svgSpan(group, options);
9314
9315 // Re shift: Note that stretchy.svgSpan returned arrowBody.depth = 0.
9316 // The point we want on the math axis is at 0.5 * arrowBody.height.
9317 var arrowShift = -options.fontMetrics().axisHeight + 0.5 * arrowBody.height;
9318 // 2 mu kern. Ref: amsmath.dtx: #7\if0#2\else\mkern#2mu\fi
9319 var upperShift = -options.fontMetrics().axisHeight - 0.5 * arrowBody.height - 0.111; // 0.111 em = 2 mu
9320 if (upperGroup.depth > 0.25 || group.value.label === "\\xleftequilibrium") {
9321 upperShift -= upperGroup.depth; // shift up if depth encroaches
9322 }
9323
9324 // Generate the vlist
9325 var vlist = void 0;
9326 if (lowerGroup) {
9327 var lowerShift = -options.fontMetrics().axisHeight + lowerGroup.height + 0.5 * arrowBody.height + 0.111;
9328 vlist = buildCommon.makeVList({
9329 positionType: "individualShift",
9330 children: [{ type: "elem", elem: upperGroup, shift: upperShift }, { type: "elem", elem: arrowBody, shift: arrowShift }, { type: "elem", elem: lowerGroup, shift: lowerShift }]
9331 }, options);
9332 } else {
9333 vlist = buildCommon.makeVList({
9334 positionType: "individualShift",
9335 children: [{ type: "elem", elem: upperGroup, shift: upperShift }, { type: "elem", elem: arrowBody, shift: arrowShift }]
9336 }, options);
9337 }
9338
9339 // $FlowFixMe: Replace this with passing "svg-align" into makeVList.
9340 vlist.children[0].children[0].children[1].classes.push("svg-align");
9341
9342 return buildCommon.makeSpan(["mrel", "x-arrow"], [vlist], options);
9343 },
9344 mathmlBuilder: function mathmlBuilder(group, options) {
9345 var arrowNode = stretchy.mathMLnode(group.value.label);
9346 var node = void 0;
9347 var lowerNode = void 0;
9348
9349 if (group.value.body) {
9350 var upperNode = buildMathML_buildGroup(group.value.body, options);
9351 if (group.value.below) {
9352 lowerNode = buildMathML_buildGroup(group.value.below, options);
9353 node = new mathMLTree.MathNode("munderover", [arrowNode, lowerNode, upperNode]);
9354 } else {
9355 node = new mathMLTree.MathNode("mover", [arrowNode, upperNode]);
9356 }
9357 } else if (group.value.below) {
9358 lowerNode = buildMathML_buildGroup(group.value.below, options);
9359 node = new mathMLTree.MathNode("munder", [arrowNode, lowerNode]);
9360 } else {
9361 node = new mathMLTree.MathNode("mover", [arrowNode]);
9362 }
9363 return node;
9364 }
9365});
9366// CONCATENATED MODULE: ./src/functions/color.js
9367
9368
9369
9370
9371
9372
9373
9374
9375var color_htmlBuilder = function htmlBuilder(group, options) {
9376 var elements = buildHTML_buildExpression(group.value.value, options.withColor(group.value.color), false);
9377
9378 // \color isn't supposed to affect the type of the elements it contains.
9379 // To accomplish this, we wrap the results in a fragment, so the inner
9380 // elements will be able to directly interact with their neighbors. For
9381 // example, `\color{red}{2 +} 3` has the same spacing as `2 + 3`
9382 return new buildCommon.makeFragment(elements);
9383};
9384
9385var color_mathmlBuilder = function mathmlBuilder(group, options) {
9386 var inner = buildMathML_buildExpression(group.value.value, options);
9387
9388 var node = new mathMLTree.MathNode("mstyle", inner);
9389
9390 node.setAttribute("mathcolor", group.value.color);
9391
9392 return node;
9393};
9394
9395defineFunction({
9396 type: "color",
9397 names: ["\\textcolor"],
9398 props: {
9399 numArgs: 2,
9400 allowedInText: true,
9401 greediness: 3,
9402 argTypes: ["color", "original"]
9403 },
9404 handler: function handler(_ref, args) {
9405 var parser = _ref.parser;
9406
9407 var color = assertNodeType(args[0], "color-token");
9408 var body = args[1];
9409 return new src_ParseNode("color", {
9410 type: "color",
9411 color: color.value,
9412 value: defineFunction_ordargument(body)
9413 }, parser.mode);
9414 },
9415
9416 htmlBuilder: color_htmlBuilder,
9417 mathmlBuilder: color_mathmlBuilder
9418});
9419
9420// TODO(kevinb): define these using macros
9421defineFunction({
9422 type: "color",
9423 names: ["\\blue", "\\orange", "\\pink", "\\red", "\\green", "\\gray", "\\purple", "\\blueA", "\\blueB", "\\blueC", "\\blueD", "\\blueE", "\\tealA", "\\tealB", "\\tealC", "\\tealD", "\\tealE", "\\greenA", "\\greenB", "\\greenC", "\\greenD", "\\greenE", "\\goldA", "\\goldB", "\\goldC", "\\goldD", "\\goldE", "\\redA", "\\redB", "\\redC", "\\redD", "\\redE", "\\maroonA", "\\maroonB", "\\maroonC", "\\maroonD", "\\maroonE", "\\purpleA", "\\purpleB", "\\purpleC", "\\purpleD", "\\purpleE", "\\mintA", "\\mintB", "\\mintC", "\\grayA", "\\grayB", "\\grayC", "\\grayD", "\\grayE", "\\grayF", "\\grayG", "\\grayH", "\\grayI", "\\kaBlue", "\\kaGreen"],
9424 props: {
9425 numArgs: 1,
9426 allowedInText: true,
9427 greediness: 3
9428 },
9429 handler: function handler(_ref2, args) {
9430 var parser = _ref2.parser,
9431 funcName = _ref2.funcName;
9432
9433 var body = args[0];
9434 return new src_ParseNode("color", {
9435 type: "color",
9436 color: "katex-" + funcName.slice(1),
9437 value: defineFunction_ordargument(body)
9438 }, parser.mode);
9439 },
9440
9441 htmlBuilder: color_htmlBuilder,
9442 mathmlBuilder: color_mathmlBuilder
9443});
9444
9445defineFunction({
9446 type: "color",
9447 names: ["\\color"],
9448 props: {
9449 numArgs: 1,
9450 allowedInText: true,
9451 greediness: 3,
9452 argTypes: ["color"]
9453 },
9454 handler: function handler(_ref3, args) {
9455 var parser = _ref3.parser,
9456 breakOnTokenText = _ref3.breakOnTokenText;
9457
9458 var color = assertNodeType(args[0], "color-token");
9459
9460 // If we see a styling function, parse out the implicit body
9461 var body = parser.parseExpression(true, breakOnTokenText);
9462
9463 return new src_ParseNode("color", {
9464 type: "color",
9465 color: color.value,
9466 value: body
9467 }, parser.mode);
9468 },
9469
9470 htmlBuilder: color_htmlBuilder,
9471 mathmlBuilder: color_mathmlBuilder
9472});
9473// CONCATENATED MODULE: ./src/functions/cr.js
9474
9475// Row breaks within tabular environments, and line breaks at top level
9476
9477
9478
9479
9480
9481
9482
9483
9484// \\ is a macro mapping to either \cr or \newline. Because they have the
9485// same signature, we implement them as one megafunction, with newRow
9486// indicating whether we're in the \cr case, and newLine indicating whether
9487// to break the line in the \newline case.
9488
9489defineFunction({
9490 type: "cr",
9491 names: ["\\cr", "\\newline"],
9492 props: {
9493 numArgs: 0,
9494 numOptionalArgs: 1,
9495 argTypes: ["size"],
9496 allowedInText: true
9497 },
9498
9499 handler: function handler(_ref, args, optArgs) {
9500 var parser = _ref.parser,
9501 funcName = _ref.funcName;
9502
9503 var size = optArgs[0];
9504 var newRow = funcName === "\\cr";
9505 var newLine = false;
9506 if (!newRow) {
9507 if (parser.settings.displayMode && parser.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline " + "does nothing in display mode")) {
9508 newLine = false;
9509 } else {
9510 newLine = true;
9511 }
9512 }
9513 return new src_ParseNode("cr", {
9514 type: "cr",
9515 newLine: newLine,
9516 newRow: newRow,
9517 size: size && assertNodeType(size, "size")
9518 }, parser.mode);
9519 },
9520
9521 // The following builders are called only at the top level,
9522 // not within tabular/array environments.
9523
9524 htmlBuilder: function htmlBuilder(group, options) {
9525 if (group.value.newRow) {
9526 throw new src_ParseError("\\cr valid only within a tabular/array environment");
9527 }
9528 var span = buildCommon.makeSpan(["mspace"], [], options);
9529 if (group.value.newLine) {
9530 span.classes.push("newline");
9531 if (group.value.size) {
9532 span.style.marginTop = units_calculateSize(group.value.size.value.value, options) + "em";
9533 }
9534 }
9535 return span;
9536 },
9537
9538 mathmlBuilder: function mathmlBuilder(group, options) {
9539 var node = new mathMLTree.MathNode("mspace");
9540 if (group.value.newLine) {
9541 node.setAttribute("linebreak", "newline");
9542 if (group.value.size) {
9543 node.setAttribute("height", units_calculateSize(group.value.size.value.value, options) + "em");
9544 }
9545 }
9546 return node;
9547 }
9548});
9549// CONCATENATED MODULE: ./src/delimiter.js
9550
9551/**
9552 * This file deals with creating delimiters of various sizes. The TeXbook
9553 * discusses these routines on page 441-442, in the "Another subroutine sets box
9554 * x to a specified variable delimiter" paragraph.
9555 *
9556 * There are three main routines here. `makeSmallDelim` makes a delimiter in the
9557 * normal font, but in either text, script, or scriptscript style.
9558 * `makeLargeDelim` makes a delimiter in textstyle, but in one of the Size1,
9559 * Size2, Size3, or Size4 fonts. `makeStackedDelim` makes a delimiter out of
9560 * smaller pieces that are stacked on top of one another.
9561 *
9562 * The functions take a parameter `center`, which determines if the delimiter
9563 * should be centered around the axis.
9564 *
9565 * Then, there are three exposed functions. `sizedDelim` makes a delimiter in
9566 * one of the given sizes. This is used for things like `\bigl`.
9567 * `customSizedDelim` makes a delimiter with a given total height+depth. It is
9568 * called in places like `\sqrt`. `leftRightDelim` makes an appropriate
9569 * delimiter which surrounds an expression of a given height an depth. It is
9570 * used in `\left` and `\right`.
9571 */
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582/**
9583 * Get the metrics for a given symbol and font, after transformation (i.e.
9584 * after following replacement from symbols.js)
9585 */
9586var delimiter_getMetrics = function getMetrics(symbol, font, mode) {
9587 var replace = src_symbols.math[symbol] && src_symbols.math[symbol].replace;
9588 var metrics = getCharacterMetrics(replace || symbol, font, mode);
9589 if (!metrics) {
9590 throw new Error("Unsupported symbol " + symbol + " and font size " + font + ".");
9591 }
9592 return metrics;
9593};
9594
9595/**
9596 * Puts a delimiter span in a given style, and adds appropriate height, depth,
9597 * and maxFontSizes.
9598 */
9599var delimiter_styleWrap = function styleWrap(delim, toStyle, options, classes) {
9600 var newOptions = options.havingBaseStyle(toStyle);
9601
9602 var span = buildCommon.makeSpan(classes.concat(newOptions.sizingClasses(options)), [delim], options);
9603
9604 var delimSizeMultiplier = newOptions.sizeMultiplier / options.sizeMultiplier;
9605 span.height *= delimSizeMultiplier;
9606 span.depth *= delimSizeMultiplier;
9607 span.maxFontSize = newOptions.sizeMultiplier;
9608
9609 return span;
9610};
9611
9612var centerSpan = function centerSpan(span, options, style) {
9613 var newOptions = options.havingBaseStyle(style);
9614 var shift = (1 - options.sizeMultiplier / newOptions.sizeMultiplier) * options.fontMetrics().axisHeight;
9615
9616 span.classes.push("delimcenter");
9617 span.style.top = shift + "em";
9618 span.height -= shift;
9619 span.depth += shift;
9620};
9621
9622/**
9623 * Makes a small delimiter. This is a delimiter that comes in the Main-Regular
9624 * font, but is restyled to either be in textstyle, scriptstyle, or
9625 * scriptscriptstyle.
9626 */
9627var delimiter_makeSmallDelim = function makeSmallDelim(delim, style, center, options, mode, classes) {
9628 var text = buildCommon.makeSymbol(delim, "Main-Regular", mode, options);
9629 var span = delimiter_styleWrap(text, style, options, classes);
9630 if (center) {
9631 centerSpan(span, options, style);
9632 }
9633 return span;
9634};
9635
9636/**
9637 * Builds a symbol in the given font size (note size is an integer)
9638 */
9639var delimiter_mathrmSize = function mathrmSize(value, size, mode, options) {
9640 return buildCommon.makeSymbol(value, "Size" + size + "-Regular", mode, options);
9641};
9642
9643/**
9644 * Makes a large delimiter. This is a delimiter that comes in the Size1, Size2,
9645 * Size3, or Size4 fonts. It is always rendered in textstyle.
9646 */
9647var delimiter_makeLargeDelim = function makeLargeDelim(delim, size, center, options, mode, classes) {
9648 var inner = delimiter_mathrmSize(delim, size, mode, options);
9649 var span = delimiter_styleWrap(buildCommon.makeSpan(["delimsizing", "size" + size], [inner], options), src_Style.TEXT, options, classes);
9650 if (center) {
9651 centerSpan(span, options, src_Style.TEXT);
9652 }
9653 return span;
9654};
9655
9656/**
9657 * Make an inner span with the given offset and in the given font. This is used
9658 * in `makeStackedDelim` to make the stacking pieces for the delimiter.
9659 */
9660var delimiter_makeInner = function makeInner(symbol, font, mode) {
9661 var sizeClass = void 0;
9662 // Apply the correct CSS class to choose the right font.
9663 if (font === "Size1-Regular") {
9664 sizeClass = "delim-size1";
9665 } else /* if (font === "Size4-Regular") */{
9666 sizeClass = "delim-size4";
9667 }
9668
9669 var inner = buildCommon.makeSpan(["delimsizinginner", sizeClass], [buildCommon.makeSpan([], [buildCommon.makeSymbol(symbol, font, mode)])]);
9670
9671 // Since this will be passed into `makeVList` in the end, wrap the element
9672 // in the appropriate tag that VList uses.
9673 return { type: "elem", elem: inner };
9674};
9675
9676/**
9677 * Make a stacked delimiter out of a given delimiter, with the total height at
9678 * least `heightTotal`. This routine is mentioned on page 442 of the TeXbook.
9679 */
9680var delimiter_makeStackedDelim = function makeStackedDelim(delim, heightTotal, center, options, mode, classes) {
9681 // There are four parts, the top, an optional middle, a repeated part, and a
9682 // bottom.
9683 var top = void 0;
9684 var middle = void 0;
9685 var repeat = void 0;
9686 var bottom = void 0;
9687 top = repeat = bottom = delim;
9688 middle = null;
9689 // Also keep track of what font the delimiters are in
9690 var font = "Size1-Regular";
9691
9692 // We set the parts and font based on the symbol. Note that we use
9693 // '\u23d0' instead of '|' and '\u2016' instead of '\\|' for the
9694 // repeats of the arrows
9695 if (delim === "\\uparrow") {
9696 repeat = bottom = "\u23D0";
9697 } else if (delim === "\\Uparrow") {
9698 repeat = bottom = "\u2016";
9699 } else if (delim === "\\downarrow") {
9700 top = repeat = "\u23D0";
9701 } else if (delim === "\\Downarrow") {
9702 top = repeat = "\u2016";
9703 } else if (delim === "\\updownarrow") {
9704 top = "\\uparrow";
9705 repeat = "\u23D0";
9706 bottom = "\\downarrow";
9707 } else if (delim === "\\Updownarrow") {
9708 top = "\\Uparrow";
9709 repeat = "\u2016";
9710 bottom = "\\Downarrow";
9711 } else if (delim === "[" || delim === "\\lbrack") {
9712 top = "\u23A1";
9713 repeat = "\u23A2";
9714 bottom = "\u23A3";
9715 font = "Size4-Regular";
9716 } else if (delim === "]" || delim === "\\rbrack") {
9717 top = "\u23A4";
9718 repeat = "\u23A5";
9719 bottom = "\u23A6";
9720 font = "Size4-Regular";
9721 } else if (delim === "\\lfloor" || delim === "\u230A") {
9722 repeat = top = "\u23A2";
9723 bottom = "\u23A3";
9724 font = "Size4-Regular";
9725 } else if (delim === "\\lceil" || delim === "\u2308") {
9726 top = "\u23A1";
9727 repeat = bottom = "\u23A2";
9728 font = "Size4-Regular";
9729 } else if (delim === "\\rfloor" || delim === "\u230B") {
9730 repeat = top = "\u23A5";
9731 bottom = "\u23A6";
9732 font = "Size4-Regular";
9733 } else if (delim === "\\rceil" || delim === "\u2309") {
9734 top = "\u23A4";
9735 repeat = bottom = "\u23A5";
9736 font = "Size4-Regular";
9737 } else if (delim === "(") {
9738 top = "\u239B";
9739 repeat = "\u239C";
9740 bottom = "\u239D";
9741 font = "Size4-Regular";
9742 } else if (delim === ")") {
9743 top = "\u239E";
9744 repeat = "\u239F";
9745 bottom = "\u23A0";
9746 font = "Size4-Regular";
9747 } else if (delim === "\\{" || delim === "\\lbrace") {
9748 top = "\u23A7";
9749 middle = "\u23A8";
9750 bottom = "\u23A9";
9751 repeat = "\u23AA";
9752 font = "Size4-Regular";
9753 } else if (delim === "\\}" || delim === "\\rbrace") {
9754 top = "\u23AB";
9755 middle = "\u23AC";
9756 bottom = "\u23AD";
9757 repeat = "\u23AA";
9758 font = "Size4-Regular";
9759 } else if (delim === "\\lgroup" || delim === "\u27EE") {
9760 top = "\u23A7";
9761 bottom = "\u23A9";
9762 repeat = "\u23AA";
9763 font = "Size4-Regular";
9764 } else if (delim === "\\rgroup" || delim === "\u27EF") {
9765 top = "\u23AB";
9766 bottom = "\u23AD";
9767 repeat = "\u23AA";
9768 font = "Size4-Regular";
9769 } else if (delim === "\\lmoustache" || delim === "\u23B0") {
9770 top = "\u23A7";
9771 bottom = "\u23AD";
9772 repeat = "\u23AA";
9773 font = "Size4-Regular";
9774 } else if (delim === "\\rmoustache" || delim === "\u23B1") {
9775 top = "\u23AB";
9776 bottom = "\u23A9";
9777 repeat = "\u23AA";
9778 font = "Size4-Regular";
9779 }
9780
9781 // Get the metrics of the four sections
9782 var topMetrics = delimiter_getMetrics(top, font, mode);
9783 var topHeightTotal = topMetrics.height + topMetrics.depth;
9784 var repeatMetrics = delimiter_getMetrics(repeat, font, mode);
9785 var repeatHeightTotal = repeatMetrics.height + repeatMetrics.depth;
9786 var bottomMetrics = delimiter_getMetrics(bottom, font, mode);
9787 var bottomHeightTotal = bottomMetrics.height + bottomMetrics.depth;
9788 var middleHeightTotal = 0;
9789 var middleFactor = 1;
9790 if (middle !== null) {
9791 var middleMetrics = delimiter_getMetrics(middle, font, mode);
9792 middleHeightTotal = middleMetrics.height + middleMetrics.depth;
9793 middleFactor = 2; // repeat symmetrically above and below middle
9794 }
9795
9796 // Calcuate the minimal height that the delimiter can have.
9797 // It is at least the size of the top, bottom, and optional middle combined.
9798 var minHeight = topHeightTotal + bottomHeightTotal + middleHeightTotal;
9799
9800 // Compute the number of copies of the repeat symbol we will need
9801 var repeatCount = Math.ceil((heightTotal - minHeight) / (middleFactor * repeatHeightTotal));
9802
9803 // Compute the total height of the delimiter including all the symbols
9804 var realHeightTotal = minHeight + repeatCount * middleFactor * repeatHeightTotal;
9805
9806 // The center of the delimiter is placed at the center of the axis. Note
9807 // that in this context, "center" means that the delimiter should be
9808 // centered around the axis in the current style, while normally it is
9809 // centered around the axis in textstyle.
9810 var axisHeight = options.fontMetrics().axisHeight;
9811 if (center) {
9812 axisHeight *= options.sizeMultiplier;
9813 }
9814 // Calculate the depth
9815 var depth = realHeightTotal / 2 - axisHeight;
9816
9817 // Now, we start building the pieces that will go into the vlist
9818
9819 // Keep a list of the inner pieces
9820 var inners = [];
9821
9822 // Add the bottom symbol
9823 inners.push(delimiter_makeInner(bottom, font, mode));
9824
9825 if (middle === null) {
9826 // Add that many symbols
9827 for (var i = 0; i < repeatCount; i++) {
9828 inners.push(delimiter_makeInner(repeat, font, mode));
9829 }
9830 } else {
9831 // When there is a middle bit, we need the middle part and two repeated
9832 // sections
9833 for (var _i = 0; _i < repeatCount; _i++) {
9834 inners.push(delimiter_makeInner(repeat, font, mode));
9835 }
9836 inners.push(delimiter_makeInner(middle, font, mode));
9837 for (var _i2 = 0; _i2 < repeatCount; _i2++) {
9838 inners.push(delimiter_makeInner(repeat, font, mode));
9839 }
9840 }
9841
9842 // Add the top symbol
9843 inners.push(delimiter_makeInner(top, font, mode));
9844
9845 // Finally, build the vlist
9846 var newOptions = options.havingBaseStyle(src_Style.TEXT);
9847 var inner = buildCommon.makeVList({
9848 positionType: "bottom",
9849 positionData: depth,
9850 children: inners
9851 }, newOptions);
9852
9853 return delimiter_styleWrap(buildCommon.makeSpan(["delimsizing", "mult"], [inner], newOptions), src_Style.TEXT, options, classes);
9854};
9855
9856// All surds have 0.08em padding above the viniculum inside the SVG.
9857// That keeps browser span height rounding error from pinching the line.
9858var vbPad = 80; // padding above the surd, measured inside the viewBox.
9859var emPad = 0.08; // padding, in ems, measured in the document.
9860
9861var delimiter_sqrtSvg = function sqrtSvg(sqrtName, height, viewBoxHeight, options) {
9862 var alternate = void 0;
9863 if (sqrtName === "sqrtTall") {
9864 // sqrtTall is from glyph U23B7 in the font KaTeX_Size4-Regular
9865 // One path edge has a variable length. It runs from the viniculumn
9866 // to a point near (14 units) the bottom of the surd. The viniculum
9867 // is 40 units thick. So the length of the line in question is:
9868 var vertSegment = viewBoxHeight - 54 - vbPad;
9869 alternate = "M702 " + vbPad + "H400000v40H742v" + vertSegment + "l-4 4-4 4c-.667.7\n-2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1h-12l-28-84c-16.667-52-96.667\n-294.333-240-727l-212 -643 -85 170c-4-3.333-8.333-7.667-13 -13l-13-13l77-155\n 77-156c66 199.333 139 419.667 219 661 l218 661zM702 " + vbPad + "H400000v40H742z";
9870 }
9871 var pathNode = new domTree.pathNode(sqrtName, alternate);
9872
9873 var svg = new domTree.svgNode([pathNode], {
9874 // Note: 1000:1 ratio of viewBox to document em width.
9875 "width": "400em",
9876 "height": height + "em",
9877 "viewBox": "0 0 400000 " + viewBoxHeight,
9878 "preserveAspectRatio": "xMinYMin slice"
9879 });
9880
9881 return buildCommon.makeSvgSpan(["hide-tail"], [svg], options);
9882};
9883
9884/**
9885 * Make a sqrt image of the given height,
9886 */
9887var makeSqrtImage = function makeSqrtImage(height, options) {
9888 var delim = traverseSequence("\\surd", height, stackLargeDelimiterSequence, options);
9889
9890 // Create a span containing an SVG image of a sqrt symbol.
9891 var span = void 0;
9892 var sizeMultiplier = options.sizeMultiplier; // default
9893 var spanHeight = 0;
9894 var texHeight = 0;
9895 var viewBoxHeight = 0;
9896 var advanceWidth = void 0;
9897
9898 // We create viewBoxes with 80 units of "padding" above each surd.
9899 // Then browser rounding error on the parent span height will not
9900 // encroach on the ink of the viniculum. But that padding is not
9901 // included in the TeX-like `height` used for calculation of
9902 // vertical alignment. So texHeight = span.height < span.style.height.
9903
9904 if (delim.type === "small") {
9905 // Get an SVG that is derived from glyph U+221A in font KaTeX-Main.
9906 viewBoxHeight = 1000 + vbPad; // 1000 unit glyph height.
9907 var newOptions = options.havingBaseStyle(delim.style);
9908 sizeMultiplier = newOptions.sizeMultiplier / options.sizeMultiplier;
9909 spanHeight = (1.0 + emPad) * sizeMultiplier;
9910 texHeight = 1.00 * sizeMultiplier;
9911 span = delimiter_sqrtSvg("sqrtMain", spanHeight, viewBoxHeight, options);
9912 span.style.minWidth = "0.853em";
9913 advanceWidth = 0.833 * sizeMultiplier; // from the font.
9914 } else if (delim.type === "large") {
9915 // These SVGs come from fonts: KaTeX_Size1, _Size2, etc.
9916 viewBoxHeight = (1000 + vbPad) * sizeToMaxHeight[delim.size];
9917 texHeight = sizeToMaxHeight[delim.size] / sizeMultiplier;
9918 spanHeight = (sizeToMaxHeight[delim.size] + emPad) / sizeMultiplier;
9919 span = delimiter_sqrtSvg("sqrtSize" + delim.size, spanHeight, viewBoxHeight, options);
9920 span.style.minWidth = "1.02em";
9921 advanceWidth = 1.0 / sizeMultiplier; // from the font.
9922 } else {
9923 // Tall sqrt. In TeX, this would be stacked using multiple glyphs.
9924 // We'll use a single SVG to accomplish the same thing.
9925 spanHeight = height / sizeMultiplier + emPad;
9926 texHeight = height / sizeMultiplier;
9927 viewBoxHeight = Math.floor(1000 * height) + vbPad;
9928 span = delimiter_sqrtSvg("sqrtTall", spanHeight, viewBoxHeight, options);
9929 span.style.minWidth = "0.742em";
9930 advanceWidth = 1.056 / sizeMultiplier;
9931 }
9932
9933 span.height = texHeight;
9934 span.style.height = spanHeight + "em";
9935
9936 return {
9937 span: span,
9938 advanceWidth: advanceWidth,
9939 // Calculate the actual line width.
9940 // This actually should depend on the chosen font -- e.g. \boldmath
9941 // should use the thicker surd symbols from e.g. KaTeX_Main-Bold, and
9942 // have thicker rules.
9943 ruleWidth: options.fontMetrics().sqrtRuleThickness * sizeMultiplier
9944 };
9945};
9946
9947// There are three kinds of delimiters, delimiters that stack when they become
9948// too large
9949var stackLargeDelimiters = ["(", ")", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "\u230A", "\u230B", "\\lceil", "\\rceil", "\u2308", "\u2309", "\\surd"];
9950
9951// delimiters that always stack
9952var stackAlwaysDelimiters = ["\\uparrow", "\\downarrow", "\\updownarrow", "\\Uparrow", "\\Downarrow", "\\Updownarrow", "|", "\\|", "\\vert", "\\Vert", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "\u27EE", "\u27EF", "\\lmoustache", "\\rmoustache", "\u23B0", "\u23B1"];
9953
9954// and delimiters that never stack
9955var stackNeverDelimiters = ["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"];
9956
9957// Metrics of the different sizes. Found by looking at TeX's output of
9958// $\bigl| // \Bigl| \biggl| \Biggl| \showlists$
9959// Used to create stacked delimiters of appropriate sizes in makeSizedDelim.
9960var sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3.0];
9961
9962/**
9963 * Used to create a delimiter of a specific size, where `size` is 1, 2, 3, or 4.
9964 */
9965var delimiter_makeSizedDelim = function makeSizedDelim(delim, size, options, mode, classes) {
9966 // < and > turn into \langle and \rangle in delimiters
9967 if (delim === "<" || delim === "\\lt" || delim === "\u27E8") {
9968 delim = "\\langle";
9969 } else if (delim === ">" || delim === "\\gt" || delim === "\u27E9") {
9970 delim = "\\rangle";
9971 }
9972
9973 // Sized delimiters are never centered.
9974 if (utils.contains(stackLargeDelimiters, delim) || utils.contains(stackNeverDelimiters, delim)) {
9975 return delimiter_makeLargeDelim(delim, size, false, options, mode, classes);
9976 } else if (utils.contains(stackAlwaysDelimiters, delim)) {
9977 return delimiter_makeStackedDelim(delim, sizeToMaxHeight[size], false, options, mode, classes);
9978 } else {
9979 throw new src_ParseError("Illegal delimiter: '" + delim + "'");
9980 }
9981};
9982
9983/**
9984 * There are three different sequences of delimiter sizes that the delimiters
9985 * follow depending on the kind of delimiter. This is used when creating custom
9986 * sized delimiters to decide whether to create a small, large, or stacked
9987 * delimiter.
9988 *
9989 * In real TeX, these sequences aren't explicitly defined, but are instead
9990 * defined inside the font metrics. Since there are only three sequences that
9991 * are possible for the delimiters that TeX defines, it is easier to just encode
9992 * them explicitly here.
9993 */
9994
9995// Delimiters that never stack try small delimiters and large delimiters only
9996var stackNeverDelimiterSequence = [{ type: "small", style: src_Style.SCRIPTSCRIPT }, { type: "small", style: src_Style.SCRIPT }, { type: "small", style: src_Style.TEXT }, { type: "large", size: 1 }, { type: "large", size: 2 }, { type: "large", size: 3 }, { type: "large", size: 4 }];
9997
9998// Delimiters that always stack try the small delimiters first, then stack
9999var stackAlwaysDelimiterSequence = [{ type: "small", style: src_Style.SCRIPTSCRIPT }, { type: "small", style: src_Style.SCRIPT }, { type: "small", style: src_Style.TEXT }, { type: "stack" }];
10000
10001// Delimiters that stack when large try the small and then large delimiters, and
10002// stack afterwards
10003var stackLargeDelimiterSequence = [{ type: "small", style: src_Style.SCRIPTSCRIPT }, { type: "small", style: src_Style.SCRIPT }, { type: "small", style: src_Style.TEXT }, { type: "large", size: 1 }, { type: "large", size: 2 }, { type: "large", size: 3 }, { type: "large", size: 4 }, { type: "stack" }];
10004
10005/**
10006 * Get the font used in a delimiter based on what kind of delimiter it is.
10007 * TODO(#963) Use more specific font family return type once that is introduced.
10008 */
10009var delimTypeToFont = function delimTypeToFont(type) {
10010 if (type.type === "small") {
10011 return "Main-Regular";
10012 } else if (type.type === "large") {
10013 return "Size" + type.size + "-Regular";
10014 } else if (type.type === "stack") {
10015 return "Size4-Regular";
10016 } else {
10017 throw new Error("Add support for delim type '" + type.type + "' here.");
10018 }
10019};
10020
10021/**
10022 * Traverse a sequence of types of delimiters to decide what kind of delimiter
10023 * should be used to create a delimiter of the given height+depth.
10024 */
10025var traverseSequence = function traverseSequence(delim, height, sequence, options) {
10026 // Here, we choose the index we should start at in the sequences. In smaller
10027 // sizes (which correspond to larger numbers in style.size) we start earlier
10028 // in the sequence. Thus, scriptscript starts at index 3-3=0, script starts
10029 // at index 3-2=1, text starts at 3-1=2, and display starts at min(2,3-0)=2
10030 var start = Math.min(2, 3 - options.style.size);
10031 for (var i = start; i < sequence.length; i++) {
10032 if (sequence[i].type === "stack") {
10033 // This is always the last delimiter, so we just break the loop now.
10034 break;
10035 }
10036
10037 var metrics = delimiter_getMetrics(delim, delimTypeToFont(sequence[i]), "math");
10038 var heightDepth = metrics.height + metrics.depth;
10039
10040 // Small delimiters are scaled down versions of the same font, so we
10041 // account for the style change size.
10042
10043 if (sequence[i].type === "small") {
10044 var newOptions = options.havingBaseStyle(sequence[i].style);
10045 heightDepth *= newOptions.sizeMultiplier;
10046 }
10047
10048 // Check if the delimiter at this size works for the given height.
10049 if (heightDepth > height) {
10050 return sequence[i];
10051 }
10052 }
10053
10054 // If we reached the end of the sequence, return the last sequence element.
10055 return sequence[sequence.length - 1];
10056};
10057
10058/**
10059 * Make a delimiter of a given height+depth, with optional centering. Here, we
10060 * traverse the sequences, and create a delimiter that the sequence tells us to.
10061 */
10062var delimiter_makeCustomSizedDelim = function makeCustomSizedDelim(delim, height, center, options, mode, classes) {
10063 if (delim === "<" || delim === "\\lt" || delim === "\u27E8") {
10064 delim = "\\langle";
10065 } else if (delim === ">" || delim === "\\gt" || delim === "\u27E9") {
10066 delim = "\\rangle";
10067 }
10068
10069 // Decide what sequence to use
10070 var sequence = void 0;
10071 if (utils.contains(stackNeverDelimiters, delim)) {
10072 sequence = stackNeverDelimiterSequence;
10073 } else if (utils.contains(stackLargeDelimiters, delim)) {
10074 sequence = stackLargeDelimiterSequence;
10075 } else {
10076 sequence = stackAlwaysDelimiterSequence;
10077 }
10078
10079 // Look through the sequence
10080 var delimType = traverseSequence(delim, height, sequence, options);
10081
10082 // Get the delimiter from font glyphs.
10083 // Depending on the sequence element we decided on, call the
10084 // appropriate function.
10085 if (delimType.type === "small") {
10086 return delimiter_makeSmallDelim(delim, delimType.style, center, options, mode, classes);
10087 } else if (delimType.type === "large") {
10088 return delimiter_makeLargeDelim(delim, delimType.size, center, options, mode, classes);
10089 } else /* if (delimType.type === "stack") */{
10090 return delimiter_makeStackedDelim(delim, height, center, options, mode, classes);
10091 }
10092};
10093
10094/**
10095 * Make a delimiter for use with `\left` and `\right`, given a height and depth
10096 * of an expression that the delimiters surround.
10097 */
10098var makeLeftRightDelim = function makeLeftRightDelim(delim, height, depth, options, mode, classes) {
10099 // We always center \left/\right delimiters, so the axis is always shifted
10100 var axisHeight = options.fontMetrics().axisHeight * options.sizeMultiplier;
10101
10102 // Taken from TeX source, tex.web, function make_left_right
10103 var delimiterFactor = 901;
10104 var delimiterExtend = 5.0 / options.fontMetrics().ptPerEm;
10105
10106 var maxDistFromAxis = Math.max(height - axisHeight, depth + axisHeight);
10107
10108 var totalHeight = Math.max(
10109 // In real TeX, calculations are done using integral values which are
10110 // 65536 per pt, or 655360 per em. So, the division here truncates in
10111 // TeX but doesn't here, producing different results. If we wanted to
10112 // exactly match TeX's calculation, we could do
10113 // Math.floor(655360 * maxDistFromAxis / 500) *
10114 // delimiterFactor / 655360
10115 // (To see the difference, compare
10116 // x^{x^{\left(\rule{0.1em}{0.68em}\right)}}
10117 // in TeX and KaTeX)
10118 maxDistFromAxis / 500 * delimiterFactor, 2 * maxDistFromAxis - delimiterExtend);
10119
10120 // Finally, we defer to `makeCustomSizedDelim` with our calculated total
10121 // height
10122 return delimiter_makeCustomSizedDelim(delim, totalHeight, true, options, mode, classes);
10123};
10124
10125/* harmony default export */ var delimiter = ({
10126 sqrtImage: makeSqrtImage,
10127 sizedDelim: delimiter_makeSizedDelim,
10128 customSizedDelim: delimiter_makeCustomSizedDelim,
10129 leftRightDelim: makeLeftRightDelim
10130});
10131// CONCATENATED MODULE: ./src/functions/delimsizing.js
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143// Extra data needed for the delimiter handler down below
10144var delimiterSizes = {
10145 "\\bigl": { mclass: "mopen", size: 1 },
10146 "\\Bigl": { mclass: "mopen", size: 2 },
10147 "\\biggl": { mclass: "mopen", size: 3 },
10148 "\\Biggl": { mclass: "mopen", size: 4 },
10149 "\\bigr": { mclass: "mclose", size: 1 },
10150 "\\Bigr": { mclass: "mclose", size: 2 },
10151 "\\biggr": { mclass: "mclose", size: 3 },
10152 "\\Biggr": { mclass: "mclose", size: 4 },
10153 "\\bigm": { mclass: "mrel", size: 1 },
10154 "\\Bigm": { mclass: "mrel", size: 2 },
10155 "\\biggm": { mclass: "mrel", size: 3 },
10156 "\\Biggm": { mclass: "mrel", size: 4 },
10157 "\\big": { mclass: "mord", size: 1 },
10158 "\\Big": { mclass: "mord", size: 2 },
10159 "\\bigg": { mclass: "mord", size: 3 },
10160 "\\Bigg": { mclass: "mord", size: 4 }
10161};
10162
10163var delimsizing_delimiters = ["(", ")", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "\u230A", "\u230B", "\\lceil", "\\rceil", "\u2308", "\u2309", "<", ">", "\\langle", "\u27E8", "\\rangle", "\u27E9", "\\lt", "\\gt", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "\u27EE", "\u27EF", "\\lmoustache", "\\rmoustache", "\u23B0", "\u23B1", "/", "\\backslash", "|", "\\vert", "\\|", "\\Vert", "\\uparrow", "\\Uparrow", "\\downarrow", "\\Downarrow", "\\updownarrow", "\\Updownarrow", "."];
10164
10165// Delimiter functions
10166function checkDelimiter(delim, context) {
10167 var symDelim = checkSymbolNodeType(delim);
10168 if (symDelim && utils.contains(delimsizing_delimiters, symDelim.value)) {
10169 return symDelim;
10170 } else {
10171 throw new src_ParseError("Invalid delimiter: '" + String(delim.value) + "' after '" + context.funcName + "'", delim);
10172 }
10173}
10174
10175defineFunction({
10176 type: "delimsizing",
10177 names: ["\\bigl", "\\Bigl", "\\biggl", "\\Biggl", "\\bigr", "\\Bigr", "\\biggr", "\\Biggr", "\\bigm", "\\Bigm", "\\biggm", "\\Biggm", "\\big", "\\Big", "\\bigg", "\\Bigg"],
10178 props: {
10179 numArgs: 1
10180 },
10181 handler: function handler(context, args) {
10182 var delim = checkDelimiter(args[0], context);
10183
10184 return new src_ParseNode("delimsizing", {
10185 type: "delimsizing",
10186 size: delimiterSizes[context.funcName].size,
10187 mclass: delimiterSizes[context.funcName].mclass,
10188 value: delim.value
10189 }, context.parser.mode);
10190 },
10191 htmlBuilder: function htmlBuilder(group, options) {
10192 var delim = group.value.value;
10193
10194 if (delim === ".") {
10195 // Empty delimiters still count as elements, even though they don't
10196 // show anything.
10197 return buildCommon.makeSpan([group.value.mclass]);
10198 }
10199
10200 // Use delimiter.sizedDelim to generate the delimiter.
10201 return delimiter.sizedDelim(delim, group.value.size, options, group.mode, [group.value.mclass]);
10202 },
10203 mathmlBuilder: function mathmlBuilder(group) {
10204 var children = [];
10205
10206 if (group.value.value !== ".") {
10207 children.push(buildMathML_makeText(group.value.value, group.mode));
10208 }
10209
10210 var node = new mathMLTree.MathNode("mo", children);
10211
10212 if (group.value.mclass === "mopen" || group.value.mclass === "mclose") {
10213 // Only some of the delimsizing functions act as fences, and they
10214 // return "mopen" or "mclose" mclass.
10215 node.setAttribute("fence", "true");
10216 } else {
10217 // Explicitly disable fencing if it's not a fence, to override the
10218 // defaults.
10219 node.setAttribute("fence", "false");
10220 }
10221
10222 return node;
10223 }
10224});
10225
10226function leftRightGroupValue(group) {
10227 if (!group.value.body) {
10228 throw new Error("Bug: The leftright ParseNode wasn't fully parsed.");
10229 }
10230 return group.value;
10231}
10232
10233defineFunction({
10234 type: "leftright-right",
10235 names: ["\\right"],
10236 props: {
10237 numArgs: 1
10238 },
10239 handler: function handler(context, args) {
10240 // \left case below triggers parsing of \right in
10241 // `const right = parser.parseFunction();`
10242 // uses this return value.
10243 return new src_ParseNode("leftright-right", {
10244 type: "leftright-right",
10245 value: checkDelimiter(args[0], context).value
10246 }, context.parser.mode);
10247 }
10248});
10249
10250defineFunction({
10251 type: "leftright",
10252 names: ["\\left"],
10253 props: {
10254 numArgs: 1
10255 },
10256 handler: function handler(context, args) {
10257 var delim = checkDelimiter(args[0], context);
10258
10259 var parser = context.parser;
10260 // Parse out the implicit body
10261 ++parser.leftrightDepth;
10262 // parseExpression stops before '\\right'
10263 var body = parser.parseExpression(false);
10264 --parser.leftrightDepth;
10265 // Check the next token
10266 parser.expect("\\right", false);
10267 var right = parser.parseFunction();
10268 if (!right) {
10269 throw new src_ParseError('failed to parse function after \\right');
10270 }
10271 return new src_ParseNode("leftright", {
10272 type: "leftright",
10273 body: body,
10274 left: delim.value,
10275 right: assertNodeType(right, "leftright-right").value.value
10276 }, parser.mode);
10277 },
10278 htmlBuilder: function htmlBuilder(group, options) {
10279 var groupValue = leftRightGroupValue(group);
10280 // Build the inner expression
10281 var inner = buildHTML_buildExpression(groupValue.body, options, true, [null, "mclose"]);
10282
10283 var innerHeight = 0;
10284 var innerDepth = 0;
10285 var hadMiddle = false;
10286
10287 // Calculate its height and depth
10288 for (var i = 0; i < inner.length; i++) {
10289 // Property `isMiddle` not defined on `span`. See comment in
10290 // "middle"'s htmlBuilder.
10291 // $FlowFixMe
10292 if (inner[i].isMiddle) {
10293 hadMiddle = true;
10294 } else {
10295 innerHeight = Math.max(inner[i].height, innerHeight);
10296 innerDepth = Math.max(inner[i].depth, innerDepth);
10297 }
10298 }
10299
10300 // The size of delimiters is the same, regardless of what style we are
10301 // in. Thus, to correctly calculate the size of delimiter we need around
10302 // a group, we scale down the inner size based on the size.
10303 innerHeight *= options.sizeMultiplier;
10304 innerDepth *= options.sizeMultiplier;
10305
10306 var leftDelim = void 0;
10307 if (groupValue.left === ".") {
10308 // Empty delimiters in \left and \right make null delimiter spaces.
10309 leftDelim = makeNullDelimiter(options, ["mopen"]);
10310 } else {
10311 // Otherwise, use leftRightDelim to generate the correct sized
10312 // delimiter.
10313 leftDelim = delimiter.leftRightDelim(groupValue.left, innerHeight, innerDepth, options, group.mode, ["mopen"]);
10314 }
10315 // Add it to the beginning of the expression
10316 inner.unshift(leftDelim);
10317
10318 // Handle middle delimiters
10319 if (hadMiddle) {
10320 for (var _i = 1; _i < inner.length; _i++) {
10321 var middleDelim = inner[_i];
10322 // Property `isMiddle` not defined on `span`. See comment in
10323 // "middle"'s htmlBuilder.
10324 // $FlowFixMe
10325 var isMiddle = middleDelim.isMiddle;
10326 if (isMiddle) {
10327 // Apply the options that were active when \middle was called
10328 inner[_i] = delimiter.leftRightDelim(isMiddle.value, innerHeight, innerDepth, isMiddle.options, group.mode, []);
10329 }
10330 }
10331 }
10332
10333 var rightDelim = void 0;
10334 // Same for the right delimiter
10335 if (groupValue.right === ".") {
10336 rightDelim = makeNullDelimiter(options, ["mclose"]);
10337 } else {
10338 rightDelim = delimiter.leftRightDelim(groupValue.right, innerHeight, innerDepth, options, group.mode, ["mclose"]);
10339 }
10340 // Add it to the end of the expression.
10341 inner.push(rightDelim);
10342
10343 return buildCommon.makeSpan(["minner"], inner, options);
10344 },
10345 mathmlBuilder: function mathmlBuilder(group, options) {
10346 var groupValue = leftRightGroupValue(group);
10347 var inner = buildMathML_buildExpression(groupValue.body, options);
10348
10349 if (groupValue.left !== ".") {
10350 var leftNode = new mathMLTree.MathNode("mo", [buildMathML_makeText(groupValue.left, group.mode)]);
10351
10352 leftNode.setAttribute("fence", "true");
10353
10354 inner.unshift(leftNode);
10355 }
10356
10357 if (groupValue.right !== ".") {
10358 var rightNode = new mathMLTree.MathNode("mo", [buildMathML_makeText(groupValue.right, group.mode)]);
10359
10360 rightNode.setAttribute("fence", "true");
10361
10362 inner.push(rightNode);
10363 }
10364
10365 return buildMathML_makeRow(inner);
10366 }
10367});
10368
10369defineFunction({
10370 type: "middle",
10371 names: ["\\middle"],
10372 props: {
10373 numArgs: 1
10374 },
10375 handler: function handler(context, args) {
10376 var delim = checkDelimiter(args[0], context);
10377 if (!context.parser.leftrightDepth) {
10378 throw new src_ParseError("\\middle without preceding \\left", delim);
10379 }
10380
10381 return new src_ParseNode("middle", {
10382 type: "middle",
10383 value: delim.value
10384 }, context.parser.mode);
10385 },
10386 htmlBuilder: function htmlBuilder(group, options) {
10387 var middleDelim = void 0;
10388 if (group.value.value === ".") {
10389 middleDelim = makeNullDelimiter(options, []);
10390 } else {
10391 middleDelim = delimiter.sizedDelim(group.value.value, 1, options, group.mode, []);
10392
10393 var isMiddle = { value: group.value.value, options: options };
10394 // Property `isMiddle` not defined on `span`. It is only used in
10395 // this file above.
10396 // TODO: Fix this violation of the `span` type and possibly rename
10397 // things since `isMiddle` sounds like a boolean, but is a struct.
10398 // $FlowFixMe
10399 middleDelim.isMiddle = isMiddle;
10400 }
10401 return middleDelim;
10402 },
10403 mathmlBuilder: function mathmlBuilder(group, options) {
10404 var middleNode = new mathMLTree.MathNode("mo", [buildMathML_makeText(group.value.value, group.mode)]);
10405 middleNode.setAttribute("fence", "true");
10406 return middleNode;
10407 }
10408});
10409// CONCATENATED MODULE: ./src/functions/enclose.js
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420var enclose_htmlBuilder = function htmlBuilder(group, options) {
10421 // \cancel, \bcancel, \xcancel, \sout, \fbox, \colorbox, \fcolorbox
10422 var inner = buildHTML_buildGroup(group.value.body, options);
10423
10424 var label = group.value.label.substr(1);
10425 var scale = options.sizeMultiplier;
10426 var img = void 0;
10427 var imgShift = 0;
10428
10429 // In the LaTeX cancel package, line geometry is slightly different
10430 // depending on whether the subject is wider than it is tall, or vice versa.
10431 // We don't know the width of a group, so as a proxy, we test if
10432 // the subject is a single character. This captures most of the
10433 // subjects that should get the "tall" treatment.
10434 var isSingleChar = utils.isCharacterBox(group.value.body);
10435
10436 if (label === "sout") {
10437 img = buildCommon.makeSpan(["stretchy", "sout"]);
10438 img.height = options.fontMetrics().defaultRuleThickness / scale;
10439 imgShift = -0.5 * options.fontMetrics().xHeight;
10440 } else {
10441 // Add horizontal padding
10442 if (/cancel/.test(label)) {
10443 if (!isSingleChar) {
10444 inner.classes.push("cancel-pad");
10445 }
10446 } else {
10447 inner.classes.push("boxpad");
10448 }
10449
10450 // Add vertical padding
10451 var vertPad = 0;
10452 // ref: LaTeX source2e: \fboxsep = 3pt; \fboxrule = .4pt
10453 // ref: cancel package: \advance\totalheight2\p@ % "+2"
10454 if (/box/.test(label)) {
10455 vertPad = label === "colorbox" ? 0.3 : 0.34;
10456 } else {
10457 vertPad = isSingleChar ? 0.2 : 0;
10458 }
10459
10460 img = stretchy.encloseSpan(inner, label, vertPad, options);
10461 imgShift = inner.depth + vertPad;
10462
10463 if (group.value.backgroundColor) {
10464 img.style.backgroundColor = group.value.backgroundColor.value;
10465 if (group.value.borderColor) {
10466 img.style.borderColor = group.value.borderColor.value;
10467 }
10468 }
10469 }
10470
10471 var vlist = void 0;
10472 if (group.value.backgroundColor) {
10473 vlist = buildCommon.makeVList({
10474 positionType: "individualShift",
10475 children: [
10476 // Put the color background behind inner;
10477 { type: "elem", elem: img, shift: imgShift }, { type: "elem", elem: inner, shift: 0 }]
10478 }, options);
10479 } else {
10480 vlist = buildCommon.makeVList({
10481 positionType: "individualShift",
10482 children: [
10483 // Write the \cancel stroke on top of inner.
10484 {
10485 type: "elem",
10486 elem: inner,
10487 shift: 0
10488 }, {
10489 type: "elem",
10490 elem: img,
10491 shift: imgShift,
10492 wrapperClasses: /cancel/.test(label) ? ["svg-align"] : []
10493 }]
10494 }, options);
10495 }
10496
10497 if (/cancel/.test(label)) {
10498 // The cancel package documentation says that cancel lines add their height
10499 // to the expression, but tests show that isn't how it actually works.
10500 vlist.height = inner.height;
10501 vlist.depth = inner.depth;
10502 }
10503
10504 if (/cancel/.test(label) && !isSingleChar) {
10505 // cancel does not create horiz space for its line extension.
10506 return buildCommon.makeSpan(["mord", "cancel-lap"], [vlist], options);
10507 } else {
10508 return buildCommon.makeSpan(["mord"], [vlist], options);
10509 }
10510};
10511
10512var enclose_mathmlBuilder = function mathmlBuilder(group, options) {
10513 var node = new mathMLTree.MathNode("menclose", [buildMathML_buildGroup(group.value.body, options)]);
10514 switch (group.value.label) {
10515 case "\\cancel":
10516 node.setAttribute("notation", "updiagonalstrike");
10517 break;
10518 case "\\bcancel":
10519 node.setAttribute("notation", "downdiagonalstrike");
10520 break;
10521 case "\\sout":
10522 node.setAttribute("notation", "horizontalstrike");
10523 break;
10524 case "\\fbox":
10525 node.setAttribute("notation", "box");
10526 break;
10527 case "\\fcolorbox":
10528 // TODO(ron): I don't know any way to set the border color.
10529 node.setAttribute("notation", "box");
10530 break;
10531 case "\\xcancel":
10532 node.setAttribute("notation", "updiagonalstrike downdiagonalstrike");
10533 break;
10534 }
10535 if (group.value.backgroundColor) {
10536 node.setAttribute("mathbackground", group.value.backgroundColor.value);
10537 }
10538 return node;
10539};
10540
10541defineFunction({
10542 type: "enclose",
10543 names: ["\\colorbox"],
10544 props: {
10545 numArgs: 2,
10546 allowedInText: true,
10547 greediness: 3,
10548 argTypes: ["color", "text"]
10549 },
10550 handler: function handler(_ref, args, optArgs) {
10551 var parser = _ref.parser,
10552 funcName = _ref.funcName;
10553
10554 var color = assertNodeType(args[0], "color-token");
10555 var body = args[1];
10556 return new src_ParseNode("enclose", {
10557 type: "enclose",
10558 label: funcName,
10559 backgroundColor: color,
10560 body: body
10561 }, parser.mode);
10562 },
10563
10564 htmlBuilder: enclose_htmlBuilder,
10565 mathmlBuilder: enclose_mathmlBuilder
10566});
10567
10568defineFunction({
10569 type: "enclose",
10570 names: ["\\fcolorbox"],
10571 props: {
10572 numArgs: 3,
10573 allowedInText: true,
10574 greediness: 3,
10575 argTypes: ["color", "color", "text"]
10576 },
10577 handler: function handler(_ref2, args, optArgs) {
10578 var parser = _ref2.parser,
10579 funcName = _ref2.funcName;
10580
10581 var borderColor = assertNodeType(args[0], "color-token");
10582 var backgroundColor = assertNodeType(args[1], "color-token");
10583 var body = args[2];
10584 return new src_ParseNode("enclose", {
10585 type: "enclose",
10586 label: funcName,
10587 backgroundColor: backgroundColor,
10588 borderColor: borderColor,
10589 body: body
10590 }, parser.mode);
10591 },
10592
10593 htmlBuilder: enclose_htmlBuilder,
10594 mathmlBuilder: enclose_mathmlBuilder
10595});
10596
10597defineFunction({
10598 type: "enclose",
10599 names: ["\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\fbox"],
10600 props: {
10601 numArgs: 1
10602 },
10603 handler: function handler(_ref3, args, optArgs) {
10604 var parser = _ref3.parser,
10605 funcName = _ref3.funcName;
10606
10607 var body = args[0];
10608 return new src_ParseNode("enclose", {
10609 type: "enclose",
10610 label: funcName,
10611 body: body
10612 }, parser.mode);
10613 },
10614
10615 htmlBuilder: enclose_htmlBuilder,
10616 mathmlBuilder: enclose_mathmlBuilder
10617});
10618// CONCATENATED MODULE: ./src/functions/environment.js
10619
10620
10621
10622
10623// Environment delimiters. HTML/MathML rendering is defined in the corresponding
10624// defineEnvironment definitions.
10625defineFunction({
10626 type: "environment",
10627 names: ["\\begin", "\\end"],
10628 props: {
10629 numArgs: 1,
10630 argTypes: ["text"]
10631 },
10632 handler: function handler(_ref, args) {
10633 var parser = _ref.parser;
10634
10635 var nameGroup = args[0];
10636 if (nameGroup.type !== "ordgroup") {
10637 throw new src_ParseError("Invalid environment name", nameGroup);
10638 }
10639 var name = "";
10640 for (var i = 0; i < nameGroup.value.length; ++i) {
10641 name += assertNodeType(nameGroup.value[i], "textord").value;
10642 }
10643 return new src_ParseNode("environment", {
10644 type: "environment",
10645 name: name,
10646 nameGroup: nameGroup
10647 }, parser.mode);
10648 }
10649});
10650// EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/object/keys.js
10651var keys = __webpack_require__(63);
10652var keys_default = /*#__PURE__*/__webpack_require__.n(keys);
10653
10654// CONCATENATED MODULE: ./src/functions/font.js
10655
10656
10657// TODO(kevinb): implement \\sl and \\sc
10658
10659
10660
10661
10662
10663
10664
10665var font_htmlBuilder = function htmlBuilder(group, options) {
10666 var font = group.value.font;
10667 var newOptions = options.withFont(font);
10668 return buildHTML_buildGroup(group.value.body, newOptions);
10669};
10670
10671var font_mathmlBuilder = function mathmlBuilder(group, options) {
10672 var font = group.value.font;
10673 var newOptions = options.withFont(font);
10674 return buildMathML_buildGroup(group.value.body, newOptions);
10675};
10676
10677var fontAliases = {
10678 "\\Bbb": "\\mathbb",
10679 "\\bold": "\\mathbf",
10680 "\\frak": "\\mathfrak",
10681 "\\bm": "\\boldsymbol"
10682};
10683
10684defineFunction({
10685 type: "font",
10686 names: [
10687 // styles, except \boldsymbol defined below
10688 "\\mathrm", "\\mathit", "\\mathbf",
10689
10690 // families
10691 "\\mathbb", "\\mathcal", "\\mathfrak", "\\mathscr", "\\mathsf", "\\mathtt",
10692
10693 // aliases, except \bm defined below
10694 "\\Bbb", "\\bold", "\\frak"],
10695 props: {
10696 numArgs: 1,
10697 greediness: 2
10698 },
10699 handler: function handler(_ref, args) {
10700 var parser = _ref.parser,
10701 funcName = _ref.funcName;
10702
10703 var body = args[0];
10704 var func = funcName;
10705 if (func in fontAliases) {
10706 func = fontAliases[func];
10707 }
10708 return new src_ParseNode("font", {
10709 type: "font",
10710 font: func.slice(1),
10711 body: body
10712 }, parser.mode);
10713 },
10714 htmlBuilder: font_htmlBuilder,
10715 mathmlBuilder: font_mathmlBuilder
10716});
10717
10718defineFunction({
10719 type: "mclass",
10720 names: ["\\boldsymbol", "\\bm"],
10721 props: {
10722 numArgs: 1,
10723 greediness: 2
10724 },
10725 handler: function handler(_ref2, args) {
10726 var parser = _ref2.parser;
10727
10728 var body = args[0];
10729 // amsbsy.sty's \boldsymbol inherits the argument's bin|rel|ord status
10730 // (similar to \stackrel in functions/mclass.js)
10731 var mclass = "mord";
10732 var atomType = body.type === "ordgroup" && body.value.length ? body.value[0].type : body.type;
10733 if (/^(bin|rel)$/.test(atomType)) {
10734 mclass = "m" + atomType;
10735 }
10736 return new src_ParseNode("mclass", {
10737 type: "mclass",
10738 mclass: mclass,
10739 value: [new src_ParseNode("font", {
10740 type: "font",
10741 font: "boldsymbol",
10742 body: body
10743 }, parser.mode)]
10744 }, parser.mode);
10745 }
10746});
10747
10748var oldFontFuncsMap = {
10749 "\\rm": "mathrm",
10750 "\\sf": "mathsf",
10751 "\\tt": "mathtt",
10752 "\\bf": "mathbf",
10753 "\\it": "mathit"
10754};
10755
10756// Old font changing functions
10757defineFunction({
10758 type: "font",
10759 names: keys_default()(oldFontFuncsMap),
10760 props: {
10761 numArgs: 0,
10762 allowedInText: true
10763 },
10764 handler: function handler(_ref3, args) {
10765 var parser = _ref3.parser,
10766 funcName = _ref3.funcName,
10767 breakOnTokenText = _ref3.breakOnTokenText;
10768 var mode = parser.mode;
10769
10770 parser.consumeSpaces();
10771 var body = parser.parseExpression(true, breakOnTokenText);
10772 var style = oldFontFuncsMap[funcName];
10773
10774 return new src_ParseNode("font", {
10775 type: "font",
10776 font: style,
10777 body: new src_ParseNode("ordgroup", body, parser.mode)
10778 }, mode);
10779 },
10780 htmlBuilder: font_htmlBuilder,
10781 mathmlBuilder: font_mathmlBuilder
10782});
10783// CONCATENATED MODULE: ./src/functions/genfrac.js
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794defineFunction({
10795 type: "genfrac",
10796 names: ["\\cfrac", "\\dfrac", "\\frac", "\\tfrac", "\\dbinom", "\\binom", "\\tbinom", "\\\\atopfrac"],
10797 props: {
10798 numArgs: 2,
10799 greediness: 2
10800 },
10801 handler: function handler(_ref, args) {
10802 var parser = _ref.parser,
10803 funcName = _ref.funcName;
10804
10805 var numer = args[0];
10806 var denom = args[1];
10807 var hasBarLine = void 0;
10808 var leftDelim = null;
10809 var rightDelim = null;
10810 var size = "auto";
10811
10812 switch (funcName) {
10813 case "\\cfrac":
10814 case "\\dfrac":
10815 case "\\frac":
10816 case "\\tfrac":
10817 hasBarLine = true;
10818 break;
10819 case "\\\\atopfrac":
10820 hasBarLine = false;
10821 break;
10822 case "\\dbinom":
10823 case "\\binom":
10824 case "\\tbinom":
10825 hasBarLine = false;
10826 leftDelim = "(";
10827 rightDelim = ")";
10828 break;
10829 default:
10830 throw new Error("Unrecognized genfrac command");
10831 }
10832
10833 switch (funcName) {
10834 case "\\cfrac":
10835 case "\\dfrac":
10836 case "\\dbinom":
10837 size = "display";
10838 break;
10839 case "\\tfrac":
10840 case "\\tbinom":
10841 size = "text";
10842 break;
10843 }
10844
10845 return new src_ParseNode("genfrac", {
10846 type: "genfrac",
10847 continued: funcName === "\\cfrac",
10848 numer: numer,
10849 denom: denom,
10850 hasBarLine: hasBarLine,
10851 leftDelim: leftDelim,
10852 rightDelim: rightDelim,
10853 size: size
10854 }, parser.mode);
10855 },
10856 htmlBuilder: function htmlBuilder(group, options) {
10857 // Fractions are handled in the TeXbook on pages 444-445, rules 15(a-e).
10858 // Figure out what style this fraction should be in based on the
10859 // function used
10860 var style = options.style;
10861 if (group.value.size === "display") {
10862 style = src_Style.DISPLAY;
10863 } else if (group.value.size === "text" && style.size === src_Style.DISPLAY.size) {
10864 // We're in a \tfrac but incoming style is displaystyle, so:
10865 style = src_Style.TEXT;
10866 }
10867
10868 var nstyle = style.fracNum();
10869 var dstyle = style.fracDen();
10870 var newOptions = void 0;
10871
10872 newOptions = options.havingStyle(nstyle);
10873 var numerm = buildHTML_buildGroup(group.value.numer, newOptions, options);
10874
10875 if (group.value.continued) {
10876 // \cfrac inserts a \strut into the numerator.
10877 // Get \strut dimensions from TeXbook page 353.
10878 var hStrut = 8.5 / options.fontMetrics().ptPerEm;
10879 var dStrut = 3.5 / options.fontMetrics().ptPerEm;
10880 numerm.height = numerm.height < hStrut ? hStrut : numerm.height;
10881 numerm.depth = numerm.depth < dStrut ? dStrut : numerm.depth;
10882 }
10883
10884 newOptions = options.havingStyle(dstyle);
10885 var denomm = buildHTML_buildGroup(group.value.denom, newOptions, options);
10886
10887 var rule = void 0;
10888 var ruleWidth = void 0;
10889 var ruleSpacing = void 0;
10890 if (group.value.hasBarLine) {
10891 rule = buildCommon.makeLineSpan("frac-line", options);
10892 ruleWidth = rule.height;
10893 ruleSpacing = rule.height;
10894 } else {
10895 rule = null;
10896 ruleWidth = 0;
10897 ruleSpacing = options.fontMetrics().defaultRuleThickness;
10898 }
10899
10900 // Rule 15b
10901 var numShift = void 0;
10902 var clearance = void 0;
10903 var denomShift = void 0;
10904 if (style.size === src_Style.DISPLAY.size) {
10905 numShift = options.fontMetrics().num1;
10906 if (ruleWidth > 0) {
10907 clearance = 3 * ruleSpacing;
10908 } else {
10909 clearance = 7 * ruleSpacing;
10910 }
10911 denomShift = options.fontMetrics().denom1;
10912 } else {
10913 if (ruleWidth > 0) {
10914 numShift = options.fontMetrics().num2;
10915 clearance = ruleSpacing;
10916 } else {
10917 numShift = options.fontMetrics().num3;
10918 clearance = 3 * ruleSpacing;
10919 }
10920 denomShift = options.fontMetrics().denom2;
10921 }
10922
10923 var frac = void 0;
10924 if (!rule) {
10925 // Rule 15c
10926 var candidateClearance = numShift - numerm.depth - (denomm.height - denomShift);
10927 if (candidateClearance < clearance) {
10928 numShift += 0.5 * (clearance - candidateClearance);
10929 denomShift += 0.5 * (clearance - candidateClearance);
10930 }
10931
10932 frac = buildCommon.makeVList({
10933 positionType: "individualShift",
10934 children: [{ type: "elem", elem: denomm, shift: denomShift }, { type: "elem", elem: numerm, shift: -numShift }]
10935 }, options);
10936 } else {
10937 // Rule 15d
10938 var axisHeight = options.fontMetrics().axisHeight;
10939
10940 if (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth) < clearance) {
10941 numShift += clearance - (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth));
10942 }
10943
10944 if (axisHeight - 0.5 * ruleWidth - (denomm.height - denomShift) < clearance) {
10945 denomShift += clearance - (axisHeight - 0.5 * ruleWidth - (denomm.height - denomShift));
10946 }
10947
10948 var midShift = -(axisHeight - 0.5 * ruleWidth);
10949
10950 frac = buildCommon.makeVList({
10951 positionType: "individualShift",
10952 children: [{ type: "elem", elem: denomm, shift: denomShift }, { type: "elem", elem: rule, shift: midShift }, { type: "elem", elem: numerm, shift: -numShift }]
10953 }, options);
10954 }
10955
10956 // Since we manually change the style sometimes (with \dfrac or \tfrac),
10957 // account for the possible size change here.
10958 newOptions = options.havingStyle(style);
10959 frac.height *= newOptions.sizeMultiplier / options.sizeMultiplier;
10960 frac.depth *= newOptions.sizeMultiplier / options.sizeMultiplier;
10961
10962 // Rule 15e
10963 var delimSize = void 0;
10964 if (style.size === src_Style.DISPLAY.size) {
10965 delimSize = options.fontMetrics().delim1;
10966 } else {
10967 delimSize = options.fontMetrics().delim2;
10968 }
10969
10970 var leftDelim = void 0;
10971 var rightDelim = void 0;
10972 if (group.value.leftDelim == null) {
10973 leftDelim = makeNullDelimiter(options, ["mopen"]);
10974 } else {
10975 leftDelim = delimiter.customSizedDelim(group.value.leftDelim, delimSize, true, options.havingStyle(style), group.mode, ["mopen"]);
10976 }
10977
10978 if (group.value.continued) {
10979 rightDelim = buildCommon.makeSpan([]); // zero width for \cfrac
10980 } else if (group.value.rightDelim == null) {
10981 rightDelim = makeNullDelimiter(options, ["mclose"]);
10982 } else {
10983 rightDelim = delimiter.customSizedDelim(group.value.rightDelim, delimSize, true, options.havingStyle(style), group.mode, ["mclose"]);
10984 }
10985
10986 return buildCommon.makeSpan(["mord"].concat(newOptions.sizingClasses(options)), [leftDelim, buildCommon.makeSpan(["mfrac"], [frac]), rightDelim], options);
10987 },
10988 mathmlBuilder: function mathmlBuilder(group, options) {
10989 var node = new mathMLTree.MathNode("mfrac", [buildMathML_buildGroup(group.value.numer, options), buildMathML_buildGroup(group.value.denom, options)]);
10990
10991 if (!group.value.hasBarLine) {
10992 node.setAttribute("linethickness", "0px");
10993 }
10994
10995 if (group.value.leftDelim != null || group.value.rightDelim != null) {
10996 var withDelims = [];
10997
10998 if (group.value.leftDelim != null) {
10999 var leftOp = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(group.value.leftDelim)]);
11000
11001 leftOp.setAttribute("fence", "true");
11002
11003 withDelims.push(leftOp);
11004 }
11005
11006 withDelims.push(node);
11007
11008 if (group.value.rightDelim != null) {
11009 var rightOp = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(group.value.rightDelim)]);
11010
11011 rightOp.setAttribute("fence", "true");
11012
11013 withDelims.push(rightOp);
11014 }
11015
11016 return buildMathML_makeRow(withDelims);
11017 }
11018
11019 return node;
11020 }
11021});
11022
11023// Infix generalized fractions -- these are not rendered directly, but replaced
11024// immediately by one of the variants above.
11025defineFunction({
11026 type: "infix",
11027 names: ["\\over", "\\choose", "\\atop"],
11028 props: {
11029 numArgs: 0,
11030 infix: true
11031 },
11032 handler: function handler(_ref2) {
11033 var parser = _ref2.parser,
11034 funcName = _ref2.funcName,
11035 token = _ref2.token;
11036
11037 var replaceWith = void 0;
11038 switch (funcName) {
11039 case "\\over":
11040 replaceWith = "\\frac";
11041 break;
11042 case "\\choose":
11043 replaceWith = "\\binom";
11044 break;
11045 case "\\atop":
11046 replaceWith = "\\\\atopfrac";
11047 break;
11048 default:
11049 throw new Error("Unrecognized infix genfrac command");
11050 }
11051 return new src_ParseNode("infix", {
11052 type: "infix",
11053 replaceWith: replaceWith,
11054 token: token
11055 }, parser.mode);
11056 }
11057});
11058// CONCATENATED MODULE: ./src/functions/horizBrace.js
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069// NOTE: Unlike most `htmlBuilder`s, this one handles not only "horizBrace", but
11070// also "supsub" since an over/underbrace can affect super/subscripting.
11071var horizBrace_htmlBuilder = function htmlBuilder(grp, options) {
11072 var style = options.style;
11073
11074 // Pull out the `ParseNode<"horizBrace">` if `grp` is a "supsub" node.
11075 var supSubGroup = void 0;
11076 var group = void 0;
11077 var supSub = checkNodeType(grp, "supsub");
11078 if (supSub) {
11079 // Ref: LaTeX source2e: }}}}\limits}
11080 // i.e. LaTeX treats the brace similar to an op and passes it
11081 // with \limits, so we need to assign supsub style.
11082 supSubGroup = supSub.value.sup ? buildHTML_buildGroup(supSub.value.sup, options.havingStyle(style.sup()), options) : buildHTML_buildGroup(supSub.value.sub, options.havingStyle(style.sub()), options);
11083 group = assertNodeType(supSub.value.base, "horizBrace");
11084 } else {
11085 group = assertNodeType(grp, "horizBrace");
11086 }
11087
11088 // Build the base group
11089 var body = buildHTML_buildGroup(group.value.base, options.havingBaseStyle(src_Style.DISPLAY));
11090
11091 // Create the stretchy element
11092 var braceBody = stretchy.svgSpan(group, options);
11093
11094 // Generate the vlist, with the appropriate kerns ??????????
11095 // This first vlist contains the content and the brace: equation
11096 var vlist = void 0;
11097 if (group.value.isOver) {
11098 vlist = buildCommon.makeVList({
11099 positionType: "firstBaseline",
11100 children: [{ type: "elem", elem: body }, { type: "kern", size: 0.1 }, { type: "elem", elem: braceBody }]
11101 }, options);
11102 // $FlowFixMe: Replace this with passing "svg-align" into makeVList.
11103 vlist.children[0].children[0].children[1].classes.push("svg-align");
11104 } else {
11105 vlist = buildCommon.makeVList({
11106 positionType: "bottom",
11107 positionData: body.depth + 0.1 + braceBody.height,
11108 children: [{ type: "elem", elem: braceBody }, { type: "kern", size: 0.1 }, { type: "elem", elem: body }]
11109 }, options);
11110 // $FlowFixMe: Replace this with passing "svg-align" into makeVList.
11111 vlist.children[0].children[0].children[0].classes.push("svg-align");
11112 }
11113
11114 if (supSubGroup) {
11115 // To write the supsub, wrap the first vlist in another vlist:
11116 // They can't all go in the same vlist, because the note might be
11117 // wider than the equation. We want the equation to control the
11118 // brace width.
11119
11120 // note long note long note
11121 // ?????????? or ????? not ???????????
11122 // equation eqn eqn
11123
11124 var vSpan = buildCommon.makeSpan(["mord", group.value.isOver ? "mover" : "munder"], [vlist], options);
11125
11126 if (group.value.isOver) {
11127 vlist = buildCommon.makeVList({
11128 positionType: "firstBaseline",
11129 children: [{ type: "elem", elem: vSpan }, { type: "kern", size: 0.2 }, { type: "elem", elem: supSubGroup }]
11130 }, options);
11131 } else {
11132 vlist = buildCommon.makeVList({
11133 positionType: "bottom",
11134 positionData: vSpan.depth + 0.2 + supSubGroup.height + supSubGroup.depth,
11135 children: [{ type: "elem", elem: supSubGroup }, { type: "kern", size: 0.2 }, { type: "elem", elem: vSpan }]
11136 }, options);
11137 }
11138 }
11139
11140 return buildCommon.makeSpan(["mord", group.value.isOver ? "mover" : "munder"], [vlist], options);
11141};
11142
11143var horizBrace_mathmlBuilder = function mathmlBuilder(group, options) {
11144 var accentNode = stretchy.mathMLnode(group.value.label);
11145 return new mathMLTree.MathNode(group.value.isOver ? "mover" : "munder", [buildMathML_buildGroup(group.value.base, options), accentNode]);
11146};
11147
11148// Horizontal stretchy braces
11149defineFunction({
11150 type: "horizBrace",
11151 names: ["\\overbrace", "\\underbrace"],
11152 props: {
11153 numArgs: 1
11154 },
11155 handler: function handler(_ref, args) {
11156 var parser = _ref.parser,
11157 funcName = _ref.funcName;
11158
11159 return new src_ParseNode("horizBrace", {
11160 type: "horizBrace",
11161 label: funcName,
11162 isOver: /^\\over/.test(funcName),
11163 base: args[0]
11164 }, parser.mode);
11165 },
11166
11167 htmlBuilder: horizBrace_htmlBuilder,
11168 mathmlBuilder: horizBrace_mathmlBuilder
11169});
11170// CONCATENATED MODULE: ./src/functions/href.js
11171
11172
11173
11174
11175
11176
11177
11178defineFunction({
11179 type: "href",
11180 names: ["\\href"],
11181 props: {
11182 numArgs: 2,
11183 argTypes: ["url", "original"]
11184 },
11185 handler: function handler(_ref, args) {
11186 var parser = _ref.parser;
11187
11188 var body = args[1];
11189 var href = assertNodeType(args[0], "url").value.value;
11190 return new src_ParseNode("href", {
11191 type: "href",
11192 href: href,
11193 body: defineFunction_ordargument(body)
11194 }, parser.mode);
11195 },
11196 htmlBuilder: function htmlBuilder(group, options) {
11197 var elements = buildHTML_buildExpression(group.value.body, options, false);
11198
11199 var href = group.value.href;
11200
11201 return new buildCommon.makeAnchor(href, [], elements, options);
11202 },
11203 mathmlBuilder: function mathmlBuilder(group, options) {
11204 var math = buildExpressionRow(group.value.body, options);
11205 math.setAttribute("href", group.value.href);
11206 return math;
11207 }
11208});
11209// CONCATENATED MODULE: ./src/functions/kern.js
11210
11211// Horizontal spacing commands
11212
11213
11214
11215
11216
11217
11218
11219// TODO: \hskip and \mskip should support plus and minus in lengths
11220
11221defineFunction({
11222 type: "kern",
11223 names: ["\\kern", "\\mkern", "\\hskip", "\\mskip"],
11224 props: {
11225 numArgs: 1,
11226 argTypes: ["size"],
11227 allowedInText: true
11228 },
11229 handler: function handler(_ref, args) {
11230 var parser = _ref.parser,
11231 funcName = _ref.funcName;
11232
11233 var size = assertNodeType(args[0], "size");
11234 if (parser.settings.strict) {
11235 var mathFunction = funcName[1] === 'm'; // \mkern, \mskip
11236 var muUnit = size.value.value.unit === 'mu';
11237 if (mathFunction) {
11238 if (!muUnit) {
11239 parser.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " supports only mu units, " + ("not " + size.value.value.unit + " units"));
11240 }
11241 if (parser.mode !== "math") {
11242 parser.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " works only in math mode");
11243 }
11244 } else {
11245 // !mathFunction
11246 if (muUnit) {
11247 parser.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " doesn't support mu units");
11248 }
11249 }
11250 }
11251 return new src_ParseNode("kern", {
11252 type: "kern",
11253 dimension: size.value.value
11254 }, parser.mode);
11255 },
11256 htmlBuilder: function htmlBuilder(group, options) {
11257 return buildCommon.makeGlue(group.value.dimension, options);
11258 },
11259 mathmlBuilder: function mathmlBuilder(group, options) {
11260 var dimension = units_calculateSize(group.value.dimension, options);
11261 return new mathMLTree.SpaceNode(dimension);
11262 }
11263});
11264// CONCATENATED MODULE: ./src/functions/lap.js
11265
11266// Horizontal overlap functions
11267
11268
11269
11270
11271
11272
11273
11274
11275defineFunction({
11276 type: "lap",
11277 names: ["\\mathllap", "\\mathrlap", "\\mathclap"],
11278 props: {
11279 numArgs: 1,
11280 allowedInText: true
11281 },
11282 handler: function handler(_ref, args) {
11283 var parser = _ref.parser,
11284 funcName = _ref.funcName;
11285
11286 var body = args[0];
11287 return new src_ParseNode("lap", {
11288 type: "lap",
11289 alignment: funcName.slice(5),
11290 body: body
11291 }, parser.mode);
11292 },
11293 htmlBuilder: function htmlBuilder(group, options) {
11294 // mathllap, mathrlap, mathclap
11295 var inner = void 0;
11296 if (group.value.alignment === "clap") {
11297 // ref: https://www.math.lsu.edu/~aperlis/publications/mathclap/
11298 inner = buildCommon.makeSpan([], [buildHTML_buildGroup(group.value.body, options)]);
11299 // wrap, since CSS will center a .clap > .inner > span
11300 inner = buildCommon.makeSpan(["inner"], [inner], options);
11301 } else {
11302 inner = buildCommon.makeSpan(["inner"], [buildHTML_buildGroup(group.value.body, options)]);
11303 }
11304 var fix = buildCommon.makeSpan(["fix"], []);
11305 var node = buildCommon.makeSpan([group.value.alignment], [inner, fix], options);
11306
11307 // At this point, we have correctly set horizontal alignment of the
11308 // two items involved in the lap.
11309 // Next, use a strut to set the height of the HTML bounding box.
11310 // Otherwise, a tall argument may be misplaced.
11311 var strut = buildCommon.makeSpan(["strut"]);
11312 strut.style.height = node.height + node.depth + "em";
11313 strut.style.verticalAlign = -node.depth + "em";
11314 node.children.unshift(strut);
11315
11316 // Next, prevent vertical misplacement when next to something tall.
11317 node = buildCommon.makeVList({
11318 positionType: "firstBaseline",
11319 children: [{ type: "elem", elem: node }]
11320 }, options);
11321
11322 // Get the horizontal spacing correct relative to adjacent items.
11323 return buildCommon.makeSpan(["mord"], [node], options);
11324 },
11325 mathmlBuilder: function mathmlBuilder(group, options) {
11326 // mathllap, mathrlap, mathclap
11327 var node = new mathMLTree.MathNode("mpadded", [buildMathML_buildGroup(group.value.body, options)]);
11328
11329 if (group.value.alignment !== "rlap") {
11330 var offset = group.value.alignment === "llap" ? "-1" : "-0.5";
11331 node.setAttribute("lspace", offset + "width");
11332 }
11333 node.setAttribute("width", "0px");
11334
11335 return node;
11336 }
11337});
11338// CONCATENATED MODULE: ./src/functions/math.js
11339
11340
11341
11342
11343// Switching from text mode back to math mode
11344defineFunction({
11345 type: "styling",
11346 names: ["\\(", "$"],
11347 props: {
11348 numArgs: 0,
11349 allowedInText: true,
11350 allowedInMath: false,
11351 consumeMode: "math"
11352 },
11353 handler: function handler(_ref, args) {
11354 var funcName = _ref.funcName,
11355 parser = _ref.parser;
11356
11357 var outerMode = parser.mode;
11358 parser.switchMode("math");
11359 var close = funcName === "\\(" ? "\\)" : "$";
11360 var body = parser.parseExpression(false, close);
11361 // We can't expand the next symbol after the closing $ until after
11362 // switching modes back. So don't consume within expect.
11363 parser.expect(close, false);
11364 parser.switchMode(outerMode);
11365 parser.consume();
11366 return new src_ParseNode("styling", {
11367 type: "styling",
11368 style: "text",
11369 value: body
11370 }, parser.mode);
11371 }
11372});
11373
11374// Check for extra closing math delimiters
11375defineFunction({
11376 type: "text", // Doesn't matter what this is.
11377 names: ["\\)", "\\]"],
11378 props: {
11379 numArgs: 0,
11380 allowedInText: true,
11381 allowedInMath: false
11382 },
11383 handler: function handler(context, args) {
11384 throw new src_ParseError("Mismatched " + context.funcName);
11385 }
11386});
11387// CONCATENATED MODULE: ./src/functions/mathchoice.js
11388
11389
11390
11391
11392
11393
11394
11395
11396var mathchoice_chooseMathStyle = function chooseMathStyle(group, options) {
11397 var style = options.style;
11398 if (style.size === src_Style.DISPLAY.size) {
11399 return group.value.display;
11400 } else if (style.size === src_Style.TEXT.size) {
11401 return group.value.text;
11402 } else if (style.size === src_Style.SCRIPT.size) {
11403 return group.value.script;
11404 } else if (style.size === src_Style.SCRIPTSCRIPT.size) {
11405 return group.value.scriptscript;
11406 }
11407 return group.value.text;
11408};
11409
11410defineFunction({
11411 type: "mathchoice",
11412 names: ["\\mathchoice"],
11413 props: {
11414 numArgs: 4
11415 },
11416 handler: function handler(_ref, args) {
11417 var parser = _ref.parser;
11418
11419 return new src_ParseNode("mathchoice", {
11420 type: "mathchoice",
11421 display: defineFunction_ordargument(args[0]),
11422 text: defineFunction_ordargument(args[1]),
11423 script: defineFunction_ordargument(args[2]),
11424 scriptscript: defineFunction_ordargument(args[3])
11425 }, parser.mode);
11426 },
11427 htmlBuilder: function htmlBuilder(group, options) {
11428 var body = mathchoice_chooseMathStyle(group, options);
11429 var elements = buildHTML_buildExpression(body, options, false);
11430 return new buildCommon.makeFragment(elements);
11431 },
11432 mathmlBuilder: function mathmlBuilder(group, options) {
11433 var body = mathchoice_chooseMathStyle(group, options);
11434 return buildExpressionRow(body, options);
11435 }
11436});
11437// CONCATENATED MODULE: ./src/functions/mclass.js
11438
11439
11440
11441
11442
11443
11444
11445
11446var mclass_makeSpan = buildCommon.makeSpan;
11447
11448function mclass_htmlBuilder(group, options) {
11449 var elements = buildHTML_buildExpression(group.value.value, options, true);
11450 return mclass_makeSpan([group.value.mclass], elements, options);
11451}
11452
11453function mclass_mathmlBuilder(group, options) {
11454 var inner = buildMathML_buildExpression(group.value.value, options);
11455 return new mathMLTree.MathNode("mstyle", inner);
11456}
11457
11458// Math class commands except \mathop
11459defineFunction({
11460 type: "mclass",
11461 names: ["\\mathord", "\\mathbin", "\\mathrel", "\\mathopen", "\\mathclose", "\\mathpunct", "\\mathinner"],
11462 props: {
11463 numArgs: 1
11464 },
11465 handler: function handler(_ref, args) {
11466 var parser = _ref.parser,
11467 funcName = _ref.funcName;
11468
11469 var body = args[0];
11470 return new src_ParseNode("mclass", {
11471 type: "mclass",
11472 mclass: "m" + funcName.substr(5),
11473 value: defineFunction_ordargument(body)
11474 }, parser.mode);
11475 },
11476
11477 htmlBuilder: mclass_htmlBuilder,
11478 mathmlBuilder: mclass_mathmlBuilder
11479});
11480
11481// Build a relation or stacked op by placing one symbol on top of another
11482defineFunction({
11483 type: "mclass",
11484 names: ["\\stackrel", "\\overset", "\\underset"],
11485 props: {
11486 numArgs: 2
11487 },
11488 handler: function handler(_ref2, args) {
11489 var parser = _ref2.parser,
11490 funcName = _ref2.funcName;
11491
11492 var baseArg = args[1];
11493 var shiftedArg = args[0];
11494
11495 var mclass = "mrel"; // default. May change below.
11496 if (funcName !== "\\stackrel") {
11497 // LaTeX applies \binrel spacing to \overset and \underset. \binrel
11498 // spacing varies with (bin|rel|ord) of the atom in the argument.
11499 // We'll do the same.
11500 var atomType = baseArg.type === "ordgroup" && baseArg.value.length ? baseArg.value[0].type : baseArg.type;
11501 if (/^(bin|rel)$/.test(atomType)) {
11502 mclass = "m" + atomType;
11503 } else {
11504 // This may capture some instances in which the baseArg is more
11505 // than just a single symbol. Say a \overset inside an \overset.
11506 // TODO: A more comprehensive way to determine the baseArg type.
11507 mclass = "mord";
11508 }
11509 }
11510
11511 var baseOp = new src_ParseNode("op", {
11512 type: "op",
11513 limits: true,
11514 alwaysHandleSupSub: true,
11515 symbol: false,
11516 suppressBaseShift: funcName !== "\\stackrel",
11517 value: defineFunction_ordargument(baseArg)
11518 }, baseArg.mode);
11519
11520 var supsub = new src_ParseNode("supsub", {
11521 type: "supsub",
11522 base: baseOp,
11523 sup: funcName === "\\underset" ? null : shiftedArg,
11524 sub: funcName === "\\underset" ? shiftedArg : null
11525 }, shiftedArg.mode);
11526
11527 return new src_ParseNode("mclass", {
11528 type: "mclass",
11529 mclass: mclass,
11530 value: [supsub]
11531 }, parser.mode);
11532 },
11533
11534 htmlBuilder: mclass_htmlBuilder,
11535 mathmlBuilder: mclass_mathmlBuilder
11536});
11537// CONCATENATED MODULE: ./src/functions/op.js
11538
11539// Limits, symbols
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551// NOTE: Unlike most `htmlBuilder`s, this one handles not only "op", but also
11552// "supsub" since some of them (like \int) can affect super/subscripting.
11553var op_htmlBuilder = function htmlBuilder(grp, options) {
11554 // Operators are handled in the TeXbook pg. 443-444, rule 13(a).
11555 var supGroup = void 0;
11556 var subGroup = void 0;
11557 var hasLimits = false;
11558 var group = void 0;
11559 var supSub = checkNodeType(grp, "supsub");
11560 if (supSub) {
11561 // If we have limits, supsub will pass us its group to handle. Pull
11562 // out the superscript and subscript and set the group to the op in
11563 // its base.
11564 supGroup = supSub.value.sup;
11565 subGroup = supSub.value.sub;
11566 group = assertNodeType(supSub.value.base, "op");
11567 hasLimits = true;
11568 } else {
11569 group = assertNodeType(grp, "op");
11570 }
11571
11572 var style = options.style;
11573
11574 // Most operators have a large successor symbol, but these don't.
11575 var noSuccessor = ["\\smallint"];
11576
11577 var large = false;
11578 if (style.size === src_Style.DISPLAY.size && group.value.symbol && !utils.contains(noSuccessor, group.value.body)) {
11579
11580 // Most symbol operators get larger in displaystyle (rule 13)
11581 large = true;
11582 }
11583
11584 var base = void 0;
11585 if (group.value.symbol) {
11586 // If this is a symbol, create the symbol.
11587 var fontName = large ? "Size2-Regular" : "Size1-Regular";
11588 base = buildCommon.makeSymbol(group.value.body, fontName, "math", options, ["mop", "op-symbol", large ? "large-op" : "small-op"]);
11589 } else if (group.value.value) {
11590 // If this is a list, compose that list.
11591 var inner = buildHTML_buildExpression(group.value.value, options, true);
11592 if (inner.length === 1 && inner[0] instanceof domTree.symbolNode) {
11593 base = inner[0];
11594 base.classes[0] = "mop"; // replace old mclass
11595 } else {
11596 base = buildCommon.makeSpan(["mop"], inner, options);
11597 }
11598 } else {
11599 // Otherwise, this is a text operator. Build the text from the
11600 // operator's name.
11601 // TODO(emily): Add a space in the middle of some of these
11602 // operators, like \limsup
11603 var output = [];
11604 for (var i = 1; i < group.value.body.length; i++) {
11605 output.push(buildCommon.mathsym(group.value.body[i], group.mode));
11606 }
11607 base = buildCommon.makeSpan(["mop"], output, options);
11608 }
11609
11610 // If content of op is a single symbol, shift it vertically.
11611 var baseShift = 0;
11612 var slant = 0;
11613 if (base instanceof domTree.symbolNode && !group.value.suppressBaseShift) {
11614 // We suppress the shift of the base of \overset and \underset. Otherwise,
11615 // shift the symbol so its center lies on the axis (rule 13). It
11616 // appears that our fonts have the centers of the symbols already
11617 // almost on the axis, so these numbers are very small. Note we
11618 // don't actually apply this here, but instead it is used either in
11619 // the vlist creation or separately when there are no limits.
11620 baseShift = (base.height - base.depth) / 2 - options.fontMetrics().axisHeight;
11621
11622 // The slant of the symbol is just its italic correction.
11623 slant = base.italic;
11624 }
11625
11626 if (hasLimits) {
11627 // IE 8 clips \int if it is in a display: inline-block. We wrap it
11628 // in a new span so it is an inline, and works.
11629 base = buildCommon.makeSpan([], [base]);
11630
11631 var sub = void 0;
11632 var sup = void 0;
11633 // We manually have to handle the superscripts and subscripts. This,
11634 // aside from the kern calculations, is copied from supsub.
11635 if (supGroup) {
11636 var elem = buildHTML_buildGroup(supGroup, options.havingStyle(style.sup()), options);
11637
11638 sup = {
11639 elem: elem,
11640 kern: Math.max(options.fontMetrics().bigOpSpacing1, options.fontMetrics().bigOpSpacing3 - elem.depth)
11641 };
11642 }
11643
11644 if (subGroup) {
11645 var _elem = buildHTML_buildGroup(subGroup, options.havingStyle(style.sub()), options);
11646
11647 sub = {
11648 elem: _elem,
11649 kern: Math.max(options.fontMetrics().bigOpSpacing2, options.fontMetrics().bigOpSpacing4 - _elem.height)
11650 };
11651 }
11652
11653 // Build the final group as a vlist of the possible subscript, base,
11654 // and possible superscript.
11655 var finalGroup = void 0;
11656 if (sup && sub) {
11657 var bottom = options.fontMetrics().bigOpSpacing5 + sub.elem.height + sub.elem.depth + sub.kern + base.depth + baseShift;
11658
11659 finalGroup = buildCommon.makeVList({
11660 positionType: "bottom",
11661 positionData: bottom,
11662 children: [{ type: "kern", size: options.fontMetrics().bigOpSpacing5 }, { type: "elem", elem: sub.elem, marginLeft: -slant + "em" }, { type: "kern", size: sub.kern }, { type: "elem", elem: base }, { type: "kern", size: sup.kern }, { type: "elem", elem: sup.elem, marginLeft: slant + "em" }, { type: "kern", size: options.fontMetrics().bigOpSpacing5 }]
11663 }, options);
11664 } else if (sub) {
11665 var top = base.height - baseShift;
11666
11667 // Shift the limits by the slant of the symbol. Note
11668 // that we are supposed to shift the limits by 1/2 of the slant,
11669 // but since we are centering the limits adding a full slant of
11670 // margin will shift by 1/2 that.
11671 finalGroup = buildCommon.makeVList({
11672 positionType: "top",
11673 positionData: top,
11674 children: [{ type: "kern", size: options.fontMetrics().bigOpSpacing5 }, { type: "elem", elem: sub.elem, marginLeft: -slant + "em" }, { type: "kern", size: sub.kern }, { type: "elem", elem: base }]
11675 }, options);
11676 } else if (sup) {
11677 var _bottom = base.depth + baseShift;
11678
11679 finalGroup = buildCommon.makeVList({
11680 positionType: "bottom",
11681 positionData: _bottom,
11682 children: [{ type: "elem", elem: base }, { type: "kern", size: sup.kern }, { type: "elem", elem: sup.elem, marginLeft: slant + "em" }, { type: "kern", size: options.fontMetrics().bigOpSpacing5 }]
11683 }, options);
11684 } else {
11685 // This case probably shouldn't occur (this would mean the
11686 // supsub was sending us a group with no superscript or
11687 // subscript) but be safe.
11688 return base;
11689 }
11690
11691 return buildCommon.makeSpan(["mop", "op-limits"], [finalGroup], options);
11692 } else {
11693 if (baseShift) {
11694 base.style.position = "relative";
11695 base.style.top = baseShift + "em";
11696 }
11697
11698 return base;
11699 }
11700};
11701
11702var op_mathmlBuilder = function mathmlBuilder(group, options) {
11703 var node = void 0;
11704
11705 // TODO(emily): handle big operators using the `largeop` attribute
11706
11707 if (group.value.symbol) {
11708 // This is a symbol. Just add the symbol.
11709 node = new mathMLTree.MathNode("mo", [buildMathML_makeText(group.value.body, group.mode)]);
11710 } else if (group.value.value) {
11711 // This is an operator with children. Add them.
11712 node = new mathMLTree.MathNode("mo", buildMathML_buildExpression(group.value.value, options));
11713 } else {
11714 // This is a text operator. Add all of the characters from the
11715 // operator's name.
11716 // TODO(emily): Add a space in the middle of some of these
11717 // operators, like \limsup.
11718 node = new mathMLTree.MathNode("mi", [new mathMLTree.TextNode(group.value.body.slice(1))]);
11719
11720 // Append an <mo>⁡</mo>.
11721 // ref: https://www.w3.org/TR/REC-MathML/chap3_2.html#sec3.2.4
11722 var operator = new mathMLTree.MathNode("mo", [buildMathML_makeText("\u2061", "text")]);
11723
11724 // TODO: Refactor to not return an HTML DOM object from MathML builder
11725 // or refactor documentFragment to be standalone and explicitly reusable
11726 // for both HTML and MathML DOM operations. In either case, update the
11727 // return type of `mathBuilder` in `defineFunction` to accommodate.
11728 return new domTree.documentFragment([node, operator]);
11729 }
11730
11731 return node;
11732};
11733
11734var singleCharBigOps = {
11735 "\u220F": "\\prod",
11736 "\u2210": "\\coprod",
11737 "\u2211": "\\sum",
11738 "\u22C0": "\\bigwedge",
11739 "\u22C1": "\\bigvee",
11740 "\u22C2": "\\bigcap",
11741 "\u22C3": "\\bigcap",
11742 "\u2A00": "\\bigodot",
11743 "\u2A01": "\\bigoplus",
11744 "\u2A02": "\\bigotimes",
11745 "\u2A04": "\\biguplus",
11746 "\u2A06": "\\bigsqcup"
11747};
11748
11749defineFunction({
11750 type: "op",
11751 names: ["\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap", "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes", "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint", "\u220F", "\u2210", "\u2211", "\u22C0", "\u22C1", "\u22C2", "\u22C3", "\u2A00", "\u2A01", "\u2A02", "\u2A04", "\u2A06"],
11752 props: {
11753 numArgs: 0
11754 },
11755 handler: function handler(_ref, args) {
11756 var parser = _ref.parser,
11757 funcName = _ref.funcName;
11758
11759 var fName = funcName;
11760 if (fName.length === 1) {
11761 fName = singleCharBigOps[fName];
11762 }
11763 return new src_ParseNode("op", {
11764 type: "op",
11765 limits: true,
11766 symbol: true,
11767 body: fName
11768 }, parser.mode);
11769 },
11770 htmlBuilder: op_htmlBuilder,
11771 mathmlBuilder: op_mathmlBuilder
11772});
11773
11774// Note: calling defineFunction with a type that's already been defined only
11775// works because the same htmlBuilder and mathmlBuilder are being used.
11776defineFunction({
11777 type: "op",
11778 names: ["\\mathop"],
11779 props: {
11780 numArgs: 1
11781 },
11782 handler: function handler(_ref2, args) {
11783 var parser = _ref2.parser;
11784
11785 var body = args[0];
11786 return new src_ParseNode("op", {
11787 type: "op",
11788 limits: false,
11789 symbol: false,
11790 value: defineFunction_ordargument(body)
11791 }, parser.mode);
11792 },
11793 htmlBuilder: op_htmlBuilder,
11794 mathmlBuilder: op_mathmlBuilder
11795});
11796
11797// There are 2 flags for operators; whether they produce limits in
11798// displaystyle, and whether they are symbols and should grow in
11799// displaystyle. These four groups cover the four possible choices.
11800
11801var singleCharIntegrals = {
11802 "\u222B": "\\int",
11803 "\u222C": "\\iint",
11804 "\u222D": "\\iiint",
11805 "\u222E": "\\oint"
11806};
11807
11808defineFunction({
11809 type: "op",
11810 names: ["\\mathop"],
11811 props: {
11812 numArgs: 1
11813 },
11814 handler: function handler(_ref3, args) {
11815 var parser = _ref3.parser;
11816
11817 var body = args[0];
11818 return new src_ParseNode("op", {
11819 type: "op",
11820 limits: false,
11821 symbol: false,
11822 value: defineFunction_ordargument(body)
11823 }, parser.mode);
11824 },
11825 htmlBuilder: op_htmlBuilder,
11826 mathmlBuilder: op_mathmlBuilder
11827});
11828
11829// No limits, not symbols
11830defineFunction({
11831 type: "op",
11832 names: ["\\arcsin", "\\arccos", "\\arctan", "\\arctg", "\\arcctg", "\\arg", "\\ch", "\\cos", "\\cosec", "\\cosh", "\\cot", "\\cotg", "\\coth", "\\csc", "\\ctg", "\\cth", "\\deg", "\\dim", "\\exp", "\\hom", "\\ker", "\\lg", "\\ln", "\\log", "\\sec", "\\sin", "\\sinh", "\\sh", "\\tan", "\\tanh", "\\tg", "\\th"],
11833 props: {
11834 numArgs: 0
11835 },
11836 handler: function handler(_ref4) {
11837 var parser = _ref4.parser,
11838 funcName = _ref4.funcName;
11839
11840 return new src_ParseNode("op", {
11841 type: "op",
11842 limits: false,
11843 symbol: false,
11844 body: funcName
11845 }, parser.mode);
11846 },
11847
11848 htmlBuilder: op_htmlBuilder,
11849 mathmlBuilder: op_mathmlBuilder
11850});
11851
11852// Limits, not symbols
11853defineFunction({
11854 type: "op",
11855 names: ["\\det", "\\gcd", "\\inf", "\\lim", "\\max", "\\min", "\\Pr", "\\sup"],
11856 props: {
11857 numArgs: 0
11858 },
11859 handler: function handler(_ref5) {
11860 var parser = _ref5.parser,
11861 funcName = _ref5.funcName;
11862
11863 return new src_ParseNode("op", {
11864 type: "op",
11865 limits: true,
11866 symbol: false,
11867 body: funcName
11868 }, parser.mode);
11869 },
11870
11871 htmlBuilder: op_htmlBuilder,
11872 mathmlBuilder: op_mathmlBuilder
11873});
11874
11875// No limits, symbols
11876defineFunction({
11877 type: "op",
11878 names: ["\\int", "\\iint", "\\iiint", "\\oint", "\u222B", "\u222C", "\u222D", "\u222E"],
11879 props: {
11880 numArgs: 0
11881 },
11882 handler: function handler(_ref6) {
11883 var parser = _ref6.parser,
11884 funcName = _ref6.funcName;
11885
11886 var fName = funcName;
11887 if (fName.length === 1) {
11888 fName = singleCharIntegrals[fName];
11889 }
11890 return new src_ParseNode("op", {
11891 type: "op",
11892 limits: false,
11893 symbol: true,
11894 body: fName
11895 }, parser.mode);
11896 },
11897
11898 htmlBuilder: op_htmlBuilder,
11899 mathmlBuilder: op_mathmlBuilder
11900});
11901// CONCATENATED MODULE: ./src/functions/operatorname.js
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912// \operatorname
11913// amsopn.dtx: \mathop{#1\kern\z@\operator@font#3}\newmcodes@
11914defineFunction({
11915 type: "operatorname",
11916 names: ["\\operatorname"],
11917 props: {
11918 numArgs: 1
11919 },
11920 handler: function handler(_ref, args) {
11921 var parser = _ref.parser;
11922
11923 var body = args[0];
11924 return new src_ParseNode("operatorname", {
11925 type: "operatorname",
11926 value: defineFunction_ordargument(body)
11927 }, parser.mode);
11928 },
11929
11930 htmlBuilder: function htmlBuilder(group, options) {
11931 var output = [];
11932 if (group.value.value.length > 0) {
11933 var letter = "";
11934 var mode = "";
11935
11936 var groupValue = group.value.value.map(function (child) {
11937 var childValue = child.value;
11938 // In the amsopn package, \newmcodes@ changes four
11939 // characters, *-/:?, from math operators back into text.
11940 if (typeof childValue === "string" && "*-/:".indexOf(childValue) !== -1) {
11941 return new src_ParseNode("textord", childValue, child.mode);
11942 } else {
11943 return child;
11944 }
11945 });
11946
11947 // Consolidate Greek letter function names into symbol characters.
11948 var temp = buildHTML_buildExpression(groupValue, options.withFont("mathrm"), true);
11949
11950 // All we want from temp are the letters. With them, we'll
11951 // create a text operator similar to \tan or \cos.
11952 var _iteratorNormalCompletion = true;
11953 var _didIteratorError = false;
11954 var _iteratorError = undefined;
11955
11956 try {
11957 for (var _iterator = get_iterator_default()(temp), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
11958 var child = _step.value;
11959
11960 if (child instanceof domTree.symbolNode) {
11961 letter = child.value;
11962
11963 // In the amsopn package, \newmcodes@ changes four
11964 // characters, *-/:?, from math operators back into text.
11965 // Given what is in temp, we have to address two of them.
11966 letter = letter.replace(/\u2212/, "-"); // minus => hyphen
11967 letter = letter.replace(/\u2217/, "*");
11968
11969 // Use math mode for Greek letters
11970 mode = /[\u0391-\u03D7]/.test(letter) ? "math" : "text";
11971 output.push(buildCommon.mathsym(letter, mode));
11972 } else {
11973 output.push(child);
11974 }
11975 }
11976 } catch (err) {
11977 _didIteratorError = true;
11978 _iteratorError = err;
11979 } finally {
11980 try {
11981 if (!_iteratorNormalCompletion && _iterator.return) {
11982 _iterator.return();
11983 }
11984 } finally {
11985 if (_didIteratorError) {
11986 throw _iteratorError;
11987 }
11988 }
11989 }
11990 }
11991 return buildCommon.makeSpan(["mop"], output, options);
11992 },
11993
11994 mathmlBuilder: function mathmlBuilder(group, options) {
11995 // The steps taken here are similar to the html version.
11996 var output = [];
11997 if (group.value.value.length > 0) {
11998 var temp = buildMathML_buildExpression(group.value.value, options.withFont("mathrm"));
11999
12000 var word = temp.map(function (node) {
12001 return node.toText();
12002 }).join("");
12003 word = word.replace(/\u2212/g, "-");
12004 word = word.replace(/\u2217/g, "*");
12005 // word has already been escaped by `node.toText()`
12006 output = [new mathMLTree.TextNode(word, false)];
12007 }
12008 var identifier = new mathMLTree.MathNode("mi", output);
12009 identifier.setAttribute("mathvariant", "normal");
12010
12011 // \u2061 is the same as ⁡
12012 // ref: https://www.w3schools.com/charsets/ref_html_entities_a.asp
12013 var operator = new mathMLTree.MathNode("mo", [buildMathML_makeText("\u2061", "text")]);
12014
12015 return new domTree.documentFragment([identifier, operator]);
12016 }
12017});
12018// CONCATENATED MODULE: ./src/functions/ordgroup.js
12019
12020
12021
12022
12023
12024
12025defineFunctionBuilders({
12026 type: "ordgroup",
12027 htmlBuilder: function htmlBuilder(group, options) {
12028 return buildCommon.makeSpan(["mord"], buildHTML_buildExpression(group.value, options, true), options);
12029 },
12030 mathmlBuilder: function mathmlBuilder(group, options) {
12031 return buildExpressionRow(group.value, options);
12032 }
12033});
12034// CONCATENATED MODULE: ./src/functions/overline.js
12035
12036
12037
12038
12039
12040
12041
12042
12043defineFunction({
12044 type: "overline",
12045 names: ["\\overline"],
12046 props: {
12047 numArgs: 1
12048 },
12049 handler: function handler(_ref, args) {
12050 var parser = _ref.parser;
12051
12052 var body = args[0];
12053 return new src_ParseNode("overline", {
12054 type: "overline",
12055 body: body
12056 }, parser.mode);
12057 },
12058 htmlBuilder: function htmlBuilder(group, options) {
12059 // Overlines are handled in the TeXbook pg 443, Rule 9.
12060
12061 // Build the inner group in the cramped style.
12062 var innerGroup = buildHTML_buildGroup(group.value.body, options.havingCrampedStyle());
12063
12064 // Create the line above the body
12065 var line = buildCommon.makeLineSpan("overline-line", options);
12066
12067 // Generate the vlist, with the appropriate kerns
12068 var vlist = buildCommon.makeVList({
12069 positionType: "firstBaseline",
12070 children: [{ type: "elem", elem: innerGroup }, { type: "kern", size: 3 * line.height }, { type: "elem", elem: line }, { type: "kern", size: line.height }]
12071 }, options);
12072
12073 return buildCommon.makeSpan(["mord", "overline"], [vlist], options);
12074 },
12075 mathmlBuilder: function mathmlBuilder(group, options) {
12076 var operator = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("\u203E")]);
12077 operator.setAttribute("stretchy", "true");
12078
12079 var node = new mathMLTree.MathNode("mover", [buildMathML_buildGroup(group.value.body, options), operator]);
12080 node.setAttribute("accent", "true");
12081
12082 return node;
12083 }
12084});
12085// CONCATENATED MODULE: ./src/functions/phantom.js
12086
12087
12088
12089
12090
12091
12092
12093
12094defineFunction({
12095 type: "phantom",
12096 names: ["\\phantom"],
12097 props: {
12098 numArgs: 1
12099 },
12100 handler: function handler(_ref, args) {
12101 var parser = _ref.parser;
12102
12103 var body = args[0];
12104 return new src_ParseNode("phantom", {
12105 type: "phantom",
12106 value: defineFunction_ordargument(body)
12107 }, parser.mode);
12108 },
12109 htmlBuilder: function htmlBuilder(group, options) {
12110 var elements = buildHTML_buildExpression(group.value.value, options.withPhantom(), false);
12111
12112 // \phantom isn't supposed to affect the elements it contains.
12113 // See "color" for more details.
12114 return new buildCommon.makeFragment(elements);
12115 },
12116 mathmlBuilder: function mathmlBuilder(group, options) {
12117 var inner = buildMathML_buildExpression(group.value.value, options);
12118 return new mathMLTree.MathNode("mphantom", inner);
12119 }
12120});
12121
12122defineFunction({
12123 type: "hphantom",
12124 names: ["\\hphantom"],
12125 props: {
12126 numArgs: 1
12127 },
12128 handler: function handler(_ref2, args) {
12129 var parser = _ref2.parser;
12130
12131 var body = args[0];
12132 return new src_ParseNode("hphantom", {
12133 type: "hphantom",
12134 value: defineFunction_ordargument(body),
12135 body: body
12136 }, parser.mode);
12137 },
12138 htmlBuilder: function htmlBuilder(group, options) {
12139 var node = buildCommon.makeSpan([], [buildHTML_buildGroup(group.value.body, options.withPhantom())]);
12140 node.height = 0;
12141 node.depth = 0;
12142 if (node.children) {
12143 for (var i = 0; i < node.children.length; i++) {
12144 node.children[i].height = 0;
12145 node.children[i].depth = 0;
12146 }
12147 }
12148
12149 // See smash for comment re: use of makeVList
12150 node = buildCommon.makeVList({
12151 positionType: "firstBaseline",
12152 children: [{ type: "elem", elem: node }]
12153 }, options);
12154
12155 return node;
12156 },
12157 mathmlBuilder: function mathmlBuilder(group, options) {
12158 var inner = buildMathML_buildExpression(group.value.value, options);
12159 var node = new mathMLTree.MathNode("mphantom", inner);
12160 node.setAttribute("height", "0px");
12161 return node;
12162 }
12163});
12164
12165defineFunction({
12166 type: "vphantom",
12167 names: ["\\vphantom"],
12168 props: {
12169 numArgs: 1
12170 },
12171 handler: function handler(_ref3, args) {
12172 var parser = _ref3.parser;
12173
12174 var body = args[0];
12175 return new src_ParseNode("vphantom", {
12176 type: "vphantom",
12177 value: defineFunction_ordargument(body),
12178 body: body
12179 }, parser.mode);
12180 },
12181 htmlBuilder: function htmlBuilder(group, options) {
12182 var inner = buildCommon.makeSpan(["inner"], [buildHTML_buildGroup(group.value.body, options.withPhantom())]);
12183 var fix = buildCommon.makeSpan(["fix"], []);
12184 return buildCommon.makeSpan(["mord", "rlap"], [inner, fix], options);
12185 },
12186 mathmlBuilder: function mathmlBuilder(group, options) {
12187 var inner = buildMathML_buildExpression(group.value.value, options);
12188 var node = new mathMLTree.MathNode("mphantom", inner);
12189 node.setAttribute("width", "0px");
12190 return node;
12191 }
12192});
12193// CONCATENATED MODULE: ./src/functions/sizing.js
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203function sizingGroup(value, options, baseOptions) {
12204 var inner = buildHTML_buildExpression(value, options, false);
12205 var multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier;
12206
12207 // Add size-resetting classes to the inner list and set maxFontSize
12208 // manually. Handle nested size changes.
12209 for (var i = 0; i < inner.length; i++) {
12210 var pos = utils.indexOf(inner[i].classes, "sizing");
12211 if (pos < 0) {
12212 Array.prototype.push.apply(inner[i].classes, options.sizingClasses(baseOptions));
12213 } else if (inner[i].classes[pos + 1] === "reset-size" + options.size) {
12214 // This is a nested size change: e.g., inner[i] is the "b" in
12215 // `\Huge a \small b`. Override the old size (the `reset-` class)
12216 // but not the new size.
12217 inner[i].classes[pos + 1] = "reset-size" + baseOptions.size;
12218 }
12219
12220 inner[i].height *= multiplier;
12221 inner[i].depth *= multiplier;
12222 }
12223
12224 return buildCommon.makeFragment(inner);
12225}
12226
12227var sizeFuncs = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"];
12228
12229var sizing_htmlBuilder = function htmlBuilder(group, options) {
12230 // Handle sizing operators like \Huge. Real TeX doesn't actually allow
12231 // these functions inside of math expressions, so we do some special
12232 // handling.
12233 var newOptions = options.havingSize(group.value.size);
12234 return sizingGroup(group.value.value, newOptions, options);
12235};
12236
12237defineFunction({
12238 type: "sizing",
12239 names: sizeFuncs,
12240 props: {
12241 numArgs: 0,
12242 allowedInText: true
12243 },
12244 handler: function handler(_ref, args) {
12245 var breakOnTokenText = _ref.breakOnTokenText,
12246 funcName = _ref.funcName,
12247 parser = _ref.parser;
12248
12249 parser.consumeSpaces();
12250 var body = parser.parseExpression(false, breakOnTokenText);
12251
12252 return new src_ParseNode("sizing", {
12253 type: "sizing",
12254 // Figure out what size to use based on the list of functions above
12255 size: utils.indexOf(sizeFuncs, funcName) + 1,
12256 value: body
12257 }, parser.mode);
12258 },
12259 htmlBuilder: sizing_htmlBuilder,
12260 mathmlBuilder: function mathmlBuilder(group, options) {
12261 var newOptions = options.havingSize(group.value.size);
12262 var inner = buildMathML_buildExpression(group.value.value, newOptions);
12263
12264 var node = new mathMLTree.MathNode("mstyle", inner);
12265
12266 // TODO(emily): This doesn't produce the correct size for nested size
12267 // changes, because we don't keep state of what style we're currently
12268 // in, so we can't reset the size to normal before changing it. Now
12269 // that we're passing an options parameter we should be able to fix
12270 // this.
12271 node.setAttribute("mathsize", newOptions.sizeMultiplier + "em");
12272
12273 return node;
12274 }
12275});
12276// CONCATENATED MODULE: ./src/functions/raisebox.js
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286// Box manipulation
12287defineFunction({
12288 type: "raisebox",
12289 names: ["\\raisebox"],
12290 props: {
12291 numArgs: 2,
12292 argTypes: ["size", "text"],
12293 allowedInText: true
12294 },
12295 handler: function handler(_ref, args) {
12296 var parser = _ref.parser;
12297
12298 var amount = assertNodeType(args[0], "size");
12299 var body = args[1];
12300 return new src_ParseNode("raisebox", {
12301 type: "raisebox",
12302 dy: amount,
12303 body: body,
12304 value: defineFunction_ordargument(body)
12305 }, parser.mode);
12306 },
12307 htmlBuilder: function htmlBuilder(group, options) {
12308 var text = new src_ParseNode("text", {
12309 type: "text",
12310 body: group.value.value,
12311 font: "mathrm" // simulate \textrm
12312 }, group.mode);
12313 var sizedText = new src_ParseNode("sizing", {
12314 type: "sizing",
12315 value: [text],
12316 size: 6 // simulate \normalsize
12317 }, group.mode);
12318 var body = sizing_htmlBuilder(sizedText, options);
12319 var dy = units_calculateSize(group.value.dy.value.value, options);
12320 return buildCommon.makeVList({
12321 positionType: "shift",
12322 positionData: -dy,
12323 children: [{ type: "elem", elem: body }]
12324 }, options);
12325 },
12326 mathmlBuilder: function mathmlBuilder(group, options) {
12327 var node = new mathMLTree.MathNode("mpadded", [buildMathML_buildGroup(group.value.body, options)]);
12328 var dy = group.value.dy.value.value.number + group.value.dy.value.value.unit;
12329 node.setAttribute("voffset", dy);
12330 return node;
12331 }
12332});
12333// CONCATENATED MODULE: ./src/functions/rule.js
12334
12335
12336
12337
12338
12339
12340defineFunction({
12341 type: "rule",
12342 names: ["\\rule"],
12343 props: {
12344 numArgs: 2,
12345 numOptionalArgs: 1,
12346 argTypes: ["size", "size", "size"]
12347 },
12348 handler: function handler(_ref, args, optArgs) {
12349 var parser = _ref.parser;
12350
12351 var shift = optArgs[0];
12352 var width = assertNodeType(args[0], "size");
12353 var height = assertNodeType(args[1], "size");
12354 return new src_ParseNode("rule", {
12355 type: "rule",
12356 shift: shift && assertNodeType(shift, "size").value.value,
12357 width: width.value.value,
12358 height: height.value.value
12359 }, parser.mode);
12360 },
12361 htmlBuilder: function htmlBuilder(group, options) {
12362 // Make an empty span for the rule
12363 var rule = buildCommon.makeSpan(["mord", "rule"], [], options);
12364
12365 // Calculate the shift, width, and height of the rule, and account for units
12366 var shift = 0;
12367 if (group.value.shift) {
12368 shift = units_calculateSize(group.value.shift, options);
12369 }
12370
12371 var width = units_calculateSize(group.value.width, options);
12372 var height = units_calculateSize(group.value.height, options);
12373
12374 // Style the rule to the right size
12375 rule.style.borderRightWidth = width + "em";
12376 rule.style.borderTopWidth = height + "em";
12377 rule.style.bottom = shift + "em";
12378
12379 // Record the height and width
12380 rule.width = width;
12381 rule.height = height + shift;
12382 rule.depth = -shift;
12383 // Font size is the number large enough that the browser will
12384 // reserve at least `absHeight` space above the baseline.
12385 // The 1.125 factor was empirically determined
12386 rule.maxFontSize = height * 1.125 * options.sizeMultiplier;
12387
12388 return rule;
12389 },
12390 mathmlBuilder: function mathmlBuilder(group, options) {
12391 // TODO(emily): Figure out if there's an actual way to draw black boxes
12392 // in MathML.
12393 var node = new mathMLTree.MathNode("mrow");
12394
12395 return node;
12396 }
12397});
12398// CONCATENATED MODULE: ./src/functions/smash.js
12399
12400// smash, with optional [tb], as in AMS
12401
12402
12403
12404
12405
12406
12407
12408
12409defineFunction({
12410 type: "smash",
12411 names: ["\\smash"],
12412 props: {
12413 numArgs: 1,
12414 numOptionalArgs: 1,
12415 allowedInText: true
12416 },
12417 handler: function handler(_ref, args, optArgs) {
12418 var parser = _ref.parser;
12419
12420 var smashHeight = false;
12421 var smashDepth = false;
12422 var tbArg = optArgs[0] && assertNodeType(optArgs[0], "ordgroup");
12423 if (tbArg) {
12424 // Optional [tb] argument is engaged.
12425 // ref: amsmath: \renewcommand{\smash}[1][tb]{%
12426 // def\mb@t{\ht}\def\mb@b{\dp}\def\mb@tb{\ht\z@\z@\dp}%
12427 var letter = "";
12428 for (var i = 0; i < tbArg.value.length; ++i) {
12429 letter = tbArg.value[i].value;
12430 if (letter === "t") {
12431 smashHeight = true;
12432 } else if (letter === "b") {
12433 smashDepth = true;
12434 } else {
12435 smashHeight = false;
12436 smashDepth = false;
12437 break;
12438 }
12439 }
12440 } else {
12441 smashHeight = true;
12442 smashDepth = true;
12443 }
12444
12445 var body = args[0];
12446 return new src_ParseNode("smash", {
12447 type: "smash",
12448 body: body,
12449 smashHeight: smashHeight,
12450 smashDepth: smashDepth
12451 }, parser.mode);
12452 },
12453 htmlBuilder: function htmlBuilder(group, options) {
12454 var node = buildCommon.makeSpan(["mord"], [buildHTML_buildGroup(group.value.body, options)]);
12455
12456 if (!group.value.smashHeight && !group.value.smashDepth) {
12457 return node;
12458 }
12459
12460 if (group.value.smashHeight) {
12461 node.height = 0;
12462 // In order to influence makeVList, we have to reset the children.
12463 if (node.children) {
12464 for (var i = 0; i < node.children.length; i++) {
12465 node.children[i].height = 0;
12466 }
12467 }
12468 }
12469
12470 if (group.value.smashDepth) {
12471 node.depth = 0;
12472 if (node.children) {
12473 for (var _i = 0; _i < node.children.length; _i++) {
12474 node.children[_i].depth = 0;
12475 }
12476 }
12477 }
12478
12479 // At this point, we've reset the TeX-like height and depth values.
12480 // But the span still has an HTML line height.
12481 // makeVList applies "display: table-cell", which prevents the browser
12482 // from acting on that line height. So we'll call makeVList now.
12483
12484 return buildCommon.makeVList({
12485 positionType: "firstBaseline",
12486 children: [{ type: "elem", elem: node }]
12487 }, options);
12488 },
12489 mathmlBuilder: function mathmlBuilder(group, options) {
12490 var node = new mathMLTree.MathNode("mpadded", [buildMathML_buildGroup(group.value.body, options)]);
12491
12492 if (group.value.smashHeight) {
12493 node.setAttribute("height", "0px");
12494 }
12495
12496 if (group.value.smashDepth) {
12497 node.setAttribute("depth", "0px");
12498 }
12499
12500 return node;
12501 }
12502});
12503// CONCATENATED MODULE: ./src/functions/sqrt.js
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515defineFunction({
12516 type: "sqrt",
12517 names: ["\\sqrt"],
12518 props: {
12519 numArgs: 1,
12520 numOptionalArgs: 1
12521 },
12522 handler: function handler(_ref, args, optArgs) {
12523 var parser = _ref.parser;
12524
12525 var index = optArgs[0];
12526 var body = args[0];
12527 return new src_ParseNode("sqrt", {
12528 type: "sqrt",
12529 body: body,
12530 index: index
12531 }, parser.mode);
12532 },
12533 htmlBuilder: function htmlBuilder(group, options) {
12534 // Square roots are handled in the TeXbook pg. 443, Rule 11.
12535
12536 // First, we do the same steps as in overline to build the inner group
12537 // and line
12538 var inner = buildHTML_buildGroup(group.value.body, options.havingCrampedStyle());
12539 if (inner.height === 0) {
12540 // Render a small surd.
12541 inner.height = options.fontMetrics().xHeight;
12542 }
12543
12544 // Some groups can return document fragments. Handle those by wrapping
12545 // them in a span.
12546 if (inner instanceof domTree.documentFragment) {
12547 inner = buildCommon.makeSpan([], [inner], options);
12548 }
12549
12550 // Calculate the minimum size for the \surd delimiter
12551 var metrics = options.fontMetrics();
12552 var theta = metrics.defaultRuleThickness;
12553
12554 var phi = theta;
12555 if (options.style.id < src_Style.TEXT.id) {
12556 phi = options.fontMetrics().xHeight;
12557 }
12558
12559 // Calculate the clearance between the body and line
12560 var lineClearance = theta + phi / 4;
12561
12562 var minDelimiterHeight = (inner.height + inner.depth + lineClearance + theta) * options.sizeMultiplier;
12563
12564 // Create a sqrt SVG of the required minimum size
12565
12566 var _delimiter$sqrtImage = delimiter.sqrtImage(minDelimiterHeight, options),
12567 img = _delimiter$sqrtImage.span,
12568 ruleWidth = _delimiter$sqrtImage.ruleWidth,
12569 advanceWidth = _delimiter$sqrtImage.advanceWidth;
12570
12571 var delimDepth = img.height - ruleWidth;
12572
12573 // Adjust the clearance based on the delimiter size
12574 if (delimDepth > inner.height + inner.depth + lineClearance) {
12575 lineClearance = (lineClearance + delimDepth - inner.height - inner.depth) / 2;
12576 }
12577
12578 // Shift the sqrt image
12579 var imgShift = img.height - inner.height - lineClearance - ruleWidth;
12580
12581 inner.style.paddingLeft = advanceWidth + "em";
12582
12583 // Overlay the image and the argument.
12584 var body = buildCommon.makeVList({
12585 positionType: "firstBaseline",
12586 children: [{ type: "elem", elem: inner, wrapperClasses: ["svg-align"] }, { type: "kern", size: -(inner.height + imgShift) }, { type: "elem", elem: img }, { type: "kern", size: ruleWidth }]
12587 }, options);
12588
12589 if (!group.value.index) {
12590 return buildCommon.makeSpan(["mord", "sqrt"], [body], options);
12591 } else {
12592 // Handle the optional root index
12593
12594 // The index is always in scriptscript style
12595 var newOptions = options.havingStyle(src_Style.SCRIPTSCRIPT);
12596 var rootm = buildHTML_buildGroup(group.value.index, newOptions, options);
12597
12598 // The amount the index is shifted by. This is taken from the TeX
12599 // source, in the definition of `\r@@t`.
12600 var toShift = 0.6 * (body.height - body.depth);
12601
12602 // Build a VList with the superscript shifted up correctly
12603 var rootVList = buildCommon.makeVList({
12604 positionType: "shift",
12605 positionData: -toShift,
12606 children: [{ type: "elem", elem: rootm }]
12607 }, options);
12608 // Add a class surrounding it so we can add on the appropriate
12609 // kerning
12610 var rootVListWrap = buildCommon.makeSpan(["root"], [rootVList]);
12611
12612 return buildCommon.makeSpan(["mord", "sqrt"], [rootVListWrap, body], options);
12613 }
12614 },
12615 mathmlBuilder: function mathmlBuilder(group, options) {
12616 var node = void 0;
12617 if (group.value.index) {
12618 node = new mathMLTree.MathNode("mroot", [buildMathML_buildGroup(group.value.body, options), buildMathML_buildGroup(group.value.index, options)]);
12619 } else {
12620 node = new mathMLTree.MathNode("msqrt", [buildMathML_buildGroup(group.value.body, options)]);
12621 }
12622
12623 return node;
12624 }
12625});
12626// CONCATENATED MODULE: ./src/functions/styling.js
12627
12628
12629
12630
12631
12632
12633
12634
12635var styling_styleMap = {
12636 "display": src_Style.DISPLAY,
12637 "text": src_Style.TEXT,
12638 "script": src_Style.SCRIPT,
12639 "scriptscript": src_Style.SCRIPTSCRIPT
12640};
12641
12642defineFunction({
12643 type: "styling",
12644 names: ["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"],
12645 props: {
12646 numArgs: 0,
12647 allowedInText: true
12648 },
12649 handler: function handler(_ref, args) {
12650 var breakOnTokenText = _ref.breakOnTokenText,
12651 funcName = _ref.funcName,
12652 parser = _ref.parser;
12653
12654 // parse out the implicit body
12655 parser.consumeSpaces();
12656 var body = parser.parseExpression(true, breakOnTokenText);
12657
12658 // TODO: Refactor to avoid duplicating styleMap in multiple places (e.g.
12659 // here and in buildHTML and de-dupe the enumeration of all the styles).
12660 // $FlowFixMe: The names above exactly match the styles.
12661 var style = funcName.slice(1, funcName.length - 5);
12662 return new src_ParseNode("styling", {
12663 type: "styling",
12664 // Figure out what style to use by pulling out the style from
12665 // the function name
12666 style: style,
12667 value: body
12668 }, parser.mode);
12669 },
12670 htmlBuilder: function htmlBuilder(group, options) {
12671 // Style changes are handled in the TeXbook on pg. 442, Rule 3.
12672 var newStyle = styling_styleMap[group.value.style];
12673 var newOptions = options.havingStyle(newStyle).withFont('');
12674 return sizingGroup(group.value.value, newOptions, options);
12675 },
12676 mathmlBuilder: function mathmlBuilder(group, options) {
12677 // Figure out what style we're changing to.
12678 // TODO(kevinb): dedupe this with buildHTML.js
12679 // This will be easier of handling of styling nodes is in the same file.
12680 var styleMap = {
12681 "display": src_Style.DISPLAY,
12682 "text": src_Style.TEXT,
12683 "script": src_Style.SCRIPT,
12684 "scriptscript": src_Style.SCRIPTSCRIPT
12685 };
12686
12687 var newStyle = styleMap[group.value.style];
12688 var newOptions = options.havingStyle(newStyle);
12689
12690 var inner = buildMathML_buildExpression(group.value.value, newOptions);
12691
12692 var node = new mathMLTree.MathNode("mstyle", inner);
12693
12694 var styleAttributes = {
12695 "display": ["0", "true"],
12696 "text": ["0", "false"],
12697 "script": ["1", "false"],
12698 "scriptscript": ["2", "false"]
12699 };
12700
12701 var attr = styleAttributes[group.value.style];
12702
12703 node.setAttribute("scriptlevel", attr[0]);
12704 node.setAttribute("displaystyle", attr[1]);
12705
12706 return node;
12707 }
12708});
12709// CONCATENATED MODULE: ./src/functions/supsub.js
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724/**
12725 * Sometimes, groups perform special rules when they have superscripts or
12726 * subscripts attached to them. This function lets the `supsub` group know that
12727 * Sometimes, groups perform special rules when they have superscripts or
12728 * its inner element should handle the superscripts and subscripts instead of
12729 * handling them itself.
12730 */
12731var supsub_htmlBuilderDelegate = function htmlBuilderDelegate(group, options) {
12732 var base = group.value.base;
12733 if (!base) {
12734 return null;
12735 } else if (base.type === "op") {
12736 // Operators handle supsubs differently when they have limits
12737 // (e.g. `\displaystyle\sum_2^3`)
12738 var delegate = base.value.limits && (options.style.size === src_Style.DISPLAY.size || base.value.alwaysHandleSupSub);
12739 return delegate ? op_htmlBuilder : null;
12740 } else if (base.type === "accent") {
12741 return utils.isCharacterBox(base.value.base) ? accent_htmlBuilder : null;
12742 } else if (base.type === "horizBrace") {
12743 var isSup = !group.value.sub;
12744 return isSup === base.value.isOver ? horizBrace_htmlBuilder : null;
12745 } else {
12746 return null;
12747 }
12748};
12749
12750// Super scripts and subscripts, whose precise placement can depend on other
12751// functions that precede them.
12752defineFunctionBuilders({
12753 type: "supsub",
12754 htmlBuilder: function htmlBuilder(group, options) {
12755 // Superscript and subscripts are handled in the TeXbook on page
12756 // 445-446, rules 18(a-f).
12757
12758 // Here is where we defer to the inner group if it should handle
12759 // superscripts and subscripts itself.
12760 var builderDelegate = supsub_htmlBuilderDelegate(group, options);
12761 if (builderDelegate) {
12762 return builderDelegate(group, options);
12763 }
12764
12765 var _group$value = group.value,
12766 valueBase = _group$value.base,
12767 valueSup = _group$value.sup,
12768 valueSub = _group$value.sub;
12769
12770 var base = buildHTML_buildGroup(valueBase, options);
12771 var supm = void 0;
12772 var subm = void 0;
12773
12774 var metrics = options.fontMetrics();
12775
12776 // Rule 18a
12777 var supShift = 0;
12778 var subShift = 0;
12779
12780 var isCharacterBox = valueBase && utils.isCharacterBox(valueBase);
12781 if (valueSup) {
12782 var newOptions = options.havingStyle(options.style.sup());
12783 supm = buildHTML_buildGroup(valueSup, newOptions, options);
12784 if (!isCharacterBox) {
12785 supShift = base.height - newOptions.fontMetrics().supDrop * newOptions.sizeMultiplier / options.sizeMultiplier;
12786 }
12787 }
12788
12789 if (valueSub) {
12790 var _newOptions = options.havingStyle(options.style.sub());
12791 subm = buildHTML_buildGroup(valueSub, _newOptions, options);
12792 if (!isCharacterBox) {
12793 subShift = base.depth + _newOptions.fontMetrics().subDrop * _newOptions.sizeMultiplier / options.sizeMultiplier;
12794 }
12795 }
12796
12797 // Rule 18c
12798 var minSupShift = void 0;
12799 if (options.style === src_Style.DISPLAY) {
12800 minSupShift = metrics.sup1;
12801 } else if (options.style.cramped) {
12802 minSupShift = metrics.sup3;
12803 } else {
12804 minSupShift = metrics.sup2;
12805 }
12806
12807 // scriptspace is a font-size-independent size, so scale it
12808 // appropriately for use as the marginRight.
12809 var multiplier = options.sizeMultiplier;
12810 var marginRight = 0.5 / metrics.ptPerEm / multiplier + "em";
12811
12812 var supsub = void 0;
12813 if (supm && subm) {
12814 supShift = Math.max(supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight);
12815 subShift = Math.max(subShift, metrics.sub2);
12816
12817 var ruleWidth = metrics.defaultRuleThickness;
12818
12819 // Rule 18e
12820 var maxWidth = 4 * ruleWidth;
12821 if (supShift - supm.depth - (subm.height - subShift) < maxWidth) {
12822 subShift = maxWidth - (supShift - supm.depth) + subm.height;
12823 var psi = 0.8 * metrics.xHeight - (supShift - supm.depth);
12824 if (psi > 0) {
12825 supShift += psi;
12826 subShift -= psi;
12827 }
12828 }
12829
12830 // Subscripts shouldn't be shifted by the base's italic correction.
12831 // Account for that by shifting the subscript back the appropriate
12832 // amount. Note we only do this when the base is a single symbol.
12833 var marginLeft = base instanceof domTree.symbolNode ? -base.italic + "em" : null;
12834 var vlistElem = [{ type: "elem", elem: subm, shift: subShift, marginRight: marginRight,
12835 marginLeft: marginLeft }, { type: "elem", elem: supm, shift: -supShift, marginRight: marginRight }];
12836
12837 supsub = buildCommon.makeVList({
12838 positionType: "individualShift",
12839 children: vlistElem
12840 }, options);
12841 } else if (subm) {
12842 // Rule 18b
12843 subShift = Math.max(subShift, metrics.sub1, subm.height - 0.8 * metrics.xHeight);
12844
12845 // See comment above about subscripts not being shifted.
12846 var _marginLeft = base instanceof domTree.symbolNode ? -base.italic + "em" : null;
12847 var _vlistElem = [{ type: "elem", elem: subm, marginLeft: _marginLeft, marginRight: marginRight }];
12848
12849 supsub = buildCommon.makeVList({
12850 positionType: "shift",
12851 positionData: subShift,
12852 children: _vlistElem
12853 }, options);
12854 } else if (supm) {
12855 // Rule 18c, d
12856 supShift = Math.max(supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight);
12857
12858 supsub = buildCommon.makeVList({
12859 positionType: "shift",
12860 positionData: -supShift,
12861 children: [{ type: "elem", elem: supm, marginRight: marginRight }]
12862 }, options);
12863 } else {
12864 throw new Error("supsub must have either sup or sub.");
12865 }
12866
12867 // Wrap the supsub vlist in a span.msupsub to reset text-align.
12868 var mclass = getTypeOfDomTree(base, "right") || "mord";
12869 return buildCommon.makeSpan([mclass], [base, buildCommon.makeSpan(["msupsub"], [supsub])], options);
12870 },
12871 mathmlBuilder: function mathmlBuilder(group, options) {
12872 // Is the inner group a relevant horizonal brace?
12873 var isBrace = false;
12874 var isOver = void 0;
12875 var isSup = void 0;
12876
12877 var horizBrace = checkNodeType(group.value.base, "horizBrace");
12878 if (horizBrace) {
12879 isSup = !!group.value.sup;
12880 if (isSup === horizBrace.value.isOver) {
12881 isBrace = true;
12882 isOver = horizBrace.value.isOver;
12883 }
12884 }
12885
12886 var children = [buildMathML_buildGroup(group.value.base, options)];
12887
12888 if (group.value.sub) {
12889 children.push(buildMathML_buildGroup(group.value.sub, options));
12890 }
12891
12892 if (group.value.sup) {
12893 children.push(buildMathML_buildGroup(group.value.sup, options));
12894 }
12895
12896 var nodeType = void 0;
12897 if (isBrace) {
12898 nodeType = isOver ? "mover" : "munder";
12899 } else if (!group.value.sub) {
12900 var base = group.value.base;
12901 if (base && base.value.limits && options.style === src_Style.DISPLAY) {
12902 nodeType = "mover";
12903 } else {
12904 nodeType = "msup";
12905 }
12906 } else if (!group.value.sup) {
12907 var _base = group.value.base;
12908 if (_base && _base.value.limits && options.style === src_Style.DISPLAY) {
12909 nodeType = "munder";
12910 } else {
12911 nodeType = "msub";
12912 }
12913 } else {
12914 var _base2 = group.value.base;
12915 if (_base2 && _base2.value.limits && options.style === src_Style.DISPLAY) {
12916 nodeType = "munderover";
12917 } else {
12918 nodeType = "msubsup";
12919 }
12920 }
12921
12922 var node = new mathMLTree.MathNode(nodeType, children);
12923
12924 return node;
12925 }
12926});
12927// CONCATENATED MODULE: ./src/functions/symbolsOp.js
12928
12929
12930
12931
12932
12933
12934// Operator ParseNodes created in Parser.js from symbol Groups in src/symbols.js.
12935
12936// NOTE: `NODETYPE` is constrained by `Group` instead of `NodeType`. This
12937// guarantees that `group.value` is a string as required by buildCommon.mathsym.
12938function defineOpFunction(type, mathmlNodePostProcessor) {
12939 defineFunctionBuilders({
12940 type: type,
12941 htmlBuilder: function htmlBuilder(group, options) {
12942 var groupValue = group.value;
12943 return buildCommon.mathsym(groupValue, group.mode, options, ["m" + type]);
12944 },
12945 mathmlBuilder: function mathmlBuilder(group, options) {
12946 var node = new mathMLTree.MathNode("mo", [buildMathML_makeText(group.value, group.mode)]);
12947 if (mathmlNodePostProcessor) {
12948 mathmlNodePostProcessor(node, group, options);
12949 }
12950 return node;
12951 }
12952 });
12953}
12954
12955defineOpFunction("bin", function (mathNode, group, options) {
12956 var variant = buildMathML_getVariant(group, options);
12957 if (variant === "bold-italic") {
12958 mathNode.setAttribute("mathvariant", variant);
12959 }
12960});
12961defineOpFunction("rel");
12962defineOpFunction("open");
12963defineOpFunction("close");
12964defineOpFunction("inner");
12965defineOpFunction("punct", function (mathNode) {
12966 return mathNode.setAttribute("separator", "true");
12967});
12968// CONCATENATED MODULE: ./src/functions/symbolsOrd.js
12969
12970
12971
12972
12973
12974
12975// "mathord" and "textord" ParseNodes created in Parser.js from symbol Groups in
12976// src/symbols.js.
12977
12978var defaultVariant = {
12979 "mi": "italic",
12980 "mn": "normal",
12981 "mtext": "normal"
12982};
12983
12984defineFunctionBuilders({
12985 type: "mathord",
12986 htmlBuilder: function htmlBuilder(group, options) {
12987 return buildCommon.makeOrd(group, options, "mathord");
12988 },
12989 mathmlBuilder: function mathmlBuilder(group, options) {
12990 var node = new mathMLTree.MathNode("mi", [buildMathML_makeText(group.value, group.mode, options)]);
12991
12992 var variant = buildMathML_getVariant(group, options) || "italic";
12993 if (variant !== defaultVariant[node.type]) {
12994 node.setAttribute("mathvariant", variant);
12995 }
12996 return node;
12997 }
12998});
12999
13000defineFunctionBuilders({
13001 type: "textord",
13002 htmlBuilder: function htmlBuilder(group, options) {
13003 return buildCommon.makeOrd(group, options, "textord");
13004 },
13005 mathmlBuilder: function mathmlBuilder(group, options) {
13006 var text = buildMathML_makeText(group.value, group.mode, options);
13007 var variant = buildMathML_getVariant(group, options) || "normal";
13008
13009 var node = void 0;
13010 if (group.mode === 'text') {
13011 node = new mathMLTree.MathNode("mtext", [text]);
13012 } else if (/[0-9]/.test(group.value)) {
13013 // TODO(kevinb) merge adjacent <mn> nodes
13014 // do it as a post processing step
13015 node = new mathMLTree.MathNode("mn", [text]);
13016 } else if (group.value === "\\prime") {
13017 node = new mathMLTree.MathNode("mo", [text]);
13018 } else {
13019 node = new mathMLTree.MathNode("mi", [text]);
13020 }
13021 if (variant !== defaultVariant[node.type]) {
13022 node.setAttribute("mathvariant", variant);
13023 }
13024
13025 return node;
13026 }
13027});
13028// CONCATENATED MODULE: ./src/functions/symbolsSpacing.js
13029
13030
13031
13032
13033
13034// ParseNode<"spacing"> created in Parser.js from the "spacing" symbol Groups in
13035// src/symbols.js.
13036defineFunctionBuilders({
13037 type: "spacing",
13038 htmlBuilder: function htmlBuilder(group, options) {
13039 if (buildCommon.regularSpace.hasOwnProperty(group.value)) {
13040 var className = buildCommon.regularSpace[group.value].className || "";
13041 // Spaces are generated by adding an actual space. Each of these
13042 // things has an entry in the symbols table, so these will be turned
13043 // into appropriate outputs.
13044 if (group.mode === "text") {
13045 var ord = buildCommon.makeOrd(group, options, "textord");
13046 ord.classes.push(className);
13047 return ord;
13048 } else {
13049 return buildCommon.makeSpan(["mspace", className], [buildCommon.mathsym(group.value, group.mode, options)], options);
13050 }
13051 } else if (buildCommon.cssSpace.hasOwnProperty(group.value)) {
13052 // Spaces based on just a CSS class.
13053 return buildCommon.makeSpan(["mspace", buildCommon.cssSpace[group.value]], [], options);
13054 } else {
13055 throw new src_ParseError("Unknown type of space \"" + group.value + "\"");
13056 }
13057 },
13058 mathmlBuilder: function mathmlBuilder(group, options) {
13059 var node = void 0;
13060
13061 if (buildCommon.regularSpace.hasOwnProperty(group.value)) {
13062 node = new mathMLTree.MathNode("mtext", [new mathMLTree.TextNode("\xA0")]);
13063 } else if (buildCommon.cssSpace.hasOwnProperty(group.value)) {
13064 // CSS-based MathML spaces (\nobreak, \allowbreak) are ignored
13065 return new mathMLTree.MathNode("mspace");
13066 } else {
13067 throw new src_ParseError("Unknown type of space \"" + group.value + "\"");
13068 }
13069
13070 return node;
13071 }
13072});
13073// CONCATENATED MODULE: ./src/functions/tag.js
13074
13075
13076
13077
13078
13079defineFunctionBuilders({
13080 type: "tag",
13081 mathmlBuilder: function mathmlBuilder(group, options) {
13082 var table = new mathMLTree.MathNode("mtable", [new mathMLTree.MathNode("mlabeledtr", [new mathMLTree.MathNode("mtd", [buildExpressionRow(group.value.tag, options)]), new mathMLTree.MathNode("mtd", [buildExpressionRow(group.value.body, options)])])]);
13083 table.setAttribute("side", "right");
13084 return table;
13085 }
13086});
13087// CONCATENATED MODULE: ./src/functions/text.js
13088
13089
13090
13091
13092
13093
13094
13095// Non-mathy text, possibly in a font
13096var textFontFamilies = {
13097 "\\text": undefined, "\\textrm": "textrm", "\\textsf": "textsf",
13098 "\\texttt": "texttt", "\\textnormal": "textrm"
13099};
13100
13101var textFontWeights = {
13102 "\\textbf": "textbf"
13103};
13104
13105var textFontShapes = {
13106 "\\textit": "textit"
13107};
13108
13109var optionsWithFont = function optionsWithFont(group, options) {
13110 var font = group.value.font;
13111 // Checks if the argument is a font family or a font style.
13112 if (!font) {
13113 return options;
13114 } else if (textFontFamilies[font]) {
13115 return options.withTextFontFamily(textFontFamilies[font]);
13116 } else if (textFontWeights[font]) {
13117 return options.withTextFontWeight(textFontWeights[font]);
13118 } else {
13119 return options.withTextFontShape(textFontShapes[font]);
13120 }
13121};
13122
13123defineFunction({
13124 type: "text",
13125 names: [
13126 // Font families
13127 "\\text", "\\textrm", "\\textsf", "\\texttt", "\\textnormal",
13128 // Font weights
13129 "\\textbf",
13130 // Font Shapes
13131 "\\textit"],
13132 props: {
13133 numArgs: 1,
13134 argTypes: ["text"],
13135 greediness: 2,
13136 allowedInText: true,
13137 consumeMode: "text"
13138 },
13139 handler: function handler(_ref, args) {
13140 var parser = _ref.parser,
13141 funcName = _ref.funcName;
13142
13143 var body = args[0];
13144 return new src_ParseNode("text", {
13145 type: "text",
13146 body: defineFunction_ordargument(body),
13147 font: funcName
13148 }, parser.mode);
13149 },
13150 htmlBuilder: function htmlBuilder(group, options) {
13151 var newOptions = optionsWithFont(group, options);
13152 var inner = buildHTML_buildExpression(group.value.body, newOptions, true);
13153 buildCommon.tryCombineChars(inner);
13154 return buildCommon.makeSpan(["mord", "text"], inner, newOptions);
13155 },
13156 mathmlBuilder: function mathmlBuilder(group, options) {
13157 var newOptions = optionsWithFont(group, options);
13158 return buildExpressionRow(group.value.body, newOptions);
13159 }
13160});
13161// CONCATENATED MODULE: ./src/functions/underline.js
13162
13163
13164
13165
13166
13167
13168
13169
13170defineFunction({
13171 type: "underline",
13172 names: ["\\underline"],
13173 props: {
13174 numArgs: 1,
13175 allowedInText: true
13176 },
13177 handler: function handler(_ref, args) {
13178 var parser = _ref.parser;
13179
13180 var body = args[0];
13181 return new src_ParseNode("underline", {
13182 type: "underline",
13183 body: body
13184 }, parser.mode);
13185 },
13186 htmlBuilder: function htmlBuilder(group, options) {
13187 // Underlines are handled in the TeXbook pg 443, Rule 10.
13188 // Build the inner group.
13189 var innerGroup = buildHTML_buildGroup(group.value.body, options);
13190
13191 // Create the line to go below the body
13192 var line = buildCommon.makeLineSpan("underline-line", options);
13193
13194 // Generate the vlist, with the appropriate kerns
13195 var vlist = buildCommon.makeVList({
13196 positionType: "top",
13197 positionData: innerGroup.height,
13198 children: [{ type: "kern", size: line.height }, { type: "elem", elem: line }, { type: "kern", size: 3 * line.height }, { type: "elem", elem: innerGroup }]
13199 }, options);
13200
13201 return buildCommon.makeSpan(["mord", "underline"], [vlist], options);
13202 },
13203 mathmlBuilder: function mathmlBuilder(group, options) {
13204 var operator = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("\u203E")]);
13205 operator.setAttribute("stretchy", "true");
13206
13207 var node = new mathMLTree.MathNode("munder", [buildMathML_buildGroup(group.value.body, options), operator]);
13208 node.setAttribute("accentunder", "true");
13209
13210 return node;
13211 }
13212});
13213// CONCATENATED MODULE: ./src/functions/verb.js
13214
13215
13216
13217
13218
13219defineFunction({
13220 type: "verb",
13221 names: ["\\verb"],
13222 props: {
13223 numArgs: 0,
13224 allowedInText: true
13225 },
13226 handler: function handler(context, args, optArgs) {
13227 // \verb and \verb* are dealt with directly in Parser.js.
13228 // If we end up here, it's because of a failure to match the two delimiters
13229 // in the regex in Lexer.js. LaTeX raises the following error when \verb is
13230 // terminated by end of line (or file).
13231 throw new src_ParseError("\\verb ended by end of line instead of matching delimiter");
13232 },
13233 htmlBuilder: function htmlBuilder(group, options) {
13234 var text = buildCommon.makeVerb(group, options);
13235 var body = [];
13236 // \verb enters text mode and therefore is sized like \textstyle
13237 var newOptions = options.havingStyle(options.style.text());
13238 for (var i = 0; i < text.length; i++) {
13239 var c = text[i];
13240 if (c === '~') {
13241 c = '\\textasciitilde';
13242 }
13243 body.push(buildCommon.makeSymbol(c, "Typewriter-Regular", group.mode, newOptions, ["mord", "texttt"]));
13244 }
13245 buildCommon.tryCombineChars(body);
13246 return buildCommon.makeSpan(["mord", "text"].concat(newOptions.sizingClasses(options)), body, newOptions);
13247 },
13248 mathmlBuilder: function mathmlBuilder(group, options) {
13249 var text = new mathMLTree.TextNode(buildCommon.makeVerb(group, options));
13250 var node = new mathMLTree.MathNode("mtext", [text]);
13251 node.setAttribute("mathvariant", "monospace");
13252 return node;
13253 }
13254});
13255// CONCATENATED MODULE: ./src/functions.js
13256
13257/** Include this to ensure that all functions are defined. */
13258
13259
13260var functions = _functions;
13261/* harmony default export */ var src_functions = (functions);
13262
13263// TODO(kevinb): have functions return an object and call defineFunction with
13264// that object in this file instead of relying on side-effects.
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301// CONCATENATED MODULE: ./src/defineEnvironment.js
13302
13303
13304
13305
13306/**
13307 * The context contains the following properties:
13308 * - mode: current parsing mode.
13309 * - envName: the name of the environment, one of the listed names.
13310 * - parser: the parser object.
13311 */
13312
13313
13314/**
13315 * - context: information and references provided by the parser
13316 * - args: an array of arguments passed to \begin{name}
13317 * - optArgs: an array of optional arguments passed to \begin{name}
13318 */
13319
13320
13321/**
13322 * - numArgs: (default 0) The number of arguments after the \begin{name} function.
13323 * - argTypes: (optional) Just like for a function
13324 * - allowedInText: (default false) Whether or not the environment is allowed
13325 * inside text mode (not enforced yet).
13326 * - numOptionalArgs: (default 0) Just like for a function
13327 */
13328
13329
13330/**
13331 * Final enviornment spec for use at parse time.
13332 * This is almost identical to `EnvDefSpec`, except it
13333 * 1. includes the function handler
13334 * 2. requires all arguments except argType
13335 * It is generated by `defineEnvironment()` below.
13336 */
13337
13338
13339/**
13340 * All registered environments.
13341 * `environments.js` exports this same dictionary again and makes it public.
13342 * `Parser.js` requires this dictionary via `environments.js`.
13343 */
13344var _environments = {};
13345
13346function defineEnvironment(_ref) {
13347 var type = _ref.type,
13348 names = _ref.names,
13349 props = _ref.props,
13350 handler = _ref.handler,
13351 htmlBuilder = _ref.htmlBuilder,
13352 mathmlBuilder = _ref.mathmlBuilder;
13353
13354 // Set default values of environments.
13355 var data = {
13356 type: type,
13357 numArgs: props.numArgs || 0,
13358 greediness: 1,
13359 allowedInText: false,
13360 numOptionalArgs: 0,
13361 handler: handler
13362 };
13363 for (var i = 0; i < names.length; ++i) {
13364 // TODO: The value type of _environments should be a type union of all
13365 // possible `EnvSpec<>` possibilities instead of `EnvSpec<*>`, which is
13366 // an existential type.
13367 // $FlowFixMe
13368 _environments[names[i]] = data;
13369 }
13370 if (htmlBuilder) {
13371 _htmlGroupBuilders[type] = htmlBuilder;
13372 }
13373 if (mathmlBuilder) {
13374 _mathmlGroupBuilders[type] = mathmlBuilder;
13375 }
13376}
13377// CONCATENATED MODULE: ./src/environments/array.js
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392// Data stored in the ParseNode associated with the environment.
13393
13394// Same as above but with some fields not yet filled.
13395
13396
13397function getHLines(parser) {
13398 // Return an array. The array length = number of hlines.
13399 // Each element in the array tells if the line is dashed.
13400 var hlineInfo = [];
13401 parser.consumeSpaces();
13402 var nxt = parser.nextToken.text;
13403 while (nxt === "\\hline" || nxt === "\\hdashline") {
13404 parser.consume();
13405 hlineInfo.push(nxt === "\\hdashline");
13406 parser.consumeSpaces();
13407 nxt = parser.nextToken.text;
13408 }
13409 return hlineInfo;
13410}
13411
13412/**
13413 * Parse the body of the environment, with rows delimited by \\ and
13414 * columns delimited by &, and create a nested list in row-major order
13415 * with one group per cell. If given an optional argument style
13416 * ("text", "display", etc.), then each cell is cast into that style.
13417 */
13418function parseArray(parser, result, style) {
13419 // Parse body of array with \\ temporarily mapped to \cr
13420 parser.gullet.beginGroup();
13421 parser.gullet.macros.set("\\\\", "\\cr");
13422
13423 // Get current arraystretch if it's not set by the environment
13424 if (!result.arraystretch) {
13425 var _arraystretch = parser.gullet.expandMacroAsText("\\arraystretch");
13426 if (_arraystretch == null) {
13427 // Default \arraystretch from lttab.dtx
13428 result.arraystretch = 1;
13429 } else {
13430 result.arraystretch = parseFloat(_arraystretch);
13431 if (!result.arraystretch || result.arraystretch < 0) {
13432 throw new src_ParseError("Invalid \\arraystretch: " + _arraystretch);
13433 }
13434 }
13435 }
13436
13437 var row = [];
13438 var body = [row];
13439 var rowGaps = [];
13440 var hLinesBeforeRow = [];
13441
13442 // Test for \hline at the top of the array.
13443 hLinesBeforeRow.push(getHLines(parser));
13444
13445 while (true) {
13446 // eslint-disable-line no-constant-condition
13447 var cell = parser.parseExpression(false, "\\cr");
13448 cell = new src_ParseNode("ordgroup", cell, parser.mode);
13449 if (style) {
13450 cell = new src_ParseNode("styling", {
13451 type: "styling",
13452 style: style,
13453 value: [cell]
13454 }, parser.mode);
13455 }
13456 row.push(cell);
13457 var next = parser.nextToken.text;
13458 if (next === "&") {
13459 parser.consume();
13460 } else if (next === "\\end") {
13461 // Arrays terminate newlines with `\crcr` which consumes a `\cr` if
13462 // the last line is empty.
13463 // NOTE: Currently, `cell` is the last item added into `row`.
13464 if (row.length === 1 && cell.value.value[0].value.length === 0) {
13465 body.pop();
13466 }
13467 if (hLinesBeforeRow.length < body.length + 1) {
13468 hLinesBeforeRow.push([]);
13469 }
13470 break;
13471 } else if (next === "\\cr") {
13472 var cr = parser.parseFunction();
13473 if (!cr) {
13474 throw new src_ParseError("Failed to parse function after " + next);
13475 }
13476 rowGaps.push(assertNodeType(cr, "cr").value.size);
13477
13478 // check for \hline(s) following the row separator
13479 hLinesBeforeRow.push(getHLines(parser));
13480
13481 row = [];
13482 body.push(row);
13483 } else {
13484 throw new src_ParseError("Expected & or \\\\ or \\cr or \\end", parser.nextToken);
13485 }
13486 }
13487 result.body = body;
13488 result.rowGaps = rowGaps;
13489 result.hLinesBeforeRow = hLinesBeforeRow;
13490 // $FlowFixMe: The required fields were added immediately above.
13491 var res = result;
13492 parser.gullet.endGroup();
13493 return new src_ParseNode("array", res, parser.mode);
13494}
13495
13496// Decides on a style for cells in an array according to whether the given
13497// environment name starts with the letter 'd'.
13498function dCellStyle(envName) {
13499 if (envName.substr(0, 1) === "d") {
13500 return "display";
13501 } else {
13502 return "text";
13503 }
13504}
13505
13506var array_htmlBuilder = function htmlBuilder(group, options) {
13507 var r = void 0;
13508 var c = void 0;
13509 var nr = group.value.body.length;
13510 var hLinesBeforeRow = group.value.hLinesBeforeRow;
13511 var nc = 0;
13512 var body = new Array(nr);
13513 var hlines = [];
13514
13515 // Horizontal spacing
13516 var pt = 1 / options.fontMetrics().ptPerEm;
13517 var arraycolsep = 5 * pt; // \arraycolsep in article.cls
13518
13519 // Vertical spacing
13520 var baselineskip = 12 * pt; // see size10.clo
13521 // Default \jot from ltmath.dtx
13522 // TODO(edemaine): allow overriding \jot via \setlength (#687)
13523 var jot = 3 * pt;
13524 var arrayskip = group.value.arraystretch * baselineskip;
13525 var arstrutHeight = 0.7 * arrayskip; // \strutbox in ltfsstrc.dtx and
13526 var arstrutDepth = 0.3 * arrayskip; // \@arstrutbox in lttab.dtx
13527
13528 var totalHeight = 0;
13529
13530 // Set a position for \hline(s) at the top of the array, if any.
13531 function setHLinePos(hlinesInGap) {
13532 for (var i = 0; i < hlinesInGap.length; ++i) {
13533 if (i > 0) {
13534 totalHeight += 0.25;
13535 }
13536 hlines.push({ pos: totalHeight, isDashed: hlinesInGap[i] });
13537 }
13538 }
13539 setHLinePos(hLinesBeforeRow[0]);
13540
13541 for (r = 0; r < group.value.body.length; ++r) {
13542 var inrow = group.value.body[r];
13543 var _height = arstrutHeight; // \@array adds an \@arstrut
13544 var _depth = arstrutDepth; // to each tow (via the template)
13545
13546 if (nc < inrow.length) {
13547 nc = inrow.length;
13548 }
13549
13550 var outrow = new Array(inrow.length);
13551 for (c = 0; c < inrow.length; ++c) {
13552 var elt = buildHTML_buildGroup(inrow[c], options);
13553 if (_depth < elt.depth) {
13554 _depth = elt.depth;
13555 }
13556 if (_height < elt.height) {
13557 _height = elt.height;
13558 }
13559 outrow[c] = elt;
13560 }
13561
13562 var rowGap = group.value.rowGaps[r];
13563 var gap = 0;
13564 if (rowGap) {
13565 gap = units_calculateSize(rowGap.value.value, options);
13566 if (gap > 0) {
13567 // \@argarraycr
13568 gap += arstrutDepth;
13569 if (_depth < gap) {
13570 _depth = gap; // \@xargarraycr
13571 }
13572 gap = 0;
13573 }
13574 }
13575 // In AMS multiline environments such as aligned and gathered, rows
13576 // correspond to lines that have additional \jot added to the
13577 // \baselineskip via \openup.
13578 if (group.value.addJot) {
13579 _depth += jot;
13580 }
13581
13582 outrow.height = _height;
13583 outrow.depth = _depth;
13584 totalHeight += _height;
13585 outrow.pos = totalHeight;
13586 totalHeight += _depth + gap; // \@yargarraycr
13587 body[r] = outrow;
13588
13589 // Set a position for \hline(s), if any.
13590 setHLinePos(hLinesBeforeRow[r + 1]);
13591 }
13592
13593 var offset = totalHeight / 2 + options.fontMetrics().axisHeight;
13594 var colDescriptions = group.value.cols || [];
13595 var cols = [];
13596 var colSep = void 0;
13597 var colDescrNum = void 0;
13598 for (c = 0, colDescrNum = 0;
13599 // Continue while either there are more columns or more column
13600 // descriptions, so trailing separators don't get lost.
13601 c < nc || colDescrNum < colDescriptions.length; ++c, ++colDescrNum) {
13602
13603 var colDescr = colDescriptions[colDescrNum] || {};
13604
13605 var firstSeparator = true;
13606 while (colDescr.type === "separator") {
13607 // If there is more than one separator in a row, add a space
13608 // between them.
13609 if (!firstSeparator) {
13610 colSep = buildCommon.makeSpan(["arraycolsep"], []);
13611 colSep.style.width = options.fontMetrics().doubleRuleSep + "em";
13612 cols.push(colSep);
13613 }
13614
13615 if (colDescr.separator === "|") {
13616 var _separator = buildCommon.makeSpan(["vertical-separator"], [], options);
13617 _separator.style.height = totalHeight + "em";
13618 _separator.style.verticalAlign = -(totalHeight - offset) + "em";
13619
13620 cols.push(_separator);
13621 } else if (colDescr.separator === ":") {
13622 var _separator2 = buildCommon.makeSpan(["vertical-separator", "vs-dashed"], [], options);
13623 _separator2.style.height = totalHeight + "em";
13624 _separator2.style.verticalAlign = -(totalHeight - offset) + "em";
13625
13626 cols.push(_separator2);
13627 } else {
13628 throw new src_ParseError("Invalid separator type: " + colDescr.separator);
13629 }
13630
13631 colDescrNum++;
13632 colDescr = colDescriptions[colDescrNum] || {};
13633 firstSeparator = false;
13634 }
13635
13636 if (c >= nc) {
13637 continue;
13638 }
13639
13640 var sepwidth = void 0;
13641 if (c > 0 || group.value.hskipBeforeAndAfter) {
13642 sepwidth = utils.deflt(colDescr.pregap, arraycolsep);
13643 if (sepwidth !== 0) {
13644 colSep = buildCommon.makeSpan(["arraycolsep"], []);
13645 colSep.style.width = sepwidth + "em";
13646 cols.push(colSep);
13647 }
13648 }
13649
13650 var col = [];
13651 for (r = 0; r < nr; ++r) {
13652 var row = body[r];
13653 var elem = row[c];
13654 if (!elem) {
13655 continue;
13656 }
13657 var shift = row.pos - offset;
13658 elem.depth = row.depth;
13659 elem.height = row.height;
13660 col.push({ type: "elem", elem: elem, shift: shift });
13661 }
13662
13663 col = buildCommon.makeVList({
13664 positionType: "individualShift",
13665 children: col
13666 }, options);
13667 col = buildCommon.makeSpan(["col-align-" + (colDescr.align || "c")], [col]);
13668 cols.push(col);
13669
13670 if (c < nc - 1 || group.value.hskipBeforeAndAfter) {
13671 sepwidth = utils.deflt(colDescr.postgap, arraycolsep);
13672 if (sepwidth !== 0) {
13673 colSep = buildCommon.makeSpan(["arraycolsep"], []);
13674 colSep.style.width = sepwidth + "em";
13675 cols.push(colSep);
13676 }
13677 }
13678 }
13679 body = buildCommon.makeSpan(["mtable"], cols);
13680
13681 // Add \hline(s), if any.
13682 if (hlines.length > 0) {
13683 var line = buildCommon.makeLineSpan("hline", options, 0.05);
13684 var dashes = buildCommon.makeLineSpan("hdashline", options, 0.05);
13685 var vListElems = [{ type: "elem", elem: body, shift: 0 }];
13686 while (hlines.length > 0) {
13687 var hline = hlines.pop();
13688 var lineShift = hline.pos - offset;
13689 if (hline.isDashed) {
13690 vListElems.push({ type: "elem", elem: dashes, shift: lineShift });
13691 } else {
13692 vListElems.push({ type: "elem", elem: line, shift: lineShift });
13693 }
13694 }
13695 body = buildCommon.makeVList({
13696 positionType: "individualShift",
13697 children: vListElems
13698 }, options);
13699 }
13700
13701 return buildCommon.makeSpan(["mord"], [body], options);
13702};
13703
13704var array_mathmlBuilder = function mathmlBuilder(group, options) {
13705 return new mathMLTree.MathNode("mtable", group.value.body.map(function (row) {
13706 return new mathMLTree.MathNode("mtr", row.map(function (cell) {
13707 return new mathMLTree.MathNode("mtd", [buildMathML_buildGroup(cell, options)]);
13708 }));
13709 }));
13710};
13711
13712// Convenience function for aligned and alignedat environments.
13713var array_alignedHandler = function alignedHandler(context, args) {
13714 var cols = [];
13715 var res = {
13716 type: "array",
13717 cols: cols,
13718 addJot: true
13719 };
13720 res = parseArray(context.parser, res, "display");
13721
13722 // Determining number of columns.
13723 // 1. If the first argument is given, we use it as a number of columns,
13724 // and makes sure that each row doesn't exceed that number.
13725 // 2. Otherwise, just count number of columns = maximum number
13726 // of cells in each row ("aligned" mode -- isAligned will be true).
13727 //
13728 // At the same time, prepend empty group {} at beginning of every second
13729 // cell in each row (starting with second cell) so that operators become
13730 // binary. This behavior is implemented in amsmath's \start@aligned.
13731 var numMaths = void 0;
13732 var numCols = 0;
13733 var emptyGroup = new src_ParseNode("ordgroup", [], context.mode);
13734 var ordgroup = checkNodeType(args[0], "ordgroup");
13735 if (ordgroup) {
13736 var arg0 = "";
13737 for (var i = 0; i < ordgroup.value.length; i++) {
13738 var textord = assertNodeType(ordgroup.value[i], "textord");
13739 arg0 += textord.value;
13740 }
13741 numMaths = Number(arg0);
13742 numCols = numMaths * 2;
13743 }
13744 var isAligned = !numCols;
13745 res.value.body.forEach(function (row) {
13746 for (var _i = 1; _i < row.length; _i += 2) {
13747 // Modify ordgroup node within styling node
13748 var styling = assertNodeType(row[_i], "styling");
13749 var _ordgroup = assertNodeType(styling.value.value[0], "ordgroup");
13750 _ordgroup.value.unshift(emptyGroup);
13751 }
13752 if (!isAligned) {
13753 // Case 1
13754 var curMaths = row.length / 2;
13755 if (numMaths < curMaths) {
13756 throw new src_ParseError("Too many math in a row: " + ("expected " + numMaths + ", but got " + curMaths), row[0]);
13757 }
13758 } else if (numCols < row.length) {
13759 // Case 2
13760 numCols = row.length;
13761 }
13762 });
13763
13764 // Adjusting alignment.
13765 // In aligned mode, we add one \qquad between columns;
13766 // otherwise we add nothing.
13767 for (var _i2 = 0; _i2 < numCols; ++_i2) {
13768 var _align = "r";
13769 var _pregap = 0;
13770 if (_i2 % 2 === 1) {
13771 _align = "l";
13772 } else if (_i2 > 0 && isAligned) {
13773 // "aligned" mode.
13774 _pregap = 1; // add one \quad
13775 }
13776 cols[_i2] = {
13777 type: "align",
13778 align: _align,
13779 pregap: _pregap,
13780 postgap: 0
13781 };
13782 }
13783 return res;
13784};
13785
13786// Arrays are part of LaTeX, defined in lttab.dtx so its documentation
13787// is part of the source2e.pdf file of LaTeX2e source documentation.
13788// {darray} is an {array} environment where cells are set in \displaystyle,
13789// as defined in nccmath.sty.
13790defineEnvironment({
13791 type: "array",
13792 names: ["array", "darray"],
13793 props: {
13794 numArgs: 1
13795 },
13796 handler: function handler(context, args) {
13797 // Since no types are specified above, the two possibilities are
13798 // - The argument is wrapped in {} or [], in which case Parser's
13799 // parseGroup() returns an "ordgroup" wrapping some symbol node.
13800 // - The argument is a bare symbol node.
13801 var symNode = checkSymbolNodeType(args[0]);
13802 var colalign = symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").value;
13803 var cols = colalign.map(function (nde) {
13804 var node = assertSymbolNodeType(nde);
13805 var ca = node.value;
13806 if ("lcr".indexOf(ca) !== -1) {
13807 return {
13808 type: "align",
13809 align: ca
13810 };
13811 } else if (ca === "|") {
13812 return {
13813 type: "separator",
13814 separator: "|"
13815 };
13816 } else if (ca === ":") {
13817 return {
13818 type: "separator",
13819 separator: ":"
13820 };
13821 }
13822 throw new src_ParseError("Unknown column alignment: " + ca, nde);
13823 });
13824 var res = {
13825 type: "array",
13826 cols: cols,
13827 hskipBeforeAndAfter: true // \@preamble in lttab.dtx
13828 };
13829 res = parseArray(context.parser, res, dCellStyle(context.envName));
13830 return res;
13831 },
13832
13833 htmlBuilder: array_htmlBuilder,
13834 mathmlBuilder: array_mathmlBuilder
13835});
13836
13837// The matrix environments of amsmath builds on the array environment
13838// of LaTeX, which is discussed above.
13839defineEnvironment({
13840 type: "array",
13841 names: ["matrix", "pmatrix", "bmatrix", "Bmatrix", "vmatrix", "Vmatrix"],
13842 props: {
13843 numArgs: 0
13844 },
13845 handler: function handler(context) {
13846 var delimiters = {
13847 "matrix": null,
13848 "pmatrix": ["(", ")"],
13849 "bmatrix": ["[", "]"],
13850 "Bmatrix": ["\\{", "\\}"],
13851 "vmatrix": ["|", "|"],
13852 "Vmatrix": ["\\Vert", "\\Vert"]
13853 }[context.envName];
13854 var res = {
13855 type: "array",
13856 hskipBeforeAndAfter: false // \hskip -\arraycolsep in amsmath
13857 };
13858 res = parseArray(context.parser, res, dCellStyle(context.envName));
13859 if (delimiters) {
13860 res = new src_ParseNode("leftright", {
13861 type: "leftright",
13862 body: [res],
13863 left: delimiters[0],
13864 right: delimiters[1]
13865 }, context.mode);
13866 }
13867 return res;
13868 },
13869 htmlBuilder: array_htmlBuilder,
13870 mathmlBuilder: array_mathmlBuilder
13871});
13872
13873// A cases environment (in amsmath.sty) is almost equivalent to
13874// \def\arraystretch{1.2}%
13875// \left\{\begin{array}{@{}l@{\quad}l@{}} ? \end{array}\right.
13876// {dcases} is a {cases} environment where cells are set in \displaystyle,
13877// as defined in mathtools.sty.
13878defineEnvironment({
13879 type: "array",
13880 names: ["cases", "dcases"],
13881 props: {
13882 numArgs: 0
13883 },
13884 handler: function handler(context) {
13885 var res = {
13886 type: "array",
13887 arraystretch: 1.2,
13888 cols: [{
13889 type: "align",
13890 align: "l",
13891 pregap: 0,
13892 // TODO(kevinb) get the current style.
13893 // For now we use the metrics for TEXT style which is what we were
13894 // doing before. Before attempting to get the current style we
13895 // should look at TeX's behavior especially for \over and matrices.
13896 postgap: 1.0 /* 1em quad */
13897 }, {
13898 type: "align",
13899 align: "l",
13900 pregap: 0,
13901 postgap: 0
13902 }]
13903 };
13904 res = parseArray(context.parser, res, dCellStyle(context.envName));
13905 res = new src_ParseNode("leftright", {
13906 type: "leftright",
13907 body: [res],
13908 left: "\\{",
13909 right: "."
13910 }, context.mode);
13911 return res;
13912 },
13913 htmlBuilder: array_htmlBuilder,
13914 mathmlBuilder: array_mathmlBuilder
13915});
13916
13917// An aligned environment is like the align* environment
13918// except it operates within math mode.
13919// Note that we assume \nomallineskiplimit to be zero,
13920// so that \strut@ is the same as \strut.
13921defineEnvironment({
13922 type: "array",
13923 names: ["aligned"],
13924 props: {
13925 numArgs: 0
13926 },
13927 handler: array_alignedHandler,
13928 htmlBuilder: array_htmlBuilder,
13929 mathmlBuilder: array_mathmlBuilder
13930});
13931
13932// A gathered environment is like an array environment with one centered
13933// column, but where rows are considered lines so get \jot line spacing
13934// and contents are set in \displaystyle.
13935defineEnvironment({
13936 type: "array",
13937 names: ["gathered"],
13938 props: {
13939 numArgs: 0
13940 },
13941 handler: function handler(context) {
13942 var res = {
13943 type: "array",
13944 cols: [{
13945 type: "align",
13946 align: "c"
13947 }],
13948 addJot: true
13949 };
13950 res = parseArray(context.parser, res, "display");
13951 return res;
13952 },
13953 htmlBuilder: array_htmlBuilder,
13954 mathmlBuilder: array_mathmlBuilder
13955});
13956
13957// alignat environment is like an align environment, but one must explicitly
13958// specify maximum number of columns in each row, and can adjust spacing between
13959// each columns.
13960defineEnvironment({
13961 type: "array",
13962 names: ["alignedat"],
13963 // One for numbered and for unnumbered;
13964 // but, KaTeX doesn't supports math numbering yet,
13965 // they make no difference for now.
13966 props: {
13967 numArgs: 1
13968 },
13969 handler: array_alignedHandler,
13970 htmlBuilder: array_htmlBuilder,
13971 mathmlBuilder: array_mathmlBuilder
13972});
13973
13974// Catch \hline outside array environment
13975defineFunction({
13976 type: "text", // Doesn't matter what this is.
13977 names: ["\\hline", "\\hdashline"],
13978 props: {
13979 numArgs: 0,
13980 allowedInText: true,
13981 allowedInMath: true
13982 },
13983 handler: function handler(context, args) {
13984 throw new src_ParseError(context.funcName + " valid only within array environment");
13985 }
13986});
13987// CONCATENATED MODULE: ./src/environments.js
13988
13989
13990var environments = _environments;
13991
13992/* harmony default export */ var src_environments = (environments);
13993
13994// All environment definitions should be imported below
13995
13996// EXTERNAL MODULE: ./node_modules/match-at/lib/matchAt.js
13997var matchAt = __webpack_require__(62);
13998var matchAt_default = /*#__PURE__*/__webpack_require__.n(matchAt);
13999
14000// CONCATENATED MODULE: ./src/Lexer.js
14001
14002
14003
14004/**
14005 * The Lexer class handles tokenizing the input in various ways. Since our
14006 * parser expects us to be able to backtrack, the lexer allows lexing from any
14007 * given starting point.
14008 *
14009 * Its main exposed function is the `lex` function, which takes a position to
14010 * lex from and a type of token to lex. It defers to the appropriate `_innerLex`
14011 * function.
14012 *
14013 * The various `_innerLex` functions perform the actual lexing of different
14014 * kinds.
14015 */
14016
14017
14018
14019
14020
14021
14022/* The following tokenRegex
14023 * - matches typical whitespace (but not NBSP etc.) using its first group
14024 * - matches comments (must have trailing newlines)
14025 * - does not match any control character \x00-\x1f except whitespace
14026 * - does not match a bare backslash
14027 * - matches any ASCII character except those just mentioned
14028 * - does not match the BMP private use area \uE000-\uF8FF
14029 * - does not match bare surrogate code units
14030 * - matches any BMP character except for those just described
14031 * - matches any valid Unicode surrogate pair
14032 * - matches a backslash followed by one or more letters
14033 * - matches a backslash followed by any BMP character, including newline
14034 * Just because the Lexer matches something doesn't mean it's valid input:
14035 * If there is no matching function or symbol definition, the Parser will
14036 * still reject the input.
14037 */
14038var spaceRegexString = "[ \r\n\t]";
14039var commentRegexString = "%[^\n]*[\n]";
14040var controlWordRegexString = "\\\\[a-zA-Z@]+";
14041var controlSymbolRegexString = "\\\\[^\uD800-\uDFFF]";
14042var controlWordWhitespaceRegexString = "" + controlWordRegexString + spaceRegexString + "*";
14043var controlWordWhitespaceRegex = new RegExp("^(" + controlWordRegexString + ")" + spaceRegexString + "*$");
14044var combiningDiacriticalMarkString = "[\u0300-\u036F]";
14045var combiningDiacriticalMarksEndRegex = new RegExp(combiningDiacriticalMarkString + "+$");
14046var tokenRegex = new RegExp("(" + spaceRegexString + "+)|" + ( // whitespace
14047"(" + commentRegexString) + // comments
14048"|[!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]" + ( // single codepoint
14049combiningDiacriticalMarkString + "*") + // ...plus accents
14050"|[\uD800-\uDBFF][\uDC00-\uDFFF]" + ( // surrogate pair
14051combiningDiacriticalMarkString + "*") + // ...plus accents
14052"|\\\\verb\\*([^]).*?\\3" + // \verb*
14053"|\\\\verb([^*a-zA-Z]).*?\\4" + ( // \verb unstarred
14054"|" + controlWordWhitespaceRegexString) + ( // \macroName + spaces
14055"|" + controlSymbolRegexString) + // \\, \', etc.
14056")");
14057
14058// tokenRegex has no ^ marker, as required by matchAt.
14059// These regexs are for matching results from tokenRegex,
14060// so they do have ^ markers.
14061var controlWordRegex = new RegExp("^" + controlWordRegexString);
14062var commentRegex = new RegExp("^" + commentRegexString);
14063
14064/** Main Lexer class */
14065
14066var Lexer_Lexer = function () {
14067 function Lexer(input) {
14068 classCallCheck_default()(this, Lexer);
14069
14070 // Separate accents from characters
14071 this.input = input;
14072 this.pos = 0;
14073 }
14074
14075 /**
14076 * This function lexes a single token.
14077 */
14078
14079
14080 createClass_default()(Lexer, [{
14081 key: "lex",
14082 value: function lex() {
14083 var input = this.input;
14084 var pos = this.pos;
14085 if (pos === input.length) {
14086 return new Token_Token("EOF", new src_SourceLocation(this, pos, pos));
14087 }
14088 var match = matchAt_default()(tokenRegex, input, pos);
14089 if (match === null) {
14090 throw new src_ParseError("Unexpected character: '" + input[pos] + "'", new Token_Token(input[pos], new src_SourceLocation(this, pos, pos + 1)));
14091 }
14092 var text = match[2] || " ";
14093 var start = this.pos;
14094 this.pos += match[0].length;
14095 var end = this.pos;
14096
14097 // Trim any trailing whitespace from control word match
14098 var controlMatch = text.match(controlWordWhitespaceRegex);
14099 if (controlMatch) {
14100 text = controlMatch[1];
14101 }
14102
14103 if (commentRegex.test(text)) {
14104 return this.lex();
14105 } else {
14106 return new Token_Token(text, new src_SourceLocation(this, start, end));
14107 }
14108 }
14109 }]);
14110
14111 return Lexer;
14112}();
14113
14114/* harmony default export */ var src_Lexer = (Lexer_Lexer);
14115// EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/object/get-own-property-names.js
14116var get_own_property_names = __webpack_require__(61);
14117var get_own_property_names_default = /*#__PURE__*/__webpack_require__.n(get_own_property_names);
14118
14119// CONCATENATED MODULE: ./src/Namespace.js
14120
14121
14122
14123
14124
14125
14126/**
14127 * A `Namespace` refers to a space of nameable things like macros or lengths,
14128 * which can be `set` either globally or local to a nested group, using an
14129 * undo stack similar to how TeX implements this functionality.
14130 * Performance-wise, `get` and local `set` take constant time, while global
14131 * `set` takes time proportional to the depth of group nesting.
14132 */
14133
14134
14135
14136var Namespace_Namespace = function () {
14137
14138 /**
14139 * Both arguments are optional. The first argument is an object of
14140 * built-in mappings which never change. The second argument is an object
14141 * of initial (global-level) mappings, which will constantly change
14142 * according to any global/top-level `set`s done.
14143 */
14144 function Namespace() {
14145 var builtins = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
14146 var globalMacros = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
14147
14148 classCallCheck_default()(this, Namespace);
14149
14150 this.current = globalMacros;
14151 this.builtins = builtins;
14152 this.undefStack = [];
14153 }
14154
14155 /**
14156 * Start a new nested group, affecting future local `set`s.
14157 */
14158
14159
14160 createClass_default()(Namespace, [{
14161 key: "beginGroup",
14162 value: function beginGroup() {
14163 this.undefStack.push({});
14164 }
14165
14166 /**
14167 * End current nested group, restoring values before the group began.
14168 */
14169
14170 }, {
14171 key: "endGroup",
14172 value: function endGroup() {
14173 if (this.undefStack.length === 0) {
14174 throw new src_ParseError("Unbalanced namespace destruction: attempt " + "to pop global namespace; please report this as a bug");
14175 }
14176 var undefs = this.undefStack.pop();
14177 var _iteratorNormalCompletion = true;
14178 var _didIteratorError = false;
14179 var _iteratorError = undefined;
14180
14181 try {
14182 for (var _iterator = get_iterator_default()(get_own_property_names_default()(undefs)), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
14183 var undef = _step.value;
14184
14185 if (undefs[undef] === undefined) {
14186 delete this.current[undef];
14187 } else {
14188 this.current[undef] = undefs[undef];
14189 }
14190 }
14191 } catch (err) {
14192 _didIteratorError = true;
14193 _iteratorError = err;
14194 } finally {
14195 try {
14196 if (!_iteratorNormalCompletion && _iterator.return) {
14197 _iterator.return();
14198 }
14199 } finally {
14200 if (_didIteratorError) {
14201 throw _iteratorError;
14202 }
14203 }
14204 }
14205 }
14206
14207 /**
14208 * Detect whether `name` has a definition. Equivalent to
14209 * `get(name) != null`.
14210 */
14211
14212 }, {
14213 key: "has",
14214 value: function has(name) {
14215 return this.current.hasOwnProperty(name) || this.builtins.hasOwnProperty(name);
14216 }
14217
14218 /**
14219 * Get the current value of a name, or `undefined` if there is no value.
14220 *
14221 * Note: Do not use `if (namespace.get(...))` to detect whether a macro
14222 * is defined, as the definition may be the empty string which evaluates
14223 * to `false` in JavaScript. Use `if (namespace.get(...) != null)` or
14224 * `if (namespace.has(...))`.
14225 */
14226
14227 }, {
14228 key: "get",
14229 value: function get(name) {
14230 if (this.current.hasOwnProperty(name)) {
14231 return this.current[name];
14232 } else {
14233 return this.builtins[name];
14234 }
14235 }
14236
14237 /**
14238 * Set the current value of a name, and optionally set it globally too.
14239 * Local set() sets the current value and (when appropriate) adds an undo
14240 * operation to the undo stack. Global set() may change the undo
14241 * operation at every level, so takes time linear in their number.
14242 */
14243
14244 }, {
14245 key: "set",
14246 value: function set(name, value) {
14247 var global = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
14248
14249 if (global) {
14250 // Global set is equivalent to setting in all groups. Simulate this
14251 // by destroying any undos currently scheduled for this name,
14252 // and adding an undo with the *new* value (in case it later gets
14253 // locally reset within this environment).
14254 for (var i = 0; i < this.undefStack.length; i++) {
14255 delete this.undefStack[i][name];
14256 }
14257 if (this.undefStack.length > 0) {
14258 this.undefStack[this.undefStack.length - 1][name] = value;
14259 }
14260 } else {
14261 // Undo this set at end of this group (possibly to `undefined`),
14262 // unless an undo is already in place, in which case that older
14263 // value is the correct one.
14264 var top = this.undefStack[this.undefStack.length - 1];
14265 if (top && !top.hasOwnProperty(name)) {
14266 top[name] = this.current[name];
14267 }
14268 }
14269 this.current[name] = value;
14270 }
14271 }]);
14272
14273 return Namespace;
14274}();
14275
14276/* harmony default export */ var src_Namespace = (Namespace_Namespace);
14277// CONCATENATED MODULE: ./src/macros.js
14278
14279/**
14280 * Predefined macros for KaTeX.
14281 * This can be used to define some commands in terms of others.
14282 */
14283
14284
14285
14286
14287
14288
14289
14290/**
14291 * Provides context to macros defined by functions. Implemented by
14292 * MacroExpander.
14293 */
14294
14295
14296/** Macro tokens (in reverse order). */
14297
14298
14299var builtinMacros = {};
14300/* harmony default export */ var macros = (builtinMacros);
14301
14302// This function might one day accept an additional argument and do more things.
14303function defineMacro(name, body) {
14304 builtinMacros[name] = body;
14305}
14306
14307//////////////////////////////////////////////////////////////////////
14308// macro tools
14309
14310// LaTeX's \@firstoftwo{#1}{#2} expands to #1, skipping #2
14311// TeX source: \long\def\@firstoftwo#1#2{#1}
14312defineMacro("\\@firstoftwo", function (context) {
14313 var args = context.consumeArgs(2);
14314 return { tokens: args[0], numArgs: 0 };
14315});
14316
14317// LaTeX's \@secondoftwo{#1}{#2} expands to #2, skipping #1
14318// TeX source: \long\def\@secondoftwo#1#2{#2}
14319defineMacro("\\@secondoftwo", function (context) {
14320 var args = context.consumeArgs(2);
14321 return { tokens: args[1], numArgs: 0 };
14322});
14323
14324// LaTeX's \@ifnextchar{#1}{#2}{#3} looks ahead to the next (unexpanded)
14325// symbol. If it matches #1, then the macro expands to #2; otherwise, #3.
14326// Note, however, that it does not consume the next symbol in either case.
14327defineMacro("\\@ifnextchar", function (context) {
14328 var args = context.consumeArgs(3); // symbol, if, else
14329 var nextToken = context.future();
14330 if (args[0].length === 1 && args[0][0].text === nextToken.text) {
14331 return { tokens: args[1], numArgs: 0 };
14332 } else {
14333 return { tokens: args[2], numArgs: 0 };
14334 }
14335});
14336
14337// LaTeX's \@ifstar{#1}{#2} looks ahead to the next (unexpanded) symbol.
14338// If it is `*`, then it consumes the symbol, and the macro expands to #1;
14339// otherwise, the macro expands to #2 (without consuming the symbol).
14340// TeX source: \def\@ifstar#1{\@ifnextchar *{\@firstoftwo{#1}}}
14341defineMacro("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}");
14342
14343// LaTeX's \TextOrMath{#1}{#2} expands to #1 in text mode, #2 in math mode
14344defineMacro("\\TextOrMath", function (context) {
14345 var args = context.consumeArgs(2);
14346 if (context.mode === 'text') {
14347 return { tokens: args[0], numArgs: 0 };
14348 } else {
14349 return { tokens: args[1], numArgs: 0 };
14350 }
14351});
14352
14353// Basic support for macro definitions:
14354// \def\macro{expansion}
14355// \def\macro#1{expansion}
14356// \def\macro#1#2{expansion}
14357// \def\macro#1#2#3#4#5#6#7#8#9{expansion}
14358// Also the \gdef and \global\def equivalents
14359var macros_def = function def(context, global) {
14360 var arg = context.consumeArgs(1)[0];
14361 if (arg.length !== 1) {
14362 throw new src_ParseError("\\gdef's first argument must be a macro name");
14363 }
14364 var name = arg[0].text;
14365 // Count argument specifiers, and check they are in the order #1 #2 ...
14366 var numArgs = 0;
14367 arg = context.consumeArgs(1)[0];
14368 while (arg.length === 1 && arg[0].text === "#") {
14369 arg = context.consumeArgs(1)[0];
14370 if (arg.length !== 1) {
14371 throw new src_ParseError("Invalid argument number length \"" + arg.length + "\"");
14372 }
14373 if (!/^[1-9]$/.test(arg[0].text)) {
14374 throw new src_ParseError("Invalid argument number \"" + arg[0].text + "\"");
14375 }
14376 numArgs++;
14377 if (parseInt(arg[0].text) !== numArgs) {
14378 throw new src_ParseError("Argument number \"" + arg[0].text + "\" out of order");
14379 }
14380 arg = context.consumeArgs(1)[0];
14381 }
14382 // Final arg is the expansion of the macro
14383 context.macros.set(name, {
14384 tokens: arg,
14385 numArgs: numArgs
14386 }, global);
14387 return '';
14388};
14389defineMacro("\\gdef", function (context) {
14390 return macros_def(context, true);
14391});
14392defineMacro("\\def", function (context) {
14393 return macros_def(context, false);
14394});
14395defineMacro("\\global", function (context) {
14396 var next = context.consumeArgs(1)[0];
14397 if (next.length !== 1) {
14398 throw new src_ParseError("Invalid command after \\global");
14399 }
14400 var command = next[0].text;
14401 // TODO: Should expand command
14402 if (command === "\\def") {
14403 // \global\def is equivalent to \gdef
14404 return macros_def(context, true);
14405 } else {
14406 throw new src_ParseError("Invalid command '" + command + "' after \\global");
14407 }
14408});
14409
14410// \newcommand{\macro}[args]{definition}
14411// \renewcommand{\macro}[args]{definition}
14412// TODO: Optional arguments: \newcommand{\macro}[args][default]{definition}
14413var macros_newcommand = function newcommand(context, existsOK, nonexistsOK) {
14414 var arg = context.consumeArgs(1)[0];
14415 if (arg.length !== 1) {
14416 throw new src_ParseError("\\newcommand's first argument must be a macro name");
14417 }
14418 var name = arg[0].text;
14419
14420 var exists = context.isDefined(name);
14421 if (exists && !existsOK) {
14422 throw new src_ParseError("\\newcommand{" + name + "} attempting to redefine " + (name + "; use \\renewcommand"));
14423 }
14424 if (!exists && !nonexistsOK) {
14425 throw new src_ParseError("\\renewcommand{" + name + "} when command " + name + " " + "does not yet exist; use \\newcommand");
14426 }
14427
14428 var numArgs = 0;
14429 arg = context.consumeArgs(1)[0];
14430 if (arg.length === 1 && arg[0].text === "[") {
14431 var argText = '';
14432 var token = context.expandNextToken();
14433 while (token.text !== "]" && token.text !== "EOF") {
14434 // TODO: Should properly expand arg, e.g., ignore {}s
14435 argText += token.text;
14436 token = context.expandNextToken();
14437 }
14438 if (!argText.match(/^\s*[0-9]+\s*$/)) {
14439 throw new src_ParseError("Invalid number of arguments: " + argText);
14440 }
14441 numArgs = parseInt(argText);
14442 arg = context.consumeArgs(1)[0];
14443 }
14444
14445 // Final arg is the expansion of the macro
14446 context.macros.set(name, {
14447 tokens: arg,
14448 numArgs: numArgs
14449 });
14450 return '';
14451};
14452defineMacro("\\newcommand", function (context) {
14453 return macros_newcommand(context, false, true);
14454});
14455defineMacro("\\renewcommand", function (context) {
14456 return macros_newcommand(context, true, false);
14457});
14458defineMacro("\\providecommand", function (context) {
14459 return macros_newcommand(context, true, true);
14460});
14461
14462//////////////////////////////////////////////////////////////////////
14463// Grouping
14464// \let\bgroup={ \let\egroup=}
14465defineMacro("\\bgroup", "{");
14466defineMacro("\\egroup", "}");
14467defineMacro("\\begingroup", "{");
14468defineMacro("\\endgroup", "}");
14469
14470// Symbols from latex.ltx:
14471// \def\lq{`}
14472// \def\rq{'}
14473// \def \aa {\r a}
14474// \def \AA {\r A}
14475defineMacro("\\lq", "`");
14476defineMacro("\\rq", "'");
14477defineMacro("\\aa", "\\r a");
14478defineMacro("\\AA", "\\r A");
14479
14480// \DeclareTextCommandDefault{\textcopyright}{\textcircled{c}}
14481// \DeclareTextCommandDefault{\textregistered}{\textcircled{%
14482// \check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont R}}
14483// \DeclareRobustCommand{\copyright}{%
14484// \ifmmode{\nfss@text{\textcopyright}}\else\textcopyright\fi}
14485defineMacro("\\textcopyright", "\\textcircled{c}");
14486defineMacro("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");
14487defineMacro("\\textregistered", "\\textcircled{\\scriptsize R}");
14488
14489// Unicode double-struck letters
14490defineMacro("\u2102", "\\mathbb{C}");
14491defineMacro("\u210D", "\\mathbb{H}");
14492defineMacro("\u2115", "\\mathbb{N}");
14493defineMacro("\u2119", "\\mathbb{P}");
14494defineMacro("\u211A", "\\mathbb{Q}");
14495defineMacro("\u211D", "\\mathbb{R}");
14496defineMacro("\u2124", "\\mathbb{Z}");
14497
14498defineMacro("\u210E", "\\mathit{h}"); // Planck constant
14499
14500// Characters omitted from Unicode range 1D400?1D7FF
14501defineMacro("\u212C", "\\mathscr{B}"); // script
14502defineMacro("\u2130", "\\mathscr{E}");
14503defineMacro("\u2131", "\\mathscr{F}");
14504defineMacro("\u210B", "\\mathscr{H}");
14505defineMacro("\u2110", "\\mathscr{I}");
14506defineMacro("\u2112", "\\mathscr{L}");
14507defineMacro("\u2133", "\\mathscr{M}");
14508defineMacro("\u211B", "\\mathscr{R}");
14509defineMacro("\u212D", "\\mathfrak{C}"); // Fraktur
14510defineMacro("\u210C", "\\mathfrak{H}");
14511defineMacro("\u2128", "\\mathfrak{Z}");
14512
14513// Unicode middle dot
14514// The KaTeX fonts do not contain U+00B7. Instead, \cdotp displays
14515// the dot at U+22C5 and gives it punct spacing.
14516defineMacro("\xB7", "\\cdotp");
14517
14518// \llap and \rlap render their contents in text mode
14519defineMacro("\\llap", "\\mathllap{\\textrm{#1}}");
14520defineMacro("\\rlap", "\\mathrlap{\\textrm{#1}}");
14521defineMacro("\\clap", "\\mathclap{\\textrm{#1}}");
14522
14523// Negated symbols from base/fontmath.ltx:
14524// \def\neq{\not=} \let\ne=\neq
14525// \DeclareRobustCommand
14526// \notin{\mathrel{\m@th\mathpalette\c@ncel\in}}
14527// \def\c@ncel#1#2{\m@th\ooalign{$\hfil#1\mkern1mu/\hfil$\crcr$#1#2$}}
14528defineMacro("\\neq", "\\not=");
14529defineMacro("\\ne", "\\neq");
14530defineMacro("\u2260", "\\neq");
14531defineMacro("\\notin", "\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}");
14532defineMacro("\u2209", "\\notin");
14533
14534// Unicode stacked relations
14535defineMacro("\u2258", "\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}");
14536defineMacro("\u2259", "\\stackrel{\\tiny\\wedge}{=}");
14537defineMacro("\u225A", "\\stackrel{\\tiny\\vee}{=}");
14538defineMacro("\u225B", "\\stackrel{\\scriptsize\\star}{=}");
14539defineMacro("\u225D", "\\stackrel{\\tiny\\mathrm{def}}{=}");
14540defineMacro("\u225E", "\\stackrel{\\tiny\\mathrm{m}}{=}");
14541defineMacro("\u225F", "\\stackrel{\\tiny?}{=}");
14542
14543// Misc Unicode
14544defineMacro("\u27C2", "\\perp");
14545defineMacro("\u203C", "\\mathclose{!\\mkern-0.8mu!}");
14546defineMacro("\u220C", "\\notni");
14547
14548//////////////////////////////////////////////////////////////////////
14549// LaTeX_2?
14550
14551// \vdots{\vbox{\baselineskip4\p@ \lineskiplimit\z@
14552// \kern6\p@\hbox{.}\hbox{.}\hbox{.}}}
14553// We'll call \varvdots, which gets a glyph from symbols.js.
14554// The zero-width rule gets us an equivalent to the vertical 6pt kern.
14555defineMacro("\\vdots", "\\mathord{\\varvdots\\rule{0pt}{15pt}}");
14556defineMacro("\u22EE", "\\vdots");
14557
14558//////////////////////////////////////////////////////////////////////
14559// amsmath.sty
14560// http://mirrors.concertpass.com/tex-archive/macros/latex/required/amsmath/amsmath.pdf
14561
14562// Italic Greek capital letters. AMS defines these with \DeclareMathSymbol,
14563// but they are equivalent to \mathit{\Letter}.
14564defineMacro("\\varGamma", "\\mathit{\\Gamma}");
14565defineMacro("\\varDelta", "\\mathit{\\Delta}");
14566defineMacro("\\varTheta", "\\mathit{\\Theta}");
14567defineMacro("\\varLambda", "\\mathit{\\Lambda}");
14568defineMacro("\\varXi", "\\mathit{\\Xi}");
14569defineMacro("\\varPi", "\\mathit{\\Pi}");
14570defineMacro("\\varSigma", "\\mathit{\\Sigma}");
14571defineMacro("\\varUpsilon", "\\mathit{\\Upsilon}");
14572defineMacro("\\varPhi", "\\mathit{\\Phi}");
14573defineMacro("\\varPsi", "\\mathit{\\Psi}");
14574defineMacro("\\varOmega", "\\mathit{\\Omega}");
14575
14576// \renewcommand{\colon}{\nobreak\mskip2mu\mathpunct{}\nonscript
14577// \mkern-\thinmuskip{:}\mskip6muplus1mu\relax}
14578defineMacro("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}" + "\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu");
14579
14580// \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}}
14581defineMacro("\\boxed", "\\fbox{\\displaystyle{#1}}");
14582
14583// \def\iff{\DOTSB\;\Longleftrightarrow\;}
14584// \def\implies{\DOTSB\;\Longrightarrow\;}
14585// \def\impliedby{\DOTSB\;\Longleftarrow\;}
14586defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");
14587defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");
14588defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;");
14589
14590// AMSMath's automatic \dots, based on \mdots@@ macro.
14591var dotsByToken = {
14592 ',': '\\dotsc',
14593 '\\not': '\\dotsb',
14594 // \keybin@ checks for the following:
14595 '+': '\\dotsb',
14596 '=': '\\dotsb',
14597 '<': '\\dotsb',
14598 '>': '\\dotsb',
14599 '-': '\\dotsb',
14600 '*': '\\dotsb',
14601 ':': '\\dotsb',
14602 // Symbols whose definition starts with \DOTSB:
14603 '\\DOTSB': '\\dotsb',
14604 '\\coprod': '\\dotsb',
14605 '\\bigvee': '\\dotsb',
14606 '\\bigwedge': '\\dotsb',
14607 '\\biguplus': '\\dotsb',
14608 '\\bigcap': '\\dotsb',
14609 '\\bigcup': '\\dotsb',
14610 '\\prod': '\\dotsb',
14611 '\\sum': '\\dotsb',
14612 '\\bigotimes': '\\dotsb',
14613 '\\bigoplus': '\\dotsb',
14614 '\\bigodot': '\\dotsb',
14615 '\\bigsqcup': '\\dotsb',
14616 '\\And': '\\dotsb',
14617 '\\longrightarrow': '\\dotsb',
14618 '\\Longrightarrow': '\\dotsb',
14619 '\\longleftarrow': '\\dotsb',
14620 '\\Longleftarrow': '\\dotsb',
14621 '\\longleftrightarrow': '\\dotsb',
14622 '\\Longleftrightarrow': '\\dotsb',
14623 '\\mapsto': '\\dotsb',
14624 '\\longmapsto': '\\dotsb',
14625 '\\hookrightarrow': '\\dotsb',
14626 '\\doteq': '\\dotsb',
14627 // Symbols whose definition starts with \mathbin:
14628 '\\mathbin': '\\dotsb',
14629 // Symbols whose definition starts with \mathrel:
14630 '\\mathrel': '\\dotsb',
14631 '\\relbar': '\\dotsb',
14632 '\\Relbar': '\\dotsb',
14633 '\\xrightarrow': '\\dotsb',
14634 '\\xleftarrow': '\\dotsb',
14635 // Symbols whose definition starts with \DOTSI:
14636 '\\DOTSI': '\\dotsi',
14637 '\\int': '\\dotsi',
14638 '\\oint': '\\dotsi',
14639 '\\iint': '\\dotsi',
14640 '\\iiint': '\\dotsi',
14641 '\\iiiint': '\\dotsi',
14642 '\\idotsint': '\\dotsi',
14643 // Symbols whose definition starts with \DOTSX:
14644 '\\DOTSX': '\\dotsx'
14645};
14646
14647defineMacro("\\dots", function (context) {
14648 // TODO: If used in text mode, should expand to \textellipsis.
14649 // However, in KaTeX, \textellipsis and \ldots behave the same
14650 // (in text mode), and it's unlikely we'd see any of the math commands
14651 // that affect the behavior of \dots when in text mode. So fine for now
14652 // (until we support \ifmmode ... \else ... \fi).
14653 var thedots = '\\dotso';
14654 var next = context.expandAfterFuture().text;
14655 if (next in dotsByToken) {
14656 thedots = dotsByToken[next];
14657 } else if (next.substr(0, 4) === '\\not') {
14658 thedots = '\\dotsb';
14659 } else if (next in src_symbols.math) {
14660 if (utils.contains(['bin', 'rel'], src_symbols.math[next].group)) {
14661 thedots = '\\dotsb';
14662 }
14663 }
14664 return thedots;
14665});
14666
14667var spaceAfterDots = {
14668 // \rightdelim@ checks for the following:
14669 ')': true,
14670 ']': true,
14671 '\\rbrack': true,
14672 '\\}': true,
14673 '\\rbrace': true,
14674 '\\rangle': true,
14675 '\\rceil': true,
14676 '\\rfloor': true,
14677 '\\rgroup': true,
14678 '\\rmoustache': true,
14679 '\\right': true,
14680 '\\bigr': true,
14681 '\\biggr': true,
14682 '\\Bigr': true,
14683 '\\Biggr': true,
14684 // \extra@ also tests for the following:
14685 '$': true,
14686 // \extrap@ checks for the following:
14687 ';': true,
14688 '.': true,
14689 ',': true
14690};
14691
14692defineMacro("\\dotso", function (context) {
14693 var next = context.future().text;
14694 if (next in spaceAfterDots) {
14695 return "\\ldots\\,";
14696 } else {
14697 return "\\ldots";
14698 }
14699});
14700
14701defineMacro("\\dotsc", function (context) {
14702 var next = context.future().text;
14703 // \dotsc uses \extra@ but not \extrap@, instead specially checking for
14704 // ';' and '.', but doesn't check for ','.
14705 if (next in spaceAfterDots && next !== ',') {
14706 return "\\ldots\\,";
14707 } else {
14708 return "\\ldots";
14709 }
14710});
14711
14712defineMacro("\\cdots", function (context) {
14713 var next = context.future().text;
14714 if (next in spaceAfterDots) {
14715 return "\\@cdots\\,";
14716 } else {
14717 return "\\@cdots";
14718 }
14719});
14720
14721defineMacro("\\dotsb", "\\cdots");
14722defineMacro("\\dotsm", "\\cdots");
14723defineMacro("\\dotsi", "\\!\\cdots");
14724// amsmath doesn't actually define \dotsx, but \dots followed by a macro
14725// starting with \DOTSX implies \dotso, and then \extra@ detects this case
14726// and forces the added `\,`.
14727defineMacro("\\dotsx", "\\ldots\\,");
14728
14729// \let\DOTSI\relax
14730// \let\DOTSB\relax
14731// \let\DOTSX\relax
14732defineMacro("\\DOTSI", "\\relax");
14733defineMacro("\\DOTSB", "\\relax");
14734defineMacro("\\DOTSX", "\\relax");
14735
14736// Spacing, based on amsmath.sty's override of LaTeX defaults
14737// \DeclareRobustCommand{\tmspace}[3]{%
14738// \ifmmode\mskip#1#2\else\kern#1#3\fi\relax}
14739defineMacro("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");
14740// \renewcommand{\,}{\tmspace+\thinmuskip{.1667em}}
14741// TODO: math mode should use \thinmuskip
14742defineMacro("\\,", "\\tmspace+{3mu}{.1667em}");
14743// \let\thinspace\,
14744defineMacro("\\thinspace", "\\,");
14745// \renewcommand{\:}{\tmspace+\medmuskip{.2222em}}
14746// TODO: math mode should use \medmuskip = 4mu plus 2mu minus 4mu
14747defineMacro("\\:", "\\tmspace+{4mu}{.2222em}");
14748// \let\medspace\:
14749defineMacro("\\medspace", "\\:");
14750// \renewcommand{\;}{\tmspace+\thickmuskip{.2777em}}
14751// TODO: math mode should use \thickmuskip = 5mu plus 5mu
14752defineMacro("\\;", "\\tmspace+{5mu}{.2777em}");
14753// \let\thickspace\;
14754defineMacro("\\thickspace", "\\;");
14755// \renewcommand{\!}{\tmspace-\thinmuskip{.1667em}}
14756// TODO: math mode should use \thinmuskip
14757defineMacro("\\!", "\\tmspace-{3mu}{.1667em}");
14758// \let\negthinspace\!
14759defineMacro("\\negthinspace", "\\!");
14760// \newcommand{\negmedspace}{\tmspace-\medmuskip{.2222em}}
14761// TODO: math mode should use \medmuskip
14762defineMacro("\\negmedspace", "\\tmspace-{4mu}{.2222em}");
14763// \newcommand{\negthickspace}{\tmspace-\thickmuskip{.2777em}}
14764// TODO: math mode should use \thickmuskip
14765defineMacro("\\negthickspace", "\\tmspace-{5mu}{.277em}");
14766// \def\enspace{\kern.5em }
14767defineMacro("\\enspace", "\\kern.5em ");
14768// \def\enskip{\hskip.5em\relax}
14769defineMacro("\\enskip", "\\hskip.5em\\relax");
14770// \def\quad{\hskip1em\relax}
14771defineMacro("\\quad", "\\hskip1em\\relax");
14772// \def\qquad{\hskip2em\relax}
14773defineMacro("\\qquad", "\\hskip2em\\relax");
14774
14775// \tag@in@display form of \tag
14776defineMacro("\\tag", "\\@ifstar\\tag@literal\\tag@paren");
14777defineMacro("\\tag@paren", "\\tag@literal{({#1})}");
14778defineMacro("\\tag@literal", function (context) {
14779 if (context.macros.get("\\df@tag")) {
14780 throw new src_ParseError("Multiple \\tag");
14781 }
14782 return "\\gdef\\df@tag{\\text{#1}}";
14783});
14784
14785// \renewcommand{\bmod}{\nonscript\mskip-\medmuskip\mkern5mu\mathbin
14786// {\operator@font mod}\penalty900
14787// \mkern5mu\nonscript\mskip-\medmuskip}
14788// \newcommand{\pod}[1]{\allowbreak
14789// \if@display\mkern18mu\else\mkern8mu\fi(#1)}
14790// \renewcommand{\pmod}[1]{\pod{{\operator@font mod}\mkern6mu#1}}
14791// \newcommand{\mod}[1]{\allowbreak\if@display\mkern18mu
14792// \else\mkern12mu\fi{\operator@font mod}\,\,#1}
14793// TODO: math mode should use \medmuskip = 4mu plus 2mu minus 4mu
14794defineMacro("\\bmod", "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}" + "\\mathbin{\\rm mod}" + "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");
14795defineMacro("\\pod", "\\allowbreak" + "\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");
14796defineMacro("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}");
14797defineMacro("\\mod", "\\allowbreak" + "\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}" + "{\\rm mod}\\,\\,#1");
14798
14799//////////////////////////////////////////////////////////////////////
14800// LaTeX source2e
14801
14802// \\ defaults to \newline, but changes to \cr within array environment
14803defineMacro("\\\\", "\\newline");
14804
14805// \def\TeX{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\@}
14806// TODO: Doesn't normally work in math mode because \@ fails. KaTeX doesn't
14807// support \@ yet, so that's omitted, and we add \text so that the result
14808// doesn't look funny in math mode.
14809defineMacro("\\TeX", "\\textrm{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}");
14810
14811// \DeclareRobustCommand{\LaTeX}{L\kern-.36em%
14812// {\sbox\z@ T%
14813// \vbox to\ht\z@{\hbox{\check@mathfonts
14814// \fontsize\sf@size\z@
14815// \math@fontsfalse\selectfont
14816// A}%
14817// \vss}%
14818// }%
14819// \kern-.15em%
14820// \TeX}
14821// This code aligns the top of the A with the T (from the perspective of TeX's
14822// boxes, though visually the A appears to extend above slightly).
14823// We compute the corresponding \raisebox when A is rendered at \scriptsize,
14824// which is size3, which has a scale factor of 0.7 (see Options.js).
14825var latexRaiseA = fontMetricsData['Main-Regular']["T".charCodeAt(0)][1] - 0.7 * fontMetricsData['Main-Regular']["A".charCodeAt(0)][1] + "em";
14826defineMacro("\\LaTeX", "\\textrm{L\\kern-.36em\\raisebox{" + latexRaiseA + "}{\\scriptsize A}" + "\\kern-.15em\\TeX}");
14827
14828// New KaTeX logo based on tweaking LaTeX logo
14829defineMacro("\\KaTeX", "\\textrm{K\\kern-.17em\\raisebox{" + latexRaiseA + "}{\\scriptsize A}" + "\\kern-.15em\\TeX}");
14830
14831// \DeclareRobustCommand\hspace{\@ifstar\@hspacer\@hspace}
14832// \def\@hspace#1{\hskip #1\relax}
14833// \def\@hspacer#1{\vrule \@width\z@\nobreak
14834// \hskip #1\hskip \z@skip}
14835defineMacro("\\hspace", "\\@ifstar\\@hspacer\\@hspace");
14836defineMacro("\\@hspace", "\\hskip #1\\relax");
14837defineMacro("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax");
14838
14839//////////////////////////////////////////////////////////////////////
14840// mathtools.sty
14841
14842//\providecommand\ordinarycolon{:}
14843defineMacro("\\ordinarycolon", ":");
14844//\def\vcentcolon{\mathrel{\mathop\ordinarycolon}}
14845//TODO(edemaine): Not yet centered. Fix via \raisebox or #726
14846defineMacro("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}");
14847// \providecommand*\dblcolon{\vcentcolon\mathrel{\mkern-.9mu}\vcentcolon}
14848defineMacro("\\dblcolon", "\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}");
14849// \providecommand*\coloneqq{\vcentcolon\mathrel{\mkern-1.2mu}=}
14850defineMacro("\\coloneqq", "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}");
14851// \providecommand*\Coloneqq{\dblcolon\mathrel{\mkern-1.2mu}=}
14852defineMacro("\\Coloneqq", "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}");
14853// \providecommand*\coloneq{\vcentcolon\mathrel{\mkern-1.2mu}\mathrel{-}}
14854defineMacro("\\coloneq", "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}");
14855// \providecommand*\Coloneq{\dblcolon\mathrel{\mkern-1.2mu}\mathrel{-}}
14856defineMacro("\\Coloneq", "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}");
14857// \providecommand*\eqqcolon{=\mathrel{\mkern-1.2mu}\vcentcolon}
14858defineMacro("\\eqqcolon", "\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
14859// \providecommand*\Eqqcolon{=\mathrel{\mkern-1.2mu}\dblcolon}
14860defineMacro("\\Eqqcolon", "\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}");
14861// \providecommand*\eqcolon{\mathrel{-}\mathrel{\mkern-1.2mu}\vcentcolon}
14862defineMacro("\\eqcolon", "\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
14863// \providecommand*\Eqcolon{\mathrel{-}\mathrel{\mkern-1.2mu}\dblcolon}
14864defineMacro("\\Eqcolon", "\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}");
14865// \providecommand*\colonapprox{\vcentcolon\mathrel{\mkern-1.2mu}\approx}
14866defineMacro("\\colonapprox", "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}");
14867// \providecommand*\Colonapprox{\dblcolon\mathrel{\mkern-1.2mu}\approx}
14868defineMacro("\\Colonapprox", "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}");
14869// \providecommand*\colonsim{\vcentcolon\mathrel{\mkern-1.2mu}\sim}
14870defineMacro("\\colonsim", "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}");
14871// \providecommand*\Colonsim{\dblcolon\mathrel{\mkern-1.2mu}\sim}
14872defineMacro("\\Colonsim", "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}");
14873
14874// Some Unicode characters are implemented with macros to mathtools functions.
14875defineMacro("\u2254", "\\coloneqq"); // :=
14876defineMacro("\u2255", "\\eqqcolon"); // =:
14877defineMacro("\u2A74", "\\Coloneqq"); // ::=
14878
14879//////////////////////////////////////////////////////////////////////
14880// colonequals.sty
14881
14882// Alternate names for mathtools's macros:
14883defineMacro("\\ratio", "\\vcentcolon");
14884defineMacro("\\coloncolon", "\\dblcolon");
14885defineMacro("\\colonequals", "\\coloneqq");
14886defineMacro("\\coloncolonequals", "\\Coloneqq");
14887defineMacro("\\equalscolon", "\\eqqcolon");
14888defineMacro("\\equalscoloncolon", "\\Eqqcolon");
14889defineMacro("\\colonminus", "\\coloneq");
14890defineMacro("\\coloncolonminus", "\\Coloneq");
14891defineMacro("\\minuscolon", "\\eqcolon");
14892defineMacro("\\minuscoloncolon", "\\Eqcolon");
14893// \colonapprox name is same in mathtools and colonequals.
14894defineMacro("\\coloncolonapprox", "\\Colonapprox");
14895// \colonsim name is same in mathtools and colonequals.
14896defineMacro("\\coloncolonsim", "\\Colonsim");
14897
14898// Additional macros, implemented by analogy with mathtools definitions:
14899defineMacro("\\simcolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
14900defineMacro("\\simcoloncolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");
14901defineMacro("\\approxcolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
14902defineMacro("\\approxcoloncolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");
14903
14904// Present in newtxmath, pxfonts and txfonts
14905// TODO: The unicode character U+220C ? should be added to the font, and this
14906// macro turned into a propper defineSymbol in symbols.js. That way, the
14907// MathML result will be much cleaner.
14908defineMacro("\\notni", "\\not\\ni");
14909defineMacro("\\limsup", "\\DOTSB\\mathop{\\operatorname{lim\\,sup}}\\limits");
14910defineMacro("\\liminf", "\\DOTSB\\mathop{\\operatorname{lim\\,inf}}\\limits");
14911// CONCATENATED MODULE: ./src/MacroExpander.js
14912
14913
14914
14915
14916/**
14917 * This file contains the ?gullet? where macros are expanded
14918 * until only non-macro tokens remain.
14919 */
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930// List of commands that act like macros but aren't defined as a macro,
14931// function, or symbol. Used in `isDefined`.
14932var implicitCommands = {
14933 "\\relax": true, // MacroExpander.js
14934 "^": true, // Parser.js
14935 "_": true, // Parser.js
14936 "\\limits": true, // Parser.js
14937 "\\nolimits": true // Parser.js
14938};
14939
14940var MacroExpander_MacroExpander = function () {
14941 function MacroExpander(input, settings, mode) {
14942 classCallCheck_default()(this, MacroExpander);
14943
14944 this.feed(input);
14945 // Make new global namespace
14946 this.macros = new src_Namespace(macros, settings.macros);
14947 this.maxExpand = settings.maxExpand;
14948 this.mode = mode;
14949 this.stack = []; // contains tokens in REVERSE order
14950 }
14951
14952 /**
14953 * Feed a new input string to the same MacroExpander
14954 * (with existing macros etc.).
14955 */
14956
14957
14958 createClass_default()(MacroExpander, [{
14959 key: "feed",
14960 value: function feed(input) {
14961 this.lexer = new src_Lexer(input);
14962 }
14963
14964 /**
14965 * Switches between "text" and "math" modes.
14966 */
14967
14968 }, {
14969 key: "switchMode",
14970 value: function switchMode(newMode) {
14971 this.mode = newMode;
14972 }
14973
14974 /**
14975 * Start a new group nesting within all namespaces.
14976 */
14977
14978 }, {
14979 key: "beginGroup",
14980 value: function beginGroup() {
14981 this.macros.beginGroup();
14982 }
14983
14984 /**
14985 * End current group nesting within all namespaces.
14986 */
14987
14988 }, {
14989 key: "endGroup",
14990 value: function endGroup() {
14991 this.macros.endGroup();
14992 }
14993
14994 /**
14995 * Returns the topmost token on the stack, without expanding it.
14996 * Similar in behavior to TeX's `\futurelet`.
14997 */
14998
14999 }, {
15000 key: "future",
15001 value: function future() {
15002 if (this.stack.length === 0) {
15003 this.pushToken(this.lexer.lex());
15004 }
15005 return this.stack[this.stack.length - 1];
15006 }
15007
15008 /**
15009 * Remove and return the next unexpanded token.
15010 */
15011
15012 }, {
15013 key: "popToken",
15014 value: function popToken() {
15015 this.future(); // ensure non-empty stack
15016 return this.stack.pop();
15017 }
15018
15019 /**
15020 * Add a given token to the token stack. In particular, this get be used
15021 * to put back a token returned from one of the other methods.
15022 */
15023
15024 }, {
15025 key: "pushToken",
15026 value: function pushToken(token) {
15027 this.stack.push(token);
15028 }
15029
15030 /**
15031 * Append an array of tokens to the token stack.
15032 */
15033
15034 }, {
15035 key: "pushTokens",
15036 value: function pushTokens(tokens) {
15037 var _stack;
15038
15039 (_stack = this.stack).push.apply(_stack, toConsumableArray_default()(tokens));
15040 }
15041
15042 /**
15043 * Consume all following space tokens, without expansion.
15044 */
15045
15046 }, {
15047 key: "consumeSpaces",
15048 value: function consumeSpaces() {
15049 for (;;) {
15050 var token = this.future();
15051 if (token.text === " ") {
15052 this.stack.pop();
15053 } else {
15054 break;
15055 }
15056 }
15057 }
15058
15059 /**
15060 * Consume the specified number of arguments from the token stream,
15061 * and return the resulting array of arguments.
15062 */
15063
15064 }, {
15065 key: "consumeArgs",
15066 value: function consumeArgs(numArgs) {
15067 var args = [];
15068 // obtain arguments, either single token or balanced {?} group
15069 for (var i = 0; i < numArgs; ++i) {
15070 this.consumeSpaces(); // ignore spaces before each argument
15071 var startOfArg = this.popToken();
15072 if (startOfArg.text === "{") {
15073 var arg = [];
15074 var depth = 1;
15075 while (depth !== 0) {
15076 var tok = this.popToken();
15077 arg.push(tok);
15078 if (tok.text === "{") {
15079 ++depth;
15080 } else if (tok.text === "}") {
15081 --depth;
15082 } else if (tok.text === "EOF") {
15083 throw new src_ParseError("End of input in macro argument", startOfArg);
15084 }
15085 }
15086 arg.pop(); // remove last }
15087 arg.reverse(); // like above, to fit in with stack order
15088 args[i] = arg;
15089 } else if (startOfArg.text === "EOF") {
15090 throw new src_ParseError("End of input expecting macro argument");
15091 } else {
15092 args[i] = [startOfArg];
15093 }
15094 }
15095 return args;
15096 }
15097
15098 /**
15099 * Expand the next token only once if possible.
15100 *
15101 * If the token is expanded, the resulting tokens will be pushed onto
15102 * the stack in reverse order and will be returned as an array,
15103 * also in reverse order.
15104 *
15105 * If not, the next token will be returned without removing it
15106 * from the stack. This case can be detected by a `Token` return value
15107 * instead of an `Array` return value.
15108 *
15109 * In either case, the next token will be on the top of the stack,
15110 * or the stack will be empty.
15111 *
15112 * Used to implement `expandAfterFuture` and `expandNextToken`.
15113 *
15114 * At the moment, macro expansion doesn't handle delimited macros,
15115 * i.e. things like those defined by \def\foo#1\end{?}.
15116 * See the TeX book page 202ff. for details on how those should behave.
15117 */
15118
15119 }, {
15120 key: "expandOnce",
15121 value: function expandOnce() {
15122 var topToken = this.popToken();
15123 var name = topToken.text;
15124 var expansion = this._getExpansion(name);
15125 if (expansion == null) {
15126 // mainly checking for undefined here
15127 // Fully expanded
15128 this.pushToken(topToken);
15129 return topToken;
15130 }
15131 if (this.maxExpand !== Infinity) {
15132 this.maxExpand--;
15133 if (this.maxExpand < 0) {
15134 throw new src_ParseError("Too many expansions: infinite loop or " + "need to increase maxExpand setting");
15135 }
15136 }
15137 var tokens = expansion.tokens;
15138 if (expansion.numArgs) {
15139 var args = this.consumeArgs(expansion.numArgs);
15140 // paste arguments in place of the placeholders
15141 tokens = tokens.slice(); // make a shallow copy
15142 for (var i = tokens.length - 1; i >= 0; --i) {
15143 var tok = tokens[i];
15144 if (tok.text === "#") {
15145 if (i === 0) {
15146 throw new src_ParseError("Incomplete placeholder at end of macro body", tok);
15147 }
15148 tok = tokens[--i]; // next token on stack
15149 if (tok.text === "#") {
15150 // ## ? #
15151 tokens.splice(i + 1, 1); // drop first #
15152 } else if (/^[1-9]$/.test(tok.text)) {
15153 var _tokens;
15154
15155 // replace the placeholder with the indicated argument
15156 (_tokens = tokens).splice.apply(_tokens, [i, 2].concat(toConsumableArray_default()(args[+tok.text - 1])));
15157 } else {
15158 throw new src_ParseError("Not a valid argument number", tok);
15159 }
15160 }
15161 }
15162 }
15163 // Concatenate expansion onto top of stack.
15164 this.pushTokens(tokens);
15165 return tokens;
15166 }
15167
15168 /**
15169 * Expand the next token only once (if possible), and return the resulting
15170 * top token on the stack (without removing anything from the stack).
15171 * Similar in behavior to TeX's `\expandafter\futurelet`.
15172 * Equivalent to expandOnce() followed by future().
15173 */
15174
15175 }, {
15176 key: "expandAfterFuture",
15177 value: function expandAfterFuture() {
15178 this.expandOnce();
15179 return this.future();
15180 }
15181
15182 /**
15183 * Recursively expand first token, then return first non-expandable token.
15184 */
15185
15186 }, {
15187 key: "expandNextToken",
15188 value: function expandNextToken() {
15189 for (;;) {
15190 var expanded = this.expandOnce();
15191 // expandOnce returns Token if and only if it's fully expanded.
15192 if (expanded instanceof Token_Token) {
15193 // \relax stops the expansion, but shouldn't get returned (a
15194 // null return value couldn't get implemented as a function).
15195 if (expanded.text === "\\relax") {
15196 this.stack.pop();
15197 } else {
15198 return this.stack.pop(); // === expanded
15199 }
15200 }
15201 }
15202
15203 // Flow unable to figure out that this pathway is impossible.
15204 // https://github.com/facebook/flow/issues/4808
15205 throw new Error(); // eslint-disable-line no-unreachable
15206 }
15207
15208 /**
15209 * Fully expand the given macro name and return the resulting list of
15210 * tokens, or return `undefined` if no such macro is defined.
15211 */
15212
15213 }, {
15214 key: "expandMacro",
15215 value: function expandMacro(name) {
15216 if (!this.macros.get(name)) {
15217 return undefined;
15218 }
15219 var output = [];
15220 var oldStackLength = this.stack.length;
15221 this.pushToken(new Token_Token(name));
15222 while (this.stack.length > oldStackLength) {
15223 var expanded = this.expandOnce();
15224 // expandOnce returns Token if and only if it's fully expanded.
15225 if (expanded instanceof Token_Token) {
15226 output.push(this.stack.pop());
15227 }
15228 }
15229 return output;
15230 }
15231
15232 /**
15233 * Fully expand the given macro name and return the result as a string,
15234 * or return `undefined` if no such macro is defined.
15235 */
15236
15237 }, {
15238 key: "expandMacroAsText",
15239 value: function expandMacroAsText(name) {
15240 var tokens = this.expandMacro(name);
15241 if (tokens) {
15242 return tokens.map(function (token) {
15243 return token.text;
15244 }).join("");
15245 } else {
15246 return tokens;
15247 }
15248 }
15249
15250 /**
15251 * Returns the expanded macro as a reversed array of tokens and a macro
15252 * argument count. Or returns `null` if no such macro.
15253 */
15254
15255 }, {
15256 key: "_getExpansion",
15257 value: function _getExpansion(name) {
15258 var definition = this.macros.get(name);
15259 if (definition == null) {
15260 // mainly checking for undefined here
15261 return definition;
15262 }
15263 var expansion = typeof definition === "function" ? definition(this) : definition;
15264 if (typeof expansion === "string") {
15265 var numArgs = 0;
15266 if (expansion.indexOf("#") !== -1) {
15267 var stripped = expansion.replace(/##/g, "");
15268 while (stripped.indexOf("#" + (numArgs + 1)) !== -1) {
15269 ++numArgs;
15270 }
15271 }
15272 var bodyLexer = new src_Lexer(expansion);
15273 var tokens = [];
15274 var tok = bodyLexer.lex();
15275 while (tok.text !== "EOF") {
15276 tokens.push(tok);
15277 tok = bodyLexer.lex();
15278 }
15279 tokens.reverse(); // to fit in with stack using push and pop
15280 var expanded = { tokens: tokens, numArgs: numArgs };
15281 return expanded;
15282 }
15283
15284 return expansion;
15285 }
15286
15287 /**
15288 * Determine whether a command is currently "defined" (has some
15289 * functionality), meaning that it's a macro (in the current group),
15290 * a function, a symbol, or one of the special commands listed in
15291 * `implicitCommands`.
15292 */
15293
15294 }, {
15295 key: "isDefined",
15296 value: function isDefined(name) {
15297 return this.macros.has(name) || src_functions.hasOwnProperty(name) || src_symbols.math.hasOwnProperty(name) || src_symbols.text.hasOwnProperty(name) || implicitCommands.hasOwnProperty(name);
15298 }
15299 }]);
15300
15301 return MacroExpander;
15302}();
15303
15304/* harmony default export */ var src_MacroExpander = (MacroExpander_MacroExpander);
15305// EXTERNAL MODULE: ./src/unicodeAccents.js
15306var unicodeAccents = __webpack_require__(40);
15307var unicodeAccents_default = /*#__PURE__*/__webpack_require__.n(unicodeAccents);
15308
15309// CONCATENATED MODULE: ./src/unicodeSymbols.js
15310
15311// This file is GENERATED by unicodeMake.js. DO NOT MODIFY.
15312
15313/* harmony default export */ var unicodeSymbols = ({
15314 "\xE1": "a\u0301", // á = \'{a}
15315 "\xE0": "a\u0300", // à = \`{a}
15316 "\xE4": "a\u0308", // ä = \"{a}
15317 "\u01DF": "a\u0308\u0304", // ? = \"\={a}
15318 "\xE3": "a\u0303", // ã = \~{a}
15319 "\u0101": "a\u0304", // ? = \={a}
15320 "\u0103": "a\u0306", // ? = \u{a}
15321 "\u1EAF": "a\u0306\u0301", // ? = \u\'{a}
15322 "\u1EB1": "a\u0306\u0300", // ? = \u\`{a}
15323 "\u1EB5": "a\u0306\u0303", // ? = \u\~{a}
15324 "\u01CE": "a\u030C", // ? = \v{a}
15325 "\xE2": "a\u0302", // â = \^{a}
15326 "\u1EA5": "a\u0302\u0301", // ? = \^\'{a}
15327 "\u1EA7": "a\u0302\u0300", // ? = \^\`{a}
15328 "\u1EAB": "a\u0302\u0303", // ? = \^\~{a}
15329 "\u0227": "a\u0307", // ? = \.{a}
15330 "\u01E1": "a\u0307\u0304", // ? = \.\={a}
15331 "\xE5": "a\u030A", // å = \r{a}
15332 "\u01FB": "a\u030A\u0301", // ? = \r\'{a}
15333 "\u1E03": "b\u0307", // ? = \.{b}
15334 "\u0107": "c\u0301", // ? = \'{c}
15335 "\u010D": "c\u030C", // ? = \v{c}
15336 "\u0109": "c\u0302", // ? = \^{c}
15337 "\u010B": "c\u0307", // ? = \.{c}
15338 "\u010F": "d\u030C", // ? = \v{d}
15339 "\u1E0B": "d\u0307", // ? = \.{d}
15340 "\xE9": "e\u0301", // é = \'{e}
15341 "\xE8": "e\u0300", // è = \`{e}
15342 "\xEB": "e\u0308", // ë = \"{e}
15343 "\u1EBD": "e\u0303", // ? = \~{e}
15344 "\u0113": "e\u0304", // ? = \={e}
15345 "\u1E17": "e\u0304\u0301", // ? = \=\'{e}
15346 "\u1E15": "e\u0304\u0300", // ? = \=\`{e}
15347 "\u0115": "e\u0306", // ? = \u{e}
15348 "\u011B": "e\u030C", // ? = \v{e}
15349 "\xEA": "e\u0302", // ê = \^{e}
15350 "\u1EBF": "e\u0302\u0301", // ? = \^\'{e}
15351 "\u1EC1": "e\u0302\u0300", // ? = \^\`{e}
15352 "\u1EC5": "e\u0302\u0303", // ? = \^\~{e}
15353 "\u0117": "e\u0307", // ? = \.{e}
15354 "\u1E1F": "f\u0307", // ? = \.{f}
15355 "\u01F5": "g\u0301", // ? = \'{g}
15356 "\u1E21": "g\u0304", // ? = \={g}
15357 "\u011F": "g\u0306", // ? = \u{g}
15358 "\u01E7": "g\u030C", // ? = \v{g}
15359 "\u011D": "g\u0302", // ? = \^{g}
15360 "\u0121": "g\u0307", // ? = \.{g}
15361 "\u1E27": "h\u0308", // ? = \"{h}
15362 "\u021F": "h\u030C", // ? = \v{h}
15363 "\u0125": "h\u0302", // ? = \^{h}
15364 "\u1E23": "h\u0307", // ? = \.{h}
15365 "\xED": "i\u0301", // í = \'{i}
15366 "\xEC": "i\u0300", // ì = \`{i}
15367 "\xEF": "i\u0308", // ï = \"{i}
15368 "\u1E2F": "i\u0308\u0301", // ? = \"\'{i}
15369 "\u0129": "i\u0303", // ? = \~{i}
15370 "\u012B": "i\u0304", // ? = \={i}
15371 "\u012D": "i\u0306", // ? = \u{i}
15372 "\u01D0": "i\u030C", // ? = \v{i}
15373 "\xEE": "i\u0302", // î = \^{i}
15374 "\u01F0": "j\u030C", // ? = \v{j}
15375 "\u0135": "j\u0302", // ? = \^{j}
15376 "\u1E31": "k\u0301", // ? = \'{k}
15377 "\u01E9": "k\u030C", // ? = \v{k}
15378 "\u013A": "l\u0301", // ? = \'{l}
15379 "\u013E": "l\u030C", // ? = \v{l}
15380 "\u1E3F": "m\u0301", // ? = \'{m}
15381 "\u1E41": "m\u0307", // ? = \.{m}
15382 "\u0144": "n\u0301", // ? = \'{n}
15383 "\u01F9": "n\u0300", // ? = \`{n}
15384 "\xF1": "n\u0303", // ñ = \~{n}
15385 "\u0148": "n\u030C", // ? = \v{n}
15386 "\u1E45": "n\u0307", // ? = \.{n}
15387 "\xF3": "o\u0301", // ó = \'{o}
15388 "\xF2": "o\u0300", // ò = \`{o}
15389 "\xF6": "o\u0308", // ö = \"{o}
15390 "\u022B": "o\u0308\u0304", // ? = \"\={o}
15391 "\xF5": "o\u0303", // õ = \~{o}
15392 "\u1E4D": "o\u0303\u0301", // ? = \~\'{o}
15393 "\u1E4F": "o\u0303\u0308", // ? = \~\"{o}
15394 "\u022D": "o\u0303\u0304", // ? = \~\={o}
15395 "\u014D": "o\u0304", // ? = \={o}
15396 "\u1E53": "o\u0304\u0301", // ? = \=\'{o}
15397 "\u1E51": "o\u0304\u0300", // ? = \=\`{o}
15398 "\u014F": "o\u0306", // ? = \u{o}
15399 "\u01D2": "o\u030C", // ? = \v{o}
15400 "\xF4": "o\u0302", // ô = \^{o}
15401 "\u1ED1": "o\u0302\u0301", // ? = \^\'{o}
15402 "\u1ED3": "o\u0302\u0300", // ? = \^\`{o}
15403 "\u1ED7": "o\u0302\u0303", // ? = \^\~{o}
15404 "\u022F": "o\u0307", // ? = \.{o}
15405 "\u0231": "o\u0307\u0304", // ? = \.\={o}
15406 "\u0151": "o\u030B", // ? = \H{o}
15407 "\u1E55": "p\u0301", // ? = \'{p}
15408 "\u1E57": "p\u0307", // ? = \.{p}
15409 "\u0155": "r\u0301", // ? = \'{r}
15410 "\u0159": "r\u030C", // ? = \v{r}
15411 "\u1E59": "r\u0307", // ? = \.{r}
15412 "\u015B": "s\u0301", // ? = \'{s}
15413 "\u1E65": "s\u0301\u0307", // ? = \'\.{s}
15414 "\u0161": "s\u030C", // ? = \v{s}
15415 "\u1E67": "s\u030C\u0307", // ? = \v\.{s}
15416 "\u015D": "s\u0302", // ? = \^{s}
15417 "\u1E61": "s\u0307", // ? = \.{s}
15418 "\u1E97": "t\u0308", // ? = \"{t}
15419 "\u0165": "t\u030C", // ? = \v{t}
15420 "\u1E6B": "t\u0307", // ? = \.{t}
15421 "\xFA": "u\u0301", // ú = \'{u}
15422 "\xF9": "u\u0300", // ù = \`{u}
15423 "\xFC": "u\u0308", // ü = \"{u}
15424 "\u01D8": "u\u0308\u0301", // ? = \"\'{u}
15425 "\u01DC": "u\u0308\u0300", // ? = \"\`{u}
15426 "\u01D6": "u\u0308\u0304", // ? = \"\={u}
15427 "\u01DA": "u\u0308\u030C", // ? = \"\v{u}
15428 "\u0169": "u\u0303", // ? = \~{u}
15429 "\u1E79": "u\u0303\u0301", // ? = \~\'{u}
15430 "\u016B": "u\u0304", // ? = \={u}
15431 "\u1E7B": "u\u0304\u0308", // ? = \=\"{u}
15432 "\u016D": "u\u0306", // ? = \u{u}
15433 "\u01D4": "u\u030C", // ? = \v{u}
15434 "\xFB": "u\u0302", // û = \^{u}
15435 "\u016F": "u\u030A", // ? = \r{u}
15436 "\u0171": "u\u030B", // ? = \H{u}
15437 "\u1E7D": "v\u0303", // ? = \~{v}
15438 "\u1E83": "w\u0301", // ? = \'{w}
15439 "\u1E81": "w\u0300", // ? = \`{w}
15440 "\u1E85": "w\u0308", // ? = \"{w}
15441 "\u0175": "w\u0302", // ? = \^{w}
15442 "\u1E87": "w\u0307", // ? = \.{w}
15443 "\u1E98": "w\u030A", // ? = \r{w}
15444 "\u1E8D": "x\u0308", // ? = \"{x}
15445 "\u1E8B": "x\u0307", // ? = \.{x}
15446 "\xFD": "y\u0301", // ý = \'{y}
15447 "\u1EF3": "y\u0300", // ? = \`{y}
15448 "\xFF": "y\u0308", // ÿ = \"{y}
15449 "\u1EF9": "y\u0303", // ? = \~{y}
15450 "\u0233": "y\u0304", // ? = \={y}
15451 "\u0177": "y\u0302", // ? = \^{y}
15452 "\u1E8F": "y\u0307", // ? = \.{y}
15453 "\u1E99": "y\u030A", // ? = \r{y}
15454 "\u017A": "z\u0301", // ? = \'{z}
15455 "\u017E": "z\u030C", // ? = \v{z}
15456 "\u1E91": "z\u0302", // ? = \^{z}
15457 "\u017C": "z\u0307", // ? = \.{z}
15458 "\xC1": "A\u0301", // Á = \'{A}
15459 "\xC0": "A\u0300", // À = \`{A}
15460 "\xC4": "A\u0308", // Ä = \"{A}
15461 "\u01DE": "A\u0308\u0304", // ? = \"\={A}
15462 "\xC3": "A\u0303", // Ã = \~{A}
15463 "\u0100": "A\u0304", // ? = \={A}
15464 "\u0102": "A\u0306", // ? = \u{A}
15465 "\u1EAE": "A\u0306\u0301", // ? = \u\'{A}
15466 "\u1EB0": "A\u0306\u0300", // ? = \u\`{A}
15467 "\u1EB4": "A\u0306\u0303", // ? = \u\~{A}
15468 "\u01CD": "A\u030C", // ? = \v{A}
15469 "\xC2": "A\u0302", // Â = \^{A}
15470 "\u1EA4": "A\u0302\u0301", // ? = \^\'{A}
15471 "\u1EA6": "A\u0302\u0300", // ? = \^\`{A}
15472 "\u1EAA": "A\u0302\u0303", // ? = \^\~{A}
15473 "\u0226": "A\u0307", // ? = \.{A}
15474 "\u01E0": "A\u0307\u0304", // ? = \.\={A}
15475 "\xC5": "A\u030A", // Å = \r{A}
15476 "\u01FA": "A\u030A\u0301", // ? = \r\'{A}
15477 "\u1E02": "B\u0307", // ? = \.{B}
15478 "\u0106": "C\u0301", // ? = \'{C}
15479 "\u010C": "C\u030C", // ? = \v{C}
15480 "\u0108": "C\u0302", // ? = \^{C}
15481 "\u010A": "C\u0307", // ? = \.{C}
15482 "\u010E": "D\u030C", // ? = \v{D}
15483 "\u1E0A": "D\u0307", // ? = \.{D}
15484 "\xC9": "E\u0301", // É = \'{E}
15485 "\xC8": "E\u0300", // È = \`{E}
15486 "\xCB": "E\u0308", // Ë = \"{E}
15487 "\u1EBC": "E\u0303", // ? = \~{E}
15488 "\u0112": "E\u0304", // ? = \={E}
15489 "\u1E16": "E\u0304\u0301", // ? = \=\'{E}
15490 "\u1E14": "E\u0304\u0300", // ? = \=\`{E}
15491 "\u0114": "E\u0306", // ? = \u{E}
15492 "\u011A": "E\u030C", // ? = \v{E}
15493 "\xCA": "E\u0302", // Ê = \^{E}
15494 "\u1EBE": "E\u0302\u0301", // ? = \^\'{E}
15495 "\u1EC0": "E\u0302\u0300", // ? = \^\`{E}
15496 "\u1EC4": "E\u0302\u0303", // ? = \^\~{E}
15497 "\u0116": "E\u0307", // ? = \.{E}
15498 "\u1E1E": "F\u0307", // ? = \.{F}
15499 "\u01F4": "G\u0301", // ? = \'{G}
15500 "\u1E20": "G\u0304", // ? = \={G}
15501 "\u011E": "G\u0306", // ? = \u{G}
15502 "\u01E6": "G\u030C", // ? = \v{G}
15503 "\u011C": "G\u0302", // ? = \^{G}
15504 "\u0120": "G\u0307", // ? = \.{G}
15505 "\u1E26": "H\u0308", // ? = \"{H}
15506 "\u021E": "H\u030C", // ? = \v{H}
15507 "\u0124": "H\u0302", // ? = \^{H}
15508 "\u1E22": "H\u0307", // ? = \.{H}
15509 "\xCD": "I\u0301", // Í = \'{I}
15510 "\xCC": "I\u0300", // Ì = \`{I}
15511 "\xCF": "I\u0308", // Ï = \"{I}
15512 "\u1E2E": "I\u0308\u0301", // ? = \"\'{I}
15513 "\u0128": "I\u0303", // ? = \~{I}
15514 "\u012A": "I\u0304", // ? = \={I}
15515 "\u012C": "I\u0306", // ? = \u{I}
15516 "\u01CF": "I\u030C", // ? = \v{I}
15517 "\xCE": "I\u0302", // Î = \^{I}
15518 "\u0130": "I\u0307", // ? = \.{I}
15519 "\u0134": "J\u0302", // ? = \^{J}
15520 "\u1E30": "K\u0301", // ? = \'{K}
15521 "\u01E8": "K\u030C", // ? = \v{K}
15522 "\u0139": "L\u0301", // ? = \'{L}
15523 "\u013D": "L\u030C", // ? = \v{L}
15524 "\u1E3E": "M\u0301", // ? = \'{M}
15525 "\u1E40": "M\u0307", // ? = \.{M}
15526 "\u0143": "N\u0301", // ? = \'{N}
15527 "\u01F8": "N\u0300", // ? = \`{N}
15528 "\xD1": "N\u0303", // Ñ = \~{N}
15529 "\u0147": "N\u030C", // ? = \v{N}
15530 "\u1E44": "N\u0307", // ? = \.{N}
15531 "\xD3": "O\u0301", // Ó = \'{O}
15532 "\xD2": "O\u0300", // Ò = \`{O}
15533 "\xD6": "O\u0308", // Ö = \"{O}
15534 "\u022A": "O\u0308\u0304", // ? = \"\={O}
15535 "\xD5": "O\u0303", // Õ = \~{O}
15536 "\u1E4C": "O\u0303\u0301", // ? = \~\'{O}
15537 "\u1E4E": "O\u0303\u0308", // ? = \~\"{O}
15538 "\u022C": "O\u0303\u0304", // ? = \~\={O}
15539 "\u014C": "O\u0304", // ? = \={O}
15540 "\u1E52": "O\u0304\u0301", // ? = \=\'{O}
15541 "\u1E50": "O\u0304\u0300", // ? = \=\`{O}
15542 "\u014E": "O\u0306", // ? = \u{O}
15543 "\u01D1": "O\u030C", // ? = \v{O}
15544 "\xD4": "O\u0302", // Ô = \^{O}
15545 "\u1ED0": "O\u0302\u0301", // ? = \^\'{O}
15546 "\u1ED2": "O\u0302\u0300", // ? = \^\`{O}
15547 "\u1ED6": "O\u0302\u0303", // ? = \^\~{O}
15548 "\u022E": "O\u0307", // ? = \.{O}
15549 "\u0230": "O\u0307\u0304", // ? = \.\={O}
15550 "\u0150": "O\u030B", // ? = \H{O}
15551 "\u1E54": "P\u0301", // ? = \'{P}
15552 "\u1E56": "P\u0307", // ? = \.{P}
15553 "\u0154": "R\u0301", // ? = \'{R}
15554 "\u0158": "R\u030C", // ? = \v{R}
15555 "\u1E58": "R\u0307", // ? = \.{R}
15556 "\u015A": "S\u0301", // ? = \'{S}
15557 "\u1E64": "S\u0301\u0307", // ? = \'\.{S}
15558 "\u0160": "S\u030C", // ? = \v{S}
15559 "\u1E66": "S\u030C\u0307", // ? = \v\.{S}
15560 "\u015C": "S\u0302", // ? = \^{S}
15561 "\u1E60": "S\u0307", // ? = \.{S}
15562 "\u0164": "T\u030C", // ? = \v{T}
15563 "\u1E6A": "T\u0307", // ? = \.{T}
15564 "\xDA": "U\u0301", // Ú = \'{U}
15565 "\xD9": "U\u0300", // Ù = \`{U}
15566 "\xDC": "U\u0308", // Ü = \"{U}
15567 "\u01D7": "U\u0308\u0301", // ? = \"\'{U}
15568 "\u01DB": "U\u0308\u0300", // ? = \"\`{U}
15569 "\u01D5": "U\u0308\u0304", // ? = \"\={U}
15570 "\u01D9": "U\u0308\u030C", // ? = \"\v{U}
15571 "\u0168": "U\u0303", // ? = \~{U}
15572 "\u1E78": "U\u0303\u0301", // ? = \~\'{U}
15573 "\u016A": "U\u0304", // ? = \={U}
15574 "\u1E7A": "U\u0304\u0308", // ? = \=\"{U}
15575 "\u016C": "U\u0306", // ? = \u{U}
15576 "\u01D3": "U\u030C", // ? = \v{U}
15577 "\xDB": "U\u0302", // Û = \^{U}
15578 "\u016E": "U\u030A", // ? = \r{U}
15579 "\u0170": "U\u030B", // ? = \H{U}
15580 "\u1E7C": "V\u0303", // ? = \~{V}
15581 "\u1E82": "W\u0301", // ? = \'{W}
15582 "\u1E80": "W\u0300", // ? = \`{W}
15583 "\u1E84": "W\u0308", // ? = \"{W}
15584 "\u0174": "W\u0302", // ? = \^{W}
15585 "\u1E86": "W\u0307", // ? = \.{W}
15586 "\u1E8C": "X\u0308", // ? = \"{X}
15587 "\u1E8A": "X\u0307", // ? = \.{X}
15588 "\xDD": "Y\u0301", // Ý = \'{Y}
15589 "\u1EF2": "Y\u0300", // ? = \`{Y}
15590 "\u0178": "Y\u0308", // ? = \"{Y}
15591 "\u1EF8": "Y\u0303", // ? = \~{Y}
15592 "\u0232": "Y\u0304", // ? = \={Y}
15593 "\u0176": "Y\u0302", // ? = \^{Y}
15594 "\u1E8E": "Y\u0307", // ? = \.{Y}
15595 "\u0179": "Z\u0301", // ? = \'{Z}
15596 "\u017D": "Z\u030C", // ? = \v{Z}
15597 "\u1E90": "Z\u0302", // ? = \^{Z}
15598 "\u017B": "Z\u0307", // ? = \.{Z}
15599 "\u03AC": "\u03B1\u0301", // ? = \'{?}
15600 "\u1F70": "\u03B1\u0300", // ? = \`{?}
15601 "\u1FB1": "\u03B1\u0304", // ? = \={?}
15602 "\u1FB0": "\u03B1\u0306", // ? = \u{?}
15603 "\u03AD": "\u03B5\u0301", // ? = \'{?}
15604 "\u1F72": "\u03B5\u0300", // ? = \`{?}
15605 "\u03AE": "\u03B7\u0301", // ? = \'{?}
15606 "\u1F74": "\u03B7\u0300", // ? = \`{?}
15607 "\u03AF": "\u03B9\u0301", // ? = \'{?}
15608 "\u1F76": "\u03B9\u0300", // ? = \`{?}
15609 "\u03CA": "\u03B9\u0308", // ? = \"{?}
15610 "\u0390": "\u03B9\u0308\u0301", // ? = \"\'{?}
15611 "\u1FD2": "\u03B9\u0308\u0300", // ? = \"\`{?}
15612 "\u1FD1": "\u03B9\u0304", // ? = \={?}
15613 "\u1FD0": "\u03B9\u0306", // ? = \u{?}
15614 "\u03CC": "\u03BF\u0301", // ? = \'{?}
15615 "\u1F78": "\u03BF\u0300", // ? = \`{?}
15616 "\u03CD": "\u03C5\u0301", // ? = \'{?}
15617 "\u1F7A": "\u03C5\u0300", // ? = \`{?}
15618 "\u03CB": "\u03C5\u0308", // ? = \"{?}
15619 "\u03B0": "\u03C5\u0308\u0301", // ? = \"\'{?}
15620 "\u1FE2": "\u03C5\u0308\u0300", // ? = \"\`{?}
15621 "\u1FE1": "\u03C5\u0304", // ? = \={?}
15622 "\u1FE0": "\u03C5\u0306", // ? = \u{?}
15623 "\u03CE": "\u03C9\u0301", // ? = \'{?}
15624 "\u1F7C": "\u03C9\u0300", // ? = \`{?}
15625 "\u038E": "\u03A5\u0301", // ? = \'{?}
15626 "\u1FEA": "\u03A5\u0300", // ? = \`{?}
15627 "\u03AB": "\u03A5\u0308", // ? = \"{?}
15628 "\u1FE9": "\u03A5\u0304", // ? = \={?}
15629 "\u1FE8": "\u03A5\u0306", // ? = \u{?}
15630 "\u038F": "\u03A9\u0301", // ? = \'{?}
15631 "\u1FFA": "\u03A9\u0300" // ? = \`{?}
15632});
15633// CONCATENATED MODULE: ./src/Parser.js
15634
15635
15636
15637/* eslint no-constant-condition:0 */
15638/* eslint no-console:0 */
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653/**
15654 * This file contains the parser used to parse out a TeX expression from the
15655 * input. Since TeX isn't context-free, standard parsers don't work particularly
15656 * well.
15657 *
15658 * The strategy of this parser is as such:
15659 *
15660 * The main functions (the `.parse...` ones) take a position in the current
15661 * parse string to parse tokens from. The lexer (found in Lexer.js, stored at
15662 * this.lexer) also supports pulling out tokens at arbitrary places. When
15663 * individual tokens are needed at a position, the lexer is called to pull out a
15664 * token, which is then used.
15665 *
15666 * The parser has a property called "mode" indicating the mode that
15667 * the parser is currently in. Currently it has to be one of "math" or
15668 * "text", which denotes whether the current environment is a math-y
15669 * one or a text-y one (e.g. inside \text). Currently, this serves to
15670 * limit the functions which can be used in text mode.
15671 *
15672 * The main functions then return an object which contains the useful data that
15673 * was parsed at its given point, and a new position at the end of the parsed
15674 * data. The main functions can call each other and continue the parsing by
15675 * using the returned position as a new starting point.
15676 *
15677 * There are also extra `.handle...` functions, which pull out some reused
15678 * functionality into self-contained functions.
15679 *
15680 * The earlier functions return ParseNodes.
15681 * The later functions (which are called deeper in the parse) sometimes return
15682 * ParsedFuncOrArg, which contain a ParseNode as well as some data about
15683 * whether the parsed object is a function which is missing some arguments, or a
15684 * standalone object which can be used as an argument to another function.
15685 */
15686
15687function newArgument(result, token) {
15688 return { type: "arg", result: result, token: token };
15689}
15690
15691function newFunction(token) {
15692 return { type: "fn", result: token.text, token: token };
15693}
15694
15695var Parser_Parser = function () {
15696 function Parser(input, settings) {
15697 classCallCheck_default()(this, Parser);
15698
15699 // Start in math mode
15700 this.mode = "math";
15701 // Create a new macro expander (gullet) and (indirectly via that) also a
15702 // new lexer (mouth) for this parser (stomach, in the language of TeX)
15703 this.gullet = new src_MacroExpander(input, settings, this.mode);
15704 // Store the settings for use in parsing
15705 this.settings = settings;
15706 // Count leftright depth (for \middle errors)
15707 this.leftrightDepth = 0;
15708 }
15709
15710 /**
15711 * Checks a result to make sure it has the right type, and throws an
15712 * appropriate error otherwise.
15713 */
15714
15715
15716 createClass_default()(Parser, [{
15717 key: "expect",
15718 value: function expect(text) {
15719 var consume = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
15720
15721 if (this.nextToken.text !== text) {
15722 throw new src_ParseError("Expected '" + text + "', got '" + this.nextToken.text + "'", this.nextToken);
15723 }
15724 if (consume) {
15725 this.consume();
15726 }
15727 }
15728
15729 /**
15730 * Considers the current look ahead token as consumed,
15731 * and fetches the one after that as the new look ahead.
15732 */
15733
15734 }, {
15735 key: "consume",
15736 value: function consume() {
15737 this.nextToken = this.gullet.expandNextToken();
15738 }
15739
15740 /**
15741 * Switches between "text" and "math" modes.
15742 */
15743
15744 }, {
15745 key: "switchMode",
15746 value: function switchMode(newMode) {
15747 this.mode = newMode;
15748 this.gullet.switchMode(newMode);
15749 }
15750
15751 /**
15752 * Main parsing function, which parses an entire input.
15753 */
15754
15755 }, {
15756 key: "parse",
15757 value: function parse() {
15758 // Create a group namespace for the math expression.
15759 // (LaTeX creates a new group for every $...$, $$...$$, \[...\].)
15760 this.gullet.beginGroup();
15761
15762 // Use old \color behavior (same as LaTeX's \textcolor) if requested.
15763 // We do this within the group for the math expression, so it doesn't
15764 // pollute settings.macros.
15765 if (this.settings.colorIsTextColor) {
15766 this.gullet.macros.set("\\color", "\\textcolor");
15767 }
15768
15769 // Try to parse the input
15770 this.consume();
15771 var parse = this.parseExpression(false);
15772
15773 // If we succeeded, make sure there's an EOF at the end
15774 this.expect("EOF", false);
15775
15776 // End the group namespace for the expression
15777 this.gullet.endGroup();
15778 return parse;
15779 }
15780 }, {
15781 key: "parseExpression",
15782
15783
15784 /**
15785 * Parses an "expression", which is a list of atoms.
15786 *
15787 * `breakOnInfix`: Should the parsing stop when we hit infix nodes? This
15788 * happens when functions have higher precendence han infix
15789 * nodes in implicit parses.
15790 *
15791 * `breakOnTokenText`: The text of the token that the expression should end
15792 * with, or `null` if something else should end the
15793 * expression.
15794 */
15795 value: function parseExpression(breakOnInfix, breakOnTokenText) {
15796 var body = [];
15797 // Keep adding atoms to the body until we can't parse any more atoms (either
15798 // we reached the end, a }, or a \right)
15799 while (true) {
15800 // Ignore spaces in math mode
15801 if (this.mode === "math") {
15802 this.consumeSpaces();
15803 }
15804 var lex = this.nextToken;
15805 if (Parser.endOfExpression.indexOf(lex.text) !== -1) {
15806 break;
15807 }
15808 if (breakOnTokenText && lex.text === breakOnTokenText) {
15809 break;
15810 }
15811 if (breakOnInfix && src_functions[lex.text] && src_functions[lex.text].infix) {
15812 break;
15813 }
15814 var atom = this.parseAtom(breakOnTokenText);
15815 if (!atom) {
15816 if (!this.settings.throwOnError && lex.text[0] === "\\") {
15817 var errorNode = this.handleUnsupportedCmd();
15818 body.push(errorNode);
15819 continue;
15820 }
15821
15822 break;
15823 }
15824 body.push(atom);
15825 }
15826 if (this.mode === "text") {
15827 this.formLigatures(body);
15828 }
15829 return this.handleInfixNodes(body);
15830 }
15831
15832 /**
15833 * Rewrites infix operators such as \over with corresponding commands such
15834 * as \frac.
15835 *
15836 * There can only be one infix operator per group. If there's more than one
15837 * then the expression is ambiguous. This can be resolved by adding {}.
15838 */
15839
15840 }, {
15841 key: "handleInfixNodes",
15842 value: function handleInfixNodes(body) {
15843 var overIndex = -1;
15844 var funcName = void 0;
15845
15846 for (var i = 0; i < body.length; i++) {
15847 var node = checkNodeType(body[i], "infix");
15848 if (node) {
15849 if (overIndex !== -1) {
15850 throw new src_ParseError("only one infix operator per group", node.value.token);
15851 }
15852 overIndex = i;
15853 funcName = node.value.replaceWith;
15854 }
15855 }
15856
15857 if (overIndex !== -1 && funcName) {
15858 var numerNode = void 0;
15859 var denomNode = void 0;
15860
15861 var numerBody = body.slice(0, overIndex);
15862 var denomBody = body.slice(overIndex + 1);
15863
15864 if (numerBody.length === 1 && numerBody[0].type === "ordgroup") {
15865 numerNode = numerBody[0];
15866 } else {
15867 numerNode = new src_ParseNode("ordgroup", numerBody, this.mode);
15868 }
15869
15870 if (denomBody.length === 1 && denomBody[0].type === "ordgroup") {
15871 denomNode = denomBody[0];
15872 } else {
15873 denomNode = new src_ParseNode("ordgroup", denomBody, this.mode);
15874 }
15875
15876 var _node = this.callFunction(funcName, [numerNode, denomNode], []);
15877 return [_node];
15878 } else {
15879 return body;
15880 }
15881 }
15882
15883 // The greediness of a superscript or subscript
15884
15885 }, {
15886 key: "handleSupSubscript",
15887
15888
15889 /**
15890 * Handle a subscript or superscript with nice errors.
15891 */
15892 value: function handleSupSubscript(name) {
15893 var symbolToken = this.nextToken;
15894 var symbol = symbolToken.text;
15895 this.consume();
15896 this.consumeSpaces(); // ignore spaces before sup/subscript argument
15897 var group = this.parseGroup();
15898
15899 if (!group) {
15900 if (!this.settings.throwOnError && this.nextToken.text[0] === "\\") {
15901 return this.handleUnsupportedCmd();
15902 } else {
15903 throw new src_ParseError("Expected group after '" + symbol + "'", symbolToken);
15904 }
15905 }
15906
15907 if (group.type === "fn") {
15908 // ^ and _ have a greediness, so handle interactions with functions'
15909 // greediness
15910 var funcGreediness = src_functions[group.result].greediness;
15911 if (funcGreediness > Parser.SUPSUB_GREEDINESS) {
15912 return this.parseGivenFunction(group);
15913 } else {
15914 throw new src_ParseError("Got function '" + group.result + "' with no arguments " + "as " + name, symbolToken);
15915 }
15916 } else {
15917 return group.result;
15918 }
15919 }
15920
15921 /**
15922 * Converts the textual input of an unsupported command into a text node
15923 * contained within a color node whose color is determined by errorColor
15924 */
15925
15926 }, {
15927 key: "handleUnsupportedCmd",
15928 value: function handleUnsupportedCmd() {
15929 var text = this.nextToken.text;
15930 var textordArray = [];
15931
15932 for (var i = 0; i < text.length; i++) {
15933 textordArray.push(new src_ParseNode("textord", text[i], "text"));
15934 }
15935
15936 var textNode = new src_ParseNode("text", {
15937 body: textordArray,
15938 type: "text"
15939 }, this.mode);
15940
15941 var colorNode = new src_ParseNode("color", {
15942 color: this.settings.errorColor,
15943 value: [textNode],
15944 type: "color"
15945 }, this.mode);
15946
15947 this.consume();
15948 return colorNode;
15949 }
15950
15951 /**
15952 * Parses a group with optional super/subscripts.
15953 */
15954
15955 }, {
15956 key: "parseAtom",
15957 value: function parseAtom(breakOnTokenText) {
15958 // The body of an atom is an implicit group, so that things like
15959 // \left(x\right)^2 work correctly.
15960 var base = this.parseImplicitGroup(breakOnTokenText);
15961
15962 // In text mode, we don't have superscripts or subscripts
15963 if (this.mode === "text") {
15964 return base;
15965 }
15966
15967 // Note that base may be empty (i.e. null) at this point.
15968
15969 var superscript = void 0;
15970 var subscript = void 0;
15971 while (true) {
15972 // Guaranteed in math mode, so eat any spaces first.
15973 this.consumeSpaces();
15974
15975 // Lex the first token
15976 var lex = this.nextToken;
15977
15978 if (lex.text === "\\limits" || lex.text === "\\nolimits") {
15979 // We got a limit control
15980 var opNode = checkNodeType(base, "op");
15981 if (opNode) {
15982 var limits = lex.text === "\\limits";
15983 opNode.value.limits = limits;
15984 opNode.value.alwaysHandleSupSub = true;
15985 } else {
15986 throw new src_ParseError("Limit controls must follow a math operator", lex);
15987 }
15988 this.consume();
15989 } else if (lex.text === "^") {
15990 // We got a superscript start
15991 if (superscript) {
15992 throw new src_ParseError("Double superscript", lex);
15993 }
15994 superscript = this.handleSupSubscript("superscript");
15995 } else if (lex.text === "_") {
15996 // We got a subscript start
15997 if (subscript) {
15998 throw new src_ParseError("Double subscript", lex);
15999 }
16000 subscript = this.handleSupSubscript("subscript");
16001 } else if (lex.text === "'") {
16002 // We got a prime
16003 if (superscript) {
16004 throw new src_ParseError("Double superscript", lex);
16005 }
16006 var prime = new src_ParseNode("textord", "\\prime", this.mode);
16007
16008 // Many primes can be grouped together, so we handle this here
16009 var primes = [prime];
16010 this.consume();
16011 // Keep lexing tokens until we get something that's not a prime
16012 while (this.nextToken.text === "'") {
16013 // For each one, add another prime to the list
16014 primes.push(prime);
16015 this.consume();
16016 }
16017 // If there's a superscript following the primes, combine that
16018 // superscript in with the primes.
16019 if (this.nextToken.text === "^") {
16020 primes.push(this.handleSupSubscript("superscript"));
16021 }
16022 // Put everything into an ordgroup as the superscript
16023 superscript = new src_ParseNode("ordgroup", primes, this.mode);
16024 } else {
16025 // If it wasn't ^, _, or ', stop parsing super/subscripts
16026 break;
16027 }
16028 }
16029
16030 // Base must be set if superscript or subscript are set per logic above,
16031 // but need to check here for type check to pass.
16032 if (superscript || subscript) {
16033 // If we got either a superscript or subscript, create a supsub
16034 return new src_ParseNode("supsub", {
16035 type: "supsub",
16036 base: base,
16037 sup: superscript,
16038 sub: subscript
16039 }, this.mode);
16040 } else {
16041 // Otherwise return the original body
16042 return base;
16043 }
16044 }
16045
16046 /**
16047 * Parses an implicit group, which is a group that starts at the end of a
16048 * specified, and ends right before a higher explicit group ends, or at EOL. It
16049 * is used for functions that appear to affect the current style, like \Large or
16050 * \textrm, where instead of keeping a style we just pretend that there is an
16051 * implicit grouping after it until the end of the group. E.g.
16052 * small text {\Large large text} small text again
16053 */
16054
16055 }, {
16056 key: "parseImplicitGroup",
16057 value: function parseImplicitGroup(breakOnTokenText) {
16058 var start = this.parseSymbol();
16059
16060 if (start == null) {
16061 // If we didn't get anything we handle, fall back to parseFunction
16062 return this.parseFunction();
16063 } else if (start.type === "arg") {
16064 // Defer to parseGivenFunction if it's not a function we handle
16065 return this.parseGivenFunction(start);
16066 }
16067
16068 var func = start.result;
16069
16070 if (func === "\\begin") {
16071 // begin...end is similar to left...right
16072 var begin = assertNodeType(this.parseGivenFunction(start), "environment");
16073
16074 var envName = begin.value.name;
16075 if (!src_environments.hasOwnProperty(envName)) {
16076 throw new src_ParseError("No such environment: " + envName, begin.value.nameGroup);
16077 }
16078 // Build the environment object. Arguments and other information will
16079 // be made available to the begin and end methods using properties.
16080 var env = src_environments[envName];
16081
16082 var _parseArguments = this.parseArguments("\\begin{" + envName + "}", env),
16083 args = _parseArguments.args,
16084 optArgs = _parseArguments.optArgs;
16085
16086 var context = {
16087 mode: this.mode,
16088 envName: envName,
16089 parser: this
16090 };
16091 var _result = env.handler(context, args, optArgs);
16092 this.expect("\\end", false);
16093 var endNameToken = this.nextToken;
16094 var end = this.parseFunction();
16095 if (!end) {
16096 throw new src_ParseError("failed to parse function after \\end");
16097 }
16098 end = assertNodeType(end, "environment");
16099 if (end.value.name !== envName) {
16100 throw new src_ParseError("Mismatch: \\begin{" + envName + "} matched " + "by \\end{" + end.value.name + "}", endNameToken);
16101 }
16102 return _result;
16103 } else {
16104 // Defer to parseGivenFunction if it's not a function we handle
16105 return this.parseGivenFunction(start, breakOnTokenText);
16106 }
16107 }
16108
16109 /**
16110 * Parses an entire function, including its base and all of its arguments.
16111 * It also handles the case where the parsed node is not a function.
16112 */
16113
16114 }, {
16115 key: "parseFunction",
16116 value: function parseFunction() {
16117 var baseGroup = this.parseGroup();
16118 return baseGroup ? this.parseGivenFunction(baseGroup) : null;
16119 }
16120
16121 /**
16122 * Same as parseFunction(), except that the base is provided, guaranteeing a
16123 * non-nullable result.
16124 */
16125
16126 }, {
16127 key: "parseGivenFunction",
16128 value: function parseGivenFunction(baseGroup, breakOnTokenText) {
16129 if (baseGroup.type === "fn") {
16130 var func = baseGroup.result;
16131 var funcData = src_functions[func];
16132 if (this.mode === "text" && !funcData.allowedInText) {
16133 throw new src_ParseError("Can't use function '" + func + "' in text mode", baseGroup.token);
16134 } else if (this.mode === "math" && funcData.allowedInMath === false) {
16135 throw new src_ParseError("Can't use function '" + func + "' in math mode", baseGroup.token);
16136 }
16137
16138 // Consume the command token after possibly switching to the
16139 // mode specified by the function (for instant mode switching),
16140 // and then immediately switch back.
16141 if (funcData.consumeMode) {
16142 var oldMode = this.mode;
16143 this.switchMode(funcData.consumeMode);
16144 this.consume();
16145 this.switchMode(oldMode);
16146 } else {
16147 this.consume();
16148 }
16149
16150 var _parseArguments2 = this.parseArguments(func, funcData),
16151 args = _parseArguments2.args,
16152 optArgs = _parseArguments2.optArgs;
16153
16154 var _token = baseGroup.token;
16155 return this.callFunction(func, args, optArgs, _token, breakOnTokenText);
16156 } else {
16157 return baseGroup.result;
16158 }
16159 }
16160
16161 /**
16162 * Call a function handler with a suitable context and arguments.
16163 */
16164
16165 }, {
16166 key: "callFunction",
16167 value: function callFunction(name, args, optArgs, token, breakOnTokenText) {
16168 var context = {
16169 funcName: name,
16170 parser: this,
16171 token: token,
16172 breakOnTokenText: breakOnTokenText
16173 };
16174 var func = src_functions[name];
16175 if (func && func.handler) {
16176 return func.handler(context, args, optArgs);
16177 } else {
16178 throw new src_ParseError("No function handler for " + name);
16179 }
16180 }
16181
16182 /**
16183 * Parses the arguments of a function or environment
16184 */
16185
16186 }, {
16187 key: "parseArguments",
16188 value: function parseArguments(func, // Should look like "\name" or "\begin{name}".
16189 funcData) {
16190 var totalArgs = funcData.numArgs + funcData.numOptionalArgs;
16191 if (totalArgs === 0) {
16192 return { args: [], optArgs: [] };
16193 }
16194
16195 var baseGreediness = funcData.greediness;
16196 var args = [];
16197 var optArgs = [];
16198
16199 for (var i = 0; i < totalArgs; i++) {
16200 var argType = funcData.argTypes && funcData.argTypes[i];
16201 var isOptional = i < funcData.numOptionalArgs;
16202 // Ignore spaces between arguments. As the TeXbook says:
16203 // "After you have said ?\def\row#1#2{...}?, you are allowed to
16204 // put spaces between the arguments (e.g., ?\row x n?), because
16205 // TeX doesn?t use single spaces as undelimited arguments."
16206 if (i > 0 && !isOptional) {
16207 this.consumeSpaces();
16208 }
16209 // Also consume leading spaces in math mode, as parseSymbol
16210 // won't know what to do with them. This can only happen with
16211 // macros, e.g. \frac\foo\foo where \foo expands to a space symbol.
16212 // In LaTeX, the \foo's get treated as (blank) arguments).
16213 // In KaTeX, for now, both spaces will get consumed.
16214 // TODO(edemaine)
16215 if (i === 0 && !isOptional && this.mode === "math") {
16216 this.consumeSpaces();
16217 }
16218 var nextToken = this.nextToken;
16219 var arg = argType ? this.parseGroupOfType(argType, isOptional) : this.parseGroup(isOptional);
16220 if (!arg) {
16221 if (isOptional) {
16222 optArgs.push(null);
16223 continue;
16224 }
16225 if (!this.settings.throwOnError && this.nextToken.text[0] === "\\") {
16226 arg = newArgument(this.handleUnsupportedCmd(), nextToken);
16227 } else {
16228 throw new src_ParseError("Expected group after '" + func + "'", nextToken);
16229 }
16230 }
16231 var argNode = void 0;
16232 if (arg.type === "fn") {
16233 var argGreediness = src_functions[arg.result].greediness;
16234 if (argGreediness > baseGreediness) {
16235 argNode = this.parseGivenFunction(arg);
16236 } else {
16237 throw new src_ParseError("Got function '" + arg.result + "' as " + "argument to '" + func + "'", nextToken);
16238 }
16239 } else {
16240 argNode = arg.result;
16241 }
16242 (isOptional ? optArgs : args).push(argNode);
16243 }
16244
16245 return { args: args, optArgs: optArgs };
16246 }
16247
16248 /**
16249 * Parses a group when the mode is changing.
16250 */
16251
16252 }, {
16253 key: "parseGroupOfType",
16254 value: function parseGroupOfType(type, // Used to describe the mode in error messages.
16255 optional) {
16256 // Handle `original` argTypes
16257 if (type === "original") {
16258 type = this.mode;
16259 }
16260
16261 if (type === "color") {
16262 return this.parseColorGroup(optional);
16263 }
16264 if (type === "size") {
16265 return this.parseSizeGroup(optional);
16266 }
16267 if (type === "url") {
16268 return this.parseUrlGroup(optional);
16269 }
16270
16271 // By the time we get here, type is one of "text" or "math".
16272 // Specify this as mode to parseGroup.
16273 return this.parseGroup(optional, type);
16274 }
16275 }, {
16276 key: "consumeSpaces",
16277 value: function consumeSpaces() {
16278 while (this.nextToken.text === " ") {
16279 this.consume();
16280 }
16281 }
16282
16283 /**
16284 * Parses a group, essentially returning the string formed by the
16285 * brace-enclosed tokens plus some position information.
16286 */
16287
16288 }, {
16289 key: "parseStringGroup",
16290 value: function parseStringGroup(modeName, // Used to describe the mode in error messages.
16291 optional) {
16292 if (optional && this.nextToken.text !== "[") {
16293 return null;
16294 }
16295 var outerMode = this.mode;
16296 this.mode = "text";
16297 this.expect(optional ? "[" : "{");
16298 var str = "";
16299 var firstToken = this.nextToken;
16300 var lastToken = firstToken;
16301 while (this.nextToken.text !== (optional ? "]" : "}")) {
16302 if (this.nextToken.text === "EOF") {
16303 throw new src_ParseError("Unexpected end of input in " + modeName, firstToken.range(this.nextToken, str));
16304 }
16305 lastToken = this.nextToken;
16306 str += lastToken.text;
16307 this.consume();
16308 }
16309 this.mode = outerMode;
16310 this.expect(optional ? "]" : "}");
16311 return firstToken.range(lastToken, str);
16312 }
16313
16314 /**
16315 * Parses a group, essentially returning the string formed by the
16316 * brace-enclosed tokens plus some position information, possibly
16317 * with nested braces.
16318 */
16319
16320 }, {
16321 key: "parseStringGroupWithBalancedBraces",
16322 value: function parseStringGroupWithBalancedBraces(modeName, // Used to describe the mode in error messages.
16323 optional) {
16324 if (optional && this.nextToken.text !== "[") {
16325 return null;
16326 }
16327 var outerMode = this.mode;
16328 this.mode = "text";
16329 this.expect(optional ? "[" : "{");
16330 var str = "";
16331 var nest = 0;
16332 var firstToken = this.nextToken;
16333 var lastToken = firstToken;
16334 while (nest > 0 || this.nextToken.text !== (optional ? "]" : "}")) {
16335 if (this.nextToken.text === "EOF") {
16336 throw new src_ParseError("Unexpected end of input in " + modeName, firstToken.range(this.nextToken, str));
16337 }
16338 lastToken = this.nextToken;
16339 str += lastToken.text;
16340 if (lastToken.text === "{") {
16341 nest += 1;
16342 } else if (lastToken.text === "}") {
16343 if (nest <= 0) {
16344 throw new src_ParseError("Unbalanced brace of input in " + modeName, firstToken.range(this.nextToken, str));
16345 } else {
16346 nest -= 1;
16347 }
16348 }
16349 this.consume();
16350 }
16351 this.mode = outerMode;
16352 this.expect(optional ? "]" : "}");
16353 return firstToken.range(lastToken, str);
16354 }
16355
16356 /**
16357 * Parses a regex-delimited group: the largest sequence of tokens
16358 * whose concatenated strings match `regex`. Returns the string
16359 * formed by the tokens plus some position information.
16360 */
16361
16362 }, {
16363 key: "parseRegexGroup",
16364 value: function parseRegexGroup(regex, modeName) {
16365 var outerMode = this.mode;
16366 this.mode = "text";
16367 var firstToken = this.nextToken;
16368 var lastToken = firstToken;
16369 var str = "";
16370 while (this.nextToken.text !== "EOF" && regex.test(str + this.nextToken.text)) {
16371 lastToken = this.nextToken;
16372 str += lastToken.text;
16373 this.consume();
16374 }
16375 if (str === "") {
16376 throw new src_ParseError("Invalid " + modeName + ": '" + firstToken.text + "'", firstToken);
16377 }
16378 this.mode = outerMode;
16379 return firstToken.range(lastToken, str);
16380 }
16381
16382 /**
16383 * Parses a color description.
16384 */
16385
16386 }, {
16387 key: "parseColorGroup",
16388 value: function parseColorGroup(optional) {
16389 var res = this.parseStringGroup("color", optional);
16390 if (!res) {
16391 return null;
16392 }
16393 var match = /^(#[a-f0-9]{3}|#[a-f0-9]{6}|[a-z]+)$/i.exec(res.text);
16394 if (!match) {
16395 throw new src_ParseError("Invalid color: '" + res.text + "'", res);
16396 }
16397 return newArgument(new src_ParseNode("color-token", match[0], this.mode), res);
16398 }
16399
16400 /**
16401 * Parses a url string.
16402 */
16403
16404 }, {
16405 key: "parseUrlGroup",
16406 value: function parseUrlGroup(optional) {
16407 var res = this.parseStringGroupWithBalancedBraces("url", optional);
16408 if (!res) {
16409 return null;
16410 }
16411 var raw = res.text;
16412 // hyperref package allows backslashes alone in href, but doesn't generate
16413 // valid links in such cases; we interpret this as "undefiend" behaviour,
16414 // and keep them as-is. Some browser will replace backslashes with
16415 // forward slashes.
16416 var url = raw.replace(/\\([#$%&~_^{}])/g, '$1');
16417 return newArgument(new src_ParseNode("url", {
16418 type: "url",
16419 value: url
16420 }, this.mode), res);
16421 }
16422
16423 /**
16424 * Parses a size specification, consisting of magnitude and unit.
16425 */
16426
16427 }, {
16428 key: "parseSizeGroup",
16429 value: function parseSizeGroup(optional) {
16430 var res = void 0;
16431 if (!optional && this.nextToken.text !== "{") {
16432 res = this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/, "size");
16433 } else {
16434 res = this.parseStringGroup("size", optional);
16435 }
16436 if (!res) {
16437 return null;
16438 }
16439 var match = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(res.text);
16440 if (!match) {
16441 throw new src_ParseError("Invalid size: '" + res.text + "'", res);
16442 }
16443 var data = {
16444 number: +(match[1] + match[2]), // sign + magnitude, cast to number
16445 unit: match[3]
16446 };
16447 if (!validUnit(data)) {
16448 throw new src_ParseError("Invalid unit: '" + data.unit + "'", res);
16449 }
16450 return newArgument(new src_ParseNode("size", {
16451 type: "size",
16452 value: data
16453 }, this.mode), res);
16454 }
16455
16456 /**
16457 * If `optional` is false or absent, this parses an ordinary group,
16458 * which is either a single nucleus (like "x") or an expression
16459 * in braces (like "{x+y}").
16460 * If `optional` is true, it parses either a bracket-delimited expression
16461 * (like "[x+y]") or returns null to indicate the absence of a
16462 * bracket-enclosed group.
16463 * If `mode` is present, switches to that mode while parsing the group,
16464 * and switches back after.
16465 */
16466
16467 }, {
16468 key: "parseGroup",
16469 value: function parseGroup(optional, mode) {
16470 var outerMode = this.mode;
16471 var firstToken = this.nextToken;
16472 // Try to parse an open brace
16473 if (this.nextToken.text === (optional ? "[" : "{")) {
16474 // Switch to specified mode before we expand symbol after brace
16475 if (mode) {
16476 this.switchMode(mode);
16477 }
16478 // Start a new group namespace
16479 this.gullet.beginGroup();
16480 // If we get a brace, parse an expression
16481 this.consume();
16482 var expression = this.parseExpression(false, optional ? "]" : "}");
16483 var lastToken = this.nextToken;
16484 // Switch mode back before consuming symbol after close brace
16485 if (mode) {
16486 this.switchMode(outerMode);
16487 }
16488 // End group namespace before consuming symbol after close brace
16489 this.gullet.endGroup();
16490 // Make sure we get a close brace
16491 this.expect(optional ? "]" : "}");
16492 return newArgument(new src_ParseNode("ordgroup", expression, this.mode, firstToken, lastToken), firstToken.range(lastToken, firstToken.text));
16493 } else {
16494 // Otherwise, just return a nucleus, or nothing for an optional group
16495 if (mode) {
16496 this.switchMode(mode);
16497 }
16498 var _result2 = optional ? null : this.parseSymbol();
16499 if (mode) {
16500 this.switchMode(outerMode);
16501 }
16502 return _result2;
16503 }
16504 }
16505
16506 /**
16507 * Form ligature-like combinations of characters for text mode.
16508 * This includes inputs like "--", "---", "``" and "''".
16509 * The result will simply replace multiple textord nodes with a single
16510 * character in each value by a single textord node having multiple
16511 * characters in its value. The representation is still ASCII source.
16512 * The group will be modified in place.
16513 */
16514
16515 }, {
16516 key: "formLigatures",
16517 value: function formLigatures(group) {
16518 var n = group.length - 1;
16519 for (var i = 0; i < n; ++i) {
16520 var a = group[i];
16521 var v = a.value;
16522 if (v === "-" && group[i + 1].value === "-") {
16523 if (i + 1 < n && group[i + 2].value === "-") {
16524 group.splice(i, 3, new src_ParseNode("textord", "---", "text", a, group[i + 2]));
16525 n -= 2;
16526 } else {
16527 group.splice(i, 2, new src_ParseNode("textord", "--", "text", a, group[i + 1]));
16528 n -= 1;
16529 }
16530 }
16531 if ((v === "'" || v === "`") && group[i + 1].value === v) {
16532 group.splice(i, 2, new src_ParseNode("textord", v + v, "text", a, group[i + 1]));
16533 n -= 1;
16534 }
16535 }
16536 }
16537
16538 /**
16539 * Parse a single symbol out of the string. Here, we handle both the functions
16540 * we have defined, as well as the single character symbols
16541 */
16542
16543 }, {
16544 key: "parseSymbol",
16545 value: function parseSymbol() {
16546 var nucleus = this.nextToken;
16547 var text = nucleus.text;
16548
16549 if (src_functions[text]) {
16550 // If there exists a function with this name, we return the
16551 // function and say that it is a function.
16552 // The token will be consumed later in parseGivenFunction
16553 // (after possibly switching modes).
16554 return newFunction(nucleus);
16555 } else if (/^\\verb[^a-zA-Z]/.test(text)) {
16556 this.consume();
16557 var arg = text.slice(5);
16558 var star = arg.charAt(0) === "*";
16559 if (star) {
16560 arg = arg.slice(1);
16561 }
16562 // Lexer's tokenRegex is constructed to always have matching
16563 // first/last characters.
16564 if (arg.length < 2 || arg.charAt(0) !== arg.slice(-1)) {
16565 throw new src_ParseError("\\verb assertion failed --\n please report what input caused this bug");
16566 }
16567 arg = arg.slice(1, -1); // remove first and last char
16568 return newArgument(new src_ParseNode("verb", {
16569 type: "verb",
16570 body: arg,
16571 star: star
16572 }, "text"), nucleus);
16573 }
16574 // At this point, we should have a symbol, possibly with accents.
16575 // First expand any accented base symbol according to unicodeSymbols.
16576 if (unicodeSymbols.hasOwnProperty(text[0]) && !src_symbols[this.mode][text[0]]) {
16577 // This behavior is not strict (XeTeX-compatible) in math mode.
16578 if (this.settings.strict && this.mode === "math") {
16579 this.settings.reportNonstrict("unicodeTextInMathMode", "Accented Unicode text character \"" + text[0] + "\" used in " + "math mode", nucleus);
16580 }
16581 text = unicodeSymbols[text[0]] + text.substr(1);
16582 }
16583 // Strip off any combining characters
16584 var match = combiningDiacriticalMarksEndRegex.exec(text);
16585 if (match) {
16586 text = text.substring(0, match.index);
16587 if (text === 'i') {
16588 text = "\u0131"; // dotless i, in math and text mode
16589 } else if (text === 'j') {
16590 text = "\u0237"; // dotless j, in math and text mode
16591 }
16592 }
16593 // Recognize base symbol
16594 var symbol = null;
16595 if (src_symbols[this.mode][text]) {
16596 if (this.settings.strict && this.mode === 'math' && extraLatin.indexOf(text) >= 0) {
16597 this.settings.reportNonstrict("unicodeTextInMathMode", "Latin-1/Unicode text character \"" + text[0] + "\" used in " + "math mode", nucleus);
16598 }
16599 symbol = new src_ParseNode(src_symbols[this.mode][text].group, text, this.mode, nucleus);
16600 } else if (text.charCodeAt(0) >= 0x80) {
16601 // no symbol for e.g. ^
16602 if (this.settings.strict) {
16603 if (!supportedCodepoint(text.charCodeAt(0))) {
16604 this.settings.reportNonstrict("unknownSymbol", "Unrecognized Unicode character \"" + text[0] + "\"", nucleus);
16605 } else if (this.mode === "math") {
16606 this.settings.reportNonstrict("unicodeTextInMathMode", "Unicode text character \"" + text[0] + "\" used in math mode", nucleus);
16607 }
16608 }
16609 symbol = new src_ParseNode("textord", text, this.mode, nucleus);
16610 } else {
16611 return null; // EOF, ^, _, {, }, etc.
16612 }
16613 this.consume();
16614 // Transform combining characters into accents
16615 if (match) {
16616 for (var i = 0; i < match[0].length; i++) {
16617 var accent = match[0][i];
16618 if (!unicodeAccents_default.a[accent]) {
16619 throw new src_ParseError("Unknown accent ' " + accent + "'", nucleus);
16620 }
16621 var command = unicodeAccents_default.a[accent][this.mode];
16622 if (!command) {
16623 throw new src_ParseError("Accent " + accent + " unsupported in " + this.mode + " mode", nucleus);
16624 }
16625 symbol = new src_ParseNode("accent", {
16626 type: "accent",
16627 label: command,
16628 isStretchy: false,
16629 isShifty: true,
16630 base: symbol
16631 }, this.mode, nucleus);
16632 }
16633 }
16634 return newArgument(symbol, nucleus);
16635 }
16636 }]);
16637
16638 return Parser;
16639}();
16640
16641Parser_Parser.endOfExpression = ["}", "\\end", "\\right", "&"];
16642Parser_Parser.SUPSUB_GREEDINESS = 1;
16643/* harmony default export */ var src_Parser = (Parser_Parser);
16644// CONCATENATED MODULE: ./src/parseTree.js
16645
16646/**
16647 * Provides a single function for parsing an expression using a Parser
16648 * TODO(emily): Remove this
16649 */
16650
16651
16652
16653
16654
16655/**
16656 * Parses an expression using a Parser, then returns the parsed result.
16657 */
16658var parseTree_parseTree = function parseTree(toParse, settings) {
16659 if (!(typeof toParse === 'string' || toParse instanceof String)) {
16660 throw new TypeError('KaTeX can only parse string typed expression');
16661 }
16662 var parser = new src_Parser(toParse, settings);
16663 // Blank out any \df@tag to avoid spurious "Duplicate \tag" errors
16664 delete parser.gullet.macros.current["\\df@tag"];
16665 var tree = parser.parse();
16666
16667 // If the input used \tag, it will set the \df@tag macro to the tag.
16668 // In this case, we separately parse the tag and wrap the tree.
16669 if (parser.gullet.macros.get("\\df@tag")) {
16670 if (!settings.displayMode) {
16671 throw new src_ParseError("\\tag works only in display equations");
16672 }
16673 parser.gullet.feed("\\df@tag");
16674 tree = [new src_ParseNode("tag", {
16675 type: "tag",
16676 body: tree,
16677 tag: parser.parse()
16678 }, "text")];
16679 }
16680
16681 return tree;
16682};
16683
16684/* harmony default export */ var src_parseTree = (parseTree_parseTree);
16685// EXTERNAL MODULE: ./package.json
16686var package_0 = __webpack_require__(60);
16687
16688// CONCATENATED MODULE: ./katex.js
16689
16690/* eslint no-console:0 */
16691/**
16692 * This is the main entry point for KaTeX. Here, we expose functions for
16693 * rendering expressions either to DOM nodes or to markup strings.
16694 *
16695 * We also expose the ParseError class to check if errors thrown from KaTeX are
16696 * errors in the expression, or errors in javascript handling.
16697 */
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714/**
16715 * Parse and build an expression, and place that expression in the DOM node
16716 * given.
16717 */
16718var katex_render = function render(expression, baseNode, options) {
16719 utils.clearNode(baseNode);
16720 var node = katex_renderToDomTree(expression, options).toNode();
16721 baseNode.appendChild(node);
16722};
16723
16724// KaTeX's styles don't work properly in quirks mode. Print out an error, and
16725// disable rendering.
16726if (typeof document !== "undefined") {
16727 if (document.compatMode !== "CSS1Compat") {
16728 typeof console !== "undefined" && console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your " + "website has a suitable doctype.");
16729
16730 katex_render = function render() {
16731 throw new src_ParseError("KaTeX doesn't work in quirks mode.");
16732 };
16733 }
16734}
16735
16736/**
16737 * Parse and build an expression, and return the markup for that.
16738 */
16739var renderToString = function renderToString(expression, options) {
16740 var markup = katex_renderToDomTree(expression, options).toMarkup();
16741 return markup;
16742};
16743
16744/**
16745 * Parse an expression and return the parse tree.
16746 */
16747var katex_generateParseTree = function generateParseTree(expression, options) {
16748 var settings = new src_Settings(options);
16749 return src_parseTree(expression, settings);
16750};
16751
16752/**
16753 * If the given error is a KaTeX ParseError and options.throwOnError is false,
16754 * renders the invalid LaTeX as a span with hover title giving the KaTeX
16755 * error message. Otherwise, simply throws the error.
16756 */
16757var katex_renderError = function renderError(error, expression, options) {
16758 if (options.throwOnError || !(error instanceof src_ParseError)) {
16759 throw error;
16760 }
16761 var node = buildCommon.makeSpan(["katex-error"], [new domTree.symbolNode(expression)]);
16762 node.setAttribute("title", error.toString());
16763 node.setAttribute("style", "color:" + options.errorColor);
16764 return node;
16765};
16766
16767/**
16768 * Generates and returns the katex build tree. This is used for advanced
16769 * use cases (like rendering to custom output).
16770 */
16771var katex_renderToDomTree = function renderToDomTree(expression, options) {
16772 var settings = new src_Settings(options);
16773 try {
16774 var tree = src_parseTree(expression, settings);
16775 return buildTree_buildTree(tree, expression, settings);
16776 } catch (error) {
16777 return katex_renderError(error, expression, settings);
16778 }
16779};
16780
16781/**
16782 * Generates and returns the katex build tree, with just HTML (no MathML).
16783 * This is used for advanced use cases (like rendering to custom output).
16784 */
16785var katex_renderToHTMLTree = function renderToHTMLTree(expression, options) {
16786 var settings = new src_Settings(options);
16787 try {
16788 var tree = src_parseTree(expression, settings);
16789 return buildTree_buildHTMLTree(tree, expression, settings);
16790 } catch (error) {
16791 return katex_renderError(error, expression, settings);
16792 }
16793};
16794
16795/* harmony default export */ var katex_0 = ({
16796 /**
16797 * Current KaTeX version
16798 */
16799 version: package_0["a" /* version */],
16800 /**
16801 * Renders the given LaTeX into an HTML+MathML combination, and adds
16802 * it as a child to the specified DOM node.
16803 */
16804 render: katex_render,
16805 /**
16806 * Renders the given LaTeX into an HTML+MathML combination string,
16807 * for sending to the client.
16808 */
16809 renderToString: renderToString,
16810 /**
16811 * KaTeX error, usually during parsing.
16812 */
16813 ParseError: src_ParseError,
16814 /**
16815 * Parses the given LaTeX into KaTeX's internal parse tree structure,
16816 * without rendering to HTML or MathML.
16817 *
16818 * NOTE: This method is not currently recommended for public use.
16819 * The internal tree representation is unstable and is very likely
16820 * to change. Use at your own risk.
16821 */
16822 __parse: katex_generateParseTree,
16823 /**
16824 * Renders the given LaTeX into an HTML+MathML internal DOM tree
16825 * representation, without flattening that representation to a string.
16826 *
16827 * NOTE: This method is not currently recommended for public use.
16828 * The internal tree representation is unstable and is very likely
16829 * to change. Use at your own risk.
16830 */
16831 __renderToDomTree: katex_renderToDomTree,
16832 /**
16833 * Renders the given LaTeX into an HTML internal DOM tree representation,
16834 * without MathML and without flattening that representation to a string.
16835 *
16836 * NOTE: This method is not currently recommended for public use.
16837 * The internal tree representation is unstable and is very likely
16838 * to change. Use at your own risk.
16839 */
16840 __renderToHTMLTree: katex_renderToHTMLTree,
16841 /**
16842 * extends internal font metrics object with a new object
16843 * each key in the new object represents a font name
16844 */
16845 __setFontMetrics: setFontMetrics,
16846 /**
16847 * adds a new symbol to builtin symbols table
16848 */
16849 __defineSymbol: defineSymbol,
16850 /**
16851 * adds a new macro to builtin macro list
16852 */
16853 __defineMacro: defineMacro
16854});
16855// CONCATENATED MODULE: ./katex.webpack.js
16856/**
16857 * This is the webpack entry point for KaTeX. As flow[1] and jest[2] doesn't support
16858 * CSS modules natively, a separate entry point is used and it is not flowtyped.
16859 *
16860 * [1] https://gist.github.com/lambdahands/d19e0da96285b749f0ef
16861 * [2] https://facebook.github.io/jest/docs/en/webpack.html
16862 */
16863
16864
16865
16866/* harmony default export */ var katex_webpack = __webpack_exports__["default"] = (katex_0);
16867
16868/***/ }),
16869/* 67 */
16870/***/ (function(module, exports, __webpack_require__) {
16871
16872// 19.1.2.7 Object.getOwnPropertyNames(O)
16873__webpack_require__(24)('getOwnPropertyNames', function () {
16874 return __webpack_require__(47).f;
16875});
16876
16877
16878/***/ }),
16879/* 68 */
16880/***/ (function(module, exports, __webpack_require__) {
16881
16882__webpack_require__(67);
16883var $Object = __webpack_require__(2).Object;
16884module.exports = function getOwnPropertyNames(it) {
16885 return $Object.getOwnPropertyNames(it);
16886};
16887
16888
16889/***/ }),
16890/* 69 */
16891/***/ (function(module, exports, __webpack_require__) {
16892
16893// 19.1.2.14 Object.keys(O)
16894var toObject = __webpack_require__(17);
16895var $keys = __webpack_require__(18);
16896
16897__webpack_require__(24)('keys', function () {
16898 return function keys(it) {
16899 return $keys(toObject(it));
16900 };
16901});
16902
16903
16904/***/ }),
16905/* 70 */
16906/***/ (function(module, exports, __webpack_require__) {
16907
16908__webpack_require__(69);
16909module.exports = __webpack_require__(2).Object.keys;
16910
16911
16912/***/ }),
16913/* 71 */
16914/***/ (function(module, exports, __webpack_require__) {
16915
16916"use strict";
16917
16918// 19.1.2.1 Object.assign(target, source, ...)
16919var getKeys = __webpack_require__(18);
16920var gOPS = __webpack_require__(26);
16921var pIE = __webpack_require__(21);
16922var toObject = __webpack_require__(17);
16923var IObject = __webpack_require__(53);
16924var $assign = Object.assign;
16925
16926// should work with symbols and should have deterministic property order (V8 bug)
16927module.exports = !$assign || __webpack_require__(15)(function () {
16928 var A = {};
16929 var B = {};
16930 // eslint-disable-next-line no-undef
16931 var S = Symbol();
16932 var K = 'abcdefghijklmnopqrst';
16933 A[S] = 7;
16934 K.split('').forEach(function (k) { B[k] = k; });
16935 return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
16936}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
16937 var T = toObject(target);
16938 var aLen = arguments.length;
16939 var index = 1;
16940 var getSymbols = gOPS.f;
16941 var isEnum = pIE.f;
16942 while (aLen > index) {
16943 var S = IObject(arguments[index++]);
16944 var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
16945 var length = keys.length;
16946 var j = 0;
16947 var key;
16948 while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
16949 } return T;
16950} : $assign;
16951
16952
16953/***/ }),
16954/* 72 */
16955/***/ (function(module, exports, __webpack_require__) {
16956
16957// 19.1.3.1 Object.assign(target, source)
16958var $export = __webpack_require__(8);
16959
16960$export($export.S + $export.F, 'Object', { assign: __webpack_require__(71) });
16961
16962
16963/***/ }),
16964/* 73 */
16965/***/ (function(module, exports, __webpack_require__) {
16966
16967__webpack_require__(72);
16968module.exports = __webpack_require__(2).Object.assign;
16969
16970
16971/***/ }),
16972/* 74 */
16973/***/ (function(module, exports, __webpack_require__) {
16974
16975var $export = __webpack_require__(8);
16976// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
16977$export($export.S, 'Object', { create: __webpack_require__(35) });
16978
16979
16980/***/ }),
16981/* 75 */
16982/***/ (function(module, exports, __webpack_require__) {
16983
16984__webpack_require__(74);
16985var $Object = __webpack_require__(2).Object;
16986module.exports = function create(P, D) {
16987 return $Object.create(P, D);
16988};
16989
16990
16991/***/ }),
16992/* 76 */
16993/***/ (function(module, exports, __webpack_require__) {
16994
16995module.exports = { "default": __webpack_require__(75), __esModule: true };
16996
16997/***/ }),
16998/* 77 */
16999/***/ (function(module, exports, __webpack_require__) {
17000
17001// Works with __proto__ only. Old v8 can't work with null proto objects.
17002/* eslint-disable no-proto */
17003var isObject = __webpack_require__(11);
17004var anObject = __webpack_require__(12);
17005var check = function (O, proto) {
17006 anObject(O);
17007 if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
17008};
17009module.exports = {
17010 set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
17011 function (test, buggy, set) {
17012 try {
17013 set = __webpack_require__(39)(Function.call, __webpack_require__(45).f(Object.prototype, '__proto__').set, 2);
17014 set(test, []);
17015 buggy = !(test instanceof Array);
17016 } catch (e) { buggy = true; }
17017 return function setPrototypeOf(O, proto) {
17018 check(O, proto);
17019 if (buggy) O.__proto__ = proto;
17020 else set(O, proto);
17021 return O;
17022 };
17023 }({}, false) : undefined),
17024 check: check
17025};
17026
17027
17028/***/ }),
17029/* 78 */
17030/***/ (function(module, exports, __webpack_require__) {
17031
17032// 19.1.3.19 Object.setPrototypeOf(O, proto)
17033var $export = __webpack_require__(8);
17034$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(77).set });
17035
17036
17037/***/ }),
17038/* 79 */
17039/***/ (function(module, exports, __webpack_require__) {
17040
17041__webpack_require__(78);
17042module.exports = __webpack_require__(2).Object.setPrototypeOf;
17043
17044
17045/***/ }),
17046/* 80 */
17047/***/ (function(module, exports, __webpack_require__) {
17048
17049module.exports = { "default": __webpack_require__(79), __esModule: true };
17050
17051/***/ }),
17052/* 81 */
17053/***/ (function(module, exports, __webpack_require__) {
17054
17055__webpack_require__(27)('observable');
17056
17057
17058/***/ }),
17059/* 82 */
17060/***/ (function(module, exports, __webpack_require__) {
17061
17062__webpack_require__(27)('asyncIterator');
17063
17064
17065/***/ }),
17066/* 83 */
17067/***/ (function(module, exports) {
17068
17069
17070
17071/***/ }),
17072/* 84 */
17073/***/ (function(module, exports, __webpack_require__) {
17074
17075// 7.2.2 IsArray(argument)
17076var cof = __webpack_require__(34);
17077module.exports = Array.isArray || function isArray(arg) {
17078 return cof(arg) == 'Array';
17079};
17080
17081
17082/***/ }),
17083/* 85 */
17084/***/ (function(module, exports, __webpack_require__) {
17085
17086// all enumerable object keys, includes symbols
17087var getKeys = __webpack_require__(18);
17088var gOPS = __webpack_require__(26);
17089var pIE = __webpack_require__(21);
17090module.exports = function (it) {
17091 var result = getKeys(it);
17092 var getSymbols = gOPS.f;
17093 if (getSymbols) {
17094 var symbols = getSymbols(it);
17095 var isEnum = pIE.f;
17096 var i = 0;
17097 var key;
17098 while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
17099 } return result;
17100};
17101
17102
17103/***/ }),
17104/* 86 */
17105/***/ (function(module, exports, __webpack_require__) {
17106
17107"use strict";
17108
17109// ECMAScript 6 symbols shim
17110var global = __webpack_require__(7);
17111var has = __webpack_require__(9);
17112var DESCRIPTORS = __webpack_require__(10);
17113var $export = __webpack_require__(8);
17114var redefine = __webpack_require__(55);
17115var META = __webpack_require__(57).KEY;
17116var $fails = __webpack_require__(15);
17117var shared = __webpack_require__(32);
17118var setToStringTag = __webpack_require__(30);
17119var uid = __webpack_require__(25);
17120var wks = __webpack_require__(5);
17121var wksExt = __webpack_require__(28);
17122var wksDefine = __webpack_require__(27);
17123var enumKeys = __webpack_require__(85);
17124var isArray = __webpack_require__(84);
17125var anObject = __webpack_require__(12);
17126var isObject = __webpack_require__(11);
17127var toIObject = __webpack_require__(13);
17128var toPrimitive = __webpack_require__(38);
17129var createDesc = __webpack_require__(19);
17130var _create = __webpack_require__(35);
17131var gOPNExt = __webpack_require__(47);
17132var $GOPD = __webpack_require__(45);
17133var $DP = __webpack_require__(6);
17134var $keys = __webpack_require__(18);
17135var gOPD = $GOPD.f;
17136var dP = $DP.f;
17137var gOPN = gOPNExt.f;
17138var $Symbol = global.Symbol;
17139var $JSON = global.JSON;
17140var _stringify = $JSON && $JSON.stringify;
17141var PROTOTYPE = 'prototype';
17142var HIDDEN = wks('_hidden');
17143var TO_PRIMITIVE = wks('toPrimitive');
17144var isEnum = {}.propertyIsEnumerable;
17145var SymbolRegistry = shared('symbol-registry');
17146var AllSymbols = shared('symbols');
17147var OPSymbols = shared('op-symbols');
17148var ObjectProto = Object[PROTOTYPE];
17149var USE_NATIVE = typeof $Symbol == 'function';
17150var QObject = global.QObject;
17151// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
17152var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
17153
17154// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
17155var setSymbolDesc = DESCRIPTORS && $fails(function () {
17156 return _create(dP({}, 'a', {
17157 get: function () { return dP(this, 'a', { value: 7 }).a; }
17158 })).a != 7;
17159}) ? function (it, key, D) {
17160 var protoDesc = gOPD(ObjectProto, key);
17161 if (protoDesc) delete ObjectProto[key];
17162 dP(it, key, D);
17163 if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
17164} : dP;
17165
17166var wrap = function (tag) {
17167 var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
17168 sym._k = tag;
17169 return sym;
17170};
17171
17172var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
17173 return typeof it == 'symbol';
17174} : function (it) {
17175 return it instanceof $Symbol;
17176};
17177
17178var $defineProperty = function defineProperty(it, key, D) {
17179 if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
17180 anObject(it);
17181 key = toPrimitive(key, true);
17182 anObject(D);
17183 if (has(AllSymbols, key)) {
17184 if (!D.enumerable) {
17185 if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
17186 it[HIDDEN][key] = true;
17187 } else {
17188 if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
17189 D = _create(D, { enumerable: createDesc(0, false) });
17190 } return setSymbolDesc(it, key, D);
17191 } return dP(it, key, D);
17192};
17193var $defineProperties = function defineProperties(it, P) {
17194 anObject(it);
17195 var keys = enumKeys(P = toIObject(P));
17196 var i = 0;
17197 var l = keys.length;
17198 var key;
17199 while (l > i) $defineProperty(it, key = keys[i++], P[key]);
17200 return it;
17201};
17202var $create = function create(it, P) {
17203 return P === undefined ? _create(it) : $defineProperties(_create(it), P);
17204};
17205var $propertyIsEnumerable = function propertyIsEnumerable(key) {
17206 var E = isEnum.call(this, key = toPrimitive(key, true));
17207 if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
17208 return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
17209};
17210var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
17211 it = toIObject(it);
17212 key = toPrimitive(key, true);
17213 if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
17214 var D = gOPD(it, key);
17215 if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
17216 return D;
17217};
17218var $getOwnPropertyNames = function getOwnPropertyNames(it) {
17219 var names = gOPN(toIObject(it));
17220 var result = [];
17221 var i = 0;
17222 var key;
17223 while (names.length > i) {
17224 if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
17225 } return result;
17226};
17227var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
17228 var IS_OP = it === ObjectProto;
17229 var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
17230 var result = [];
17231 var i = 0;
17232 var key;
17233 while (names.length > i) {
17234 if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
17235 } return result;
17236};
17237
17238// 19.4.1.1 Symbol([description])
17239if (!USE_NATIVE) {
17240 $Symbol = function Symbol() {
17241 if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
17242 var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
17243 var $set = function (value) {
17244 if (this === ObjectProto) $set.call(OPSymbols, value);
17245 if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
17246 setSymbolDesc(this, tag, createDesc(1, value));
17247 };
17248 if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
17249 return wrap(tag);
17250 };
17251 redefine($Symbol[PROTOTYPE], 'toString', function toString() {
17252 return this._k;
17253 });
17254
17255 $GOPD.f = $getOwnPropertyDescriptor;
17256 $DP.f = $defineProperty;
17257 __webpack_require__(46).f = gOPNExt.f = $getOwnPropertyNames;
17258 __webpack_require__(21).f = $propertyIsEnumerable;
17259 __webpack_require__(26).f = $getOwnPropertySymbols;
17260
17261 if (DESCRIPTORS && !__webpack_require__(22)) {
17262 redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
17263 }
17264
17265 wksExt.f = function (name) {
17266 return wrap(wks(name));
17267 };
17268}
17269
17270$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
17271
17272for (var es6Symbols = (
17273 // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
17274 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
17275).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
17276
17277for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
17278
17279$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
17280 // 19.4.2.1 Symbol.for(key)
17281 'for': function (key) {
17282 return has(SymbolRegistry, key += '')
17283 ? SymbolRegistry[key]
17284 : SymbolRegistry[key] = $Symbol(key);
17285 },
17286 // 19.4.2.5 Symbol.keyFor(sym)
17287 keyFor: function keyFor(sym) {
17288 if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
17289 for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
17290 },
17291 useSetter: function () { setter = true; },
17292 useSimple: function () { setter = false; }
17293});
17294
17295$export($export.S + $export.F * !USE_NATIVE, 'Object', {
17296 // 19.1.2.2 Object.create(O [, Properties])
17297 create: $create,
17298 // 19.1.2.4 Object.defineProperty(O, P, Attributes)
17299 defineProperty: $defineProperty,
17300 // 19.1.2.3 Object.defineProperties(O, Properties)
17301 defineProperties: $defineProperties,
17302 // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
17303 getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
17304 // 19.1.2.7 Object.getOwnPropertyNames(O)
17305 getOwnPropertyNames: $getOwnPropertyNames,
17306 // 19.1.2.8 Object.getOwnPropertySymbols(O)
17307 getOwnPropertySymbols: $getOwnPropertySymbols
17308});
17309
17310// 24.3.2 JSON.stringify(value [, replacer [, space]])
17311$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
17312 var S = $Symbol();
17313 // MS Edge converts symbol values to JSON as {}
17314 // WebKit converts symbol values to JSON as null
17315 // V8 throws on boxed symbols
17316 return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
17317})), 'JSON', {
17318 stringify: function stringify(it) {
17319 var args = [it];
17320 var i = 1;
17321 var replacer, $replacer;
17322 while (arguments.length > i) args.push(arguments[i++]);
17323 $replacer = replacer = args[1];
17324 if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
17325 if (!isArray(replacer)) replacer = function (key, value) {
17326 if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
17327 if (!isSymbol(value)) return value;
17328 };
17329 args[1] = replacer;
17330 return _stringify.apply($JSON, args);
17331 }
17332});
17333
17334// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
17335$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(16)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
17336// 19.4.3.5 Symbol.prototype[@@toStringTag]
17337setToStringTag($Symbol, 'Symbol');
17338// 20.2.1.9 Math[@@toStringTag]
17339setToStringTag(Math, 'Math', true);
17340// 24.3.3 JSON[@@toStringTag]
17341setToStringTag(global.JSON, 'JSON', true);
17342
17343
17344/***/ }),
17345/* 87 */
17346/***/ (function(module, exports, __webpack_require__) {
17347
17348__webpack_require__(86);
17349__webpack_require__(83);
17350__webpack_require__(82);
17351__webpack_require__(81);
17352module.exports = __webpack_require__(2).Symbol;
17353
17354
17355/***/ }),
17356/* 88 */
17357/***/ (function(module, exports, __webpack_require__) {
17358
17359module.exports = { "default": __webpack_require__(87), __esModule: true };
17360
17361/***/ }),
17362/* 89 */
17363/***/ (function(module, exports, __webpack_require__) {
17364
17365__webpack_require__(23);
17366__webpack_require__(29);
17367module.exports = __webpack_require__(28).f('iterator');
17368
17369
17370/***/ }),
17371/* 90 */
17372/***/ (function(module, exports, __webpack_require__) {
17373
17374module.exports = { "default": __webpack_require__(89), __esModule: true };
17375
17376/***/ }),
17377/* 91 */
17378/***/ (function(module, exports, __webpack_require__) {
17379
17380// 19.1.2.9 Object.getPrototypeOf(O)
17381var toObject = __webpack_require__(17);
17382var $getPrototypeOf = __webpack_require__(51);
17383
17384__webpack_require__(24)('getPrototypeOf', function () {
17385 return function getPrototypeOf(it) {
17386 return $getPrototypeOf(toObject(it));
17387 };
17388});
17389
17390
17391/***/ }),
17392/* 92 */
17393/***/ (function(module, exports, __webpack_require__) {
17394
17395__webpack_require__(91);
17396module.exports = __webpack_require__(2).Object.getPrototypeOf;
17397
17398
17399/***/ }),
17400/* 93 */
17401/***/ (function(module, exports, __webpack_require__) {
17402
17403var classof = __webpack_require__(49);
17404var ITERATOR = __webpack_require__(5)('iterator');
17405var Iterators = __webpack_require__(14);
17406module.exports = __webpack_require__(2).isIterable = function (it) {
17407 var O = Object(it);
17408 return O[ITERATOR] !== undefined
17409 || '@@iterator' in O
17410 // eslint-disable-next-line no-prototype-builtins
17411 || Iterators.hasOwnProperty(classof(O));
17412};
17413
17414
17415/***/ }),
17416/* 94 */
17417/***/ (function(module, exports, __webpack_require__) {
17418
17419__webpack_require__(29);
17420__webpack_require__(23);
17421module.exports = __webpack_require__(93);
17422
17423
17424/***/ }),
17425/* 95 */
17426/***/ (function(module, exports, __webpack_require__) {
17427
17428module.exports = { "default": __webpack_require__(94), __esModule: true };
17429
17430/***/ }),
17431/* 96 */
17432/***/ (function(module, exports, __webpack_require__) {
17433
17434var anObject = __webpack_require__(12);
17435var get = __webpack_require__(50);
17436module.exports = __webpack_require__(2).getIterator = function (it) {
17437 var iterFn = get(it);
17438 if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');
17439 return anObject(iterFn.call(it));
17440};
17441
17442
17443/***/ }),
17444/* 97 */
17445/***/ (function(module, exports) {
17446
17447module.exports = function (done, value) {
17448 return { value: value, done: !!done };
17449};
17450
17451
17452/***/ }),
17453/* 98 */
17454/***/ (function(module, exports) {
17455
17456module.exports = function () { /* empty */ };
17457
17458
17459/***/ }),
17460/* 99 */
17461/***/ (function(module, exports, __webpack_require__) {
17462
17463"use strict";
17464
17465var addToUnscopables = __webpack_require__(98);
17466var step = __webpack_require__(97);
17467var Iterators = __webpack_require__(14);
17468var toIObject = __webpack_require__(13);
17469
17470// 22.1.3.4 Array.prototype.entries()
17471// 22.1.3.13 Array.prototype.keys()
17472// 22.1.3.29 Array.prototype.values()
17473// 22.1.3.30 Array.prototype[@@iterator]()
17474module.exports = __webpack_require__(56)(Array, 'Array', function (iterated, kind) {
17475 this._t = toIObject(iterated); // target
17476 this._i = 0; // next index
17477 this._k = kind; // kind
17478// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
17479}, function () {
17480 var O = this._t;
17481 var kind = this._k;
17482 var index = this._i++;
17483 if (!O || index >= O.length) {
17484 this._t = undefined;
17485 return step(1);
17486 }
17487 if (kind == 'keys') return step(0, index);
17488 if (kind == 'values') return step(0, O[index]);
17489 return step(0, [index, O[index]]);
17490}, 'values');
17491
17492// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
17493Iterators.Arguments = Iterators.Array;
17494
17495addToUnscopables('keys');
17496addToUnscopables('values');
17497addToUnscopables('entries');
17498
17499
17500/***/ }),
17501/* 100 */
17502/***/ (function(module, exports, __webpack_require__) {
17503
17504__webpack_require__(29);
17505__webpack_require__(23);
17506module.exports = __webpack_require__(96);
17507
17508
17509/***/ }),
17510/* 101 */
17511/***/ (function(module, exports, __webpack_require__) {
17512
17513var ITERATOR = __webpack_require__(5)('iterator');
17514var SAFE_CLOSING = false;
17515
17516try {
17517 var riter = [7][ITERATOR]();
17518 riter['return'] = function () { SAFE_CLOSING = true; };
17519 // eslint-disable-next-line no-throw-literal
17520 Array.from(riter, function () { throw 2; });
17521} catch (e) { /* empty */ }
17522
17523module.exports = function (exec, skipClosing) {
17524 if (!skipClosing && !SAFE_CLOSING) return false;
17525 var safe = false;
17526 try {
17527 var arr = [7];
17528 var iter = arr[ITERATOR]();
17529 iter.next = function () { return { done: safe = true }; };
17530 arr[ITERATOR] = function () { return iter; };
17531 exec(arr);
17532 } catch (e) { /* empty */ }
17533 return safe;
17534};
17535
17536
17537/***/ }),
17538/* 102 */
17539/***/ (function(module, exports, __webpack_require__) {
17540
17541"use strict";
17542
17543var $defineProperty = __webpack_require__(6);
17544var createDesc = __webpack_require__(19);
17545
17546module.exports = function (object, index, value) {
17547 if (index in object) $defineProperty.f(object, index, createDesc(0, value));
17548 else object[index] = value;
17549};
17550
17551
17552/***/ }),
17553/* 103 */
17554/***/ (function(module, exports, __webpack_require__) {
17555
17556// check on default Array iterator
17557var Iterators = __webpack_require__(14);
17558var ITERATOR = __webpack_require__(5)('iterator');
17559var ArrayProto = Array.prototype;
17560
17561module.exports = function (it) {
17562 return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
17563};
17564
17565
17566/***/ }),
17567/* 104 */
17568/***/ (function(module, exports, __webpack_require__) {
17569
17570// call something on iterator step with safe closing on error
17571var anObject = __webpack_require__(12);
17572module.exports = function (iterator, fn, value, entries) {
17573 try {
17574 return entries ? fn(anObject(value)[0], value[1]) : fn(value);
17575 // 7.4.6 IteratorClose(iterator, completion)
17576 } catch (e) {
17577 var ret = iterator['return'];
17578 if (ret !== undefined) anObject(ret.call(iterator));
17579 throw e;
17580 }
17581};
17582
17583
17584/***/ }),
17585/* 105 */
17586/***/ (function(module, exports, __webpack_require__) {
17587
17588"use strict";
17589
17590var ctx = __webpack_require__(39);
17591var $export = __webpack_require__(8);
17592var toObject = __webpack_require__(17);
17593var call = __webpack_require__(104);
17594var isArrayIter = __webpack_require__(103);
17595var toLength = __webpack_require__(52);
17596var createProperty = __webpack_require__(102);
17597var getIterFn = __webpack_require__(50);
17598
17599$export($export.S + $export.F * !__webpack_require__(101)(function (iter) { Array.from(iter); }), 'Array', {
17600 // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
17601 from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
17602 var O = toObject(arrayLike);
17603 var C = typeof this == 'function' ? this : Array;
17604 var aLen = arguments.length;
17605 var mapfn = aLen > 1 ? arguments[1] : undefined;
17606 var mapping = mapfn !== undefined;
17607 var index = 0;
17608 var iterFn = getIterFn(O);
17609 var length, result, step, iterator;
17610 if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
17611 // if object isn't iterable or it's array with default iterator - use simple case
17612 if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
17613 for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
17614 createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
17615 }
17616 } else {
17617 length = toLength(O.length);
17618 for (result = new C(length); length > index; index++) {
17619 createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
17620 }
17621 }
17622 result.length = index;
17623 return result;
17624 }
17625});
17626
17627
17628/***/ }),
17629/* 106 */
17630/***/ (function(module, exports, __webpack_require__) {
17631
17632var document = __webpack_require__(7).document;
17633module.exports = document && document.documentElement;
17634
17635
17636/***/ }),
17637/* 107 */
17638/***/ (function(module, exports, __webpack_require__) {
17639
17640var toInteger = __webpack_require__(37);
17641var max = Math.max;
17642var min = Math.min;
17643module.exports = function (index, length) {
17644 index = toInteger(index);
17645 return index < 0 ? max(index + length, 0) : min(index, length);
17646};
17647
17648
17649/***/ }),
17650/* 108 */
17651/***/ (function(module, exports, __webpack_require__) {
17652
17653// false -> Array#indexOf
17654// true -> Array#includes
17655var toIObject = __webpack_require__(13);
17656var toLength = __webpack_require__(52);
17657var toAbsoluteIndex = __webpack_require__(107);
17658module.exports = function (IS_INCLUDES) {
17659 return function ($this, el, fromIndex) {
17660 var O = toIObject($this);
17661 var length = toLength(O.length);
17662 var index = toAbsoluteIndex(fromIndex, length);
17663 var value;
17664 // Array#includes uses SameValueZero equality algorithm
17665 // eslint-disable-next-line no-self-compare
17666 if (IS_INCLUDES && el != el) while (length > index) {
17667 value = O[index++];
17668 // eslint-disable-next-line no-self-compare
17669 if (value != value) return true;
17670 // Array#indexOf ignores holes, Array#includes - not
17671 } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
17672 if (O[index] === el) return IS_INCLUDES || index || 0;
17673 } return !IS_INCLUDES && -1;
17674 };
17675};
17676
17677
17678/***/ }),
17679/* 109 */
17680/***/ (function(module, exports, __webpack_require__) {
17681
17682var dP = __webpack_require__(6);
17683var anObject = __webpack_require__(12);
17684var getKeys = __webpack_require__(18);
17685
17686module.exports = __webpack_require__(10) ? Object.defineProperties : function defineProperties(O, Properties) {
17687 anObject(O);
17688 var keys = getKeys(Properties);
17689 var length = keys.length;
17690 var i = 0;
17691 var P;
17692 while (length > i) dP.f(O, P = keys[i++], Properties[P]);
17693 return O;
17694};
17695
17696
17697/***/ }),
17698/* 110 */
17699/***/ (function(module, exports, __webpack_require__) {
17700
17701"use strict";
17702
17703var create = __webpack_require__(35);
17704var descriptor = __webpack_require__(19);
17705var setToStringTag = __webpack_require__(30);
17706var IteratorPrototype = {};
17707
17708// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
17709__webpack_require__(16)(IteratorPrototype, __webpack_require__(5)('iterator'), function () { return this; });
17710
17711module.exports = function (Constructor, NAME, next) {
17712 Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
17713 setToStringTag(Constructor, NAME + ' Iterator');
17714};
17715
17716
17717/***/ }),
17718/* 111 */
17719/***/ (function(module, exports, __webpack_require__) {
17720
17721var toInteger = __webpack_require__(37);
17722var defined = __webpack_require__(36);
17723// true -> String#at
17724// false -> String#codePointAt
17725module.exports = function (TO_STRING) {
17726 return function (that, pos) {
17727 var s = String(defined(that));
17728 var i = toInteger(pos);
17729 var l = s.length;
17730 var a, b;
17731 if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
17732 a = s.charCodeAt(i);
17733 return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
17734 ? TO_STRING ? s.charAt(i) : a
17735 : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
17736 };
17737};
17738
17739
17740/***/ }),
17741/* 112 */
17742/***/ (function(module, exports, __webpack_require__) {
17743
17744__webpack_require__(23);
17745__webpack_require__(105);
17746module.exports = __webpack_require__(2).Array.from;
17747
17748
17749/***/ }),
17750/* 113 */
17751/***/ (function(module, exports, __webpack_require__) {
17752
17753module.exports = { "default": __webpack_require__(112), __esModule: true };
17754
17755/***/ }),
17756/* 114 */
17757/***/ (function(module, exports, __webpack_require__) {
17758
17759var core = __webpack_require__(2);
17760var $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });
17761module.exports = function stringify(it) { // eslint-disable-line no-unused-vars
17762 return $JSON.stringify.apply($JSON, arguments);
17763};
17764
17765
17766/***/ }),
17767/* 115 */
17768/***/ (function(module, exports, __webpack_require__) {
17769
17770// 19.1.2.5 Object.freeze(O)
17771var isObject = __webpack_require__(11);
17772var meta = __webpack_require__(57).onFreeze;
17773
17774__webpack_require__(24)('freeze', function ($freeze) {
17775 return function freeze(it) {
17776 return $freeze && isObject(it) ? $freeze(meta(it)) : it;
17777 };
17778});
17779
17780
17781/***/ }),
17782/* 116 */
17783/***/ (function(module, exports, __webpack_require__) {
17784
17785__webpack_require__(115);
17786module.exports = __webpack_require__(2).Object.freeze;
17787
17788
17789/***/ }),
17790/* 117 */
17791/***/ (function(module, exports) {
17792
17793module.exports = function (it) {
17794 if (typeof it != 'function') throw TypeError(it + ' is not a function!');
17795 return it;
17796};
17797
17798
17799/***/ }),
17800/* 118 */
17801/***/ (function(module, exports, __webpack_require__) {
17802
17803var $export = __webpack_require__(8);
17804// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
17805$export($export.S + $export.F * !__webpack_require__(10), 'Object', { defineProperty: __webpack_require__(6).f });
17806
17807
17808/***/ }),
17809/* 119 */
17810/***/ (function(module, exports, __webpack_require__) {
17811
17812__webpack_require__(118);
17813var $Object = __webpack_require__(2).Object;
17814module.exports = function defineProperty(it, key, desc) {
17815 return $Object.defineProperty(it, key, desc);
17816};
17817
17818
17819/***/ }),
17820/* 120 */
17821/***/ (function(module, exports, __webpack_require__) {
17822
17823module.exports = { "default": __webpack_require__(119), __esModule: true };
17824
17825/***/ }),
17826/* 121 */,
17827/* 122 */
17828/***/ (function(module, exports, __webpack_require__) {
17829
17830// extracted by mini-css-extract-plugin
17831
17832/***/ })
17833/******/ ])["default"];
17834});