Update katex to v0.16.21

master
Will Faught 6 months ago
parent d663b8aa90
commit 3ac8d7b9b8

@ -55,13 +55,14 @@
}
},
"node_modules/katex": {
"version": "0.16.10",
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.10.tgz",
"integrity": "sha512-ZiqaC04tp2O5utMsl2TEZTXxa6WSC4yo0fv5ML++D3QZv/vx2Mct0mTlRx3O+uUkjfuAgOkzsCmq5MiUEsDDdA==",
"version": "0.16.21",
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.21.tgz",
"integrity": "sha512-XvqR7FgOHtWupfMiigNzmh+MgUVmDGU2kXZm899ZkPfcuoPuFxyHmXsgATDpFZDAXCI8tvinaVcDo8PIIJSo4A==",
"funding": [
"https://opencollective.com/katex",
"https://github.com/sponsors/katex"
],
"license": "MIT",
"dependencies": {
"commander": "^8.3.0"
},

@ -37,13 +37,13 @@ Try out KaTeX [on the demo page](https://katex.org/#demo)!
<!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
<html>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.css" integrity="sha384-wcIxkf4k558AjM3Yz3BBFQUbk/zgIYC2R0QpeeYb+TwlBVMrlgLqwRjRtGZiK7ww" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.css" integrity="sha384-zh0CIslj+VczCZtlzBcjt5ppRcsAmDnRem7ESsYwWwg3m/OaJ2l4x7YBZl9Kxxib" crossorigin="anonymous">
<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.js" integrity="sha384-hIoBPJpTUs74ddyc4bFZSM1TVlQDA60VBbJS0oA934VSz82sBx1X7kSx2ATBDIyd" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.js" integrity="sha384-Rma6DA2IPUwhNxmrB/7S3Tno0YY7sFu9WSYMCuulLhIqYSGZ2gKCJWIqhBWqMQfh" crossorigin="anonymous"></script>
<!-- To automatically render math in text elements, include the auto-render extension: -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous"
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/contrib/auto-render.min.js" integrity="sha384-hCXGrW6PitJEwbkoStFjeJxv+fSOOQKOPbJxSfM6G5sWZjAyWhXiTIIAmQqnlLlh" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>
</head>
...

@ -18,7 +18,7 @@ This extension isn't part of KaTeX proper, so the script should be separately
included in the page.
```html
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/copy-tex.min.js" integrity="sha384-HORx6nWi8j5/mYA+y57/9/CZc5z8HnEw4WUZWy5yOn9ToKBv1l58vJaufFAn9Zzi" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/contrib/copy-tex.min.js" integrity="sha384-HORx6nWi8j5/mYA+y57/9/CZc5z8HnEw4WUZWy5yOn9ToKBv1l58vJaufFAn9Zzi" crossorigin="anonymous"></script>
```
(Note that, as of KaTeX 0.16.0, there is no longer a corresponding CSS file.)
@ -35,5 +35,5 @@ statement with `require('katex/contrib/copy-tex/katex2tex.js')`.
ECMAScript module is also available:
```html
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/copy-tex.mjs" integrity="sha384-bVEnwt0PtX+1EuJoOEcm4rgTUWvb2ILTdjHfI1gUe/r5fdqrTcQaUuRdHG2DciuQ" crossorigin="anonymous"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/contrib/copy-tex.mjs" integrity="sha384-bVEnwt0PtX+1EuJoOEcm4rgTUWvb2ILTdjHfI1gUe/r5fdqrTcQaUuRdHG2DciuQ" crossorigin="anonymous"></script>
```

@ -11,7 +11,7 @@ included in the page, in addition to KaTeX.
Load the extension by adding the following line to your HTML file.
```html
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/mathtex-script-type.min.js" integrity="sha384-OGHJvxKrLNowXjZcg7A8ziPZctl4h7FncefPoKSuxgVXFxeM87GCKFJvOaTeBB9q" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/contrib/mathtex-script-type.min.js" integrity="sha384-sg4gBRJTqTCyzYbB7e72xGs3dA2LK994XRZS6urZW6Uh6Mu3j2JJ3YG2s9HALO8U" crossorigin="anonymous"></script>
```
You can download the script and use it locally, or from a local KaTeX installation instead.
@ -23,9 +23,9 @@ Then, in the body, we use a `math/tex` script to typeset the equation `x+\sqrt{1
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.css" integrity="sha384-wcIxkf4k558AjM3Yz3BBFQUbk/zgIYC2R0QpeeYb+TwlBVMrlgLqwRjRtGZiK7ww" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.js" integrity="sha384-hIoBPJpTUs74ddyc4bFZSM1TVlQDA60VBbJS0oA934VSz82sBx1X7kSx2ATBDIyd" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/mathtex-script-type.min.js" integrity="sha384-OGHJvxKrLNowXjZcg7A8ziPZctl4h7FncefPoKSuxgVXFxeM87GCKFJvOaTeBB9q" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.css" integrity="sha384-zh0CIslj+VczCZtlzBcjt5ppRcsAmDnRem7ESsYwWwg3m/OaJ2l4x7YBZl9Kxxib" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.js" integrity="sha384-Rma6DA2IPUwhNxmrB/7S3Tno0YY7sFu9WSYMCuulLhIqYSGZ2gKCJWIqhBWqMQfh" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/contrib/mathtex-script-type.min.js" integrity="sha384-sg4gBRJTqTCyzYbB7e72xGs3dA2LK994XRZS6urZW6Uh6Mu3j2JJ3YG2s9HALO8U" crossorigin="anonymous"></script>
</head>
<body>
<script type="math/tex">x+\sqrt{1-x^2}</script>
@ -35,4 +35,4 @@ Then, in the body, we use a `math/tex` script to typeset the equation `x+\sqrt{1
ECMAScript module is also available:
```html
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/mathtex-script-type.mjs" integrity="sha384-4EJvC5tvqq9XJxXvdD4JutBokuFw/dCe2AB4gZ9sRpwFFXECpL3qT43tmE0PkpVg" crossorigin="anonymous"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/contrib/mathtex-script-type.mjs" integrity="sha384-4EJvC5tvqq9XJxXvdD4JutBokuFw/dCe2AB4gZ9sRpwFFXECpL3qT43tmE0PkpVg" crossorigin="anonymous"></script>

@ -7,7 +7,7 @@ This extension adds to KaTeX the `\ce` and `\pu` functions from the [mhchem](htt
This extension isn't part of core KaTeX, so the script should be separately included. Write the following line into the HTML page's `<head>`. Place it *after* the line that calls `katex.js`, and if you make use of the [auto-render](https://katex.org/docs/autorender.html) extension, place it *before* the line that calls `auto-render.js`.
```html
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/mhchem.min.js" integrity="sha384-ifpG+NlgMq0kvOSGqGQxW1mJKpjjMDmZdpKGq3tbvD3WPhyshCEEYClriK/wRVU0" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/contrib/mhchem.min.js" integrity="sha384-F2ptQFZqNJuqfGGl28mIXyQ5kXH48spn7rcoS0Y9psqIKAcZPLd1NzwFlm/bl1mH" crossorigin="anonymous"></script>
```
If you remove the `defer` attribute from this tag, then you must also remove the `defer` attribute from the `<script src="https://../katex.min.js">` tag.

@ -37,13 +37,13 @@ Try out KaTeX [on the demo page](https://katex.org/#demo)!
<!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
<html>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.css" integrity="sha384-wcIxkf4k558AjM3Yz3BBFQUbk/zgIYC2R0QpeeYb+TwlBVMrlgLqwRjRtGZiK7ww" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.css" integrity="sha384-zh0CIslj+VczCZtlzBcjt5ppRcsAmDnRem7ESsYwWwg3m/OaJ2l4x7YBZl9Kxxib" crossorigin="anonymous">
<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.js" integrity="sha384-hIoBPJpTUs74ddyc4bFZSM1TVlQDA60VBbJS0oA934VSz82sBx1X7kSx2ATBDIyd" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.js" integrity="sha384-Rma6DA2IPUwhNxmrB/7S3Tno0YY7sFu9WSYMCuulLhIqYSGZ2gKCJWIqhBWqMQfh" crossorigin="anonymous"></script>
<!-- To automatically render math in text elements, include the auto-render extension: -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous"
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/contrib/auto-render.min.js" integrity="sha384-hCXGrW6PitJEwbkoStFjeJxv+fSOOQKOPbJxSfM6G5sWZjAyWhXiTIIAmQqnlLlh" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>
</head>
...

@ -7,15 +7,15 @@
exports["renderMathInElement"] = factory(require("katex"));
else
root["renderMathInElement"] = factory(root["katex"]);
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__771__) {
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__757__) {
return /******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ 771:
/***/ 757:
/***/ (function(module) {
module.exports = __WEBPACK_EXTERNAL_MODULE__771__;
module.exports = __WEBPACK_EXTERNAL_MODULE__757__;
/***/ })
@ -77,8 +77,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__771__;
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
!function() {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
@ -86,7 +84,7 @@ __webpack_require__.d(__webpack_exports__, {
});
// EXTERNAL MODULE: external "katex"
var external_katex_ = __webpack_require__(771);
var external_katex_ = __webpack_require__(757);
var external_katex_default = /*#__PURE__*/__webpack_require__.n(external_katex_);
;// CONCATENATED MODULE: ./contrib/auto-render/splitAtDelimiters.js
/* eslint no-constant-condition:0 */
@ -333,7 +331,6 @@ const renderMathInElement = function (elem, options) {
};
/* harmony default export */ var auto_render = (renderMathInElement);
}();
__webpack_exports__ = __webpack_exports__["default"];
/******/ return __webpack_exports__;
/******/ })()

@ -1 +1 @@
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};return function(){r.d(o,{default:function(){return d}});var e=r(771),t=r.n(e);const n=function(e,t,n){let r=n,o=0;const i=e.length;for(;r<t.length;){const n=t[r];if(o<=0&&t.slice(r,r+i)===e)return r;"\\"===n?r++:"{"===n?o++:"}"===n&&o--,r++}return-1},i=/^\\begin{/;var a=function(e,t){let r;const o=[],a=new RegExp("("+t.map((e=>e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))).join("|")+")");for(;r=e.search(a),-1!==r;){r>0&&(o.push({type:"text",data:e.slice(0,r)}),e=e.slice(r));const a=t.findIndex((t=>e.startsWith(t.left)));if(r=n(t[a].right,e,t[a].left.length),-1===r)break;const l=e.slice(0,r+t[a].right.length),s=i.test(l)?l:e.slice(t[a].left.length,r);o.push({type:"math",data:s,rawData:l,display:t[a].display}),e=e.slice(r+t[a].right.length)}return""!==e&&o.push({type:"text",data:e}),o};const l=function(e,n){const r=a(e,n.delimiters);if(1===r.length&&"text"===r[0].type)return null;const o=document.createDocumentFragment();for(let e=0;e<r.length;e++)if("text"===r[e].type)o.appendChild(document.createTextNode(r[e].data));else{const i=document.createElement("span");let a=r[e].data;n.displayMode=r[e].display;try{n.preProcess&&(a=n.preProcess(a)),t().render(a,i,n)}catch(i){if(!(i instanceof t().ParseError))throw i;n.errorCallback("KaTeX auto-render: Failed to parse `"+r[e].data+"` with ",i),o.appendChild(document.createTextNode(r[e].rawData));continue}o.appendChild(i)}return o},s=function(e,t){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(3===r.nodeType){let o=r.textContent,i=r.nextSibling,a=0;for(;i&&i.nodeType===Node.TEXT_NODE;)o+=i.textContent,i=i.nextSibling,a++;const s=l(o,t);if(s){for(let e=0;e<a;e++)r.nextSibling.remove();n+=s.childNodes.length-1,e.replaceChild(s,r)}else n+=a}else if(1===r.nodeType){const e=" "+r.className+" ";-1===t.ignoredTags.indexOf(r.nodeName.toLowerCase())&&t.ignoredClasses.every((t=>-1===e.indexOf(" "+t+" ")))&&s(r,t)}}};var d=function(e,t){if(!e)throw new Error("No element provided to render");const n={};for(const e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);n.delimiters=n.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],n.ignoredTags=n.ignoredTags||["script","noscript","style","textarea","pre","code","option"],n.ignoredClasses=n.ignoredClasses||[],n.errorCallback=n.errorCallback||console.error,n.macros=n.macros||{},s(e,n)}}(),o=o.default}()}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={757:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};r.d(o,{default:function(){return p}});var i=r(757),a=r.n(i);const l=function(e,t,n){let r=n,o=0;const i=e.length;for(;r<t.length;){const n=t[r];if(o<=0&&t.slice(r,r+i)===e)return r;"\\"===n?r++:"{"===n?o++:"}"===n&&o--,r++}return-1},s=/^\\begin{/;var d=function(e,t){let n;const r=[],o=new RegExp("("+t.map((e=>e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))).join("|")+")");for(;n=e.search(o),-1!==n;){n>0&&(r.push({type:"text",data:e.slice(0,n)}),e=e.slice(n));const o=t.findIndex((t=>e.startsWith(t.left)));if(n=l(t[o].right,e,t[o].left.length),-1===n)break;const i=e.slice(0,n+t[o].right.length),a=s.test(i)?i:e.slice(t[o].left.length,n);r.push({type:"math",data:a,rawData:i,display:t[o].display}),e=e.slice(n+t[o].right.length)}return""!==e&&r.push({type:"text",data:e}),r};const c=function(e,t){const n=d(e,t.delimiters);if(1===n.length&&"text"===n[0].type)return null;const r=document.createDocumentFragment();for(let e=0;e<n.length;e++)if("text"===n[e].type)r.appendChild(document.createTextNode(n[e].data));else{const o=document.createElement("span");let i=n[e].data;t.displayMode=n[e].display;try{t.preProcess&&(i=t.preProcess(i)),a().render(i,o,t)}catch(o){if(!(o instanceof a().ParseError))throw o;t.errorCallback("KaTeX auto-render: Failed to parse `"+n[e].data+"` with ",o),r.appendChild(document.createTextNode(n[e].rawData));continue}r.appendChild(o)}return r},f=function(e,t){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(3===r.nodeType){let o=r.textContent,i=r.nextSibling,a=0;for(;i&&i.nodeType===Node.TEXT_NODE;)o+=i.textContent,i=i.nextSibling,a++;const l=c(o,t);if(l){for(let e=0;e<a;e++)r.nextSibling.remove();n+=l.childNodes.length-1,e.replaceChild(l,r)}else n+=a}else if(1===r.nodeType){const e=" "+r.className+" ";-1===t.ignoredTags.indexOf(r.nodeName.toLowerCase())&&t.ignoredClasses.every((t=>-1===e.indexOf(" "+t+" ")))&&f(r,t)}}};var p=function(e,t){if(!e)throw new Error("No element provided to render");const n={};for(const e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);n.delimiters=n.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],n.ignoredTags=n.ignoredTags||["script","noscript","style","textarea","pre","code","option"],n.ignoredClasses=n.ignoredClasses||[],n.errorCallback=n.errorCallback||console.error,n.macros=n.macros||{},f(e,n)};return o=o.default}()}));

@ -7,15 +7,15 @@
var a = typeof exports === 'object' ? factory(require("katex")) : factory(root["katex"]);
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
}
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__771__) {
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__757__) {
return /******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ 771:
/***/ 757:
/***/ (function(module) {
module.exports = __WEBPACK_EXTERNAL_MODULE__771__;
module.exports = __WEBPACK_EXTERNAL_MODULE__757__;
/***/ })
@ -77,9 +77,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__771__;
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
!function() {
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(771);
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(757);
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_0__);
let scripts = document.body.getElementsByTagName("script");
@ -104,7 +102,6 @@ scripts.forEach(function (script) {
script.parentNode.replaceChild(katexElement, script);
});
}();
__webpack_exports__ = __webpack_exports__["default"];
/******/ return __webpack_exports__;
/******/ })()

@ -1 +1 @@
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],t);else{var n="object"==typeof exports?t(require("katex")):t(e.katex);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};return function(){var e=r(771),t=r.n(e);let n=document.body.getElementsByTagName("script");n=Array.prototype.slice.call(n),n.forEach((function(e){if(!e.type||!e.type.match(/math\/tex/i))return-1;const n=null!=e.type.match(/mode\s*=\s*display(;|\s|\n|$)/),r=document.createElement(n?"div":"span");r.setAttribute("class",n?"equation":"inline-equation");try{t().render(e.text,r,{displayMode:n})}catch(t){r.textContent=e.text}e.parentNode.replaceChild(r,e)}))}(),o=o.default}()}));
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],t);else{var n="object"==typeof exports?t(require("katex")):t(e.katex);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={757:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={},i=r(757),a=r.n(i);let u=document.body.getElementsByTagName("script");return u=Array.prototype.slice.call(u),u.forEach((function(e){if(!e.type||!e.type.match(/math\/tex/i))return-1;const t=null!=e.type.match(/mode\s*=\s*display(;|\s|\n|$)/),n=document.createElement(t?"div":"span");n.setAttribute("class",t?"equation":"inline-equation");try{a().render(e.text,n,{displayMode:t})}catch(t){n.textContent=e.text}e.parentNode.replaceChild(n,e)})),o=o.default}()}));

@ -7,15 +7,15 @@
var a = typeof exports === 'object' ? factory(require("katex")) : factory(root["katex"]);
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
}
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__771__) {
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__757__) {
return /******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ 771:
/***/ 757:
/***/ (function(module) {
module.exports = __WEBPACK_EXTERNAL_MODULE__771__;
module.exports = __WEBPACK_EXTERNAL_MODULE__757__;
/***/ })
@ -77,9 +77,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__771__;
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
!function() {
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(771);
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(757);
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_0__);
/* eslint-disable */
@ -3208,7 +3206,6 @@ function assertNever(a) {}
function assertString(a) {}
}();
__webpack_exports__ = __webpack_exports__["default"];
/******/ return __webpack_exports__;
/******/ })()

File diff suppressed because one or more lines are too long

@ -7,15 +7,15 @@
var a = typeof exports === 'object' ? factory(require("katex")) : factory(root["katex"]);
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
}
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__771__) {
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__757__) {
return /******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ 771:
/***/ 757:
/***/ (function(module) {
module.exports = __WEBPACK_EXTERNAL_MODULE__771__;
module.exports = __WEBPACK_EXTERNAL_MODULE__757__;
/***/ })
@ -77,9 +77,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__771__;
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
!function() {
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(771);
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(757);
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_0__);
/**
* renderA11yString returns a readable string.
@ -882,7 +880,6 @@ const renderA11yString = function (text, settings) {
};
/* harmony default export */ __webpack_exports__["default"] = (renderA11yString);
}();
__webpack_exports__ = __webpack_exports__["default"];
/******/ return __webpack_exports__;
/******/ })()

File diff suppressed because one or more lines are too long

@ -1,121 +1,121 @@
/* stylelint-disable font-family-no-missing-generic-family-keyword */
@font-face {
font-family: 'KaTeX_AMS';
src: url(fonts/KaTeX_AMS-Regular.woff2) format('woff2'), url(fonts/KaTeX_AMS-Regular.woff) format('woff'), url(fonts/KaTeX_AMS-Regular.ttf) format('truetype');
font-family: "KaTeX_AMS";
src: url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"), url(fonts/KaTeX_AMS-Regular.woff) format("woff"), url(fonts/KaTeX_AMS-Regular.ttf) format("truetype");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'KaTeX_Caligraphic';
src: url(fonts/KaTeX_Caligraphic-Bold.woff2) format('woff2'), url(fonts/KaTeX_Caligraphic-Bold.woff) format('woff'), url(fonts/KaTeX_Caligraphic-Bold.ttf) format('truetype');
font-family: "KaTeX_Caligraphic";
src: url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"), url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"), url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype");
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'KaTeX_Caligraphic';
src: url(fonts/KaTeX_Caligraphic-Regular.woff2) format('woff2'), url(fonts/KaTeX_Caligraphic-Regular.woff) format('woff'), url(fonts/KaTeX_Caligraphic-Regular.ttf) format('truetype');
font-family: "KaTeX_Caligraphic";
src: url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"), url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"), url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'KaTeX_Fraktur';
src: url(fonts/KaTeX_Fraktur-Bold.woff2) format('woff2'), url(fonts/KaTeX_Fraktur-Bold.woff) format('woff'), url(fonts/KaTeX_Fraktur-Bold.ttf) format('truetype');
font-family: "KaTeX_Fraktur";
src: url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"), url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"), url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype");
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'KaTeX_Fraktur';
src: url(fonts/KaTeX_Fraktur-Regular.woff2) format('woff2'), url(fonts/KaTeX_Fraktur-Regular.woff) format('woff'), url(fonts/KaTeX_Fraktur-Regular.ttf) format('truetype');
font-family: "KaTeX_Fraktur";
src: url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"), url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"), url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'KaTeX_Main';
src: url(fonts/KaTeX_Main-Bold.woff2) format('woff2'), url(fonts/KaTeX_Main-Bold.woff) format('woff'), url(fonts/KaTeX_Main-Bold.ttf) format('truetype');
font-family: "KaTeX_Main";
src: url(fonts/KaTeX_Main-Bold.woff2) format("woff2"), url(fonts/KaTeX_Main-Bold.woff) format("woff"), url(fonts/KaTeX_Main-Bold.ttf) format("truetype");
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'KaTeX_Main';
src: url(fonts/KaTeX_Main-BoldItalic.woff2) format('woff2'), url(fonts/KaTeX_Main-BoldItalic.woff) format('woff'), url(fonts/KaTeX_Main-BoldItalic.ttf) format('truetype');
font-family: "KaTeX_Main";
src: url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"), url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"), url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype");
font-weight: bold;
font-style: italic;
}
@font-face {
font-family: 'KaTeX_Main';
src: url(fonts/KaTeX_Main-Italic.woff2) format('woff2'), url(fonts/KaTeX_Main-Italic.woff) format('woff'), url(fonts/KaTeX_Main-Italic.ttf) format('truetype');
font-family: "KaTeX_Main";
src: url(fonts/KaTeX_Main-Italic.woff2) format("woff2"), url(fonts/KaTeX_Main-Italic.woff) format("woff"), url(fonts/KaTeX_Main-Italic.ttf) format("truetype");
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'KaTeX_Main';
src: url(fonts/KaTeX_Main-Regular.woff2) format('woff2'), url(fonts/KaTeX_Main-Regular.woff) format('woff'), url(fonts/KaTeX_Main-Regular.ttf) format('truetype');
font-family: "KaTeX_Main";
src: url(fonts/KaTeX_Main-Regular.woff2) format("woff2"), url(fonts/KaTeX_Main-Regular.woff) format("woff"), url(fonts/KaTeX_Main-Regular.ttf) format("truetype");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'KaTeX_Math';
src: url(fonts/KaTeX_Math-BoldItalic.woff2) format('woff2'), url(fonts/KaTeX_Math-BoldItalic.woff) format('woff'), url(fonts/KaTeX_Math-BoldItalic.ttf) format('truetype');
font-family: "KaTeX_Math";
src: url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"), url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"), url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype");
font-weight: bold;
font-style: italic;
}
@font-face {
font-family: 'KaTeX_Math';
src: url(fonts/KaTeX_Math-Italic.woff2) format('woff2'), url(fonts/KaTeX_Math-Italic.woff) format('woff'), url(fonts/KaTeX_Math-Italic.ttf) format('truetype');
font-family: "KaTeX_Math";
src: url(fonts/KaTeX_Math-Italic.woff2) format("woff2"), url(fonts/KaTeX_Math-Italic.woff) format("woff"), url(fonts/KaTeX_Math-Italic.ttf) format("truetype");
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'KaTeX_SansSerif';
src: url(fonts/KaTeX_SansSerif-Bold.woff2) format('woff2'), url(fonts/KaTeX_SansSerif-Bold.woff) format('woff'), url(fonts/KaTeX_SansSerif-Bold.ttf) format('truetype');
font-family: "KaTeX_SansSerif";
src: url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"), url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"), url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype");
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'KaTeX_SansSerif';
src: url(fonts/KaTeX_SansSerif-Italic.woff2) format('woff2'), url(fonts/KaTeX_SansSerif-Italic.woff) format('woff'), url(fonts/KaTeX_SansSerif-Italic.ttf) format('truetype');
font-family: "KaTeX_SansSerif";
src: url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"), url(fonts/KaTeX_SansSerif-Italic.woff) format("woff"), url(fonts/KaTeX_SansSerif-Italic.ttf) format("truetype");
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'KaTeX_SansSerif';
src: url(fonts/KaTeX_SansSerif-Regular.woff2) format('woff2'), url(fonts/KaTeX_SansSerif-Regular.woff) format('woff'), url(fonts/KaTeX_SansSerif-Regular.ttf) format('truetype');
font-family: "KaTeX_SansSerif";
src: url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"), url(fonts/KaTeX_SansSerif-Regular.woff) format("woff"), url(fonts/KaTeX_SansSerif-Regular.ttf) format("truetype");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'KaTeX_Script';
src: url(fonts/KaTeX_Script-Regular.woff2) format('woff2'), url(fonts/KaTeX_Script-Regular.woff) format('woff'), url(fonts/KaTeX_Script-Regular.ttf) format('truetype');
font-family: "KaTeX_Script";
src: url(fonts/KaTeX_Script-Regular.woff2) format("woff2"), url(fonts/KaTeX_Script-Regular.woff) format("woff"), url(fonts/KaTeX_Script-Regular.ttf) format("truetype");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'KaTeX_Size1';
src: url(fonts/KaTeX_Size1-Regular.woff2) format('woff2'), url(fonts/KaTeX_Size1-Regular.woff) format('woff'), url(fonts/KaTeX_Size1-Regular.ttf) format('truetype');
font-family: "KaTeX_Size1";
src: url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"), url(fonts/KaTeX_Size1-Regular.woff) format("woff"), url(fonts/KaTeX_Size1-Regular.ttf) format("truetype");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'KaTeX_Size2';
src: url(fonts/KaTeX_Size2-Regular.woff2) format('woff2'), url(fonts/KaTeX_Size2-Regular.woff) format('woff'), url(fonts/KaTeX_Size2-Regular.ttf) format('truetype');
font-family: "KaTeX_Size2";
src: url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"), url(fonts/KaTeX_Size2-Regular.woff) format("woff"), url(fonts/KaTeX_Size2-Regular.ttf) format("truetype");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'KaTeX_Size3';
src: url(fonts/KaTeX_Size3-Regular.woff2) format('woff2'), url(fonts/KaTeX_Size3-Regular.woff) format('woff'), url(fonts/KaTeX_Size3-Regular.ttf) format('truetype');
font-family: "KaTeX_Size3";
src: url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"), url(fonts/KaTeX_Size3-Regular.woff) format("woff"), url(fonts/KaTeX_Size3-Regular.ttf) format("truetype");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'KaTeX_Size4';
src: url(fonts/KaTeX_Size4-Regular.woff2) format('woff2'), url(fonts/KaTeX_Size4-Regular.woff) format('woff'), url(fonts/KaTeX_Size4-Regular.ttf) format('truetype');
font-family: "KaTeX_Size4";
src: url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"), url(fonts/KaTeX_Size4-Regular.woff) format("woff"), url(fonts/KaTeX_Size4-Regular.ttf) format("truetype");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'KaTeX_Typewriter';
src: url(fonts/KaTeX_Typewriter-Regular.woff2) format('woff2'), url(fonts/KaTeX_Typewriter-Regular.woff) format('woff'), url(fonts/KaTeX_Typewriter-Regular.ttf) format('truetype');
font-family: "KaTeX_Typewriter";
src: url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"), url(fonts/KaTeX_Typewriter-Regular.woff) format("woff"), url(fonts/KaTeX_Typewriter-Regular.ttf) format("truetype");
font-weight: normal;
font-style: normal;
}
@ -132,11 +132,11 @@
border-color: currentColor;
}
.katex .katex-version::after {
content: "0.16.10";
content: "0.16.21";
}
.katex .katex-mathml {
/* Accessibility hack to only show to screen readers
Found at: http://a11yproject.com/posts/how-to-hide-content/ */
Found at: http://a11yproject.com/posts/how-to-hide-content/ */
position: absolute;
clip: rect(1px, 1px, 1px, 1px);
padding: 0;
@ -232,6 +232,7 @@
font-family: KaTeX_SansSerif;
font-weight: bold;
}
.katex .mathsfit,
.katex .mathitsf,
.katex .textitsf {
font-family: KaTeX_SansSerif;
@ -360,492 +361,613 @@
}
.katex .sqrt > .root {
/* These values are taken from the definition of `\r@@t`,
`\mkern 5mu` and `\mkern -10mu`. */
margin-left: 0.27777778em;
margin-right: -0.55555556em;
`\mkern 5mu` and `\mkern -10mu`. */
margin-left: 0.2777777778em;
margin-right: -0.5555555556em;
}
.katex .sizing.reset-size1.size1,
.katex .fontsize-ensurer.reset-size1.size1 {
/* stylelint-disable-next-line */
font-size: 1em;
}
.katex .sizing.reset-size1.size2,
.katex .fontsize-ensurer.reset-size1.size2 {
/* stylelint-disable-next-line */
font-size: 1.2em;
}
.katex .sizing.reset-size1.size3,
.katex .fontsize-ensurer.reset-size1.size3 {
/* stylelint-disable-next-line */
font-size: 1.4em;
}
.katex .sizing.reset-size1.size4,
.katex .fontsize-ensurer.reset-size1.size4 {
/* stylelint-disable-next-line */
font-size: 1.6em;
}
.katex .sizing.reset-size1.size5,
.katex .fontsize-ensurer.reset-size1.size5 {
/* stylelint-disable-next-line */
font-size: 1.8em;
}
.katex .sizing.reset-size1.size6,
.katex .fontsize-ensurer.reset-size1.size6 {
/* stylelint-disable-next-line */
font-size: 2em;
}
.katex .sizing.reset-size1.size7,
.katex .fontsize-ensurer.reset-size1.size7 {
/* stylelint-disable-next-line */
font-size: 2.4em;
}
.katex .sizing.reset-size1.size8,
.katex .fontsize-ensurer.reset-size1.size8 {
/* stylelint-disable-next-line */
font-size: 2.88em;
}
.katex .sizing.reset-size1.size9,
.katex .fontsize-ensurer.reset-size1.size9 {
/* stylelint-disable-next-line */
font-size: 3.456em;
}
.katex .sizing.reset-size1.size10,
.katex .fontsize-ensurer.reset-size1.size10 {
/* stylelint-disable-next-line */
font-size: 4.148em;
}
.katex .sizing.reset-size1.size11,
.katex .fontsize-ensurer.reset-size1.size11 {
/* stylelint-disable-next-line */
font-size: 4.976em;
}
.katex .sizing.reset-size2.size1,
.katex .fontsize-ensurer.reset-size2.size1 {
font-size: 0.83333333em;
/* stylelint-disable-next-line */
font-size: 0.8333333333em;
}
.katex .sizing.reset-size2.size2,
.katex .fontsize-ensurer.reset-size2.size2 {
/* stylelint-disable-next-line */
font-size: 1em;
}
.katex .sizing.reset-size2.size3,
.katex .fontsize-ensurer.reset-size2.size3 {
font-size: 1.16666667em;
/* stylelint-disable-next-line */
font-size: 1.1666666667em;
}
.katex .sizing.reset-size2.size4,
.katex .fontsize-ensurer.reset-size2.size4 {
font-size: 1.33333333em;
/* stylelint-disable-next-line */
font-size: 1.3333333333em;
}
.katex .sizing.reset-size2.size5,
.katex .fontsize-ensurer.reset-size2.size5 {
/* stylelint-disable-next-line */
font-size: 1.5em;
}
.katex .sizing.reset-size2.size6,
.katex .fontsize-ensurer.reset-size2.size6 {
font-size: 1.66666667em;
/* stylelint-disable-next-line */
font-size: 1.6666666667em;
}
.katex .sizing.reset-size2.size7,
.katex .fontsize-ensurer.reset-size2.size7 {
/* stylelint-disable-next-line */
font-size: 2em;
}
.katex .sizing.reset-size2.size8,
.katex .fontsize-ensurer.reset-size2.size8 {
/* stylelint-disable-next-line */
font-size: 2.4em;
}
.katex .sizing.reset-size2.size9,
.katex .fontsize-ensurer.reset-size2.size9 {
/* stylelint-disable-next-line */
font-size: 2.88em;
}
.katex .sizing.reset-size2.size10,
.katex .fontsize-ensurer.reset-size2.size10 {
font-size: 3.45666667em;
/* stylelint-disable-next-line */
font-size: 3.4566666667em;
}
.katex .sizing.reset-size2.size11,
.katex .fontsize-ensurer.reset-size2.size11 {
font-size: 4.14666667em;
/* stylelint-disable-next-line */
font-size: 4.1466666667em;
}
.katex .sizing.reset-size3.size1,
.katex .fontsize-ensurer.reset-size3.size1 {
font-size: 0.71428571em;
/* stylelint-disable-next-line */
font-size: 0.7142857143em;
}
.katex .sizing.reset-size3.size2,
.katex .fontsize-ensurer.reset-size3.size2 {
font-size: 0.85714286em;
/* stylelint-disable-next-line */
font-size: 0.8571428571em;
}
.katex .sizing.reset-size3.size3,
.katex .fontsize-ensurer.reset-size3.size3 {
/* stylelint-disable-next-line */
font-size: 1em;
}
.katex .sizing.reset-size3.size4,
.katex .fontsize-ensurer.reset-size3.size4 {
font-size: 1.14285714em;
/* stylelint-disable-next-line */
font-size: 1.1428571429em;
}
.katex .sizing.reset-size3.size5,
.katex .fontsize-ensurer.reset-size3.size5 {
font-size: 1.28571429em;
/* stylelint-disable-next-line */
font-size: 1.2857142857em;
}
.katex .sizing.reset-size3.size6,
.katex .fontsize-ensurer.reset-size3.size6 {
font-size: 1.42857143em;
/* stylelint-disable-next-line */
font-size: 1.4285714286em;
}
.katex .sizing.reset-size3.size7,
.katex .fontsize-ensurer.reset-size3.size7 {
font-size: 1.71428571em;
/* stylelint-disable-next-line */
font-size: 1.7142857143em;
}
.katex .sizing.reset-size3.size8,
.katex .fontsize-ensurer.reset-size3.size8 {
font-size: 2.05714286em;
/* stylelint-disable-next-line */
font-size: 2.0571428571em;
}
.katex .sizing.reset-size3.size9,
.katex .fontsize-ensurer.reset-size3.size9 {
font-size: 2.46857143em;
/* stylelint-disable-next-line */
font-size: 2.4685714286em;
}
.katex .sizing.reset-size3.size10,
.katex .fontsize-ensurer.reset-size3.size10 {
font-size: 2.96285714em;
/* stylelint-disable-next-line */
font-size: 2.9628571429em;
}
.katex .sizing.reset-size3.size11,
.katex .fontsize-ensurer.reset-size3.size11 {
font-size: 3.55428571em;
/* stylelint-disable-next-line */
font-size: 3.5542857143em;
}
.katex .sizing.reset-size4.size1,
.katex .fontsize-ensurer.reset-size4.size1 {
/* stylelint-disable-next-line */
font-size: 0.625em;
}
.katex .sizing.reset-size4.size2,
.katex .fontsize-ensurer.reset-size4.size2 {
/* stylelint-disable-next-line */
font-size: 0.75em;
}
.katex .sizing.reset-size4.size3,
.katex .fontsize-ensurer.reset-size4.size3 {
/* stylelint-disable-next-line */
font-size: 0.875em;
}
.katex .sizing.reset-size4.size4,
.katex .fontsize-ensurer.reset-size4.size4 {
/* stylelint-disable-next-line */
font-size: 1em;
}
.katex .sizing.reset-size4.size5,
.katex .fontsize-ensurer.reset-size4.size5 {
/* stylelint-disable-next-line */
font-size: 1.125em;
}
.katex .sizing.reset-size4.size6,
.katex .fontsize-ensurer.reset-size4.size6 {
/* stylelint-disable-next-line */
font-size: 1.25em;
}
.katex .sizing.reset-size4.size7,
.katex .fontsize-ensurer.reset-size4.size7 {
/* stylelint-disable-next-line */
font-size: 1.5em;
}
.katex .sizing.reset-size4.size8,
.katex .fontsize-ensurer.reset-size4.size8 {
/* stylelint-disable-next-line */
font-size: 1.8em;
}
.katex .sizing.reset-size4.size9,
.katex .fontsize-ensurer.reset-size4.size9 {
/* stylelint-disable-next-line */
font-size: 2.16em;
}
.katex .sizing.reset-size4.size10,
.katex .fontsize-ensurer.reset-size4.size10 {
/* stylelint-disable-next-line */
font-size: 2.5925em;
}
.katex .sizing.reset-size4.size11,
.katex .fontsize-ensurer.reset-size4.size11 {
/* stylelint-disable-next-line */
font-size: 3.11em;
}
.katex .sizing.reset-size5.size1,
.katex .fontsize-ensurer.reset-size5.size1 {
font-size: 0.55555556em;
/* stylelint-disable-next-line */
font-size: 0.5555555556em;
}
.katex .sizing.reset-size5.size2,
.katex .fontsize-ensurer.reset-size5.size2 {
font-size: 0.66666667em;
/* stylelint-disable-next-line */
font-size: 0.6666666667em;
}
.katex .sizing.reset-size5.size3,
.katex .fontsize-ensurer.reset-size5.size3 {
font-size: 0.77777778em;
/* stylelint-disable-next-line */
font-size: 0.7777777778em;
}
.katex .sizing.reset-size5.size4,
.katex .fontsize-ensurer.reset-size5.size4 {
font-size: 0.88888889em;
/* stylelint-disable-next-line */
font-size: 0.8888888889em;
}
.katex .sizing.reset-size5.size5,
.katex .fontsize-ensurer.reset-size5.size5 {
/* stylelint-disable-next-line */
font-size: 1em;
}
.katex .sizing.reset-size5.size6,
.katex .fontsize-ensurer.reset-size5.size6 {
font-size: 1.11111111em;
/* stylelint-disable-next-line */
font-size: 1.1111111111em;
}
.katex .sizing.reset-size5.size7,
.katex .fontsize-ensurer.reset-size5.size7 {
font-size: 1.33333333em;
/* stylelint-disable-next-line */
font-size: 1.3333333333em;
}
.katex .sizing.reset-size5.size8,
.katex .fontsize-ensurer.reset-size5.size8 {
/* stylelint-disable-next-line */
font-size: 1.6em;
}
.katex .sizing.reset-size5.size9,
.katex .fontsize-ensurer.reset-size5.size9 {
/* stylelint-disable-next-line */
font-size: 1.92em;
}
.katex .sizing.reset-size5.size10,
.katex .fontsize-ensurer.reset-size5.size10 {
font-size: 2.30444444em;
/* stylelint-disable-next-line */
font-size: 2.3044444444em;
}
.katex .sizing.reset-size5.size11,
.katex .fontsize-ensurer.reset-size5.size11 {
font-size: 2.76444444em;
/* stylelint-disable-next-line */
font-size: 2.7644444444em;
}
.katex .sizing.reset-size6.size1,
.katex .fontsize-ensurer.reset-size6.size1 {
/* stylelint-disable-next-line */
font-size: 0.5em;
}
.katex .sizing.reset-size6.size2,
.katex .fontsize-ensurer.reset-size6.size2 {
/* stylelint-disable-next-line */
font-size: 0.6em;
}
.katex .sizing.reset-size6.size3,
.katex .fontsize-ensurer.reset-size6.size3 {
/* stylelint-disable-next-line */
font-size: 0.7em;
}
.katex .sizing.reset-size6.size4,
.katex .fontsize-ensurer.reset-size6.size4 {
/* stylelint-disable-next-line */
font-size: 0.8em;
}
.katex .sizing.reset-size6.size5,
.katex .fontsize-ensurer.reset-size6.size5 {
/* stylelint-disable-next-line */
font-size: 0.9em;
}
.katex .sizing.reset-size6.size6,
.katex .fontsize-ensurer.reset-size6.size6 {
/* stylelint-disable-next-line */
font-size: 1em;
}
.katex .sizing.reset-size6.size7,
.katex .fontsize-ensurer.reset-size6.size7 {
/* stylelint-disable-next-line */
font-size: 1.2em;
}
.katex .sizing.reset-size6.size8,
.katex .fontsize-ensurer.reset-size6.size8 {
/* stylelint-disable-next-line */
font-size: 1.44em;
}
.katex .sizing.reset-size6.size9,
.katex .fontsize-ensurer.reset-size6.size9 {
/* stylelint-disable-next-line */
font-size: 1.728em;
}
.katex .sizing.reset-size6.size10,
.katex .fontsize-ensurer.reset-size6.size10 {
/* stylelint-disable-next-line */
font-size: 2.074em;
}
.katex .sizing.reset-size6.size11,
.katex .fontsize-ensurer.reset-size6.size11 {
/* stylelint-disable-next-line */
font-size: 2.488em;
}
.katex .sizing.reset-size7.size1,
.katex .fontsize-ensurer.reset-size7.size1 {
font-size: 0.41666667em;
/* stylelint-disable-next-line */
font-size: 0.4166666667em;
}
.katex .sizing.reset-size7.size2,
.katex .fontsize-ensurer.reset-size7.size2 {
/* stylelint-disable-next-line */
font-size: 0.5em;
}
.katex .sizing.reset-size7.size3,
.katex .fontsize-ensurer.reset-size7.size3 {
font-size: 0.58333333em;
/* stylelint-disable-next-line */
font-size: 0.5833333333em;
}
.katex .sizing.reset-size7.size4,
.katex .fontsize-ensurer.reset-size7.size4 {
font-size: 0.66666667em;
/* stylelint-disable-next-line */
font-size: 0.6666666667em;
}
.katex .sizing.reset-size7.size5,
.katex .fontsize-ensurer.reset-size7.size5 {
/* stylelint-disable-next-line */
font-size: 0.75em;
}
.katex .sizing.reset-size7.size6,
.katex .fontsize-ensurer.reset-size7.size6 {
font-size: 0.83333333em;
/* stylelint-disable-next-line */
font-size: 0.8333333333em;
}
.katex .sizing.reset-size7.size7,
.katex .fontsize-ensurer.reset-size7.size7 {
/* stylelint-disable-next-line */
font-size: 1em;
}
.katex .sizing.reset-size7.size8,
.katex .fontsize-ensurer.reset-size7.size8 {
/* stylelint-disable-next-line */
font-size: 1.2em;
}
.katex .sizing.reset-size7.size9,
.katex .fontsize-ensurer.reset-size7.size9 {
/* stylelint-disable-next-line */
font-size: 1.44em;
}
.katex .sizing.reset-size7.size10,
.katex .fontsize-ensurer.reset-size7.size10 {
font-size: 1.72833333em;
/* stylelint-disable-next-line */
font-size: 1.7283333333em;
}
.katex .sizing.reset-size7.size11,
.katex .fontsize-ensurer.reset-size7.size11 {
font-size: 2.07333333em;
/* stylelint-disable-next-line */
font-size: 2.0733333333em;
}
.katex .sizing.reset-size8.size1,
.katex .fontsize-ensurer.reset-size8.size1 {
font-size: 0.34722222em;
/* stylelint-disable-next-line */
font-size: 0.3472222222em;
}
.katex .sizing.reset-size8.size2,
.katex .fontsize-ensurer.reset-size8.size2 {
font-size: 0.41666667em;
/* stylelint-disable-next-line */
font-size: 0.4166666667em;
}
.katex .sizing.reset-size8.size3,
.katex .fontsize-ensurer.reset-size8.size3 {
font-size: 0.48611111em;
/* stylelint-disable-next-line */
font-size: 0.4861111111em;
}
.katex .sizing.reset-size8.size4,
.katex .fontsize-ensurer.reset-size8.size4 {
font-size: 0.55555556em;
/* stylelint-disable-next-line */
font-size: 0.5555555556em;
}
.katex .sizing.reset-size8.size5,
.katex .fontsize-ensurer.reset-size8.size5 {
/* stylelint-disable-next-line */
font-size: 0.625em;
}
.katex .sizing.reset-size8.size6,
.katex .fontsize-ensurer.reset-size8.size6 {
font-size: 0.69444444em;
/* stylelint-disable-next-line */
font-size: 0.6944444444em;
}
.katex .sizing.reset-size8.size7,
.katex .fontsize-ensurer.reset-size8.size7 {
font-size: 0.83333333em;
/* stylelint-disable-next-line */
font-size: 0.8333333333em;
}
.katex .sizing.reset-size8.size8,
.katex .fontsize-ensurer.reset-size8.size8 {
/* stylelint-disable-next-line */
font-size: 1em;
}
.katex .sizing.reset-size8.size9,
.katex .fontsize-ensurer.reset-size8.size9 {
/* stylelint-disable-next-line */
font-size: 1.2em;
}
.katex .sizing.reset-size8.size10,
.katex .fontsize-ensurer.reset-size8.size10 {
font-size: 1.44027778em;
/* stylelint-disable-next-line */
font-size: 1.4402777778em;
}
.katex .sizing.reset-size8.size11,
.katex .fontsize-ensurer.reset-size8.size11 {
font-size: 1.72777778em;
/* stylelint-disable-next-line */
font-size: 1.7277777778em;
}
.katex .sizing.reset-size9.size1,
.katex .fontsize-ensurer.reset-size9.size1 {
font-size: 0.28935185em;
/* stylelint-disable-next-line */
font-size: 0.2893518519em;
}
.katex .sizing.reset-size9.size2,
.katex .fontsize-ensurer.reset-size9.size2 {
font-size: 0.34722222em;
/* stylelint-disable-next-line */
font-size: 0.3472222222em;
}
.katex .sizing.reset-size9.size3,
.katex .fontsize-ensurer.reset-size9.size3 {
font-size: 0.40509259em;
/* stylelint-disable-next-line */
font-size: 0.4050925926em;
}
.katex .sizing.reset-size9.size4,
.katex .fontsize-ensurer.reset-size9.size4 {
font-size: 0.46296296em;
/* stylelint-disable-next-line */
font-size: 0.462962963em;
}
.katex .sizing.reset-size9.size5,
.katex .fontsize-ensurer.reset-size9.size5 {
font-size: 0.52083333em;
/* stylelint-disable-next-line */
font-size: 0.5208333333em;
}
.katex .sizing.reset-size9.size6,
.katex .fontsize-ensurer.reset-size9.size6 {
font-size: 0.5787037em;
/* stylelint-disable-next-line */
font-size: 0.5787037037em;
}
.katex .sizing.reset-size9.size7,
.katex .fontsize-ensurer.reset-size9.size7 {
font-size: 0.69444444em;
/* stylelint-disable-next-line */
font-size: 0.6944444444em;
}
.katex .sizing.reset-size9.size8,
.katex .fontsize-ensurer.reset-size9.size8 {
font-size: 0.83333333em;
/* stylelint-disable-next-line */
font-size: 0.8333333333em;
}
.katex .sizing.reset-size9.size9,
.katex .fontsize-ensurer.reset-size9.size9 {
/* stylelint-disable-next-line */
font-size: 1em;
}
.katex .sizing.reset-size9.size10,
.katex .fontsize-ensurer.reset-size9.size10 {
font-size: 1.20023148em;
/* stylelint-disable-next-line */
font-size: 1.2002314815em;
}
.katex .sizing.reset-size9.size11,
.katex .fontsize-ensurer.reset-size9.size11 {
font-size: 1.43981481em;
/* stylelint-disable-next-line */
font-size: 1.4398148148em;
}
.katex .sizing.reset-size10.size1,
.katex .fontsize-ensurer.reset-size10.size1 {
font-size: 0.24108004em;
/* stylelint-disable-next-line */
font-size: 0.2410800386em;
}
.katex .sizing.reset-size10.size2,
.katex .fontsize-ensurer.reset-size10.size2 {
font-size: 0.28929605em;
/* stylelint-disable-next-line */
font-size: 0.2892960463em;
}
.katex .sizing.reset-size10.size3,
.katex .fontsize-ensurer.reset-size10.size3 {
font-size: 0.33751205em;
/* stylelint-disable-next-line */
font-size: 0.337512054em;
}
.katex .sizing.reset-size10.size4,
.katex .fontsize-ensurer.reset-size10.size4 {
font-size: 0.38572806em;
/* stylelint-disable-next-line */
font-size: 0.3857280617em;
}
.katex .sizing.reset-size10.size5,
.katex .fontsize-ensurer.reset-size10.size5 {
font-size: 0.43394407em;
/* stylelint-disable-next-line */
font-size: 0.4339440694em;
}
.katex .sizing.reset-size10.size6,
.katex .fontsize-ensurer.reset-size10.size6 {
font-size: 0.48216008em;
/* stylelint-disable-next-line */
font-size: 0.4821600771em;
}
.katex .sizing.reset-size10.size7,
.katex .fontsize-ensurer.reset-size10.size7 {
font-size: 0.57859209em;
/* stylelint-disable-next-line */
font-size: 0.5785920926em;
}
.katex .sizing.reset-size10.size8,
.katex .fontsize-ensurer.reset-size10.size8 {
font-size: 0.69431051em;
/* stylelint-disable-next-line */
font-size: 0.6943105111em;
}
.katex .sizing.reset-size10.size9,
.katex .fontsize-ensurer.reset-size10.size9 {
font-size: 0.83317261em;
/* stylelint-disable-next-line */
font-size: 0.8331726133em;
}
.katex .sizing.reset-size10.size10,
.katex .fontsize-ensurer.reset-size10.size10 {
/* stylelint-disable-next-line */
font-size: 1em;
}
.katex .sizing.reset-size10.size11,
.katex .fontsize-ensurer.reset-size10.size11 {
font-size: 1.19961427em;
/* stylelint-disable-next-line */
font-size: 1.1996142719em;
}
.katex .sizing.reset-size11.size1,
.katex .fontsize-ensurer.reset-size11.size1 {
font-size: 0.20096463em;
/* stylelint-disable-next-line */
font-size: 0.2009646302em;
}
.katex .sizing.reset-size11.size2,
.katex .fontsize-ensurer.reset-size11.size2 {
font-size: 0.24115756em;
/* stylelint-disable-next-line */
font-size: 0.2411575563em;
}
.katex .sizing.reset-size11.size3,
.katex .fontsize-ensurer.reset-size11.size3 {
font-size: 0.28135048em;
/* stylelint-disable-next-line */
font-size: 0.2813504823em;
}
.katex .sizing.reset-size11.size4,
.katex .fontsize-ensurer.reset-size11.size4 {
font-size: 0.32154341em;
/* stylelint-disable-next-line */
font-size: 0.3215434084em;
}
.katex .sizing.reset-size11.size5,
.katex .fontsize-ensurer.reset-size11.size5 {
font-size: 0.36173633em;
/* stylelint-disable-next-line */
font-size: 0.3617363344em;
}
.katex .sizing.reset-size11.size6,
.katex .fontsize-ensurer.reset-size11.size6 {
font-size: 0.40192926em;
/* stylelint-disable-next-line */
font-size: 0.4019292605em;
}
.katex .sizing.reset-size11.size7,
.katex .fontsize-ensurer.reset-size11.size7 {
font-size: 0.48231511em;
/* stylelint-disable-next-line */
font-size: 0.4823151125em;
}
.katex .sizing.reset-size11.size8,
.katex .fontsize-ensurer.reset-size11.size8 {
font-size: 0.57877814em;
/* stylelint-disable-next-line */
font-size: 0.578778135em;
}
.katex .sizing.reset-size11.size9,
.katex .fontsize-ensurer.reset-size11.size9 {
font-size: 0.69453376em;
/* stylelint-disable-next-line */
font-size: 0.6945337621em;
}
.katex .sizing.reset-size11.size10,
.katex .fontsize-ensurer.reset-size11.size10 {
font-size: 0.83360129em;
/* stylelint-disable-next-line */
font-size: 0.8336012862em;
}
.katex .sizing.reset-size11.size11,
.katex .fontsize-ensurer.reset-size11.size11 {
/* stylelint-disable-next-line */
font-size: 1em;
}
.katex .delimsizing.size1 {
@ -949,8 +1071,7 @@
position: relative;
overflow: hidden;
}
.katex .stretchy::before,
.katex .stretchy::after {
.katex .stretchy::before, .katex .stretchy::after {
content: "";
}
.katex .hide-tail {
@ -1054,6 +1175,7 @@
left: calc(50% + 0.3em);
text-align: right;
}
.katex-display {
display: block;
margin: 1em 0;
@ -1072,15 +1194,17 @@
position: absolute;
right: 0;
}
.katex-display.leqno > .katex > .katex-html > .tag {
left: 0;
right: auto;
}
.katex-display.fleqn > .katex {
text-align: left;
padding-left: 2em;
}
body {
counter-reset: katexEqnNo mmlEqnNo;
}

@ -3234,7 +3234,7 @@ const sigmasAndXis = {
sqrtRuleThickness: [0.04, 0.04, 0.04],
// This value determines how large a pt is, for metrics which are defined
// in terms of pts.
// This value is also used in katex.less; if you change it make sure the
// This value is also used in katex.scss; if you change it make sure the
// values match.
ptPerEm: [10.0, 10.0, 10.0],
// The space between adjacent `|` columns in an array definition. From
@ -3870,6 +3870,7 @@ const makeEm = function (n) {
/**
* Create an HTML className based on a list of classes. In addition to joining
* with spaces, we also remove empty classes.
@ -3930,10 +3931,20 @@ const toNode = function (tagName) {
return node;
};
/**
* Convert into an HTML markup string
* https://w3c.github.io/html-reference/syntax.html#syntax-attributes
*
* > Attribute Names must consist of one or more characters
* other than the space characters, U+0000 NULL,
* '"', "'", ">", "/", "=", the control characters,
* and any characters that are not defined by Unicode.
*/
const invalidAttributeNameRegex = /[\s"'>/=\x00-\x1f]/;
/**
* Convert into an HTML markup string
*/
const toMarkup = function (tagName) {
let markup = "<" + tagName; // Add the class
@ -3956,6 +3967,10 @@ const toMarkup = function (tagName) {
for (const attr in this.attributes) {
if (this.attributes.hasOwnProperty(attr)) {
if (invalidAttributeNameRegex.test(attr)) {
throw new src_ParseError("Invalid attribute name '" + attr + "'");
}
markup += " " + attr + "=\"" + utils.escape(this.attributes[attr]) + "\"";
}
}
@ -5027,9 +5042,10 @@ defineSymbol(math, main, inner, "\u2026", "\\mathellipsis");
defineSymbol(symbols_text, main, inner, "\u2026", "\\ldots", true);
defineSymbol(math, main, inner, "\u2026", "\\ldots", true);
defineSymbol(math, main, inner, "\u22ef", "\\@cdots", true);
defineSymbol(math, main, inner, "\u22f1", "\\ddots", true);
defineSymbol(math, main, textord, "\u22ee", "\\varvdots"); // \vdots is a macro
defineSymbol(math, main, inner, "\u22f1", "\\ddots", true); // \vdots is a macro that uses one of these two symbols (with made-up names):
defineSymbol(math, main, textord, "\u22ee", "\\varvdots");
defineSymbol(symbols_text, main, textord, "\u22ee", "\\varvdots");
defineSymbol(math, main, accent, "\u02ca", "\\acute");
defineSymbol(math, main, accent, "\u02cb", "\\grave");
defineSymbol(math, main, accent, "\u00a8", "\\ddot");
@ -5182,11 +5198,11 @@ for (let i = 0; i < letters.length; i++) {
defineSymbol(math, main, mathord, ch, wideChar);
defineSymbol(symbols_text, main, textord, ch, wideChar);
wideChar = String.fromCharCode(0xD835, 0xDD04 + i); // A-Z a-z Fractur
wideChar = String.fromCharCode(0xD835, 0xDD04 + i); // A-Z a-z Fraktur
defineSymbol(math, main, mathord, ch, wideChar);
defineSymbol(symbols_text, main, textord, ch, wideChar);
wideChar = String.fromCharCode(0xD835, 0xDD6C + i); // A-Z a-z bold Fractur
wideChar = String.fromCharCode(0xD835, 0xDD6C + i); // A-Z a-z bold Fraktur
defineSymbol(math, main, mathord, ch, wideChar);
defineSymbol(symbols_text, main, textord, ch, wideChar);
@ -5950,6 +5966,10 @@ const fontMap = {
variant: "italic",
fontName: "Math-Italic"
},
"mathsfit": {
variant: "sans-serif-italic",
fontName: "SansSerif-Italic"
},
// "boldsymbol" is missing because they require the use of multiple fonts:
// Math-BoldItalic and Main-Bold. This is handled by a special case in
// makeOrd which ends up calling boldsymbol.
@ -6676,7 +6696,19 @@ class MathNode {
}
for (let i = 0; i < this.children.length; i++) {
node.appendChild(this.children[i].toNode());
// Combine multiple TextNodes into one TextNode, to prevent
// screen readers from reading each as a separate word [#3995]
if (this.children[i] instanceof TextNode && this.children[i + 1] instanceof TextNode) {
let text = this.children[i].toText() + this.children[++i].toText();
while (this.children[i + 1] instanceof TextNode) {
text += this.children[++i].toText();
}
node.appendChild(new TextNode(text).toNode());
} else {
node.appendChild(this.children[i].toNode());
}
}
return node;
@ -6923,6 +6955,8 @@ const getVariant = function (group, options) {
return "bold";
} else if (font === "mathbb") {
return "double-struck";
} else if (font === "mathsfit") {
return "sans-serif-italic";
} else if (font === "mathfrak") {
return "fraktur";
} else if (font === "mathscr" || font === "mathcal") {
@ -6952,12 +6986,34 @@ const getVariant = function (group, options) {
return null;
};
/**
* Check for <mi>.</mi> which is how a dot renders in MathML,
* or <mo separator="true" lspace="0em" rspace="0em">,</mo>
* which is how a braced comma {,} renders in MathML
*/
function isNumberPunctuation(group) {
if (!group) {
return false;
}
if (group.type === 'mi' && group.children.length === 1) {
const child = group.children[0];
return child instanceof TextNode && child.text === '.';
} else if (group.type === 'mo' && group.children.length === 1 && group.getAttribute('separator') === 'true' && group.getAttribute('lspace') === '0em' && group.getAttribute('rspace') === '0em') {
const child = group.children[0];
return child instanceof TextNode && child.text === ',';
} else {
return false;
}
}
/**
* Takes a list of nodes, builds them, and returns a list of the generated
* MathML nodes. Also combine consecutive <mtext> outputs into a single
* <mtext> tag.
*/
const buildMathML_buildExpression = function (expression, options, isOrdgroup) {
if (expression.length === 1) {
const group = buildMathML_buildGroup(expression[0], options);
@ -6986,13 +7042,21 @@ const buildMathML_buildExpression = function (expression, options, isOrdgroup) {
} else if (group.type === 'mn' && lastGroup.type === 'mn') {
lastGroup.children.push(...group.children);
continue; // Concatenate <mn>...</mn> followed by <mi>.</mi>
} else if (group.type === 'mi' && group.children.length === 1 && lastGroup.type === 'mn') {
const child = group.children[0];
} else if (isNumberPunctuation(group) && lastGroup.type === 'mn') {
lastGroup.children.push(...group.children);
continue; // Concatenate <mi>.</mi> followed by <mn>...</mn>
} else if (group.type === 'mn' && isNumberPunctuation(lastGroup)) {
group.children = [...lastGroup.children, ...group.children];
groups.pop(); // Put preceding <mn>...</mn> or <mi>.</mi> inside base of
// <msup><mn>...base...</mn>...exponent...</msup> (or <msub>)
} else if ((group.type === 'msup' || group.type === 'msub') && group.children.length >= 1 && (lastGroup.type === 'mn' || isNumberPunctuation(lastGroup))) {
const base = group.children[0];
if (base instanceof MathNode && base.type === 'mn') {
base.children = [...lastGroup.children, ...base.children];
groups.pop();
} // \not
if (child instanceof TextNode && child.text === '.') {
lastGroup.children.push(...group.children);
continue;
}
} else if (lastGroup.type === 'mi' && lastGroup.children.length === 1) {
const lastChild = lastGroup.children[0];
@ -9111,7 +9175,7 @@ const makeGlyphSpan = function (symbol, font, mode) {
const makeInner = function (ch, height, options) {
// Create a span with inline SVG for the inner part of a tall stacked delimiter.
const width = fontMetricsData["Size4-Regular"][ch.charCodeAt(0)] ? fontMetricsData["Size4-Regular"][ch.charCodeAt(0)][4] : fontMetricsData["Size1-Regular"][ch.charCodeAt(0)][4];
const width = fontMetricsData['Size4-Regular'][ch.charCodeAt(0)] ? fontMetricsData['Size4-Regular'][ch.charCodeAt(0)][4] : fontMetricsData['Size1-Regular'][ch.charCodeAt(0)][4];
const path = new PathNode("inner", innerPath(ch, Math.round(1000 * height)));
const svgNode = new SvgNode([path], {
"width": makeEm(width),
@ -11782,7 +11846,7 @@ const fontAliases = {
defineFunction({
type: "font",
names: [// styles, except \boldsymbol defined below
"\\mathrm", "\\mathit", "\\mathbf", "\\mathnormal", // families
"\\mathrm", "\\mathit", "\\mathbf", "\\mathnormal", "\\mathsfit", // families
"\\mathbb", "\\mathcal", "\\mathfrak", "\\mathscr", "\\mathsf", "\\mathtt", // aliases, except \bm defined below
"\\Bbb", "\\bold", "\\frak"],
props: {
@ -14156,6 +14220,8 @@ defineFunction({
props: {
numArgs: 2,
numOptionalArgs: 1,
allowedInText: true,
allowedInMath: true,
argTypes: ["size", "size", "size"]
},
@ -15085,9 +15151,11 @@ const optionsWithFont = (group, options) => {
return options.withTextFontFamily(textFontFamilies[font]);
} else if (textFontWeights[font]) {
return options.withTextFontWeight(textFontWeights[font]);
} else {
return options.withTextFontShape(textFontShapes[font]);
} else if (font === "\\emph") {
return options.fontShape === "textit" ? options.withTextFontShape("textup") : options.withTextFontShape("textit");
}
return options.withTextFontShape(textFontShapes[font]);
};
defineFunction({
@ -15095,7 +15163,7 @@ defineFunction({
names: [// Font families
"\\text", "\\textrm", "\\textsf", "\\texttt", "\\textnormal", // Font weights
"\\textbf", "\\textmd", // Font Shapes
"\\textit", "\\textup"],
"\\textit", "\\textup", "\\emph"],
props: {
numArgs: 1,
argTypes: ["text"],
@ -15806,7 +15874,7 @@ defineMacro("\\char", function (context) {
// \renewcommand{\macro}[args]{definition}
// TODO: Optional arguments: \newcommand{\macro}[args][default]{definition}
const newcommand = (context, existsOK, nonexistsOK) => {
const newcommand = (context, existsOK, nonexistsOK, skipIfExists) => {
let arg = context.consumeArg().tokens;
if (arg.length !== 1) {
@ -15843,19 +15911,22 @@ const newcommand = (context, existsOK, nonexistsOK) => {
numArgs = parseInt(argText);
arg = context.consumeArg().tokens;
} // Final arg is the expansion of the macro
}
if (!(exists && skipIfExists)) {
// Final arg is the expansion of the macro
context.macros.set(name, {
tokens: arg,
numArgs
});
}
context.macros.set(name, {
tokens: arg,
numArgs
});
return '';
};
defineMacro("\\newcommand", context => newcommand(context, false, true));
defineMacro("\\renewcommand", context => newcommand(context, true, false));
defineMacro("\\providecommand", context => newcommand(context, true, true)); // terminal (console) tools
defineMacro("\\newcommand", context => newcommand(context, false, true, false));
defineMacro("\\renewcommand", context => newcommand(context, true, false, false));
defineMacro("\\providecommand", context => newcommand(context, true, true, true)); // terminal (console) tools
defineMacro("\\message", context => {
const arg = context.consumeArgs(1)[0]; // eslint-disable-next-line no-console
@ -15976,7 +16047,7 @@ defineMacro("\\lrcorner", "\\html@mathml{\\@lrcorner}{\\mathop{\\char\"231f}}");
// We'll call \varvdots, which gets a glyph from symbols.js.
// The zero-width rule gets us an equivalent to the vertical 6pt kern.
defineMacro("\\vdots", "\\mathord{\\varvdots\\rule{0pt}{15pt}}");
defineMacro("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}");
defineMacro("\u22ee", "\\vdots"); //////////////////////////////////////////////////////////////////////
// amsmath.sty
// http://mirrors.concertpass.com/tex-archive/macros/latex/required/amsmath/amsmath.pdf
@ -16006,7 +16077,12 @@ defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}"); // \def\iff{\DOTSB\;\Lon
defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");
defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");
defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;"); // AMSMath's automatic \dots, based on \mdots@@ macro.
defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;"); // \def\dddot#1{{\mathop{#1}\limits^{\vbox to-1.4\ex@{\kern-\tw@\ex@
// \hbox{\normalfont ...}\vss}}}}
// We use \overset which avoids the vertical shift of \mathop.
defineMacro("\\dddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");
defineMacro("\\ddddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}"); // AMSMath's automatic \dots, based on \mdots@@ macro.
const dotsByToken = {
',': '\\dotsc',
@ -16237,7 +16313,7 @@ defineMacro("\\TeX", "\\textrm{\\html@mathml{" + "T\\kern-.1667em\\raisebox{-.5e
// We compute the corresponding \raisebox when A is rendered in \normalsize
// \scriptstyle, which has a scale factor of 0.7 (see Options.js).
const latexRaiseA = makeEm(fontMetricsData["Main-Regular"]["T".charCodeAt(0)][1] - 0.7 * fontMetricsData["Main-Regular"]["A".charCodeAt(0)][1]);
const latexRaiseA = makeEm(fontMetricsData['Main-Regular']["T".charCodeAt(0)][1] - 0.7 * fontMetricsData['Main-Regular']["A".charCodeAt(0)][1]);
defineMacro("\\LaTeX", "\\textrm{\\html@mathml{" + ("L\\kern-.36em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{LaTeX}}"); // New KaTeX logo based on tweaking LaTeX logo
defineMacro("\\KaTeX", "\\textrm{\\html@mathml{" + ("K\\kern-.17em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{KaTeX}}"); // \DeclareRobustCommand\hspace{\@ifstar\@hspacer\@hspace}
@ -18880,11 +18956,23 @@ const renderToHTMLTree = function (expression, options) {
}
};
const version = "0.16.21";
const __domTree = {
Span: Span,
Anchor: Anchor,
SymbolNode: SymbolNode,
SvgNode: SvgNode,
PathNode: PathNode,
LineNode: LineNode
}; // ESM exports
// CJS exports and ESM default export
/* harmony default export */ var katex = ({
/**
* Current KaTeX version
*/
version: "0.16.10",
version,
/**
* Renders the given LaTeX into an HTML+MathML combination, and adds
@ -18904,7 +18992,7 @@ const renderToHTMLTree = function (expression, options) {
ParseError: src_ParseError,
/**
* The shema of Settings
* The schema of Settings
*/
SETTINGS_SCHEMA: SETTINGS_SCHEMA,
@ -18964,18 +19052,11 @@ const renderToHTMLTree = function (expression, options) {
/**
* Expose the dom tree node types, which can be useful for type checking nodes.
*
* NOTE: This method is not currently recommended for public use.
* NOTE: These methods are not currently recommended for public use.
* The internal tree representation is unstable and is very likely
* to change. Use at your own risk.
*/
__domTree: {
Span: Span,
Anchor: Anchor,
SymbolNode: SymbolNode,
SvgNode: SvgNode,
PathNode: PathNode,
LineNode: LineNode
}
__domTree
});
;// CONCATENATED MODULE: ./katex.webpack.js
/**

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -3260,7 +3260,7 @@ var sigmasAndXis = {
sqrtRuleThickness: [0.04, 0.04, 0.04],
// This value determines how large a pt is, for metrics which are defined
// in terms of pts.
// This value is also used in katex.less; if you change it make sure the
// This value is also used in katex.scss; if you change it make sure the
// values match.
ptPerEm: [10.0, 10.0, 10.0],
// The space between adjacent `|` columns in an array definition. From
@ -3942,10 +3942,20 @@ var toNode = function toNode(tagName) {
return node;
};
/**
* Convert into an HTML markup string
* https://w3c.github.io/html-reference/syntax.html#syntax-attributes
*
* > Attribute Names must consist of one or more characters
* other than the space characters, U+0000 NULL,
* '"', "'", ">", "/", "=", the control characters,
* and any characters that are not defined by Unicode.
*/
var invalidAttributeNameRegex = /[\s"'>/=\x00-\x1f]/;
/**
* Convert into an HTML markup string
*/
var toMarkup = function toMarkup(tagName) {
var markup = "<" + tagName; // Add the class
@ -3968,6 +3978,10 @@ var toMarkup = function toMarkup(tagName) {
for (var attr in this.attributes) {
if (this.attributes.hasOwnProperty(attr)) {
if (invalidAttributeNameRegex.test(attr)) {
throw new ParseError("Invalid attribute name '" + attr + "'");
}
markup += " " + attr + "=\"" + utils.escape(this.attributes[attr]) + "\"";
}
}
@ -5038,9 +5052,10 @@ defineSymbol(math, main, inner, "\u2026", "\\mathellipsis");
defineSymbol(text, main, inner, "\u2026", "\\ldots", true);
defineSymbol(math, main, inner, "\u2026", "\\ldots", true);
defineSymbol(math, main, inner, "\u22ef", "\\@cdots", true);
defineSymbol(math, main, inner, "\u22f1", "\\ddots", true);
defineSymbol(math, main, textord, "\u22ee", "\\varvdots"); // \vdots is a macro
defineSymbol(math, main, inner, "\u22f1", "\\ddots", true); // \vdots is a macro that uses one of these two symbols (with made-up names):
defineSymbol(math, main, textord, "\u22ee", "\\varvdots");
defineSymbol(text, main, textord, "\u22ee", "\\varvdots");
defineSymbol(math, main, accent, "\u02ca", "\\acute");
defineSymbol(math, main, accent, "\u02cb", "\\grave");
defineSymbol(math, main, accent, "\u00a8", "\\ddot");
@ -5196,11 +5211,11 @@ for (var _i3 = 0; _i3 < letters.length; _i3++) {
defineSymbol(math, main, mathord, _ch3, wideChar);
defineSymbol(text, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(0xD835, 0xDD04 + _i3); // A-Z a-z Fractur
wideChar = String.fromCharCode(0xD835, 0xDD04 + _i3); // A-Z a-z Fraktur
defineSymbol(math, main, mathord, _ch3, wideChar);
defineSymbol(text, main, textord, _ch3, wideChar);
wideChar = String.fromCharCode(0xD835, 0xDD6C + _i3); // A-Z a-z bold Fractur
wideChar = String.fromCharCode(0xD835, 0xDD6C + _i3); // A-Z a-z bold Fraktur
defineSymbol(math, main, mathord, _ch3, wideChar);
defineSymbol(text, main, textord, _ch3, wideChar);
@ -5959,6 +5974,10 @@ var fontMap = {
variant: "italic",
fontName: "Math-Italic"
},
"mathsfit": {
variant: "sans-serif-italic",
fontName: "SansSerif-Italic"
},
// "boldsymbol" is missing because they require the use of multiple fonts:
// Math-BoldItalic and Main-Bold. This is handled by a special case in
// makeOrd which ends up calling boldsymbol.
@ -6672,7 +6691,19 @@ class MathNode {
}
for (var i = 0; i < this.children.length; i++) {
node.appendChild(this.children[i].toNode());
// Combine multiple TextNodes into one TextNode, to prevent
// screen readers from reading each as a separate word [#3995]
if (this.children[i] instanceof TextNode && this.children[i + 1] instanceof TextNode) {
var text = this.children[i].toText() + this.children[++i].toText();
while (this.children[i + 1] instanceof TextNode) {
text += this.children[++i].toText();
}
node.appendChild(new TextNode(text).toNode());
} else {
node.appendChild(this.children[i].toNode());
}
}
return node;
@ -6911,6 +6942,8 @@ var getVariant = function getVariant(group, options) {
return "bold";
} else if (font === "mathbb") {
return "double-struck";
} else if (font === "mathsfit") {
return "sans-serif-italic";
} else if (font === "mathfrak") {
return "fraktur";
} else if (font === "mathscr" || font === "mathcal") {
@ -6940,12 +6973,34 @@ var getVariant = function getVariant(group, options) {
return null;
};
/**
* Check for <mi>.</mi> which is how a dot renders in MathML,
* or <mo separator="true" lspace="0em" rspace="0em">,</mo>
* which is how a braced comma {,} renders in MathML
*/
function isNumberPunctuation(group) {
if (!group) {
return false;
}
if (group.type === 'mi' && group.children.length === 1) {
var child = group.children[0];
return child instanceof TextNode && child.text === '.';
} else if (group.type === 'mo' && group.children.length === 1 && group.getAttribute('separator') === 'true' && group.getAttribute('lspace') === '0em' && group.getAttribute('rspace') === '0em') {
var _child = group.children[0];
return _child instanceof TextNode && _child.text === ',';
} else {
return false;
}
}
/**
* Takes a list of nodes, builds them, and returns a list of the generated
* MathML nodes. Also combine consecutive <mtext> outputs into a single
* <mtext> tag.
*/
var buildExpression = function buildExpression(expression, options, isOrdgroup) {
if (expression.length === 1) {
var group = buildGroup(expression[0], options);
@ -6974,22 +7029,30 @@ var buildExpression = function buildExpression(expression, options, isOrdgroup)
} else if (_group.type === 'mn' && lastGroup.type === 'mn') {
lastGroup.children.push(..._group.children);
continue; // Concatenate <mn>...</mn> followed by <mi>.</mi>
} else if (_group.type === 'mi' && _group.children.length === 1 && lastGroup.type === 'mn') {
var child = _group.children[0];
} else if (isNumberPunctuation(_group) && lastGroup.type === 'mn') {
lastGroup.children.push(..._group.children);
continue; // Concatenate <mi>.</mi> followed by <mn>...</mn>
} else if (_group.type === 'mn' && isNumberPunctuation(lastGroup)) {
_group.children = [...lastGroup.children, ..._group.children];
groups.pop(); // Put preceding <mn>...</mn> or <mi>.</mi> inside base of
// <msup><mn>...base...</mn>...exponent...</msup> (or <msub>)
} else if ((_group.type === 'msup' || _group.type === 'msub') && _group.children.length >= 1 && (lastGroup.type === 'mn' || isNumberPunctuation(lastGroup))) {
var base = _group.children[0];
if (base instanceof MathNode && base.type === 'mn') {
base.children = [...lastGroup.children, ...base.children];
groups.pop();
} // \not
if (child instanceof TextNode && child.text === '.') {
lastGroup.children.push(..._group.children);
continue;
}
} else if (lastGroup.type === 'mi' && lastGroup.children.length === 1) {
var lastChild = lastGroup.children[0];
if (lastChild instanceof TextNode && lastChild.text === '\u0338' && (_group.type === 'mo' || _group.type === 'mi' || _group.type === 'mn')) {
var _child = _group.children[0];
var child = _group.children[0];
if (_child instanceof TextNode && _child.text.length > 0) {
if (child instanceof TextNode && child.text.length > 0) {
// Overlay with combining character long solidus
_child.text = _child.text.slice(0, 1) + "\u0338" + _child.text.slice(1);
child.text = child.text.slice(0, 1) + "\u0338" + child.text.slice(1);
groups.pop();
}
}
@ -11555,7 +11618,7 @@ var fontAliases = {
defineFunction({
type: "font",
names: [// styles, except \boldsymbol defined below
"\\mathrm", "\\mathit", "\\mathbf", "\\mathnormal", // families
"\\mathrm", "\\mathit", "\\mathbf", "\\mathnormal", "\\mathsfit", // families
"\\mathbb", "\\mathcal", "\\mathfrak", "\\mathscr", "\\mathsf", "\\mathtt", // aliases, except \bm defined below
"\\Bbb", "\\bold", "\\frak"],
props: {
@ -13810,6 +13873,8 @@ defineFunction({
props: {
numArgs: 2,
numOptionalArgs: 1,
allowedInText: true,
allowedInMath: true,
argTypes: ["size", "size", "size"]
},
@ -14679,9 +14744,11 @@ var optionsWithFont = (group, options) => {
return options.withTextFontFamily(textFontFamilies[font]);
} else if (textFontWeights[font]) {
return options.withTextFontWeight(textFontWeights[font]);
} else {
return options.withTextFontShape(textFontShapes[font]);
} else if (font === "\\emph") {
return options.fontShape === "textit" ? options.withTextFontShape("textup") : options.withTextFontShape("textit");
}
return options.withTextFontShape(textFontShapes[font]);
};
defineFunction({
@ -14689,7 +14756,7 @@ defineFunction({
names: [// Font families
"\\text", "\\textrm", "\\textsf", "\\texttt", "\\textnormal", // Font weights
"\\textbf", "\\textmd", // Font Shapes
"\\textit", "\\textup"],
"\\textit", "\\textup", "\\emph"],
props: {
numArgs: 1,
argTypes: ["text"],
@ -15322,7 +15389,7 @@ defineMacro("\\char", function (context) {
// \renewcommand{\macro}[args]{definition}
// TODO: Optional arguments: \newcommand{\macro}[args][default]{definition}
var newcommand = (context, existsOK, nonexistsOK) => {
var newcommand = (context, existsOK, nonexistsOK, skipIfExists) => {
var arg = context.consumeArg().tokens;
if (arg.length !== 1) {
@ -15359,19 +15426,22 @@ var newcommand = (context, existsOK, nonexistsOK) => {
numArgs = parseInt(argText);
arg = context.consumeArg().tokens;
} // Final arg is the expansion of the macro
}
if (!(exists && skipIfExists)) {
// Final arg is the expansion of the macro
context.macros.set(name, {
tokens: arg,
numArgs
});
}
context.macros.set(name, {
tokens: arg,
numArgs
});
return '';
};
defineMacro("\\newcommand", context => newcommand(context, false, true));
defineMacro("\\renewcommand", context => newcommand(context, true, false));
defineMacro("\\providecommand", context => newcommand(context, true, true)); // terminal (console) tools
defineMacro("\\newcommand", context => newcommand(context, false, true, false));
defineMacro("\\renewcommand", context => newcommand(context, true, false, false));
defineMacro("\\providecommand", context => newcommand(context, true, true, true)); // terminal (console) tools
defineMacro("\\message", context => {
var arg = context.consumeArgs(1)[0]; // eslint-disable-next-line no-console
@ -15492,7 +15562,7 @@ defineMacro("\\lrcorner", "\\html@mathml{\\@lrcorner}{\\mathop{\\char\"231f}}");
// We'll call \varvdots, which gets a glyph from symbols.js.
// The zero-width rule gets us an equivalent to the vertical 6pt kern.
defineMacro("\\vdots", "\\mathord{\\varvdots\\rule{0pt}{15pt}}");
defineMacro("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}");
defineMacro("\u22ee", "\\vdots"); //////////////////////////////////////////////////////////////////////
// amsmath.sty
// http://mirrors.concertpass.com/tex-archive/macros/latex/required/amsmath/amsmath.pdf
@ -15522,7 +15592,12 @@ defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}"); // \def\iff{\DOTSB\;\Lon
defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");
defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");
defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;"); // AMSMath's automatic \dots, based on \mdots@@ macro.
defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;"); // \def\dddot#1{{\mathop{#1}\limits^{\vbox to-1.4\ex@{\kern-\tw@\ex@
// \hbox{\normalfont ...}\vss}}}}
// We use \overset which avoids the vertical shift of \mathop.
defineMacro("\\dddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");
defineMacro("\\ddddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}"); // AMSMath's automatic \dots, based on \mdots@@ macro.
var dotsByToken = {
',': '\\dotsc',
@ -18355,11 +18430,21 @@ var renderToHTMLTree = function renderToHTMLTree(expression, options) {
}
};
var version = "0.16.21";
var __domTree = {
Span,
Anchor,
SymbolNode,
SvgNode,
PathNode,
LineNode
}; // ESM exports
var katex = {
/**
* Current KaTeX version
*/
version: "0.16.10",
version,
/**
* Renders the given LaTeX into an HTML+MathML combination, and adds
@ -18379,7 +18464,7 @@ var katex = {
ParseError,
/**
* The shema of Settings
* The schema of Settings
*/
SETTINGS_SCHEMA,
@ -18439,18 +18524,11 @@ var katex = {
/**
* Expose the dom tree node types, which can be useful for type checking nodes.
*
* NOTE: This method is not currently recommended for public use.
* NOTE: These methods are not currently recommended for public use.
* The internal tree representation is unstable and is very likely
* to change. Use at your own risk.
*/
__domTree: {
Span,
Anchor,
SymbolNode,
SvgNode,
PathNode,
LineNode
}
__domTree
};
export { katex as default };
export { ParseError, SETTINGS_SCHEMA, defineFunction as __defineFunction, defineMacro as __defineMacro, defineSymbol as __defineSymbol, __domTree, generateParseTree as __parse, renderToDomTree as __renderToDomTree, renderToHTMLTree as __renderToHTMLTree, setFontMetrics as __setFontMetrics, katex as default, render, renderToString, version };

44
paige/node_modules/katex/katex.js generated vendored

@ -138,11 +138,40 @@ const renderToHTMLTree = function(
}
};
const version = __VERSION__;
const __domTree = {
Span,
Anchor,
SymbolNode,
SvgNode,
PathNode,
LineNode,
};
// ESM exports
export {
version,
render,
renderToString,
ParseError,
SETTINGS_SCHEMA,
generateParseTree as __parse,
renderToDomTree as __renderToDomTree,
renderToHTMLTree as __renderToHTMLTree,
setFontMetrics as __setFontMetrics,
defineSymbol as __defineSymbol,
defineFunction as __defineFunction,
defineMacro as __defineMacro,
__domTree,
};
// CJS exports and ESM default export
export default {
/**
* Current KaTeX version
*/
version: __VERSION__,
version,
/**
* Renders the given LaTeX into an HTML+MathML combination, and adds
* it as a child to the specified DOM node.
@ -158,7 +187,7 @@ export default {
*/
ParseError,
/**
* The shema of Settings
* The schema of Settings
*/
SETTINGS_SCHEMA,
/**
@ -210,16 +239,9 @@ export default {
/**
* Expose the dom tree node types, which can be useful for type checking nodes.
*
* NOTE: This method is not currently recommended for public use.
* NOTE: These methods are not currently recommended for public use.
* The internal tree representation is unstable and is very likely
* to change. Use at your own risk.
*/
__domTree: {
Span,
Anchor,
SymbolNode,
SvgNode,
PathNode,
LineNode,
},
__domTree,
};

@ -1,12 +1,18 @@
{
"name": "katex",
"version": "0.16.10",
"version": "0.16.21",
"description": "Fast math typesetting for the web.",
"main": "dist/katex.js",
"exports": {
".": {
"require": "./dist/katex.js",
"import": "./dist/katex.mjs"
"require": {
"types": "./types/katex.d.ts",
"default": "./dist/katex.js"
},
"import": {
"types": "./types/katex.d.ts",
"default": "./dist/katex.mjs"
}
},
"./contrib/auto-render": {
"require": "./dist/contrib/auto-render.js",
@ -44,7 +50,8 @@
"cli.js",
"src/",
"contrib/",
"dist/"
"dist/",
"types/"
],
"license": "MIT",
"packageManager": "yarn@4.1.1",
@ -97,26 +104,27 @@
"js-yaml": "^4.1.0",
"json-stable-stringify": "^1.0.1",
"jspngopt": "^0.2.0",
"less": "^4.1.3",
"less-loader": "^11.0.0",
"mini-css-extract-plugin": "^2.6.1",
"mkdirp": "^1.0.4",
"p-retry": "^4.6.2",
"pako": "^2.0.4",
"postcss": "^8.4.16",
"postcss-less": "^6.0.0",
"postcss-loader": "^7.0.1",
"postcss-preset-env": "^7.8.0",
"postcss-scss": "^4.0.9",
"prettier": "^2.7.1",
"query-string": "^7.1.1",
"rimraf": "^3.0.2",
"rollup": "^2.78.1",
"rollup": "^2.79.2",
"sass": "^1.75.6",
"sass-loader": "^14.2.1",
"selenium-webdriver": "^4.4.0",
"semantic-release": "^19.0.5",
"sri-toolbox": "^0.2.0",
"style-loader": "^3.3.1",
"stylelint": "^14.11.0",
"stylelint-config-standard": "^28.0.0",
"stylelint-scss": "^6.3.2",
"terser-webpack-plugin": "^5.3.6",
"webpack": "^5.74.0",
"webpack-bundle-analyzer": "^4.6.1",
@ -128,7 +136,7 @@
"test": "yarn test:lint && yarn test:flow && yarn test:jest",
"test:lint": "yarn test:lint:js && yarn test:lint:css",
"test:lint:js": "eslint .",
"test:lint:css": "stylelint src/katex.less static/main.css website/static/**/*.css",
"test:lint:css": "stylelint src/styles/katex.scss static/main.css website/static/**/*.css",
"test:flow": "flow",
"test:jest": "jest",
"test:jest:watch": "jest --watch",

@ -700,7 +700,10 @@ const fontMap: {[string]: {| variant: FontVariant, fontName: string |}} = {
variant: "italic",
fontName: "Math-Italic",
},
"mathsfit": {
variant: "sans-serif-italic",
fontName: "SansSerif-Italic",
},
// "boldsymbol" is missing because they require the use of multiple fonts:
// Math-BoldItalic and Main-Bold. This is handled by a special case in
// makeOrd which ends up calling boldsymbol.

@ -98,6 +98,8 @@ export const getVariant = function(
return "bold";
} else if (font === "mathbb") {
return "double-struck";
} else if (font === "mathsfit") {
return "sans-serif-italic";
} else if (font === "mathfrak") {
return "fraktur";
} else if (font === "mathscr" || font === "mathcal") {
@ -126,6 +128,30 @@ export const getVariant = function(
return null;
};
/**
* Check for <mi>.</mi> which is how a dot renders in MathML,
* or <mo separator="true" lspace="0em" rspace="0em">,</mo>
* which is how a braced comma {,} renders in MathML
*/
function isNumberPunctuation(group: ?MathNode): boolean {
if (!group) {
return false;
}
if (group.type === 'mi' && group.children.length === 1) {
const child = group.children[0];
return child instanceof TextNode && child.text === '.';
} else if (group.type === 'mo' && group.children.length === 1 &&
group.getAttribute('separator') === 'true' &&
group.getAttribute('lspace') === '0em' &&
group.getAttribute('rspace') === '0em'
) {
const child = group.children[0];
return child instanceof TextNode && child.text === ',';
} else {
return false;
}
}
/**
* Takes a list of nodes, builds them, and returns a list of the generated
* MathML nodes. Also combine consecutive <mtext> outputs into a single
@ -163,13 +189,25 @@ export const buildExpression = function(
lastGroup.children.push(...group.children);
continue;
// Concatenate <mn>...</mn> followed by <mi>.</mi>
} else if (group.type === 'mi' && group.children.length === 1 &&
lastGroup.type === 'mn') {
const child = group.children[0];
if (child instanceof TextNode && child.text === '.') {
lastGroup.children.push(...group.children);
continue;
} else if (isNumberPunctuation(group) && lastGroup.type === 'mn') {
lastGroup.children.push(...group.children);
continue;
// Concatenate <mi>.</mi> followed by <mn>...</mn>
} else if (group.type === 'mn' && isNumberPunctuation(lastGroup)) {
group.children = [...lastGroup.children, ...group.children];
groups.pop();
// Put preceding <mn>...</mn> or <mi>.</mi> inside base of
// <msup><mn>...base...</mn>...exponent...</msup> (or <msub>)
} else if ((group.type === 'msup' || group.type === 'msub') &&
group.children.length >= 1 &&
(lastGroup.type === 'mn' || isNumberPunctuation(lastGroup))
) {
const base = group.children[0];
if (base instanceof MathNode && base.type === 'mn') {
base.children = [...lastGroup.children, ...base.children];
groups.pop();
}
// \not
} else if (lastGroup.type === 'mi' && lastGroup.children.length === 1) {
const lastChild = lastGroup.children[0];
if (lastChild instanceof TextNode && lastChild.text === '\u0338' &&

@ -17,6 +17,7 @@ import {path} from "./svgGeometry";
import type Options from "./Options";
import {DocumentFragment} from "./tree";
import {makeEm} from "./units";
import ParseError from "./ParseError";
import type {VirtualNode} from "./tree";
@ -83,6 +84,16 @@ const toNode = function(tagName: string): HTMLElement {
return node;
};
/**
* https://w3c.github.io/html-reference/syntax.html#syntax-attributes
*
* > Attribute Names must consist of one or more characters
* other than the space characters, U+0000 NULL,
* '"', "'", ">", "/", "=", the control characters,
* and any characters that are not defined by Unicode.
*/
const invalidAttributeNameRegex = /[\s"'>/=\x00-\x1f]/;
/**
* Convert into an HTML markup string
*/
@ -110,6 +121,9 @@ const toMarkup = function(tagName: string): string {
// Add the attributes
for (const attr in this.attributes) {
if (this.attributes.hasOwnProperty(attr)) {
if (invalidAttributeNameRegex.test(attr)) {
throw new ParseError(`Invalid attribute name '${attr}'`);
}
markup += ` ${attr}="${utils.escape(this.attributes[attr])}"`;
}
}

@ -75,7 +75,7 @@ const sigmasAndXis = {
// This value determines how large a pt is, for metrics which are defined
// in terms of pts.
// This value is also used in katex.less; if you change it make sure the
// This value is also used in katex.scss; if you change it make sure the
// values match.
ptPerEm: [10.0, 10.0, 10.0],

@ -1,64 +0,0 @@
@font-folder: "../fonts";
@use-ttf: true;
@use-woff: true;
@use-woff2: true;
.use-woff2(@family, @family-suffix) when (@use-woff2 = true) {
src+: url('@{font-folder}/KaTeX_@{family}-@{family-suffix}.woff2') format('woff2')
}
.use-woff(@family, @family-suffix) when (@use-woff = true) {
src+: url('@{font-folder}/KaTeX_@{family}-@{family-suffix}.woff') format('woff')
}
.use-ttf(@family, @family-suffix) when (@use-ttf = true) {
src+: url('@{font-folder}/KaTeX_@{family}-@{family-suffix}.ttf') format('truetype')
}
.generate-suffix(@weight, @style) when (@weight = normal) and (@style = normal) {
@suffix: 'Regular';
}
.generate-suffix(@weight, @style) when (@weight = normal) and (@style = italic) {
@suffix: 'Italic';
}
.generate-suffix(@weight, @style) when (@weight = bold) and (@style = normal) {
@suffix: 'Bold';
}
.generate-suffix(@weight, @style) when (@weight = bold) and (@style = italic) {
@suffix: 'BoldItalic';
}
.font-face(@family, @weight, @style) {
.generate-suffix(@weight, @style);
@font-face {
font-family: 'KaTeX_@{family}';
.use-woff2(@family, @suffix);
.use-woff(@family, @suffix);
.use-ttf(@family, @suffix);
font-weight: @weight;
font-style: @style;
}
}
.font-face('AMS', normal, normal);
.font-face('Caligraphic', bold, normal);
.font-face('Caligraphic', normal, normal);
.font-face('Fraktur', bold, normal);
.font-face('Fraktur', normal, normal);
.font-face('Main', bold, normal);
.font-face('Main', bold, italic);
.font-face('Main', normal, italic);
.font-face('Main', normal, normal);
//.font-face('Math', bold, normal);
.font-face('Math', bold, italic);
.font-face('Math', normal, italic);
//.font-face('Math', normal, normal);
.font-face('SansSerif', bold, normal);
.font-face('SansSerif', normal, italic);
.font-face('SansSerif', normal, normal);
.font-face('Script', normal, normal);
.font-face('Size1', normal, normal);
.font-face('Size2', normal, normal);
.font-face('Size3', normal, normal);
.font-face('Size4', normal, normal);
.font-face('Typewriter', normal, normal);

@ -33,7 +33,7 @@ defineFunction({
type: "font",
names: [
// styles, except \boldsymbol defined below
"\\mathrm", "\\mathit", "\\mathbf", "\\mathnormal",
"\\mathrm", "\\mathit", "\\mathbf", "\\mathnormal", "\\mathsfit",
// families
"\\mathbb", "\\mathcal", "\\mathfrak", "\\mathscr", "\\mathsf",

@ -11,6 +11,8 @@ defineFunction({
props: {
numArgs: 2,
numOptionalArgs: 1,
allowedInText: true,
allowedInMath: true,
argTypes: ["size", "size", "size"],
},
handler({parser}, args, optArgs) {

@ -30,9 +30,13 @@ const optionsWithFont = (group, options) => {
return options.withTextFontFamily(textFontFamilies[font]);
} else if (textFontWeights[font]) {
return options.withTextFontWeight(textFontWeights[font]);
} else {
return options.withTextFontShape(textFontShapes[font]);
} else if (font === "\\emph") {
return options.fontShape === "textit" ?
options.withTextFontShape("textup") :
options.withTextFontShape("textit");
}
return options.withTextFontShape(textFontShapes[font]);
};
defineFunction({
@ -43,7 +47,7 @@ defineFunction({
// Font weights
"\\textbf", "\\textmd",
// Font Shapes
"\\textit", "\\textup",
"\\textit", "\\textup", "\\emph",
],
props: {
numArgs: 1,

@ -146,7 +146,9 @@ defineMacro("\\char", function(context) {
// \newcommand{\macro}[args]{definition}
// \renewcommand{\macro}[args]{definition}
// TODO: Optional arguments: \newcommand{\macro}[args][default]{definition}
const newcommand = (context, existsOK: boolean, nonexistsOK: boolean) => {
const newcommand = (
context, existsOK: boolean, nonexistsOK: boolean, skipIfExists: boolean
) => {
let arg = context.consumeArg().tokens;
if (arg.length !== 1) {
throw new ParseError(
@ -181,16 +183,21 @@ const newcommand = (context, existsOK: boolean, nonexistsOK: boolean) => {
arg = context.consumeArg().tokens;
}
// Final arg is the expansion of the macro
context.macros.set(name, {
tokens: arg,
numArgs,
});
if (!(exists && skipIfExists)) {
// Final arg is the expansion of the macro
context.macros.set(name, {
tokens: arg,
numArgs,
});
}
return '';
};
defineMacro("\\newcommand", (context) => newcommand(context, false, true));
defineMacro("\\renewcommand", (context) => newcommand(context, true, false));
defineMacro("\\providecommand", (context) => newcommand(context, true, true));
defineMacro("\\newcommand",
(context) => newcommand(context, false, true, false));
defineMacro("\\renewcommand",
(context) => newcommand(context, true, false, false));
defineMacro("\\providecommand",
(context) => newcommand(context, true, true, true));
// terminal (console) tools
defineMacro("\\message", (context) => {
@ -341,7 +348,7 @@ defineMacro("\\lrcorner", "\\html@mathml{\\@lrcorner}{\\mathop{\\char\"231f}}");
// \kern6\p@\hbox{.}\hbox{.}\hbox{.}}}
// We'll call \varvdots, which gets a glyph from symbols.js.
// The zero-width rule gets us an equivalent to the vertical 6pt kern.
defineMacro("\\vdots", "\\mathord{\\varvdots\\rule{0pt}{15pt}}");
defineMacro("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}");
defineMacro("\u22ee", "\\vdots");
//////////////////////////////////////////////////////////////////////
@ -380,6 +387,12 @@ defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");
defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");
defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;");
// \def\dddot#1{{\mathop{#1}\limits^{\vbox to-1.4\ex@{\kern-\tw@\ex@
// \hbox{\normalfont ...}\vss}}}}
// We use \overset which avoids the vertical shift of \mathop.
defineMacro("\\dddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");
defineMacro("\\ddddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");
// AMSMath's automatic \dots, based on \mdots@@ macro.
const dotsByToken = {
',': '\\dotsc',

@ -95,7 +95,18 @@ export class MathNode implements MathDomNode {
}
for (let i = 0; i < this.children.length; i++) {
node.appendChild(this.children[i].toNode());
// Combine multiple TextNodes into one TextNode, to prevent
// screen readers from reading each as a separate word [#3995]
if (this.children[i] instanceof TextNode &&
this.children[i + 1] instanceof TextNode) {
let text = this.children[i].toText() + this.children[++i].toText();
while (this.children[i + 1] instanceof TextNode) {
text += this.children[++i].toText();
}
node.appendChild(new TextNode(text).toNode());
} else {
node.appendChild(this.children[i].toNode());
}
}
return node;

@ -0,0 +1,71 @@
$font-folder: "../../fonts" !default;
$use-woff2: true !default;
$use-woff: true !default;
$use-ttf: true !default;
@function generate-src($family, $family-suffix) {
$src: null;
@if $use-woff2 {
$src: append($src, url('#{$font-folder}/KaTeX_#{$family}-#{$family-suffix}.woff2') format('woff2'), comma);
}
@if $use-woff {
$src: append($src, url('#{$font-folder}/KaTeX_#{$family}-#{$family-suffix}.woff') format('woff'), comma);
}
@if $use-ttf {
$src: append($src, url('#{$font-folder}/KaTeX_#{$family}-#{$family-suffix}.ttf') format('truetype'), comma);
}
@return $src;
}
@function generate-suffix($weight, $style) {
$suffix: null;
@if $weight == normal and $style == normal {
$suffix: 'Regular';
}
@if $weight == normal and $style == italic {
$suffix: 'Italic';
}
@if $weight == bold and $style == normal {
$suffix: 'Bold';
}
@if $weight == bold and $style == italic {
$suffix: 'BoldItalic';
}
@return $suffix;
}
@mixin font-face($family, $weight, $style) {
$suffix: generate-suffix($weight, $style);
$src: generate-src($family, $suffix);
@font-face {
font-family: 'KaTeX_#{$family}';
src: $src;
font-weight: $weight;
font-style: $style;
}
}
@include font-face('AMS', normal, normal);
@include font-face('Caligraphic', bold, normal);
@include font-face('Caligraphic', normal, normal);
@include font-face('Fraktur', bold, normal);
@include font-face('Fraktur', normal, normal);
@include font-face('Main', bold, normal);
@include font-face('Main', bold, italic);
@include font-face('Main', normal, italic);
@include font-face('Main', normal, normal);
@include font-face('Math', bold, italic);
@include font-face('Math', normal, italic);
@include font-face('SansSerif', bold, normal);
@include font-face('SansSerif', normal, italic);
@include font-face('SansSerif', normal, normal);
@include font-face('Script', normal, normal);
@include font-face('Size1', normal, normal);
@include font-face('Size2', normal, normal);
@include font-face('Size3', normal, normal);
@include font-face('Size4', normal, normal);
@include font-face('Typewriter', normal, normal);

@ -1,11 +1,14 @@
/* stylelint-disable font-family-no-missing-generic-family-keyword */
@import "fonts.less";
@import "./fonts.scss";
// The mu unit is defined as 1/18 em
@mu: (1em / 18);
$mu: calc(1em / 18);
// The version is dynamically set from package.json via webpack.common.js
@version: "";
$version: "" !default;
// CSS margin property for math in display mode
$display-margin: 1em 0 !default;
.katex {
font: normal 1.21em KaTeX_Main, Times New Roman, serif;
@ -27,7 +30,7 @@
}
.katex-version::after {
content: @version;
content: $version;
}
.katex-mathml {
@ -155,6 +158,7 @@
font-weight: bold;
}
.mathsfit,
.mathitsf,
.textitsf {
font-family: KaTeX_SansSerif;
@ -168,13 +172,13 @@
// This value is also used in fontMetrics.js, if you change it make sure the
// values match.
@ptperem: 10;
@nulldelimiterspace: (1.2em / @ptperem);
$ptperem: 10;
$nulldelimiterspace: calc(1.2em / $ptperem);
@muspace: 0.055556em; // 1mu
@thinspace: 0.16667em; // 3mu
@mediumspace: 0.22222em; // 4mu
@thickspace: 0.27778em; // 5mu
$muspace: 0.055556em; // 1mu
$thinspace: 0.16667em; // 3mu
$mediumspace: 0.22222em; // 4mu
$thickspace: 0.27778em; // 5mu
.vlist-t {
display: inline-table;
@ -328,47 +332,23 @@
> .root {
/* These values are taken from the definition of `\r@@t`,
`\mkern 5mu` and `\mkern -10mu`. */
margin-left: 5*@mu;
margin-right: -10*@mu;
margin-left: calc(5*$mu);
margin-right: calc(-10*$mu);
}
}
.sizing,
.fontsize-ensurer {
@size1: 0.5;
@size2: 0.6;
@size3: 0.7;
@size4: 0.8;
@size5: 0.9;
@size6: 1;
@size7: 1.2;
@size8: 1.44;
@size9: 1.728;
@size10: 2.074;
@size11: 2.488;
.generate-size-change(@from, @to) {
&.reset-size@{from}.size@{to} {
@sizeFromVariable: ~"size@{from}";
@sizeToVariable: ~"size@{to}";
font-size: (@@sizeToVariable / @@sizeFromVariable) * 1em;
$sizes: 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.44, 1.728, 2.074, 2.488;
@for $from from 1 through length($sizes) {
@for $to from 1 through length($sizes) {
&.reset-size#{$from}.size#{$to} {
/* stylelint-disable-next-line */
font-size: calc((nth($sizes, $to) / nth($sizes, $from)) * 1em);
}
}
}
.generate-to-size-change(@from, @currTo) when (@currTo =< 11) {
.generate-size-change(@from, @currTo);
.generate-to-size-change(@from, (@currTo + 1));
}
.generate-from-size-change(@currFrom) when (@currFrom =< 11) {
.generate-to-size-change(@currFrom, 1);
.generate-from-size-change((@currFrom + 1));
}
.generate-from-size-change(1);
}
.delimsizing {
@ -390,7 +370,7 @@
.nulldelimiter {
display: inline-block;
width: @nulldelimiterspace;
width: $nulldelimiterspace;
}
.delimcenter {
@ -645,7 +625,7 @@
.katex-display {
display: block;
margin: 1em 0;
margin: $display-margin;
text-align: center;
> .katex {

@ -673,7 +673,9 @@ defineSymbol(text, main, inner, "\u2026", "\\ldots", true);
defineSymbol(math, main, inner, "\u2026", "\\ldots", true);
defineSymbol(math, main, inner, "\u22ef", "\\@cdots", true);
defineSymbol(math, main, inner, "\u22f1", "\\ddots", true);
defineSymbol(math, main, textord, "\u22ee", "\\varvdots"); // \vdots is a macro
// \vdots is a macro that uses one of these two symbols (with made-up names):
defineSymbol(math, main, textord, "\u22ee", "\\varvdots");
defineSymbol(text, main, textord, "\u22ee", "\\varvdots");
defineSymbol(math, main, accent, "\u02ca", "\\acute");
defineSymbol(math, main, accent, "\u02cb", "\\grave");
defineSymbol(math, main, accent, "\u00a8", "\\ddot");
@ -812,11 +814,11 @@ for (let i = 0; i < letters.length; i++) {
defineSymbol(math, main, mathord, ch, wideChar);
defineSymbol(text, main, textord, ch, wideChar);
wideChar = String.fromCharCode(0xD835, 0xDD04 + i); // A-Z a-z Fractur
wideChar = String.fromCharCode(0xD835, 0xDD04 + i); // A-Z a-z Fraktur
defineSymbol(math, main, mathord, ch, wideChar);
defineSymbol(text, main, textord, ch, wideChar);
wideChar = String.fromCharCode(0xD835, 0xDD6C + i); // A-Z a-z bold Fractur
wideChar = String.fromCharCode(0xD835, 0xDD6C + i); // A-Z a-z bold Fraktur
defineSymbol(math, main, mathord, ch, wideChar);
defineSymbol(text, main, textord, ch, wideChar);

@ -0,0 +1,258 @@
// Adapted from
// - https://katex.org/docs/options
// - https://katex.org/docs/api
// - https://katex.org/docs/error
// for v0.16.11 on 2024/12/01
// with some references from https://www.npmjs.com/package/@types/katex
/**
* For the `trust` option in `KatexOptions`, a custom function
* `handler(context)` can be provided to customize behavior depending on the
* context (command, arguments e.g. a URL, etc.)
* @see https://katex.org/docs/options
*/
export type TrustContext =
| { command: "\\url", url: string, protocol?: string }
| { command: "\\href", url: string, protocol?: string }
| { command: "\\includegraphics", url: string, protocol?: string }
| { command: "\\htmlClass", class: string }
| { command: "\\htmlId", id: string }
| { command: "\\htmlStyle", style: string }
| { command: "\\htmlData", attributes: Record<string, string> }
export type Catcodes = Record<string, number>;
export interface Lexer {
input: string;
tokenRegex: RegExp;
settings: Required<KatexOptions>;
catcodes: Catcodes;
}
export interface SourceLocation {
start: number;
end: number;
lexer: Lexer;
}
export interface Token {
text: string;
loc: SourceLocation | undefined;
noexpand?: boolean;
treatAsRelax?: boolean;
}
export type StrictFunction = (
errorCode:
| "unknownSymbol"
| "unicodeTextInMathMode"
| "mathVsTextUnits"
| "commentAtEnd"
| "htmlExtension"
| "newLineInDisplayMode",
errorMsg: string,
token: Token,
) => boolean | "error" | "warn" | "ignore" | undefined;
/**
* Options for `katex.render` and `katex.renderToString`.
* @see https://katex.org/docs/options
*/
export interface KatexOptions {
/**
* If `true` the math will be rendered in display mode.
* If `false` the math will be rendered in inline mode.
* @see https://katex.org/docs/options
*
* @default false
*/
displayMode?: boolean;
/**
* Determines the markup language of the output. The valid choices are:
* - `html`: Outputs KaTeX in HTML only.
* - `mathml`: Outputs KaTeX in MathML only.
* - `htmlAndMathml`: Outputs HTML for visual rendering and includes MathML
* for accessibility.
*
* @default "htmlAndMathml"
*/
output?: "html" | "mathml" | "htmlAndMathml";
/**
* If `true`, display math has `\tag`s rendered on the left instead of the
* right, like `\usepackage[leqno]{amsmath}` in LaTeX.
*
* @default false
*/
leqno?: boolean;
/**
* If `true`, display math renders flush left with a `2em` left margin,
* like `\documentclass[fleqn]` in LaTeX with the `amsmath` package.
*
* @default false
*/
fleqn?: boolean;
/**
* If `true`, KaTeX will throw a `ParseError` when it encounters an
* unsupported command or invalid LaTeX.
* If `false`, KaTeX will render unsupported commands as text, and render
* invalid LaTeX as its source code with hover text giving the error, in
* the color given by `errorColor`.
*
* @default true
*/
throwOnError?: boolean;
/**
* A color string given in the format `"#XXX"` or `"#XXXXXX"`. This option
* determines the color that unsupported commands and invalid LaTeX are
* rendered in when `throwOnError` is set to `false`.
*
* @default "#cc0000"
*/
errorColor?: string;
/**
* A collection of custom macros.
* @see https://katex.org/docs/options
*/
macros?: Record<string, string | object | ((macroExpander:object) => string | object)>;
/**
* Specifies a minimum thickness, in ems, for fraction lines, `\sqrt` top
* lines, `{array}` vertical lines, `\hline`, `\hdashline`, `\underline`,
* `\overline`, and the borders of `\fbox`, `\boxed`, and `\fcolorbox`.
* The usual value for these items is `0.04`, so for `minRuleThickness`
* to be effective it should probably take a value slightly above `0.04`,
* say `0.05` or `0.06`. Negative values will be ignored.
*/
minRuleThickness?: number;
/**
* In early versions of both KaTeX (<0.8.0) and MathJax, the `\color`
* function expected the content to be a function argument, as in
* `\color{blue}{hello}`. In current KaTeX, `\color` is a switch, as in
* `\color{blue}` hello. This matches LaTeX behavior. If you want the old
* `\color` behavior, set option colorIsTextColor to true.
*/
colorIsTextColor?: boolean;
/**
* All user-specified sizes, e.g. in `\rule{500em}{500em}`, will be capped
* to `maxSize` ems. If set to `Infinity` (the default), users can make
* elements and spaces arbitrarily large.
*
* @default Infinity
*/
maxSize?: number;
/**
* Limit the number of macro expansions to the specified number, to prevent
* e.g. infinite macro loops. `\edef` expansion counts all expanded tokens.
* If set to `Infinity`, the macro expander will try to fully expand as in
* LaTeX.
*
* @default 1000
*/
maxExpand?: number;
/**
* If `false` or `"ignore"`, allow features that make writing LaTeX
* convenient but are not actually supported by (Xe)LaTeX
* (similar to MathJax).
* If `true` or `"error"` (LaTeX faithfulness mode), throw an error for any
* such transgressions.
* If `"warn"` (the default), warn about such behavior via `console.warn`.
* Provide a custom function `handler(errorCode, errorMsg, token)` to
* customize behavior depending on the type of transgression (summarized by
* the string code `errorCode` and detailed in `errorMsg`); this function
* can also return `"ignore"`, `"error"`, or `"warn"` to use a built-in
* behavior.
* @see https://katex.org/docs/options
*
* @default "warn"
*/
strict?:
| boolean
| "ignore" | "warn" | "error"
| StrictFunction;
/**
* If `false` (do not trust input), prevent any commands like
* `\includegraphics` that could enable adverse behavior, rendering them
* instead in `errorColor`.
* If `true` (trust input), allow all such commands.
* Provide a custom function `handler(context)` to customize behavior
* depending on the context (command, arguments e.g. a URL, etc.).
* @see https://katex.org/docs/options
*
* @default false
*/
trust?: boolean | ((context: TrustContext) => boolean);
/**
* Run KaTeX code in the global group. As a consequence, macros defined at
* the top level by `\def` and `\newcommand` are added to the macros
* argument and can be used in subsequent render calls. In LaTeX,
* constructs such as `\begin{equation}` and `$$` create a local group and
* prevent definitions other than `\gdef` from becoming visible outside of
* those blocks, so this is KaTeX's default behavior.
*
* @default false
*/
globalGroup?: boolean;
}
/**
* In-browser rendering
*
* Call the `render` function with a TeX expression and a DOM element to
* render into.
*
* @param {string} tex A TeX expression.
* @param {HTMLElement} element A HTML DOM element.
* @param {KatexOptions} options An options object.
* @returns {void}
* @see https://katex.org/docs/api
*/
export function render(
tex: string,
element: HTMLElement,
options?: KatexOptions,
): void;
/**
* Server-side rendering or rendering to a string
*
* Use the `renderToString` function to generate HTML on the server or to
* generate an HTML string of the rendered math.
*
* @param {string} tex A TeX expression.
* @param {KatexOptions} options An options object.
* @returns {string} The HTML string of the rendered math.
* @see https://katex.org/docs/api
*/
export function renderToString(tex: string, options?: KatexOptions): string;
/**
* If KaTeX encounters an error (invalid or unsupported LaTeX) and
* `throwOnError` hasn't been set to `false`, then `katex.render` and
* `katex.renderToString` will throw an exception of type
* `ParseError`. The message in this error includes some of the LaTeX source
* code, so needs to be escaped if you want to render it to HTML.
* @see https://katex.org/docs/error
*/
export class ParseError implements Error {
constructor(message: string, token?: object);
name: "ParseError";
position: number;
length: number;
rawMessage: string;
message: string;
}
export const version: string;
export as namespace katex;
declare const katex: {
version: string;
render: typeof render;
renderToString: typeof renderToString;
ParseError: typeof ParseError;
};
export default katex;

@ -62,13 +62,14 @@
}
},
"node_modules/katex": {
"version": "0.16.10",
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.10.tgz",
"integrity": "sha512-ZiqaC04tp2O5utMsl2TEZTXxa6WSC4yo0fv5ML++D3QZv/vx2Mct0mTlRx3O+uUkjfuAgOkzsCmq5MiUEsDDdA==",
"version": "0.16.21",
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.21.tgz",
"integrity": "sha512-XvqR7FgOHtWupfMiigNzmh+MgUVmDGU2kXZm899ZkPfcuoPuFxyHmXsgATDpFZDAXCI8tvinaVcDo8PIIJSo4A==",
"funding": [
"https://opencollective.com/katex",
"https://github.com/sponsors/katex"
],
"license": "MIT",
"dependencies": {
"commander": "^8.3.0"
},

Loading…
Cancel
Save