katex 0.14.1 → 0.15.0
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/README.md +3 -3
- package/contrib/copy-tex/README.md +3 -3
- package/contrib/mathtex-script-type/README.md +5 -5
- package/contrib/mhchem/README.md +1 -1
- package/dist/README.md +3 -3
- package/dist/katex.css +1 -1
- package/dist/katex.js +24 -10
- package/dist/katex.min.css +1 -1
- package/dist/katex.min.js +1 -1
- package/dist/katex.mjs +26 -10
- package/package.json +1 -1
- package/src/MacroExpander.js +3 -7
- package/src/functions/relax.js +17 -0
- package/src/functions.js +1 -0
- package/src/macros.js +1 -1
package/dist/katex.mjs
CHANGED
|
@@ -13544,6 +13544,26 @@ defineFunction({
|
|
|
13544
13544
|
|
|
13545
13545
|
});
|
|
13546
13546
|
|
|
13547
|
+
defineFunction({
|
|
13548
|
+
type: "internal",
|
|
13549
|
+
names: ["\\relax"],
|
|
13550
|
+
props: {
|
|
13551
|
+
numArgs: 0,
|
|
13552
|
+
allowedInText: true
|
|
13553
|
+
},
|
|
13554
|
+
|
|
13555
|
+
handler(_ref) {
|
|
13556
|
+
var {
|
|
13557
|
+
parser
|
|
13558
|
+
} = _ref;
|
|
13559
|
+
return {
|
|
13560
|
+
type: "internal",
|
|
13561
|
+
mode: parser.mode
|
|
13562
|
+
};
|
|
13563
|
+
}
|
|
13564
|
+
|
|
13565
|
+
});
|
|
13566
|
+
|
|
13547
13567
|
defineFunction({
|
|
13548
13568
|
type: "rule",
|
|
13549
13569
|
names: ["\\rule"],
|
|
@@ -15249,7 +15269,7 @@ defineMacro("\\varOmega", "\\mathit{\\Omega}"); //\newcommand{\substack}[1]{\sub
|
|
|
15249
15269
|
defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}"); // \renewcommand{\colon}{\nobreak\mskip2mu\mathpunct{}\nonscript
|
|
15250
15270
|
// \mkern-\thinmuskip{:}\mskip6muplus1mu\relax}
|
|
15251
15271
|
|
|
15252
|
-
defineMacro("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}" + "\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu"); // \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}}
|
|
15272
|
+
defineMacro("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}" + "\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"); // \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}}
|
|
15253
15273
|
|
|
15254
15274
|
defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}"); // \def\iff{\DOTSB\;\Longleftrightarrow\;}
|
|
15255
15275
|
// \def\implies{\DOTSB\;\Longrightarrow\;}
|
|
@@ -15776,8 +15796,6 @@ defineMacro("\\kaGreen", "\\textcolor{##71B307}{#1}");
|
|
|
15776
15796
|
// List of commands that act like macros but aren't defined as a macro,
|
|
15777
15797
|
// function, or symbol. Used in `isDefined`.
|
|
15778
15798
|
var implicitCommands = {
|
|
15779
|
-
"\\relax": true,
|
|
15780
|
-
// MacroExpander.js
|
|
15781
15799
|
"^": true,
|
|
15782
15800
|
// Parser.js
|
|
15783
15801
|
"_": true,
|
|
@@ -16141,15 +16159,13 @@ class MacroExpander {
|
|
|
16141
16159
|
var expanded = this.expandOnce(); // expandOnce returns Token if and only if it's fully expanded.
|
|
16142
16160
|
|
|
16143
16161
|
if (expanded instanceof Token) {
|
|
16144
|
-
// \relax stops the expansion, but shouldn't get returned (a
|
|
16145
|
-
// null return value couldn't get implemented as a function).
|
|
16146
16162
|
// the token after \noexpand is interpreted as if its meaning
|
|
16147
16163
|
// were ‘\relax’
|
|
16148
|
-
if (expanded.
|
|
16149
|
-
|
|
16150
|
-
} else {
|
|
16151
|
-
return this.stack.pop(); // === expanded
|
|
16164
|
+
if (expanded.treatAsRelax) {
|
|
16165
|
+
expanded.text = "\\relax";
|
|
16152
16166
|
}
|
|
16167
|
+
|
|
16168
|
+
return this.stack.pop(); // === expanded
|
|
16153
16169
|
}
|
|
16154
16170
|
} // Flow unable to figure out that this pathway is impossible.
|
|
16155
16171
|
// https://github.com/facebook/flow/issues/4808
|
|
@@ -17863,7 +17879,7 @@ var katex = {
|
|
|
17863
17879
|
/**
|
|
17864
17880
|
* Current KaTeX version
|
|
17865
17881
|
*/
|
|
17866
|
-
version: "0.
|
|
17882
|
+
version: "0.15.0",
|
|
17867
17883
|
|
|
17868
17884
|
/**
|
|
17869
17885
|
* Renders the given LaTeX into an HTML+MathML combination, and adds
|
package/package.json
CHANGED
package/src/MacroExpander.js
CHANGED
|
@@ -20,7 +20,6 @@ import type Settings from "./Settings";
|
|
|
20
20
|
// List of commands that act like macros but aren't defined as a macro,
|
|
21
21
|
// function, or symbol. Used in `isDefined`.
|
|
22
22
|
export const implicitCommands = {
|
|
23
|
-
"\\relax": true, // MacroExpander.js
|
|
24
23
|
"^": true, // Parser.js
|
|
25
24
|
"_": true, // Parser.js
|
|
26
25
|
"\\limits": true, // Parser.js
|
|
@@ -333,15 +332,12 @@ export default class MacroExpander implements MacroContextInterface {
|
|
|
333
332
|
const expanded = this.expandOnce();
|
|
334
333
|
// expandOnce returns Token if and only if it's fully expanded.
|
|
335
334
|
if (expanded instanceof Token) {
|
|
336
|
-
// \relax stops the expansion, but shouldn't get returned (a
|
|
337
|
-
// null return value couldn't get implemented as a function).
|
|
338
335
|
// the token after \noexpand is interpreted as if its meaning
|
|
339
336
|
// were ‘\relax’
|
|
340
|
-
if (expanded.
|
|
341
|
-
|
|
342
|
-
} else {
|
|
343
|
-
return this.stack.pop(); // === expanded
|
|
337
|
+
if (expanded.treatAsRelax) {
|
|
338
|
+
expanded.text = "\\relax";
|
|
344
339
|
}
|
|
340
|
+
return this.stack.pop(); // === expanded
|
|
345
341
|
}
|
|
346
342
|
}
|
|
347
343
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//@flow
|
|
2
|
+
import defineFunction from "../defineFunction";
|
|
3
|
+
|
|
4
|
+
defineFunction({
|
|
5
|
+
type: "internal",
|
|
6
|
+
names: ["\\relax"],
|
|
7
|
+
props: {
|
|
8
|
+
numArgs: 0,
|
|
9
|
+
allowedInText: true,
|
|
10
|
+
},
|
|
11
|
+
handler({parser}) {
|
|
12
|
+
return {
|
|
13
|
+
type: "internal",
|
|
14
|
+
mode: parser.mode,
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
});
|
package/src/functions.js
CHANGED
package/src/macros.js
CHANGED
|
@@ -368,7 +368,7 @@ defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}");
|
|
|
368
368
|
// \renewcommand{\colon}{\nobreak\mskip2mu\mathpunct{}\nonscript
|
|
369
369
|
// \mkern-\thinmuskip{:}\mskip6muplus1mu\relax}
|
|
370
370
|
defineMacro("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}" +
|
|
371
|
-
"\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu");
|
|
371
|
+
"\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");
|
|
372
372
|
|
|
373
373
|
// \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}}
|
|
374
374
|
defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}");
|