MCPcopy Create free account
hub / github.com/TruthHun/BookStack / delimiter_sqrtSvg

Function delimiter_sqrtSvg

static/katex/katex.js:8394–8415  ·  view source on GitHub ↗
(sqrtName, height, viewBoxHeight, options)

Source from the content-addressed store, hash-verified

8392var emPad = 0.08; // padding, in ems, measured in the document.
8393
8394var delimiter_sqrtSvg = function sqrtSvg(sqrtName, height, viewBoxHeight, options) {
8395 var alternate;
8396
8397 if (sqrtName === "sqrtTall") {
8398 // sqrtTall is from glyph U23B7 in the font KaTeX_Size4-Regular
8399 // One path edge has a variable length. It runs from the viniculumn
8400 // to a point near (14 units) the bottom of the surd. The viniculum
8401 // is 40 units thick. So the length of the line in question is:
8402 var vertSegment = viewBoxHeight - 54 - vbPad;
8403 alternate = "M702 " + vbPad + "H400000v40H742v" + vertSegment + "l-4 4-4 4c-.667.7\n-2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1h-12l-28-84c-16.667-52-96.667\n-294.333-240-727l-212 -643 -85 170c-4-3.333-8.333-7.667-13 -13l-13-13l77-155\n 77-156c66 199.333 139 419.667 219 661 l218 661zM702 " + vbPad + "H400000v40H742z";
8404 }
8405
8406 var pathNode = new domTree_PathNode(sqrtName, alternate);
8407 var svg = new SvgNode([pathNode], {
8408 // Note: 1000:1 ratio of viewBox to document em width.
8409 "width": "400em",
8410 "height": height + "em",
8411 "viewBox": "0 0 400000 " + viewBoxHeight,
8412 "preserveAspectRatio": "xMinYMin slice"
8413 });
8414 return buildCommon.makeSvgSpan(["hide-tail"], [svg], options);
8415};
8416/**
8417 * Make a sqrt image of the given height,
8418 */

Callers 1

makeSqrtImageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected