katex 0.10.0-rc → 0.10.2

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.
Files changed (144) hide show
  1. package/CHANGELOG.md +214 -126
  2. package/README.md +18 -17
  3. package/cli.js +5 -1
  4. package/contrib/auto-render/README.md +1 -1
  5. package/contrib/auto-render/auto-render.js +4 -1
  6. package/contrib/auto-render/test/auto-render-spec.js +17 -0
  7. package/contrib/copy-tex/README.md +8 -2
  8. package/contrib/copy-tex/copy-tex.js +0 -1
  9. package/contrib/copy-tex/copy-tex.webpack.js +6 -0
  10. package/contrib/mathtex-script-type/README.md +10 -6
  11. package/contrib/mhchem/README.md +19 -0
  12. package/contrib/mhchem/mhchem.js +1695 -0
  13. package/contrib/mhchem/mhchem.patch +235 -0
  14. package/dist/README.md +18 -17
  15. package/dist/contrib/auto-render.js +179 -161
  16. package/dist/contrib/auto-render.min.js +1 -1
  17. package/dist/contrib/auto-render.mjs +215 -0
  18. package/dist/contrib/copy-tex.js +84 -62
  19. package/dist/contrib/copy-tex.min.css +1 -1
  20. package/dist/contrib/copy-tex.min.js +1 -1
  21. package/dist/contrib/copy-tex.mjs +85 -0
  22. package/dist/contrib/mathtex-script-type.js +17 -14
  23. package/dist/contrib/mathtex-script-type.mjs +24 -0
  24. package/dist/contrib/mhchem.js +3241 -0
  25. package/dist/contrib/mhchem.min.js +1 -0
  26. package/dist/contrib/mhchem.mjs +3109 -0
  27. package/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
  28. package/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
  29. package/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  30. package/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  31. package/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  32. package/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  33. package/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  34. package/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  35. package/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  36. package/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  37. package/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  38. package/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  39. package/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  40. package/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  41. package/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  42. package/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
  43. package/dist/fonts/KaTeX_Main-Bold.woff +0 -0
  44. package/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
  45. package/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  46. package/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  47. package/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  48. package/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
  49. package/dist/fonts/KaTeX_Main-Italic.woff +0 -0
  50. package/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
  51. package/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
  52. package/dist/fonts/KaTeX_Main-Regular.woff +0 -0
  53. package/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
  54. package/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  55. package/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  56. package/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  57. package/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
  58. package/dist/fonts/KaTeX_Math-Italic.woff +0 -0
  59. package/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
  60. package/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  61. package/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  62. package/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  63. package/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  64. package/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  65. package/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  66. package/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  67. package/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  68. package/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  69. package/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
  70. package/dist/fonts/KaTeX_Script-Regular.woff +0 -0
  71. package/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
  72. package/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
  73. package/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
  74. package/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  75. package/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
  76. package/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
  77. package/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  78. package/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
  79. package/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
  80. package/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  81. package/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
  82. package/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
  83. package/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  84. package/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  85. package/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  86. package/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  87. package/dist/katex.css +24 -9
  88. package/dist/katex.js +13295 -12413
  89. package/dist/katex.min.css +1 -1
  90. package/dist/katex.min.js +1 -1
  91. package/dist/katex.mjs +13388 -11826
  92. package/katex.js +1 -2
  93. package/package.json +60 -48
  94. package/src/Lexer.js +25 -25
  95. package/src/MacroExpander.js +0 -1
  96. package/src/Options.js +11 -75
  97. package/src/Parser.js +231 -313
  98. package/src/Settings.js +6 -0
  99. package/src/buildCommon.js +140 -103
  100. package/src/buildHTML.js +125 -121
  101. package/src/buildMathML.js +14 -4
  102. package/src/buildTree.js +16 -10
  103. package/src/delimiter.js +4 -3
  104. package/src/domTree.js +91 -44
  105. package/src/environments/array.js +120 -7
  106. package/src/fontMetrics.js +3 -2
  107. package/src/functions/arrow.js +21 -7
  108. package/src/functions/color.js +2 -37
  109. package/src/functions/delimsizing.js +18 -11
  110. package/src/functions/enclose.js +19 -4
  111. package/src/functions/environment.js +35 -4
  112. package/src/functions/font.js +1 -2
  113. package/src/functions/genfrac.js +35 -20
  114. package/src/functions/href.js +5 -3
  115. package/src/functions/includegraphics.js +146 -0
  116. package/src/functions/mclass.js +1 -0
  117. package/src/functions/op.js +21 -32
  118. package/src/functions/operatorname.js +1 -2
  119. package/src/functions/ordgroup.js +4 -0
  120. package/src/functions/phantom.js +7 -3
  121. package/src/functions/rule.js +20 -9
  122. package/src/functions/sizing.js +2 -4
  123. package/src/functions/smash.js +5 -2
  124. package/src/functions/sqrt.js +1 -4
  125. package/src/functions/styling.js +0 -1
  126. package/src/functions/supsub.js +6 -2
  127. package/src/functions/symbolsOp.js +4 -0
  128. package/src/functions/symbolsSpacing.js +29 -6
  129. package/src/functions/tag.js +20 -4
  130. package/src/functions/text.js +6 -4
  131. package/src/functions/verb.js +16 -4
  132. package/src/functions.js +2 -0
  133. package/src/katex.less +35 -12
  134. package/src/macros.js +161 -36
  135. package/src/mathMLTree.js +17 -19
  136. package/src/parseNode.js +27 -1
  137. package/src/stretchy.js +3 -1
  138. package/src/svgGeometry.js +1 -1
  139. package/src/symbols.js +39 -17
  140. package/src/tree.js +0 -4
  141. package/src/types.js +4 -3
  142. package/src/unicodeMake.js +1 -1
  143. package/src/utils.js +1 -62
  144. package/src/wide-character.js +2 -2
package/src/Settings.js CHANGED
@@ -18,6 +18,8 @@ export type StrictFunction =
18
18
 
19
19
  export type SettingsOptions = {
20
20
  displayMode?: boolean;
21
+ leqno?: boolean;
22
+ fleqn?: boolean;
21
23
  throwOnError?: boolean;
22
24
  errorColor?: string;
23
25
  macros?: MacroMap;
@@ -40,6 +42,8 @@ export type SettingsOptions = {
40
42
  */
41
43
  class Settings {
42
44
  displayMode: boolean;
45
+ leqno: boolean;
46
+ fleqn: boolean;
43
47
  throwOnError: boolean;
44
48
  errorColor: string;
45
49
  macros: MacroMap;
@@ -53,6 +57,8 @@ class Settings {
53
57
  // allow null options
54
58
  options = options || {};
55
59
  this.displayMode = utils.deflt(options.displayMode, false);
60
+ this.leqno = utils.deflt(options.leqno, false);
61
+ this.fleqn = utils.deflt(options.fleqn, false);
56
62
  this.throwOnError = utils.deflt(options.throwOnError, true);
57
63
  this.errorColor = utils.deflt(options.errorColor, "#cc0000");
58
64
  this.macros = options.macros || {};
@@ -5,7 +5,7 @@
5
5
  * different kinds of domTree nodes in a consistent manner.
6
6
  */
7
7
 
8
- import {SymbolNode, Anchor, Span, PathNode, SvgNode} from "./domTree";
8
+ import {SymbolNode, Anchor, Span, PathNode, SvgNode, createClass} from "./domTree";
9
9
  import {getCharacterMetrics} from "./fontMetrics";
10
10
  import symbols, {ligatures} from "./symbols";
11
11
  import utils from "./utils";
@@ -15,15 +15,14 @@ import {DocumentFragment} from "./tree";
15
15
 
16
16
  import type Options from "./Options";
17
17
  import type {ParseNode} from "./parseNode";
18
- import type {NodeType} from "./parseNode";
19
18
  import type {CharacterMetrics} from "./fontMetrics";
20
19
  import type {FontVariant, Mode} from "./types";
21
20
  import type {documentFragment as HtmlDocumentFragment} from "./domTree";
22
21
  import type {HtmlDomNode, DomSpan, SvgSpan, CssStyle} from "./domTree";
23
22
  import type {Measurement} from "./units";
24
23
 
25
- // The following have to be loaded from Main-Italic font, using class mainit
26
- const mainitLetters = [
24
+ // The following have to be loaded from Main-Italic font, using class mathit
25
+ const mathitLetters = [
27
26
  "\\imath", "ı", // dotless i
28
27
  "\\jmath", "ȷ", // dotless j
29
28
  "\\pounds", "\\mathsterling", "\\textsterling", "£", // pounds symbol
@@ -73,7 +72,7 @@ const makeSymbol = function(
73
72
  let symbolNode;
74
73
  if (metrics) {
75
74
  let italic = metrics.italic;
76
- if (mode === "text") {
75
+ if (mode === "text" || (options && options.font === "mathit")) {
77
76
  italic = 0;
78
77
  }
79
78
  symbolNode = new SymbolNode(
@@ -133,70 +132,58 @@ const mathsym = function(
133
132
  };
134
133
 
135
134
  /**
136
- * Makes a symbol in the default font for mathords and textords.
135
+ * Determines which of the two font names (Main-Italic and Math-Italic) and
136
+ * corresponding style tags (maindefault or mathit) to use for default math font,
137
+ * depending on the symbol.
137
138
  */
138
- const mathDefault = function(
139
+ const mathdefault = function(
139
140
  value: string,
140
141
  mode: Mode,
141
142
  options: Options,
142
143
  classes: string[],
143
- type: NodeType,
144
- ): SymbolNode {
145
- if (type === "mathord") {
146
- const fontLookup = mathit(value, mode, options, classes);
147
- return makeSymbol(value, fontLookup.fontName, mode, options,
148
- classes.concat([fontLookup.fontClass]));
149
- } else if (type === "textord") {
150
- const font = symbols[mode][value] && symbols[mode][value].font;
151
- if (font === "ams") {
152
- const fontName = retrieveTextFontName("amsrm", options.fontWeight,
153
- options.fontShape);
154
- return makeSymbol(
155
- value, fontName, mode, options,
156
- classes.concat("amsrm", options.fontWeight, options.fontShape));
157
- } else if (font === "main" || !font) {
158
- const fontName = retrieveTextFontName("textrm", options.fontWeight,
159
- options.fontShape);
160
- return makeSymbol(
161
- value, fontName, mode, options,
162
- classes.concat(options.fontWeight, options.fontShape));
163
- } else { // fonts added by plugins
164
- const fontName = retrieveTextFontName(font, options.fontWeight,
165
- options.fontShape);
166
- // We add font name as a css class
167
- return makeSymbol(
168
- value, fontName, mode, options,
169
- classes.concat(fontName, options.fontWeight, options.fontShape));
170
- }
144
+ ): {| fontName: string, fontClass: string |} {
145
+ if (/[0-9]/.test(value.charAt(0)) ||
146
+ // glyphs for \imath and \jmath do not exist in Math-Italic so we
147
+ // need to use Main-Italic instead
148
+ utils.contains(mathitLetters, value)) {
149
+ return {
150
+ fontName: "Main-Italic",
151
+ fontClass: "mathit",
152
+ };
171
153
  } else {
172
- throw new Error("unexpected type: " + type + " in mathDefault");
154
+ return {
155
+ fontName: "Math-Italic",
156
+ fontClass: "mathdefault",
157
+ };
173
158
  }
174
159
  };
175
160
 
176
161
  /**
177
- * Determines which of the two font names (Main-Italic and Math-Italic) and
178
- * corresponding style tags (mainit or mathit) to use for font "mathit",
179
- * depending on the symbol. Use this function instead of fontMap for font
180
- * "mathit".
162
+ * Determines which of the font names (Main-Italic, Math-Italic, and Caligraphic)
163
+ * and corresponding style tags (mathit, mathdefault, or mathcal) to use for font
164
+ * "mathnormal", depending on the symbol. Use this function instead of fontMap for
165
+ * font "mathnormal".
181
166
  */
182
- const mathit = function(
167
+ const mathnormal = function(
183
168
  value: string,
184
169
  mode: Mode,
185
170
  options: Options,
186
171
  classes: string[],
187
172
  ): {| fontName: string, fontClass: string |} {
188
- if (/[0-9]/.test(value.charAt(0)) ||
189
- // glyphs for \imath and \jmath do not exist in Math-Italic so we
190
- // need to use Main-Italic instead
191
- utils.contains(mainitLetters, value)) {
173
+ if (utils.contains(mathitLetters, value)) {
192
174
  return {
193
175
  fontName: "Main-Italic",
194
- fontClass: "mainit",
176
+ fontClass: "mathit",
177
+ };
178
+ } else if (/[0-9]/.test(value.charAt(0))) {
179
+ return {
180
+ fontName: "Caligraphic-Regular",
181
+ fontClass: "mathcal",
195
182
  };
196
183
  } else {
197
184
  return {
198
185
  fontName: "Math-Italic",
199
- fontClass: "mathit",
186
+ fontClass: "mathdefault",
200
187
  };
201
188
  }
202
189
  };
@@ -252,15 +239,15 @@ const makeOrd = function<NODETYPE: "spacing" | "mathord" | "textord">(
252
239
  } else if (fontOrFamily) {
253
240
  let fontName;
254
241
  let fontClasses;
255
- if (fontOrFamily === "boldsymbol") {
256
- const fontData = boldsymbol(text, mode, options, classes);
257
- fontName = fontData.fontName;
258
- fontClasses = [fontData.fontClass];
259
- } else if (fontOrFamily === "mathit" ||
260
- utils.contains(mainitLetters, text)) {
261
- const fontData = mathit(text, mode, options, classes);
242
+ if (fontOrFamily === "boldsymbol" || fontOrFamily === "mathnormal") {
243
+ const fontData = fontOrFamily === "boldsymbol"
244
+ ? boldsymbol(text, mode, options, classes)
245
+ : mathnormal(text, mode, options, classes);
262
246
  fontName = fontData.fontName;
263
247
  fontClasses = [fontData.fontClass];
248
+ } else if (utils.contains(mathitLetters, text)) {
249
+ fontName = "Main-Italic";
250
+ fontClasses = ["mathit"];
264
251
  } else if (isFont) {
265
252
  fontName = fontMap[fontOrFamily].fontName;
266
253
  fontClasses = [fontOrFamily];
@@ -282,21 +269,88 @@ const makeOrd = function<NODETYPE: "spacing" | "mathord" | "textord">(
282
269
  classes.concat(fontClasses)));
283
270
  }
284
271
  return makeFragment(parts);
285
- } else {
286
- return mathDefault(text, mode, options, classes, type);
272
+ }
273
+ }
274
+
275
+ // Makes a symbol in the default font for mathords and textords.
276
+ if (type === "mathord") {
277
+ const fontLookup = mathdefault(text, mode, options, classes);
278
+ return makeSymbol(text, fontLookup.fontName, mode, options,
279
+ classes.concat([fontLookup.fontClass]));
280
+ } else if (type === "textord") {
281
+ const font = symbols[mode][text] && symbols[mode][text].font;
282
+ if (font === "ams") {
283
+ const fontName = retrieveTextFontName("amsrm", options.fontWeight,
284
+ options.fontShape);
285
+ return makeSymbol(
286
+ text, fontName, mode, options,
287
+ classes.concat("amsrm", options.fontWeight, options.fontShape));
288
+ } else if (font === "main" || !font) {
289
+ const fontName = retrieveTextFontName("textrm", options.fontWeight,
290
+ options.fontShape);
291
+ return makeSymbol(
292
+ text, fontName, mode, options,
293
+ classes.concat(options.fontWeight, options.fontShape));
294
+ } else { // fonts added by plugins
295
+ const fontName = retrieveTextFontName(font, options.fontWeight,
296
+ options.fontShape);
297
+ // We add font name as a css class
298
+ return makeSymbol(
299
+ text, fontName, mode, options,
300
+ classes.concat(fontName, options.fontWeight, options.fontShape));
287
301
  }
288
302
  } else {
289
- return mathDefault(text, mode, options, classes, type);
303
+ throw new Error("unexpected type: " + type + " in makeOrd");
290
304
  }
291
305
  };
292
306
 
293
307
  /**
294
- * Combine as many characters as possible in the given array of characters
295
- * via their tryCombine method.
308
+ * Returns true if subsequent symbolNodes have the same classes, skew, maxFont,
309
+ * and styles.
296
310
  */
297
- const tryCombineChars = function(chars: HtmlDomNode[]): HtmlDomNode[] {
311
+ const canCombine = (prev: SymbolNode, next: SymbolNode) => {
312
+ if (createClass(prev.classes) !== createClass(next.classes)
313
+ || prev.skew !== next.skew
314
+ || prev.maxFontSize !== next.maxFontSize) {
315
+ return false;
316
+ }
317
+
318
+ for (const style in prev.style) {
319
+ if (prev.style.hasOwnProperty(style)
320
+ && prev.style[style] !== next.style[style]) {
321
+ return false;
322
+ }
323
+ }
324
+
325
+ for (const style in next.style) {
326
+ if (next.style.hasOwnProperty(style)
327
+ && prev.style[style] !== next.style[style]) {
328
+ return false;
329
+ }
330
+ }
331
+
332
+ return true;
333
+ };
334
+
335
+ /**
336
+ * Combine consequetive domTree.symbolNodes into a single symbolNode.
337
+ * Note: this function mutates the argument.
338
+ */
339
+ const tryCombineChars = (chars: HtmlDomNode[]): HtmlDomNode[] => {
298
340
  for (let i = 0; i < chars.length - 1; i++) {
299
- if (chars[i].tryCombine(chars[i + 1])) {
341
+ const prev = chars[i];
342
+ const next = chars[i + 1];
343
+ if (prev instanceof SymbolNode
344
+ && next instanceof SymbolNode
345
+ && canCombine(prev, next)) {
346
+
347
+ prev.text += next.text;
348
+ prev.height = Math.max(prev.height, next.height);
349
+ prev.depth = Math.max(prev.depth, next.depth);
350
+ // Use the last character's italic correction since we use
351
+ // it to add padding to the right of the span created from
352
+ // the combined characters.
353
+ prev.italic = next.italic;
300
354
  chars.splice(i + 1, 1);
301
355
  i--;
302
356
  }
@@ -405,6 +459,20 @@ const makeFragment = function(
405
459
  return fragment;
406
460
  };
407
461
 
462
+ /**
463
+ * Wraps group in a span if it's a document fragment, allowing to apply classes
464
+ * and styles
465
+ */
466
+ const wrapFragment = function(
467
+ group: HtmlDomNode,
468
+ options: Options,
469
+ ): HtmlDomNode {
470
+ if (group instanceof DocumentFragment) {
471
+ return makeSpan([], [group], options);
472
+ }
473
+ return group;
474
+ };
475
+
408
476
 
409
477
  // These are exact object types to catch typos in the names of the optional fields.
410
478
  export type VListElem = {|
@@ -611,18 +679,6 @@ const makeVList = function(params: VListParam, options: Options): DomSpan {
611
679
  return vtable;
612
680
  };
613
681
 
614
- // Converts verb group into body string, dealing with \verb* form
615
- const makeVerb = function(group: ParseNode<"verb">, options: Options): string {
616
- let text = group.body;
617
- if (group.star) {
618
- text = text.replace(/ /g, '\u2423'); // Open Box
619
- } else {
620
- text = text.replace(/ /g, '\xA0'); // No-Break Space
621
- // (so that, in particular, spaces don't coalesce)
622
- }
623
- return text;
624
- };
625
-
626
682
  // Glue is a concept from TeX which is a flexible space between elements in
627
683
  // either a vertical or horizontal list. In KaTeX, at least for now, it's
628
684
  // static space between elements in a horizontal layout.
@@ -672,29 +728,6 @@ const retrieveTextFontName = function(
672
728
  return `${baseFontName}-${fontStylesName}`;
673
729
  };
674
730
 
675
- // A map of CSS-based spacing functions to their CSS class.
676
- const cssSpace: {[string]: string} = {
677
- "\\nobreak": "nobreak",
678
- "\\allowbreak": "allowbreak",
679
- };
680
-
681
- // A lookup table to determine whether a spacing function/symbol should be
682
- // treated like a regular space character. If a symbol or command is a key
683
- // in this table, then it should be a regular space character. Furthermore,
684
- // the associated value may have a `className` specifying an extra CSS class
685
- // to add to the created `span`.
686
- const regularSpace: {[string]: { className?: string }} = {
687
- " ": {},
688
- "\\ ": {},
689
- "~": {
690
- className: "nobreak",
691
- },
692
- "\\space": {},
693
- "\\nobreakspace": {
694
- className: "nobreak",
695
- },
696
- };
697
-
698
731
  /**
699
732
  * Maps TeX font commands to objects containing:
700
733
  * - variant: string used for "mathvariant" attribute in buildMathML.js
@@ -715,11 +748,17 @@ const fontMap: {[string]: {| variant: FontVariant, fontName: string |}} = {
715
748
  variant: "italic",
716
749
  fontName: "Main-Italic",
717
750
  },
751
+ "mathit": {
752
+ variant: "italic",
753
+ fontName: "Main-Italic",
754
+ },
718
755
 
719
- // "mathit" and "boldsymbol" are missing because they require the use of two
720
- // fonts: Main-Italic and Math-Italic for "mathit", and Math-BoldItalic and
721
- // Main-Bold for "boldsymbol". This is handled by a special case in makeOrd
722
- // which ends up calling mathit and boldsymbol.
756
+ // Default math font, "mathnormal" and "boldsymbol" are missing because they
757
+ // require the use of several fonts: Main-Italic and Math-Italic for default
758
+ // math font, Main-Italic, Math-Italic, Caligraphic for "mathnormal", and
759
+ // Math-BoldItalic and Main-Bold for "boldsymbol". This is handled by a
760
+ // special case in makeOrd which ends up calling mathdefault, mathnormal,
761
+ // and boldsymbol.
723
762
 
724
763
  // families
725
764
  "mathbb": {
@@ -787,13 +826,11 @@ export default {
787
826
  makeLineSpan,
788
827
  makeAnchor,
789
828
  makeFragment,
829
+ wrapFragment,
790
830
  makeVList,
791
831
  makeOrd,
792
- makeVerb,
793
832
  makeGlue,
794
833
  staticSvg,
795
834
  svgData,
796
835
  tryCombineChars,
797
- cssSpace,
798
- regularSpace,
799
836
  };