katex 0.10.1 → 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.
- package/CHANGELOG.md +51 -0
- package/README.md +4 -4
- package/cli.js +0 -0
- 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 +4 -4
- package/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/katex.css +10 -0
- package/dist/katex.js +541 -249
- package/dist/katex.min.css +1 -1
- package/dist/katex.min.js +1 -1
- package/dist/katex.mjs +418 -198
- package/package.json +1 -1
- package/src/Options.js +11 -75
- package/src/buildMathML.js +13 -3
- package/src/domTree.js +63 -0
- package/src/environments/array.js +118 -2
- package/src/fontMetrics.js +3 -2
- package/src/functions/arrow.js +15 -5
- package/src/functions/color.js +2 -37
- package/src/functions/delimsizing.js +12 -2
- package/src/functions/enclose.js +15 -3
- package/src/functions/genfrac.js +31 -12
- package/src/functions/includegraphics.js +146 -0
- package/src/functions/mclass.js +1 -0
- package/src/functions/op.js +18 -10
- package/src/functions/phantom.js +5 -2
- package/src/functions/rule.js +20 -9
- package/src/functions/supsub.js +6 -2
- package/src/functions/symbolsOp.js +4 -0
- package/src/functions/tag.js +20 -4
- package/src/functions/text.js +4 -2
- package/src/functions.js +2 -0
- package/src/katex.less +15 -0
- package/src/macros.js +144 -27
- package/src/mathMLTree.js +1 -1
- package/src/parseNode.js +20 -1
- package/src/stretchy.js +3 -1
- package/src/symbols.js +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,57 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
All notable changes to this project will be documented in this file. This CHANGELOG roughly follows the guidelines from [www.keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
3
3
|
|
|
4
|
+
## [v0.10.2]
|
|
5
|
+
### Added
|
|
6
|
+
- Approximate font metrics only when metrics don't exist (#1898)
|
|
7
|
+
- Add KaTeX version to stylesheet and troubleshooting guide (#1893)
|
|
8
|
+
- Add symbol double square brackets (#1947, #1954)
|
|
9
|
+
- Support double-square curly braces (#1953)
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- Upgrade minimum development Node version to v8 (#1861)
|
|
13
|
+
- Disable @babel/env debug (#1874)
|
|
14
|
+
- Add issue templates (#1862)
|
|
15
|
+
- Added 'katex-element' (#1905)
|
|
16
|
+
- Fix Users' logo and url (#1896)
|
|
17
|
+
- Load fonts before running screenshotter (#1891)
|
|
18
|
+
- Add Browserstack logo (#1879)
|
|
19
|
+
- Added Android library (#1943)
|
|
20
|
+
- Move custom colors used by Khan into macros.js (#1933)
|
|
21
|
+
- Test for duplicate symbols/macros (#1955)
|
|
22
|
+
- Include extensions mhchem & copy-tex in home-page (#1932)
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- Fix \Rho (#1870)
|
|
26
|
+
- Fix nested \dfrac (#1825)
|
|
27
|
+
- Improve MathML accents (#1877)
|
|
28
|
+
- Improve MathML for \overset, \stackrel, and \underset (#1886)
|
|
29
|
+
- Fix \not (U+E020) RBearing (width) (#1878)
|
|
30
|
+
- Fix ApplyFunction character (#1890)
|
|
31
|
+
- Improve MathML for \limits (#1897)
|
|
32
|
+
- Improve MathML for \hphantom and \vphantom (#1883)
|
|
33
|
+
- Improve MathML for \coloneqq, \dblcolon, \eqcolon, and \eqqcolon (#1889)
|
|
34
|
+
- Improve MathML for \brace (#1884)
|
|
35
|
+
- Fix \middle spacing (#1906)
|
|
36
|
+
- Get a tall \middle\vert from MathML (#1911)
|
|
37
|
+
- Improve more coloneq (#1902)
|
|
38
|
+
- Make \smallint small in \displaystyle (#1907)
|
|
39
|
+
- Improve MathML for characters in Unicode private use area (#1908)
|
|
40
|
+
- Improve MathML for extensible arrows (#1901)
|
|
41
|
+
- Improve MathML for \rule (#1912)
|
|
42
|
+
- Improve MathML for fractions (#1882)
|
|
43
|
+
- Improve MathML for \tag (#1915)
|
|
44
|
+
- Improve MathML for \colorbox and \fcolorbox (#1914)
|
|
45
|
+
- Improve MathML for environments (#1910)
|
|
46
|
+
- Improve MathML for \genfrac barline (#1925)
|
|
47
|
+
- Support \textup and \textmd (#1921)
|
|
48
|
+
- Improve MathML for \not (#1923)
|
|
49
|
+
- Improve MathML for \Bbbk (#1930)
|
|
50
|
+
- Prevent inadvertent tall delims (#1948)
|
|
51
|
+
|
|
52
|
+
### Removed
|
|
53
|
+
- Re-added code for \includegraphics but disabled the function until trust settings is merged (#1951)
|
|
54
|
+
|
|
4
55
|
## [v0.10.1]
|
|
5
56
|
### Added
|
|
6
57
|
- ECMAScript module for contrib (#1624)
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://gitter.im/KaTeX/KaTeX?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
6
6
|
[](https://greenkeeper.io/)
|
|
7
7
|
[](https://www.jsdelivr.com/package/npm/katex)
|
|
8
|
-

|
|
9
9
|
|
|
10
10
|
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.
|
|
11
11
|
|
|
@@ -29,13 +29,13 @@ Try out KaTeX [on the demo page](https://katex.org/#demo)!
|
|
|
29
29
|
<!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
|
|
30
30
|
<html>
|
|
31
31
|
<head>
|
|
32
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.
|
|
32
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous">
|
|
33
33
|
|
|
34
34
|
<!-- The loading of KaTeX is deferred to speed up page rendering -->
|
|
35
|
-
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.
|
|
35
|
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.js" integrity="sha384-9Nhn55MVVN0/4OFx7EE5kpFBPsEMZxKTCnA+4fqDmg12eCTqGi6+BB2LjY8brQxJ" crossorigin="anonymous"></script>
|
|
36
36
|
|
|
37
37
|
<!-- To automatically render math in text elements, include the auto-render extension: -->
|
|
38
|
-
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.
|
|
38
|
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"
|
|
39
39
|
onload="renderMathInElement(document.body);"></script>
|
|
40
40
|
</head>
|
|
41
41
|
...
|
package/cli.js
CHANGED
|
File without changes
|
|
@@ -21,8 +21,8 @@ provided by this extension). Without this CSS, partially selected equations
|
|
|
21
21
|
will just get the usual HTML copy/paste behavior.
|
|
22
22
|
|
|
23
23
|
```html
|
|
24
|
-
<link href="https://cdn.jsdelivr.net/npm/katex@0.10.
|
|
25
|
-
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.
|
|
24
|
+
<link href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/copy-tex.css" rel="stylesheet" type="text/css">
|
|
25
|
+
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/copy-tex.min.js" integrity="sha384-XhWAe6BtVcvEdS3FFKT7Mcft4HJjPqMQvi5V4YhzH9Qxw497jC13TupOEvjoIPy7" crossorigin="anonymous"></script>
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
See [index.html](index.html) for an example.
|
|
@@ -38,7 +38,7 @@ statement with `require('katex/contrib/copy-tex/katex2tex.js')`.
|
|
|
38
38
|
<!-- TODO: uncomment when releasing a new version
|
|
39
39
|
ECMAScript module is also available:
|
|
40
40
|
```html
|
|
41
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.10.
|
|
41
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/copy-tex.mjs" integrity="sha384-kS7UtO844uqLwxPmaRwzg1nGbKiHsIteWh+DP2cvT2FtigL0v6w1yPXYKEDzct0C" crossorigin="anonymous"></script>
|
|
42
42
|
```` -->
|
|
43
43
|
|
|
44
44
|
### Known Issues
|
|
@@ -12,7 +12,7 @@ Load the extension by adding the following line to your HTML file.
|
|
|
12
12
|
This extension should be loaded *after* all `script type=math/tex` blocks that you want to render.
|
|
13
13
|
|
|
14
14
|
```html
|
|
15
|
-
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.
|
|
15
|
+
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/mathtex-script-type.min.js" integrity="sha384-LJ2FmexL77rmGm6SIpxq7y+XA6bkLzGZEgCywzKOZG/ws4va9fUVu2neMjvc3zdv"></script>
|
|
16
16
|
```
|
|
17
17
|
You can download the script and use it locally, or from a local KaTeX installation instead.
|
|
18
18
|
|
|
@@ -23,12 +23,12 @@ After we're done writing `math/tex` scripts, we load this extension.
|
|
|
23
23
|
```html
|
|
24
24
|
<html>
|
|
25
25
|
<head>
|
|
26
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.
|
|
27
|
-
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.
|
|
26
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous">
|
|
27
|
+
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.js" integrity="sha384-9Nhn55MVVN0/4OFx7EE5kpFBPsEMZxKTCnA+4fqDmg12eCTqGi6+BB2LjY8brQxJ" crossorigin="anonymous"></script>
|
|
28
28
|
</head>
|
|
29
29
|
<body>
|
|
30
30
|
<script type="math/tex">x+\sqrt{1-x^2}</script>
|
|
31
|
-
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/mathtex-script-type.min.js" integrity="sha384-LJ2FmexL77rmGm6SIpxq7y+XA6bkLzGZEgCywzKOZG/ws4va9fUVu2neMjvc3zdv"></script>
|
|
32
32
|
</body>
|
|
33
33
|
</html>
|
|
34
34
|
```
|
|
@@ -36,5 +36,5 @@ After we're done writing `math/tex` scripts, we load this extension.
|
|
|
36
36
|
<!-- TODO: uncomment when releasing a new version
|
|
37
37
|
ECMAScript module is also available:
|
|
38
38
|
```html
|
|
39
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.10.
|
|
39
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/mathtex-script-type.mjs" integrity="sha384-qc7HqE4GHbr2H9R+C8mTSdJmkkZ9E1bkIRyRrxMsoj3dcbGjILzoXJGcBGGns1bk" crossorigin="anonymous"></script>
|
|
40
40
|
```` -->
|
package/contrib/mhchem/README.md
CHANGED
|
@@ -7,7 +7,7 @@ This extension adds to KaTeX the `\ce` and `\pu` functions from the [mhchem](htt
|
|
|
7
7
|
This extension isn't part of core KaTeX, so the script should be separately included. Write the following line into the HTML page's `<head>`. Place it *after* the line that calls `katex.js`.
|
|
8
8
|
|
|
9
9
|
```html
|
|
10
|
-
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.
|
|
10
|
+
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/mhchem.min.js" integrity="sha384-oa0lfxCGjaU1LdYckhq8LZcP+JTf8cyJXe69O6VE6UrShzWveT6KiCElJrck/stm"></script>
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
### Syntax
|
package/dist/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://gitter.im/KaTeX/KaTeX?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
6
6
|
[](https://greenkeeper.io/)
|
|
7
7
|
[](https://www.jsdelivr.com/package/npm/katex)
|
|
8
|
-

|
|
9
9
|
|
|
10
10
|
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.
|
|
11
11
|
|
|
@@ -29,13 +29,13 @@ Try out KaTeX [on the demo page](https://katex.org/#demo)!
|
|
|
29
29
|
<!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
|
|
30
30
|
<html>
|
|
31
31
|
<head>
|
|
32
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.
|
|
32
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous">
|
|
33
33
|
|
|
34
34
|
<!-- The loading of KaTeX is deferred to speed up page rendering -->
|
|
35
|
-
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.
|
|
35
|
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.js" integrity="sha384-9Nhn55MVVN0/4OFx7EE5kpFBPsEMZxKTCnA+4fqDmg12eCTqGi6+BB2LjY8brQxJ" crossorigin="anonymous"></script>
|
|
36
36
|
|
|
37
37
|
<!-- To automatically render math in text elements, include the auto-render extension: -->
|
|
38
|
-
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.
|
|
38
|
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"
|
|
39
39
|
onload="renderMathInElement(document.body);"></script>
|
|
40
40
|
</head>
|
|
41
41
|
...
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/katex.css
CHANGED
|
@@ -128,6 +128,9 @@
|
|
|
128
128
|
.katex * {
|
|
129
129
|
-ms-high-contrast-adjust: none !important;
|
|
130
130
|
}
|
|
131
|
+
.katex .katex-version::after {
|
|
132
|
+
content: "0.10.2";
|
|
133
|
+
}
|
|
131
134
|
.katex .katex-mathml {
|
|
132
135
|
position: absolute;
|
|
133
136
|
clip: rect(1px, 1px, 1px, 1px);
|
|
@@ -911,6 +914,13 @@
|
|
|
911
914
|
.katex svg path {
|
|
912
915
|
stroke: none;
|
|
913
916
|
}
|
|
917
|
+
.katex img {
|
|
918
|
+
border-style: none;
|
|
919
|
+
min-width: 0;
|
|
920
|
+
min-height: 0;
|
|
921
|
+
max-width: none;
|
|
922
|
+
max-height: none;
|
|
923
|
+
}
|
|
914
924
|
.katex .stretchy {
|
|
915
925
|
width: 100%;
|
|
916
926
|
display: block;
|