Socket
Socket
Sign inDemoInstall

katex

Package Overview
Dependencies
Maintainers
7
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

katex - npm Package Compare versions

Comparing version 0.16.5 to 0.16.6

2

contrib/auto-render/test/auto-render-spec.js

@@ -130,3 +130,3 @@ /**

it("splits mutliple times", function() {
it("splits multiple times", function() {
expect("hello ( world ) boo ( more ) stuff").toSplitInto(

@@ -133,0 +133,0 @@ [

@@ -21,3 +21,3 @@ # Copy-tex extension

```html
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.5/dist/contrib/copy-tex.min.js" integrity="sha384-ww/583aHhxWkz5DEVn6OKtNiIaLi2iBRNZXfJRiY1Ai7tnJ9UXpEsyvOITVpTl4A" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.6/dist/contrib/copy-tex.min.js" integrity="sha384-ww/583aHhxWkz5DEVn6OKtNiIaLi2iBRNZXfJRiY1Ai7tnJ9UXpEsyvOITVpTl4A" crossorigin="anonymous"></script>
```

@@ -39,3 +39,3 @@

```html
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.16.5/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.6/dist/contrib/copy-tex.mjs" integrity="sha384-bVEnwt0PtX+1EuJoOEcm4rgTUWvb2ILTdjHfI1gUe/r5fdqrTcQaUuRdHG2DciuQ" crossorigin="anonymous"></script>
```

@@ -14,3 +14,3 @@ # `math/tex` Custom Script Type Extension

```html
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.5/dist/contrib/mathtex-script-type.min.js" integrity="sha384-jiBVvJ8NGGj5n7kJaiWwWp9AjC+Yh8rhZY3GtAX8yU28azcLgoRo4oukO87g7zDT" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.6/dist/contrib/mathtex-script-type.min.js" integrity="sha384-jiBVvJ8NGGj5n7kJaiWwWp9AjC+Yh8rhZY3GtAX8yU28azcLgoRo4oukO87g7zDT" crossorigin="anonymous"></script>
```

@@ -27,5 +27,5 @@ You can download the script and use it locally, or from a local KaTeX installation instead.

<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.5/dist/katex.min.css" integrity="sha384-JzZYylmwsQW/mzosimflHksK2k3GXCUi9MKWSj4R8C123trOprLxW8kTXkCx27vx" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.5/dist/katex.min.js" integrity="sha384-ln7gG7tOY4cLmBcihVLqtNOlWe3w2+ayBobLDCNSdFEanAuMF+lPAntv5HEHEJuT" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.5/dist/contrib/mathtex-script-type.min.js" integrity="sha384-jiBVvJ8NGGj5n7kJaiWwWp9AjC+Yh8rhZY3GtAX8yU28azcLgoRo4oukO87g7zDT" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.6/dist/katex.min.css" integrity="sha384-mXD7x5S50Ko38scHSnD4egvoExgMPbrseZorkbE49evAfv9nNcbrXJ8LLNsDgh9d" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.6/dist/katex.min.js" integrity="sha384-j/ZricySXBnNMJy9meJCtyXTKMhIJ42heyr7oAdxTDBy/CYA9hzpMo+YTNV5C+1X" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.6/dist/contrib/mathtex-script-type.min.js" integrity="sha384-jiBVvJ8NGGj5n7kJaiWwWp9AjC+Yh8rhZY3GtAX8yU28azcLgoRo4oukO87g7zDT" crossorigin="anonymous"></script>
</head>

@@ -40,2 +40,2 @@ <body>

```html
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.16.5/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.6/dist/contrib/mathtex-script-type.mjs" integrity="sha384-4EJvC5tvqq9XJxXvdD4JutBokuFw/dCe2AB4gZ9sRpwFFXECpL3qT43tmE0PkpVg" crossorigin="anonymous"></script>

@@ -10,3 +10,3 @@ # mhchem extension

```html
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.5/dist/contrib/mhchem.min.js" integrity="sha384-ifpG+NlgMq0kvOSGqGQxW1mJKpjjMDmZdpKGq3tbvD3WPhyshCEEYClriK/wRVU0" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.6/dist/contrib/mhchem.min.js" integrity="sha384-ifpG+NlgMq0kvOSGqGQxW1mJKpjjMDmZdpKGq3tbvD3WPhyshCEEYClriK/wRVU0" crossorigin="anonymous"></script>
```

@@ -13,0 +13,0 @@

@@ -673,3 +673,3 @@ // @flow

case "mathchoice": {
// TODO: track which which style we're using, e.g. dispaly, text, etc.
// TODO: track which style we're using, e.g. display, text, etc.
// default to text style if even that may not be the correct style

@@ -676,0 +676,0 @@ buildA11yStrings(tree.text, a11yStrings, atomType);

@@ -804,3 +804,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

{
// TODO: track which which style we're using, e.g. dispaly, text, etc.
// TODO: track which style we're using, e.g. display, text, etc.
// default to text style if even that may not be the correct style

@@ -807,0 +807,0 @@ buildA11yStrings(tree.text, a11yStrings, atomType);

@@ -34,9 +34,9 @@ # [<img src="https://katex.org/img/katex-logo-black.svg" width="130" alt="KaTeX">](https://katex.org/)

<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.5/dist/katex.min.css" integrity="sha384-JzZYylmwsQW/mzosimflHksK2k3GXCUi9MKWSj4R8C123trOprLxW8kTXkCx27vx" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.6/dist/katex.min.css" integrity="sha384-mXD7x5S50Ko38scHSnD4egvoExgMPbrseZorkbE49evAfv9nNcbrXJ8LLNsDgh9d" crossorigin="anonymous">
<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.5/dist/katex.min.js" integrity="sha384-ln7gG7tOY4cLmBcihVLqtNOlWe3w2+ayBobLDCNSdFEanAuMF+lPAntv5HEHEJuT" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.6/dist/katex.min.js" integrity="sha384-j/ZricySXBnNMJy9meJCtyXTKMhIJ42heyr7oAdxTDBy/CYA9hzpMo+YTNV5C+1X" 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.5/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.6/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>

@@ -43,0 +43,0 @@ </head>

{
"name": "katex",
"version": "0.16.5",
"version": "0.16.6",
"description": "Fast math typesetting for the web.",

@@ -5,0 +5,0 @@ "main": "dist/katex.js",

@@ -34,9 +34,9 @@ # [<img src="https://katex.org/img/katex-logo-black.svg" width="130" alt="KaTeX">](https://katex.org/)

<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.5/dist/katex.min.css" integrity="sha384-JzZYylmwsQW/mzosimflHksK2k3GXCUi9MKWSj4R8C123trOprLxW8kTXkCx27vx" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.6/dist/katex.min.css" integrity="sha384-mXD7x5S50Ko38scHSnD4egvoExgMPbrseZorkbE49evAfv9nNcbrXJ8LLNsDgh9d" crossorigin="anonymous">
<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.5/dist/katex.min.js" integrity="sha384-ln7gG7tOY4cLmBcihVLqtNOlWe3w2+ayBobLDCNSdFEanAuMF+lPAntv5HEHEJuT" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.6/dist/katex.min.js" integrity="sha384-j/ZricySXBnNMJy9meJCtyXTKMhIJ42heyr7oAdxTDBy/CYA9hzpMo+YTNV5C+1X" 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.5/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.6/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>

@@ -43,0 +43,0 @@ </head>

// @flow
/**
* This file converts a parse tree into a cooresponding MathML tree. The main
* This file converts a parse tree into a corresponding MathML tree. The main
* entry point is the `buildMathML` function, which takes a parse tree from the

@@ -104,3 +104,3 @@ * parser.

} else if (font === "mathscr" || font === "mathcal") {
// MathML makes no distinction between script and caligrahpic
// MathML makes no distinction between script and calligraphic
return "script";

@@ -107,0 +107,0 @@ } else if (font === "mathsf") {

@@ -45,3 +45,3 @@ // @flow

/**
* Final enviornment spec for use at parse time.
* Final environment spec for use at parse time.
* This is almost identical to `EnvDefSpec`, except it

@@ -48,0 +48,0 @@ * 1. includes the function handler

@@ -38,3 +38,3 @@ // @flow

*/
expandOnce(expandableOnly?: boolean): Token | Token[];
expandOnce(expandableOnly?: boolean): number | boolean;

@@ -41,0 +41,0 @@ /**

@@ -367,3 +367,3 @@ // @flow

// Calcuate the minimal height that the delimiter can have.
// Calculate the minimal height that the delimiter can have.
// It is at least the size of the top, bottom, and optional middle combined.

@@ -457,3 +457,3 @@ const minHeight = topHeightTotal + bottomHeightTotal + middleHeightTotal;

// All surds have 0.08em padding above the viniculum inside the SVG.
// All surds have 0.08em padding above the vinculum inside the SVG.
// That keeps browser span height rounding error from pinching the line.

@@ -467,6 +467,6 @@ const vbPad = 80; // padding above the surd, measured inside the viewBox.

viewBoxHeight: number,
extraViniculum: number,
extraVinculum: number,
options: Options,
): SvgSpan {
const path = sqrtPath(sqrtName, extraViniculum, viewBoxHeight);
const path = sqrtPath(sqrtName, extraVinculum, viewBoxHeight);
const pathNode = new PathNode(sqrtName, path);

@@ -506,5 +506,5 @@

// The standard sqrt SVGs each have a 0.04em thick viniculum.
// If Settings.minRuleThickness is larger than that, we add extraViniculum.
const extraViniculum = Math.max(0,
// The standard sqrt SVGs each have a 0.04em thick vinculum.
// If Settings.minRuleThickness is larger than that, we add extraVinculum.
const extraVinculum = Math.max(0,
options.minRuleThickness - options.fontMetrics().sqrtRuleThickness);

@@ -521,3 +521,3 @@

// Then browser rounding error on the parent span height will not
// encroach on the ink of the viniculum. But that padding is not
// encroach on the ink of the vinculum. But that padding is not
// included in the TeX-like `height` used for calculation of

@@ -529,3 +529,3 @@ // vertical alignment. So texHeight = span.height < span.style.height.

// 1000 unit normal glyph height.
viewBoxHeight = 1000 + 1000 * extraViniculum + vbPad;
viewBoxHeight = 1000 + 1000 * extraVinculum + vbPad;
if (height < 1.0) {

@@ -536,5 +536,5 @@ sizeMultiplier = 1.0; // mimic a \textfont radical

}
spanHeight = (1.0 + extraViniculum + emPad) / sizeMultiplier;
texHeight = (1.00 + extraViniculum) / sizeMultiplier;
span = sqrtSvg("sqrtMain", spanHeight, viewBoxHeight, extraViniculum,
spanHeight = (1.0 + extraVinculum + emPad) / sizeMultiplier;
texHeight = (1.00 + extraVinculum) / sizeMultiplier;
span = sqrtSvg("sqrtMain", spanHeight, viewBoxHeight, extraVinculum,
options);

@@ -547,7 +547,7 @@ span.style.minWidth = "0.853em";

viewBoxHeight = (1000 + vbPad) * sizeToMaxHeight[delim.size];
texHeight = (sizeToMaxHeight[delim.size] + extraViniculum) / sizeMultiplier;
spanHeight = (sizeToMaxHeight[delim.size] + extraViniculum + emPad)
texHeight = (sizeToMaxHeight[delim.size] + extraVinculum) / sizeMultiplier;
spanHeight = (sizeToMaxHeight[delim.size] + extraVinculum + emPad)
/ sizeMultiplier;
span = sqrtSvg("sqrtSize" + delim.size, spanHeight, viewBoxHeight,
extraViniculum, options);
extraVinculum, options);
span.style.minWidth = "1.02em";

@@ -559,6 +559,6 @@ advanceWidth = 1.0 / sizeMultiplier; // 1.0 from the font.

// We'll use a single SVG to accomplish the same thing.
spanHeight = height + extraViniculum + emPad;
texHeight = height + extraViniculum;
viewBoxHeight = Math.floor(1000 * height + extraViniculum) + vbPad;
span = sqrtSvg("sqrtTall", spanHeight, viewBoxHeight, extraViniculum,
spanHeight = height + extraVinculum + emPad;
texHeight = height + extraVinculum;
viewBoxHeight = Math.floor(1000 * height + extraVinculum) + vbPad;
span = sqrtSvg("sqrtTall", spanHeight, viewBoxHeight, extraVinculum,
options);

@@ -579,3 +579,3 @@ span.style.minWidth = "0.742em";

// have thicker rules.
ruleWidth: (options.fontMetrics().sqrtRuleThickness + extraViniculum)
ruleWidth: (options.fontMetrics().sqrtRuleThickness + extraVinculum)
* sizeMultiplier,

@@ -582,0 +582,0 @@ };

@@ -576,4 +576,4 @@ // @flow

// The 0.16 and 0.09 values are found emprically. They produce an array
// similar to LaTeX and in which content does not interfere with \hines.
// The 0.16 and 0.09 values are found empirically. They produce an array
// similar to LaTeX and in which content does not interfere with \hlines.
const gap = (group.arraystretch === 0.5)

@@ -580,0 +580,0 @@ ? 0.1 // {smallmatrix}, {subarray}

@@ -16,5 +16,5 @@ // @flow

// 7-8pt), and scriptscriptstyle (size index 1 and 2: 5-6pt). These are
// provided in the the arrays below, in that order.
// provided in the arrays below, in that order.
//
// The font metrics are stored in fonts cmsy10, cmsy7, and cmsy5 respsectively.
// The font metrics are stored in fonts cmsy10, cmsy7, and cmsy5 respectively.
// This was determined by running the following script:

@@ -29,3 +29,3 @@ //

//
// The metrics themselves were retreived using the following commands:
// The metrics themselves were retrieved using the following commands:
//

@@ -235,3 +235,3 @@ // tftopl cmsy10

// the Latin capital letter M. This is close enough because
// we (currently) only care about the height of the glpyh
// we (currently) only care about the height of the glyph
// not its width.

@@ -238,0 +238,0 @@ if (supportedCodepoint(ch)) {

@@ -50,3 +50,3 @@ // @flow

// Flow is unable to correctly infer the type of `group`, even though it's
// unamibiguously determined from the passed-in `type` above.
// unambiguously determined from the passed-in `type` above.
htmlBuilder(group: ParseNode<"xArrow">, options) {

@@ -53,0 +53,0 @@ const style = options.style;

@@ -345,3 +345,3 @@ // @flow

mathmlBuilder: (group, options) => {
// A Firefox \middle will strech a character vertically only if it
// A Firefox \middle will stretch a character vertically only if it
// is in the fence part of the operator dictionary at:

@@ -348,0 +348,0 @@ // https://www.w3.org/TR/MathML3/appendixc.html.

@@ -252,11 +252,11 @@ // @flow

* If the token is expanded, the resulting tokens will be pushed onto
* the stack in reverse order and will be returned as an array,
* also in reverse order.
* the stack in reverse order, and the number of such tokens will be
* returned. This number might be zero or positive.
*
* If not, the next token will be returned without removing it
* from the stack. This case can be detected by a `Token` return value
* instead of an `Array` return value.
* If not, the return value is `false`, and the next token remains at the
* top of the stack.
*
* In either case, the next token will be on the top of the stack,
* or the stack will be empty.
* or the stack will be empty (in case of empty expansion
* and no other tokens).
*

@@ -268,3 +268,3 @@ * Used to implement `expandAfterFuture` and `expandNextToken`.

*/
expandOnce(expandableOnly?: boolean): Token | Token[] {
expandOnce(expandableOnly?: boolean): number | boolean {
const topToken = this.popToken();

@@ -279,3 +279,3 @@ const name = topToken.text;

this.pushToken(topToken);
return topToken;
return false;
}

@@ -316,3 +316,3 @@ this.expansionCount++;

this.pushTokens(tokens);
return tokens;
return tokens.length;
}

@@ -336,11 +336,10 @@

for (;;) {
const expanded = this.expandOnce();
// expandOnce returns Token if and only if it's fully expanded.
if (expanded instanceof Token) {
if (this.expandOnce() === false) { // fully expanded
const token = this.stack.pop();
// the token after \noexpand is interpreted as if its meaning
// were ‘\relax’
if (expanded.treatAsRelax) {
expanded.text = "\\relax";
if (token.treatAsRelax) {
token.text = "\\relax";
}
return this.stack.pop(); // === expanded
return token;
}

@@ -373,11 +372,11 @@ }

while (this.stack.length > oldStackLength) {
const expanded = this.expandOnce(true); // expand only expandable tokens
// expandOnce returns Token if and only if it's fully expanded.
if (expanded instanceof Token) {
if (expanded.treatAsRelax) {
// Expand only expandable tokens
if (this.expandOnce(true) === false) { // fully expanded
const token = this.stack.pop();
if (token.treatAsRelax) {
// the expansion of \noexpand is the token itself
expanded.noexpand = false;
expanded.treatAsRelax = false;
token.noexpand = false;
token.treatAsRelax = false;
}
output.push(this.stack.pop());
output.push(token);
}

@@ -384,0 +383,0 @@ }

@@ -8,3 +8,3 @@ // @flow

*
* The `toNode` and `toMarkup` functions work simlarly to how they do in
* The `toNode` and `toMarkup` functions work similarly to how they do in
* domTree.js, creating namespaced DOM nodes and HTML text markup respectively.

@@ -170,3 +170,3 @@ */

* Converts the text node into a string
* (representing the text iteself).
* (representing the text itself).
*/

@@ -173,0 +173,0 @@ toText(): string {

@@ -75,3 +75,3 @@ // @flow

// the requirements on the fields per the op.js htmlBuilder logic:
// - `body` and `value` are NEVER set simultanouesly.
// - `body` and `value` are NEVER set simultaneously.
// - When `symbol` is true, `body` is set.

@@ -78,0 +78,0 @@ "op": {|

@@ -181,3 +181,3 @@ // @flow

* `breakOnInfix`: Should the parsing stop when we hit infix nodes? This
* happens when functions have higher precendence han infix
* happens when functions have higher precedence han infix
* nodes in implicit parses.

@@ -184,0 +184,0 @@ *

@@ -9,16 +9,16 @@ // @flow

const hLinePad = 80; // padding above a sqrt viniculum. Prevents image cropping.
const hLinePad = 80; // padding above a sqrt vinculum. Prevents image cropping.
// The viniculum of a \sqrt can be made thicker by a KaTeX rendering option.
// Think of variable extraViniculum as two detours in the SVG path.
// The detour begins at the lower left of the area labeled extraViniculum below.
// The detour proceeds one extraViniculum distance up and slightly to the right,
// displacing the radiused corner between surd and viniculum. The radius is
// The vinculum of a \sqrt can be made thicker by a KaTeX rendering option.
// Think of variable extraVinculum as two detours in the SVG path.
// The detour begins at the lower left of the area labeled extraVinculum below.
// The detour proceeds one extraVinculum distance up and slightly to the right,
// displacing the radiused corner between surd and vinculum. The radius is
// traversed as usual, then the detour resumes. It goes right, to the end of
// the very long viniculumn, then down one extraViniculum distance,
// the very long vinculum, then down one extraVinculum distance,
// after which it resumes regular path geometry for the radical.
/* viniculum
/* vinculum
/
/▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒←extraViniculum
/ █████████████████████←0.04em (40 unit) std viniculum thickness
/▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒←extraVinculum
/ █████████████████████←0.04em (40 unit) std vinculum thickness
/ /

@@ -30,5 +30,5 @@ / /

const sqrtMain = function(extraViniculum: number, hLinePad: number): string {
const sqrtMain = function(extraVinculum: number, hLinePad: number): string {
// sqrtMain path geometry is from glyph U221A in the font KaTeX Main
return `M95,${622 + extraViniculum + hLinePad}
return `M95,${622 + extraVinculum + hLinePad}
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14

@@ -39,18 +39,18 @@ c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54

c69,-144,104.5,-217.7,106.5,-221
l${extraViniculum / 2.075} -${extraViniculum}
l${extraVinculum / 2.075} -${extraVinculum}
c5.3,-9.3,12,-14,20,-14
H400000v${40 + extraViniculum}H845.2724
H400000v${40 + extraVinculum}H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M${834 + extraViniculum} ${hLinePad}h400000v${40 + extraViniculum}h-400000z`;
M${834 + extraVinculum} ${hLinePad}h400000v${40 + extraVinculum}h-400000z`;
};
const sqrtSize1 = function(extraViniculum: number, hLinePad: number): string {
const sqrtSize1 = function(extraVinculum: number, hLinePad: number): string {
// size1 is from glyph U221A in the font KaTeX_Size1-Regular
return `M263,${601 + extraViniculum + hLinePad}c0.7,0,18,39.7,52,119
return `M263,${601 + extraVinculum + hLinePad}c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l${extraViniculum / 2.084} -${extraViniculum}
l${extraVinculum / 2.084} -${extraVinculum}
c4.7,-7.3,11,-11,19,-11
H40000v${40 + extraViniculum}H1012.3
H40000v${40 + extraVinculum}H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232

@@ -60,10 +60,10 @@ c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1

c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M${1001 + extraViniculum} ${hLinePad}h400000v${40 + extraViniculum}h-400000z`;
M${1001 + extraVinculum} ${hLinePad}h400000v${40 + extraVinculum}h-400000z`;
};
const sqrtSize2 = function(extraViniculum: number, hLinePad: number): string {
const sqrtSize2 = function(extraVinculum: number, hLinePad: number): string {
// size2 is from glyph U221A in the font KaTeX_Size2-Regular
return `M983 ${10 + extraViniculum + hLinePad}
l${extraViniculum / 3.13} -${extraViniculum}
c4,-6.7,10,-10,18,-10 H400000v${40 + extraViniculum}
return `M983 ${10 + extraVinculum + hLinePad}
l${extraVinculum / 3.13} -${extraVinculum}
c4,-6.7,10,-10,18,-10 H400000v${40 + extraVinculum}
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7

@@ -75,8 +75,8 @@ s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744

c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M${1001 + extraViniculum} ${hLinePad}h400000v${40 + extraViniculum}h-400000z`;
M${1001 + extraVinculum} ${hLinePad}h400000v${40 + extraVinculum}h-400000z`;
};
const sqrtSize3 = function(extraViniculum: number, hLinePad: number): string {
const sqrtSize3 = function(extraVinculum: number, hLinePad: number): string {
// size3 is from glyph U221A in the font KaTeX_Size3-Regular
return `M424,${2398 + extraViniculum + hLinePad}
return `M424,${2398 + extraVinculum + hLinePad}
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514

@@ -86,15 +86,15 @@ c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20

s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l${extraViniculum / 4.223} -${extraViniculum}c4,-6.7,10,-10,18,-10 H400000
v${40 + extraViniculum}H1014.6
l${extraVinculum / 4.223} -${extraVinculum}c4,-6.7,10,-10,18,-10 H400000
v${40 + extraVinculum}H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M${1001 + extraViniculum} ${hLinePad}
h400000v${40 + extraViniculum}h-400000z`;
c-8,0,-12,-0.7,-12,-2z M${1001 + extraVinculum} ${hLinePad}
h400000v${40 + extraVinculum}h-400000z`;
};
const sqrtSize4 = function(extraViniculum: number, hLinePad: number): string {
const sqrtSize4 = function(extraVinculum: number, hLinePad: number): string {
// size4 is from glyph U221A in the font KaTeX_Size4-Regular
return `M473,${2713 + extraViniculum + hLinePad}
c339.3,-1799.3,509.3,-2700,510,-2702 l${extraViniculum / 5.298} -${extraViniculum}
c3.3,-7.3,9.3,-11,18,-11 H400000v${40 + extraViniculum}H1017.7
return `M473,${2713 + extraVinculum + hLinePad}
c339.3,-1799.3,509.3,-2700,510,-2702 l${extraVinculum / 5.298} -${extraVinculum}
c3.3,-7.3,9.3,-11,18,-11 H400000v${40 + extraVinculum}H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9

@@ -104,3 +104,3 @@ c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200

s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM${1001 + extraViniculum} ${hLinePad}h400000v${40 + extraViniculum}H1017.7z`;
606zM${1001 + extraVinculum} ${hLinePad}h400000v${40 + extraVinculum}H1017.7z`;
};

@@ -114,3 +114,3 @@

const sqrtTall = function(
extraViniculum: number,
extraVinculum: number,
hLinePad: number,

@@ -120,12 +120,12 @@ viewBoxHeight: number

// sqrtTall is from glyph U23B7 in the font KaTeX_Size4-Regular
// One path edge has a variable length. It runs vertically from the viniculumn
// to a point near (14 units) the bottom of the surd. The viniculum
// One path edge has a variable length. It runs vertically from the vinculum
// to a point near (14 units) the bottom of the surd. The vinculum
// is normally 40 units thick. So the length of the line in question is:
const vertSegment = viewBoxHeight - 54 - hLinePad - extraViniculum;
const vertSegment = viewBoxHeight - 54 - hLinePad - extraVinculum;
return `M702 ${extraViniculum + hLinePad}H400000${40 + extraViniculum}
return `M702 ${extraVinculum + hLinePad}H400000${40 + extraVinculum}
H742v${vertSegment}l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 ${hLinePad}H400000v${40 + extraViniculum}H742z`;
219 661 l218 661zM702 ${hLinePad}H400000v${40 + extraVinculum}H742z`;
};

@@ -135,6 +135,6 @@

size: string,
extraViniculum: number,
extraVinculum: number,
viewBoxHeight: number
): string {
extraViniculum = 1000 * extraViniculum; // Convert from document ems to viewBox.
extraVinculum = 1000 * extraVinculum; // Convert from document ems to viewBox.
let path = "";

@@ -144,18 +144,18 @@

case "sqrtMain":
path = sqrtMain(extraViniculum, hLinePad);
path = sqrtMain(extraVinculum, hLinePad);
break;
case "sqrtSize1":
path = sqrtSize1(extraViniculum, hLinePad);
path = sqrtSize1(extraVinculum, hLinePad);
break;
case "sqrtSize2":
path = sqrtSize2(extraViniculum, hLinePad);
path = sqrtSize2(extraVinculum, hLinePad);
break;
case "sqrtSize3":
path = sqrtSize3(extraViniculum, hLinePad);
path = sqrtSize3(extraVinculum, hLinePad);
break;
case "sqrtSize4":
path = sqrtSize4(extraViniculum, hLinePad);
path = sqrtSize4(extraVinculum, hLinePad);
break;
case "sqrtTall":
path = sqrtTall(extraViniculum, hLinePad, viewBoxHeight);
path = sqrtTall(extraVinculum, hLinePad, viewBoxHeight);
}

@@ -455,3 +455,3 @@ return path;

// Arrows for \ce{<-->} are offset from xAxis by 0.22ex, per mhchem in LaTeX
// baraboveleftarrow is mostly from from glyph U+2190 in font KaTeX Main
// baraboveleftarrow is mostly from glyph U+2190 in font KaTeX Main
baraboveleftarrow: `M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202

@@ -458,0 +458,0 @@ c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc