katex 0.16.42 → 0.16.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/katex.mjs CHANGED
@@ -1189,7 +1189,7 @@ class SymbolNode {
1189
1189
  }
1190
1190
  var styles = "";
1191
1191
  if (this.italic > 0) {
1192
- styles += "margin-right:" + this.italic + "em;";
1192
+ styles += "margin-right:" + makeEm(this.italic) + ";";
1193
1193
  }
1194
1194
  for (var key of Object.keys(this.style)) {
1195
1195
  styles += hyphenate(key) + ":" + this.style[key] + ";";
@@ -8260,8 +8260,8 @@ var makeStackedDelim = function makeStackedDelim(delim, heightTotal, center, opt
8260
8260
  var viewBoxHeight = Math.round(realHeightTotal * 1000);
8261
8261
  var pathStr = tallDelim(svgLabel, Math.round(midHeight * 1000));
8262
8262
  var path = new PathNode(svgLabel, pathStr);
8263
- var width = (viewBoxWidth / 1000).toFixed(3) + "em";
8264
- var height = (viewBoxHeight / 1000).toFixed(3) + "em";
8263
+ var width = makeEm(viewBoxWidth / 1000);
8264
+ var height = makeEm(viewBoxHeight / 1000);
8265
8265
  var svg = new SvgNode([path], {
8266
8266
  "width": width,
8267
8267
  "height": height,
@@ -9082,7 +9082,7 @@ var mathmlBuilder$6 = (group, options) => {
9082
9082
  var thk = Math.max(options.fontMetrics().fboxrule,
9083
9083
  // default
9084
9084
  options.minRuleThickness);
9085
- node.setAttribute("style", "border: " + thk + "em solid " + String(group.borderColor));
9085
+ node.setAttribute("style", "border: " + makeEm(thk) + " solid " + group.borderColor);
9086
9086
  }
9087
9087
  break;
9088
9088
  case "\\xcancel":
@@ -9631,9 +9631,10 @@ var htmlBuilder$6 = function htmlBuilder(group, options) {
9631
9631
  }
9632
9632
  }
9633
9633
  // In AMS multiline environments such as aligned and gathered, rows
9634
- // correspond to lines that have additional \jot added to the
9635
- // \baselineskip via \openup.
9636
- if (group.addJot) {
9634
+ // correspond to lines that have additional \jot added between lines
9635
+ // via \openup.
9636
+ // We simulate this by adding \jot depth to each row except the last.
9637
+ if (group.addJot && r < group.body.length - 1) {
9637
9638
  depth += jot;
9638
9639
  }
9639
9640
  outrow.height = height;
@@ -16403,7 +16404,7 @@ var renderToHTMLTree = function renderToHTMLTree(expression, options) {
16403
16404
  return renderError(error, expression, settings);
16404
16405
  }
16405
16406
  };
16406
- var version = "0.16.42";
16407
+ var version = "0.16.44";
16407
16408
  var __domTree = {
16408
16409
  Span,
16409
16410
  Anchor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "katex",
3
- "version": "0.16.42",
3
+ "version": "0.16.44",
4
4
  "description": "Fast math typesetting for the web.",
5
5
  "main": "dist/katex.js",
6
6
  "types": "types/katex.d.ts",
package/src/delimiter.ts CHANGED
@@ -398,8 +398,8 @@ const makeStackedDelim = function(
398
398
  const viewBoxHeight = Math.round(realHeightTotal * 1000);
399
399
  const pathStr = tallDelim(svgLabel, Math.round(midHeight * 1000));
400
400
  const path = new PathNode(svgLabel, pathStr);
401
- const width = (viewBoxWidth / 1000).toFixed(3) + "em";
402
- const height = (viewBoxHeight / 1000).toFixed(3) + "em";
401
+ const width = makeEm(viewBoxWidth / 1000);
402
+ const height = makeEm(viewBoxHeight / 1000);
403
403
  const svg = new SvgNode([path], {
404
404
  "width": width,
405
405
  "height": height,
package/src/domTree.ts CHANGED
@@ -463,7 +463,7 @@ export class SymbolNode implements HtmlDomNode {
463
463
  let styles = "";
464
464
 
465
465
  if (this.italic > 0) {
466
- styles += "margin-right:" + this.italic + "em;";
466
+ styles += `margin-right:${makeEm(this.italic)};`;
467
467
  }
468
468
  for (const key of Object.keys(this.style) as Array<keyof CssStyle>) {
469
469
  styles += hyphenate(key) + ":" + this.style[key] + ";";
@@ -366,9 +366,10 @@ const htmlBuilder: HtmlBuilder<"array"> = function(group, options) {
366
366
  }
367
367
  }
368
368
  // In AMS multiline environments such as aligned and gathered, rows
369
- // correspond to lines that have additional \jot added to the
370
- // \baselineskip via \openup.
371
- if (group.addJot) {
369
+ // correspond to lines that have additional \jot added between lines
370
+ // via \openup.
371
+ // We simulate this by adding \jot depth to each row except the last.
372
+ if (group.addJot && r < group.body.length - 1) {
372
373
  depth += jot;
373
374
  }
374
375
 
@@ -204,8 +204,7 @@ const mathmlBuilder: MathMLBuilder<"enclose"> = (group, options) => {
204
204
  options.fontMetrics().fboxrule, // default
205
205
  options.minRuleThickness, // user override
206
206
  );
207
- node.setAttribute("style", "border: " + thk + "em solid " +
208
- String(group.borderColor));
207
+ node.setAttribute("style", `border: ${makeEm(thk)} solid ${group.borderColor}`);
209
208
  }
210
209
  break;
211
210
  case "\\xcancel":