mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 03:08:40 +00:00
Release v0.10.2 (take 4) (#1961)
* Release v0.10.2 Bump master to v0.10.3-pre * update CHANGELOG * add integrity hash to mhchem script in README * tweaked CHANGELOG
This commit is contained in:
51
CHANGELOG.md
51
CHANGELOG.md
@@ -1,6 +1,57 @@
|
||||
# Changelog
|
||||
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/).
|
||||
|
||||
## [v0.10.2]
|
||||
### Added
|
||||
- Approximate font metrics only when metrics don't exist (#1898)
|
||||
- Add KaTeX version to stylesheet and troubleshooting guide (#1893)
|
||||
- Add symbol double square brackets (#1947, #1954)
|
||||
- Support double-square curly braces (#1953)
|
||||
|
||||
### Changed
|
||||
- Upgrade minimum development Node version to v8 (#1861)
|
||||
- Disable @babel/env debug (#1874)
|
||||
- Add issue templates (#1862)
|
||||
- Added 'katex-element' (#1905)
|
||||
- Fix Users' logo and url (#1896)
|
||||
- Load fonts before running screenshotter (#1891)
|
||||
- Add Browserstack logo (#1879)
|
||||
- Added Android library (#1943)
|
||||
- Move custom colors used by Khan into macros.js (#1933)
|
||||
- Test for duplicate symbols/macros (#1955)
|
||||
- Include extensions mhchem & copy-tex in home-page (#1932)
|
||||
|
||||
### Fixed
|
||||
- Fix \Rho (#1870)
|
||||
- Fix nested \dfrac (#1825)
|
||||
- Improve MathML accents (#1877)
|
||||
- Improve MathML for \overset, \stackrel, and \underset (#1886)
|
||||
- Fix \not (U+E020) RBearing (width) (#1878)
|
||||
- Fix ApplyFunction character (#1890)
|
||||
- Improve MathML for \limits (#1897)
|
||||
- Improve MathML for \hphantom and \vphantom (#1883)
|
||||
- Improve MathML for \coloneqq, \dblcolon, \eqcolon, and \eqqcolon (#1889)
|
||||
- Improve MathML for \brace (#1884)
|
||||
- Fix \middle spacing (#1906)
|
||||
- Get a tall \middle\vert from MathML (#1911)
|
||||
- Improve more coloneq (#1902)
|
||||
- Make \smallint small in \displaystyle (#1907)
|
||||
- Improve MathML for characters in Unicode private use area (#1908)
|
||||
- Improve MathML for extensible arrows (#1901)
|
||||
- Improve MathML for \rule (#1912)
|
||||
- Improve MathML for fractions (#1882)
|
||||
- Improve MathML for \tag (#1915)
|
||||
- Improve MathML for \colorbox and \fcolorbox (#1914)
|
||||
- Improve MathML for environments (#1910)
|
||||
- Improve MathML for \genfrac barline (#1925)
|
||||
- Support \textup and \textmd (#1921)
|
||||
- Improve MathML for \not (#1923)
|
||||
- Improve MathML for \Bbbk (#1930)
|
||||
- Prevent inadvertent tall delims (#1948)
|
||||
|
||||
### Removed
|
||||
- Re-added code for \includegraphics but disabled the function until trust settings is merged (#1951)
|
||||
|
||||
## [v0.10.1]
|
||||
### Added
|
||||
- ECMAScript module for contrib (#1624)
|
||||
|
@@ -5,7 +5,7 @@
|
||||
[](https://gitter.im/KaTeX/KaTeX?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://greenkeeper.io/)
|
||||
[](https://www.jsdelivr.com/package/npm/katex)
|
||||

|
||||

|
||||
|
||||
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.
|
||||
|
||||
@@ -29,13 +29,13 @@ Try out KaTeX [on the demo page](https://katex.org/#demo)!
|
||||
<!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.css" integrity="sha384-dbVIfZGuN1Yq7/1Ocstc1lUEm+AT+/rCkibIcC/OmWo5f0EA48Vf8CytHzGrSwbQ" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous">
|
||||
|
||||
<!-- The loading of KaTeX is deferred to speed up page rendering -->
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.js" integrity="sha384-2BKqo+exmr9su6dir+qCw08N2ZKRucY4PrGQPPWU1A7FtlCGjmEGFqXCv5nyM5Ij" crossorigin="anonymous"></script>
|
||||
<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>
|
||||
|
||||
<!-- To automatically render math in text elements, include the auto-render extension: -->
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"
|
||||
onload="renderMathInElement(document.body);"></script>
|
||||
</head>
|
||||
...
|
||||
|
@@ -21,8 +21,8 @@ provided by this extension). Without this CSS, partially selected equations
|
||||
will just get the usual HTML copy/paste behavior.
|
||||
|
||||
```html
|
||||
<link href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/copy-tex.css" rel="stylesheet" type="text/css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/copy-tex.min.js" integrity="sha384-XhWAe6BtVcvEdS3FFKT7Mcft4HJjPqMQvi5V4YhzH9Qxw497jC13TupOEvjoIPy7" crossorigin="anonymous"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/copy-tex.css" rel="stylesheet" type="text/css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/copy-tex.min.js" integrity="sha384-XhWAe6BtVcvEdS3FFKT7Mcft4HJjPqMQvi5V4YhzH9Qxw497jC13TupOEvjoIPy7" crossorigin="anonymous"></script>
|
||||
```
|
||||
|
||||
See [index.html](index.html) for an example.
|
||||
@@ -38,7 +38,7 @@ statement with `require('katex/contrib/copy-tex/katex2tex.js')`.
|
||||
<!-- TODO: uncomment when releasing a new version
|
||||
ECMAScript module is also available:
|
||||
```html
|
||||
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/copy-tex.mjs" integrity="sha384-kS7UtO844uqLwxPmaRwzg1nGbKiHsIteWh+DP2cvT2FtigL0v6w1yPXYKEDzct0C" crossorigin="anonymous"></script>
|
||||
<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>
|
||||
```` -->
|
||||
|
||||
### Known Issues
|
||||
|
@@ -12,7 +12,7 @@ Load the extension by adding the following line to your HTML file.
|
||||
This extension should be loaded *after* all `script type=math/tex` blocks that you want to render.
|
||||
|
||||
```html
|
||||
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/mathtex-script-type.min.js" integrity="sha384-LJ2FmexL77rmGm6SIpxq7y+XA6bkLzGZEgCywzKOZG/ws4va9fUVu2neMjvc3zdv"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/mathtex-script-type.min.js" integrity="sha384-LJ2FmexL77rmGm6SIpxq7y+XA6bkLzGZEgCywzKOZG/ws4va9fUVu2neMjvc3zdv"></script>
|
||||
```
|
||||
You can download the script and use it locally, or from a local KaTeX installation instead.
|
||||
|
||||
@@ -23,12 +23,12 @@ After we're done writing `math/tex` scripts, we load this extension.
|
||||
```html
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.css" integrity="sha384-dbVIfZGuN1Yq7/1Ocstc1lUEm+AT+/rCkibIcC/OmWo5f0EA48Vf8CytHzGrSwbQ" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.js" integrity="sha384-2BKqo+exmr9su6dir+qCw08N2ZKRucY4PrGQPPWU1A7FtlCGjmEGFqXCv5nyM5Ij" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.js" integrity="sha384-9Nhn55MVVN0/4OFx7EE5kpFBPsEMZxKTCnA+4fqDmg12eCTqGi6+BB2LjY8brQxJ" crossorigin="anonymous"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script type="math/tex">x+\sqrt{1-x^2}</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/mathtex-script-type.min.js" integrity="sha384-LJ2FmexL77rmGm6SIpxq7y+XA6bkLzGZEgCywzKOZG/ws4va9fUVu2neMjvc3zdv"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/mathtex-script-type.min.js" integrity="sha384-LJ2FmexL77rmGm6SIpxq7y+XA6bkLzGZEgCywzKOZG/ws4va9fUVu2neMjvc3zdv"></script>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
@@ -36,5 +36,5 @@ After we're done writing `math/tex` scripts, we load this extension.
|
||||
<!-- TODO: uncomment when releasing a new version
|
||||
ECMAScript module is also available:
|
||||
```html
|
||||
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/mathtex-script-type.mjs" integrity="sha384-qc7HqE4GHbr2H9R+C8mTSdJmkkZ9E1bkIRyRrxMsoj3dcbGjILzoXJGcBGGns1bk" crossorigin="anonymous"></script>
|
||||
<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>
|
||||
```` -->
|
||||
|
@@ -7,7 +7,7 @@ This extension adds to KaTeX the `\ce` and `\pu` functions from the [mhchem](htt
|
||||
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`.
|
||||
|
||||
```html
|
||||
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/mhchem.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/mhchem.min.js" integrity="sha384-oa0lfxCGjaU1LdYckhq8LZcP+JTf8cyJXe69O6VE6UrShzWveT6KiCElJrck/stm"></script>
|
||||
```
|
||||
|
||||
### Syntax
|
||||
|
@@ -12,9 +12,9 @@ This extension isn't part of KaTeX proper, so the script needs to be included
|
||||
using a CDN:
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.css" integrity="sha384-dbVIfZGuN1Yq7/1Ocstc1lUEm+AT+/rCkibIcC/OmWo5f0EA48Vf8CytHzGrSwbQ" crossorigin="anonymous">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.js" integrity="sha384-2BKqo+exmr9su6dir+qCw08N2ZKRucY4PrGQPPWU1A7FtlCGjmEGFqXCv5nyM5Ij" crossorigin="anonymous"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous">
|
||||
<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>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"
|
||||
onload="renderMathInElement(document.body);"></script>
|
||||
```
|
||||
|
||||
@@ -31,9 +31,9 @@ want to use a `defer` or `onload` attribute.
|
||||
For example:
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.css" integrity="sha384-dbVIfZGuN1Yq7/1Ocstc1lUEm+AT+/rCkibIcC/OmWo5f0EA48Vf8CytHzGrSwbQ" crossorigin="anonymous">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.js" integrity="sha384-2BKqo+exmr9su6dir+qCw08N2ZKRucY4PrGQPPWU1A7FtlCGjmEGFqXCv5nyM5Ij" crossorigin="anonymous"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous">
|
||||
<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>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"></script>
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
renderMathInElement(document.body, {
|
||||
@@ -46,9 +46,9 @@ For example:
|
||||
<!-- TODO: uncomment when releasing a new version
|
||||
ECMAScript module is also available:
|
||||
```html
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.css" integrity="sha384-dbVIfZGuN1Yq7/1Ocstc1lUEm+AT+/rCkibIcC/OmWo5f0EA48Vf8CytHzGrSwbQ" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous">
|
||||
<script type="module">
|
||||
import renderMathInElement from "https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/auto-render.mjs";
|
||||
import renderMathInElement from "https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/auto-render.mjs";
|
||||
renderMathInElement(document.body);
|
||||
</script>
|
||||
```
|
||||
|
@@ -9,15 +9,15 @@ If you include the `katex.js` directly, the `katex` object will be available as
|
||||
a global variable.
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.css" integrity="sha384-b/NoaeRXkMxyKcrDw2KtVtYKkVg3dA0rTRgLoV7W2df3MzeR1eHLTi+l4//4fMwk" crossorigin="anonymous">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.js" integrity="sha384-ern5NCRqs6nJ/a4Ik0nB9hnKVH5HwV2XRUYdQl09OB/vvd1Lmmqbg1Mh+mYUclXx" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.css" integrity="sha384-+MsSfd29vjUzcyqYURxcmpWGtqoSHBy+QdEJNLEslXQftxojQv0k6BGDqUNp9GtA" crossorigin="anonymous">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.js" integrity="sha384-5zUJgoXUAOXAoLeyJm2Ja3vbN3VCnoc2w0rG7dyC2jjGwD8PINuWoDHJ3gNdkOxj" crossorigin="anonymous"></script>
|
||||
```
|
||||
|
||||
KaTeX also provides minified versions:
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.css" integrity="sha384-dbVIfZGuN1Yq7/1Ocstc1lUEm+AT+/rCkibIcC/OmWo5f0EA48Vf8CytHzGrSwbQ" crossorigin="anonymous">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.js" integrity="sha384-2BKqo+exmr9su6dir+qCw08N2ZKRucY4PrGQPPWU1A7FtlCGjmEGFqXCv5nyM5Ij" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous">
|
||||
<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>
|
||||
```
|
||||
|
||||
The loading of scripts are [deferred using `defer` attribute](https://developer.mozilla.org/en/HTML/Element/script#Attributes)
|
||||
@@ -61,22 +61,22 @@ for more detail.
|
||||
```html
|
||||
<script type="text/javascript">
|
||||
require([
|
||||
"https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.js",
|
||||
"https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.js",
|
||||
], katex => {
|
||||
...
|
||||
});
|
||||
</script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.css" integrity="sha384-b/NoaeRXkMxyKcrDw2KtVtYKkVg3dA0rTRgLoV7W2df3MzeR1eHLTi+l4//4fMwk" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.css" integrity="sha384-+MsSfd29vjUzcyqYURxcmpWGtqoSHBy+QdEJNLEslXQftxojQv0k6BGDqUNp9GtA" crossorigin="anonymous">
|
||||
```
|
||||
|
||||
### ECMAScript module
|
||||
```html
|
||||
<script type="module" type="text/javascript">
|
||||
import katex from 'https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.mjs';
|
||||
import katex from 'https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.mjs';
|
||||
...
|
||||
</script>
|
||||
<script nomodule defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.js" integrity="sha384-ern5NCRqs6nJ/a4Ik0nB9hnKVH5HwV2XRUYdQl09OB/vvd1Lmmqbg1Mh+mYUclXx" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.css" integrity="sha384-b/NoaeRXkMxyKcrDw2KtVtYKkVg3dA0rTRgLoV7W2df3MzeR1eHLTi+l4//4fMwk" crossorigin="anonymous">
|
||||
<script nomodule defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.js" integrity="sha384-5zUJgoXUAOXAoLeyJm2Ja3vbN3VCnoc2w0rG7dyC2jjGwD8PINuWoDHJ3gNdkOxj" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.css" integrity="sha384-+MsSfd29vjUzcyqYURxcmpWGtqoSHBy+QdEJNLEslXQftxojQv0k6BGDqUNp9GtA" crossorigin="anonymous">
|
||||
```
|
||||
|
||||
> Use [`nomodule` attribute](https://developer.mozilla.org/en/HTML/Element/script#Attributes)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "katex",
|
||||
"version": "0.10.2-pre",
|
||||
"version": "0.10.3-pre",
|
||||
"description": "Fast math typesetting for the web.",
|
||||
"main": "dist/katex.js",
|
||||
"homepage": "https://katex.org",
|
||||
|
112
website/versioned_docs/version-0.10.2/autorender.md
Normal file
112
website/versioned_docs/version-0.10.2/autorender.md
Normal file
@@ -0,0 +1,112 @@
|
||||
---
|
||||
id: version-0.10.2-autorender
|
||||
title: Auto-render Extension
|
||||
original_id: autorender
|
||||
---
|
||||
This is an extension to automatically render all of the math inside of text. It
|
||||
searches all of the text nodes within a given element for the given delimiters,
|
||||
ignoring certain tags like `<pre>`, and renders the math in place.
|
||||
|
||||
## Usage
|
||||
This extension isn't part of KaTeX proper, so the script needs to be included
|
||||
(via a `<script>` tag) in the page along with KaTeX itself. For example,
|
||||
using a CDN:
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous">
|
||||
<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>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"
|
||||
onload="renderMathInElement(document.body);"></script>
|
||||
```
|
||||
|
||||
> Above, the [`defer` attribute](https://developer.mozilla.org/en/HTML/Element/script#Attributes)
|
||||
indicates that the script doesn't need to execute until the page has loaded,
|
||||
speeding up page rendering; and the `onload` attribute calls
|
||||
`renderMathInElement` once the auto-render script loads.
|
||||
|
||||
Alternatively, you can call the `renderMathInElement` when (or after) the
|
||||
[`DOMContentLoaded` event](https://developer.mozilla.org/ko/docs/Web/Reference/Events/DOMContentLoaded)
|
||||
fires on the document or in another deferred script.
|
||||
This approach is useful for specifying or computing options, or if you don't
|
||||
want to use a `defer` or `onload` attribute.
|
||||
For example:
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous">
|
||||
<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>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"></script>
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
renderMathInElement(document.body, {
|
||||
// ...options...
|
||||
});
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
<!-- TODO: uncomment when releasing a new version
|
||||
ECMAScript module is also available:
|
||||
```html
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous">
|
||||
<script type="module">
|
||||
import renderMathInElement from "https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/auto-render.mjs";
|
||||
renderMathInElement(document.body);
|
||||
</script>
|
||||
```
|
||||
|
||||
> You can use [`nomodule` attribute](https://developer.mozilla.org/en/HTML/Element/script#Attributes)
|
||||
to provide a fallback for older browsers that do not support ES modules. -->
|
||||
|
||||
## API
|
||||
This extension exposes a single function, `window.renderMathInElement`, with
|
||||
the following API:
|
||||
|
||||
```js
|
||||
function renderMathInElement(elem, options)
|
||||
```
|
||||
|
||||
`elem` is an HTML DOM element. The function will recursively search for text
|
||||
nodes inside this element and render the math in them.
|
||||
|
||||
`options` is an optional object argument that can have the same keys as [the
|
||||
object passed to `katex.render`](https://github.com/KaTeX/KaTeX/#rendering-options),
|
||||
in addition to two auto-render-specific keys:
|
||||
|
||||
- `delimiters`: This is a list of delimiters to look for math. Each delimiter
|
||||
has three properties:
|
||||
|
||||
- `left`: A string which starts the math expression (i.e. the left delimiter).
|
||||
- `right`: A string which ends the math expression (i.e. the right delimiter).
|
||||
- `display`: A boolean of whether the math in the expression should be
|
||||
rendered in display mode or not.
|
||||
|
||||
The default value is:
|
||||
|
||||
```js
|
||||
[
|
||||
{left: "$$", right: "$$", display: true},
|
||||
{left: "\\(", right: "\\)", display: false},
|
||||
{left: "\\[", right: "\\]", display: true}
|
||||
]
|
||||
```
|
||||
|
||||
- `ignoredTags`: This is a list of DOM node types to ignore when recursing
|
||||
through. The default value is
|
||||
`["script", "noscript", "style", "textarea", "pre", "code"]`.
|
||||
|
||||
- `ignoredClasses`: This is a list of DOM node class names to ignore when
|
||||
recursing through. By default, this value is not set.
|
||||
|
||||
- `errorCallback`: A callback method returning a message and an error stack
|
||||
in case of an critical error during rendering. The default uses `console.error`.
|
||||
|
||||
- `preProcess`: A callback function, `(math: string) => string`, used to process
|
||||
math expressions before rendering.
|
||||
|
||||
The `displayMode` property of the options object is ignored, and is
|
||||
instead taken from the `display` key of the corresponding entry in the
|
||||
`delimiters` key.
|
||||
|
||||
The same `options.macros` object (which defaults to an empty object `{}`)
|
||||
is passed into several calls to `katex.render`, so that consecutive equations
|
||||
can build up shared macros by `\gdef`.
|
99
website/versioned_docs/version-0.10.2/browser.md
Normal file
99
website/versioned_docs/version-0.10.2/browser.md
Normal file
@@ -0,0 +1,99 @@
|
||||
---
|
||||
id: version-0.10.2-browser
|
||||
title: Browser
|
||||
original_id: browser
|
||||
---
|
||||
> KaTeX supports all major browsers, including Chrome, Safari, Firefox, Opera, Edge, and IE 9–11.
|
||||
|
||||
## Global
|
||||
If you include the `katex.js` directly, the `katex` object will be available as
|
||||
a global variable.
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.css" integrity="sha384-+MsSfd29vjUzcyqYURxcmpWGtqoSHBy+QdEJNLEslXQftxojQv0k6BGDqUNp9GtA" crossorigin="anonymous">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.js" integrity="sha384-5zUJgoXUAOXAoLeyJm2Ja3vbN3VCnoc2w0rG7dyC2jjGwD8PINuWoDHJ3gNdkOxj" crossorigin="anonymous"></script>
|
||||
```
|
||||
|
||||
KaTeX also provides minified versions:
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous">
|
||||
<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>
|
||||
```
|
||||
|
||||
The loading of scripts are [deferred using `defer` attribute](https://developer.mozilla.org/en/HTML/Element/script#Attributes)
|
||||
to speed up page rendering. The `katex` object will be available after
|
||||
[`DOMContentLoaded` event is fired on the `document`](https://developer.mozilla.org/ko/docs/Web/Reference/Events/DOMContentLoaded).
|
||||
If you do not use `defer`, `katex` object will be available after corresponding
|
||||
`script` tag.
|
||||
|
||||
If KaTeX is not used immediately or not critical, it is possible to load KaTeX
|
||||
asynchronously. Add [`async` attribute](https://developer.mozilla.org/en/HTML/Element/script#Attributes)
|
||||
to `script` and use [`rel="preload"` and `onload` attribute](https://github.com/filamentgroup/loadCSS)
|
||||
on `link`.
|
||||
|
||||
You can prefetch KaTeX fonts to prevent FOUT or FOIT. Use [Font Loading API](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Font_Loading_API)
|
||||
or [Web Font Loader](https://github.com/typekit/webfontloader):
|
||||
|
||||
```html
|
||||
<script>
|
||||
window.WebFontConfig = {
|
||||
custom: {
|
||||
families: ['KaTeX_AMS', 'KaTeX_Caligraphic:n4,n7', 'KaTeX_Fraktur:n4,n7',
|
||||
'KaTeX_Main:n4,n7,i4,i7', 'KaTeX_Math:i4,i7', 'KaTeX_Script',
|
||||
'KaTeX_SansSerif:n4,n7,i4', 'KaTeX_Size1', 'KaTeX_Size2', 'KaTeX_Size3',
|
||||
'KaTeX_Size4', 'KaTeX_Typewriter'],
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/webfontloader@1.6.28/webfontloader.js" integrity="sha256-4O4pS1SH31ZqrSO2A/2QJTVjTPqVe+jnYgOWUVr7EEc=" crossorigin="anonymous"></script>
|
||||
```
|
||||
|
||||
You can also use [`rel="preload"`](https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content).
|
||||
Add `<link rel="preload" href=(path to WOFF2 font) as="font" type="font/woff2" crossorigin="anonymous">`
|
||||
to `head`. Note that [only few browsers support it](https://caniuse.com/#feat=link-rel-preload)
|
||||
and they all support WOFF2 so preloading WOFF2 fonts is enough.
|
||||
|
||||
See [Google Web Fundamentals - Web Font Optimization](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/webfont-optimization)
|
||||
for more detail.
|
||||
|
||||
## Module Loaders
|
||||
### AMD
|
||||
```html
|
||||
<script type="text/javascript">
|
||||
require([
|
||||
"https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.js",
|
||||
], katex => {
|
||||
...
|
||||
});
|
||||
</script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.css" integrity="sha384-+MsSfd29vjUzcyqYURxcmpWGtqoSHBy+QdEJNLEslXQftxojQv0k6BGDqUNp9GtA" crossorigin="anonymous">
|
||||
```
|
||||
|
||||
### ECMAScript module
|
||||
```html
|
||||
<script type="module" type="text/javascript">
|
||||
import katex from 'https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.mjs';
|
||||
...
|
||||
</script>
|
||||
<script nomodule defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.js" integrity="sha384-5zUJgoXUAOXAoLeyJm2Ja3vbN3VCnoc2w0rG7dyC2jjGwD8PINuWoDHJ3gNdkOxj" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.css" integrity="sha384-+MsSfd29vjUzcyqYURxcmpWGtqoSHBy+QdEJNLEslXQftxojQv0k6BGDqUNp9GtA" crossorigin="anonymous">
|
||||
```
|
||||
|
||||
> Use [`nomodule` attribute](https://developer.mozilla.org/en/HTML/Element/script#Attributes)
|
||||
to provide a fallback for older browsers that do not support ES modules.
|
||||
|
||||
## Download & Host Things Yourself
|
||||
Download a [KaTeX release](https://github.com/KaTeX/KaTeX/releases),
|
||||
copy `katex.js`, `katex.css`
|
||||
(or `katex.min.js` and `katex.min.css` to use minified versions),
|
||||
and the `fonts` directory, and include or import it like above.
|
||||
|
||||
You can also build from source. See [Building from Source](node.md#building-from-source)
|
||||
for more details.
|
||||
|
||||
## Bundler
|
||||
[Use Node.js package managers to install KaTeX and import it](node.md) in your
|
||||
project. Then bundle using bundlers like [webpack](https://webpack.js.org/) or
|
||||
[rollup.js](https://rollupjs.org/). Note that you have to bundle the stylesheet
|
||||
(`katex.css`) or include it manually.
|
51
website/versioned_docs/version-0.10.2/libs.md
Normal file
51
website/versioned_docs/version-0.10.2/libs.md
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
id: version-0.10.2-libs
|
||||
title: Extensions & Libraries
|
||||
original_id: libs
|
||||
---
|
||||
## Extensions
|
||||
|
||||
These extensions are provided by KaTeX.
|
||||
|
||||
- [Auto-render](autorender.md): Automatically renders all of the math inside text
|
||||
- [Copy-tex](https://github.com/Khan/KaTeX/tree/master/contrib/copy-tex): When selecting and copying KaTeX-rendered elements, copies their LaTeX source to the clipboard
|
||||
- [`math/tex` Custom Script Type](https://github.com/Khan/KaTeX/tree/master/contrib/mathtex-script-type): Automatically displays LaTeX math inside `script` tags with `type=math/tex`
|
||||
- [mhchem](https://github.com/Khan/KaTeX/tree/master/contrib/mhchem): Write beautiful chemical equations easily
|
||||
|
||||
## Libraries
|
||||
|
||||
These libraries are maintained by third-parties.
|
||||
|
||||
### Angular2+
|
||||
- [ng-katex](https://github.com/garciparedes/ng-katex): Angular module to write beautiful math expressions with TeX syntax boosted by KaTeX library
|
||||
|
||||
### iOS
|
||||
- [KaTeX-iOS](https://github.com/ianarawjo/KaTeX-iOS): iOS UIView that renders TeX expressions with KaTeX
|
||||
|
||||
### Android
|
||||
- [KaTeXView](https://github.com/judemanutd/KaTeXView): An android library that uses Khan Academy KaTeX for TeX math rendering.
|
||||
|
||||
### React
|
||||
- [react-latex](https://github.com/zzish/react-latex): React component to render latex strings, based on KaTeX
|
||||
- [react-katex](https://github.com/talyssonoc/react-katex): React components that use KaTeX to typeset math expressions
|
||||
|
||||
### Ruby
|
||||
|
||||
- [katex-ruby](https://github.com/glebm/katex-ruby): Provides server-side rendering and integration with popular Ruby web frameworks (Rails, Hanami, and anything that uses Sprockets).
|
||||
|
||||
### Vue
|
||||
- [vue-katex](https://github.com/lucpotage/vue-katex): Vue plugin to render TeX expressions using KaTeX.
|
||||
|
||||
### AsciiMath
|
||||
|
||||
If you want to render math written in [AsciiMath](http://asciimath.org/),
|
||||
you'll need to first convert AsciiMath into LaTeX input, then call KaTeX.
|
||||
|
||||
- [asciimath2tex](https://github.com/christianp/asciimath2tex): Converts AsciiMath to TeX, with KaTeX in mind
|
||||
|
||||
### Canvas LaTeX
|
||||
|
||||
- [canvas-latex](https://github.com/CurriculumAssociates/canvas-latex): Renders mathematical expressions on HTML5's canvas element. Supports popular libraries like: CreateJS, and PIXI.
|
||||
|
||||
### Web-Components
|
||||
- [katex-element](https://github.com/georges-gomes/katex-element): KaTeX wrapped in a custom element. Simply use `<katex-element>` in HTML - framework independent.
|
79
website/versioned_docs/version-0.10.2/node.md
Normal file
79
website/versioned_docs/version-0.10.2/node.md
Normal file
@@ -0,0 +1,79 @@
|
||||
---
|
||||
id: version-0.10.2-node
|
||||
title: Node.js
|
||||
original_id: node
|
||||
---
|
||||
## Installation
|
||||
### npm
|
||||
Install with `npm`:
|
||||
|
||||
```bash
|
||||
npm install katex
|
||||
# or globally
|
||||
npm install -g katex
|
||||
```
|
||||
|
||||
### Yarn
|
||||
Install with `Yarn`:
|
||||
|
||||
```bash
|
||||
yarn add katex
|
||||
# or globally
|
||||
yarn global add katex
|
||||
```
|
||||
|
||||
### Building from Source
|
||||
To build you will need Git, Node.js 8 or later, and Yarn.
|
||||
|
||||
Clone a copy of the GitHub source repository:
|
||||
```bash
|
||||
git clone https://github.com/KaTeX/KaTeX.git
|
||||
cd KaTeX
|
||||
```
|
||||
|
||||
Then install dependencies and run `build` script:
|
||||
```bash
|
||||
yarn
|
||||
yarn build
|
||||
```
|
||||
|
||||
It will automatically transpile code and include only necessary fonts for
|
||||
target environments specified by [Browserslist config](https://github.com/browserslist/browserslist#environment-variables).
|
||||
For example, if you are making a web app for a kiosk with Chrome 68, run
|
||||
`BROWSERSLIST="Chrome 68" yarn build` and it will produce build with no
|
||||
transpilation, as it fully supports ES6, and only include WOFF2 fonts.
|
||||
|
||||
You can override included fonts using environment variables. Set `USE_(FONT NAME)`
|
||||
environment variable to `"true"` or `"false"`, to force a font type to be included
|
||||
or excluded, respectively.`
|
||||
|
||||
If you'd like to use the built KaTeX in other projects, install the package by
|
||||
specifying the path:
|
||||
```bash
|
||||
yarn add /path/to/KaTeX
|
||||
# or using npm
|
||||
npm install /path/to/KaTeX
|
||||
```
|
||||
|
||||
> You can manually download the package and source code from
|
||||
[GitHub releases](https://github.com/KaTeX/KaTeX/releases).
|
||||
|
||||
## Importing
|
||||
KaTeX is exported as a CommonJS module, which can be imported using `require`:
|
||||
```js
|
||||
const katex = require('katex');
|
||||
```
|
||||
|
||||
If you're using a module loader, transpiler, or bundler that supports interoperability
|
||||
between ECMAScript module and CommonJS module, you can use `import`:
|
||||
```js
|
||||
import katex from 'katex';
|
||||
```
|
||||
|
||||
KaTeX also provides an ECMAScript module:
|
||||
```js
|
||||
import katex from 'katex/dist/katex.mjs'
|
||||
```
|
||||
|
||||
> The ES module contains ES6 syntaxes and features, and may need transpiling to
|
||||
use in old environments:
|
1216
website/versioned_docs/version-0.10.2/support_table.md
Normal file
1216
website/versioned_docs/version-0.10.2/support_table.md
Normal file
File diff suppressed because it is too large
Load Diff
641
website/versioned_docs/version-0.10.2/supported.md
Normal file
641
website/versioned_docs/version-0.10.2/supported.md
Normal file
@@ -0,0 +1,641 @@
|
||||
---
|
||||
id: version-0.10.2-supported
|
||||
title: Supported Functions
|
||||
original_id: supported
|
||||
---
|
||||
This is a list of TeX functions supported by KaTeX. It is sorted into logical groups.
|
||||
|
||||
There is a similar [Support Table](support_table.md), sorted alphabetically, that lists both supported and un-supported functions.
|
||||
|
||||
<link rel="stylesheet" href="/static/katex.min.css"/>
|
||||
<style>
|
||||
p {overflow-wrap: break-word;}
|
||||
table tr,
|
||||
table td {
|
||||
vertical-align: middle;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="katex-hopscotch">
|
||||
|
||||
## Accents
|
||||
|
||||
||||
|
||||
|:----------------------------|:----------------------------------------------------|:-----
|
||||
|$a'$ `a'` |$\tilde{a}$ `\tilde{a}`|$\mathring{g}$ `\mathring{g}`
|
||||
|$a''$ `a''`|$\widetilde{ac}$ `\widetilde{ac}` |$\overgroup{AB}$ `\overgroup{AB}`
|
||||
|$a^{\prime}$ `a^{\prime}` |$\utilde{AB}$ `\utilde{AB}` |$\undergroup{AB}$ `\undergroup{AB}`
|
||||
|$\acute{a}$ `\acute{a}`|$\vec{F}$ `\vec{F}` |$\Overrightarrow{AB}$ `\Overrightarrow{AB}`
|
||||
|$\bar{y}$ `\bar{y}` |$\overleftarrow{AB}$ `\overleftarrow{AB}`|$\overrightarrow{AB}$ `\overrightarrow{AB}`
|
||||
|$\breve{a}$ `\breve{a}`|$\underleftarrow{AB}$ `\underleftarrow{AB}` |$\underrightarrow{AB}$ `\underrightarrow{AB}`
|
||||
|$\check{a}$ `\check{a}`|$\overleftharpoon{ac}$ `\overleftharpoon{ac}` |$\overrightharpoon{ac}$ `\overrightharpoon{ac}`
|
||||
|$\dot{a}$ `\dot{a}` |$\overleftrightarrow{AB}$ `\overleftrightarrow{AB}` |$\overbrace{AB}$ `\overbrace{AB}`
|
||||
|$\ddot{a}$ `\ddot{a}` |$\underleftrightarrow{AB}$ `\underleftrightarrow{AB}`|$\underbrace{AB}$ `\underbrace{AB}`
|
||||
|$\grave{a}$ `\grave{a}`|$\overline{AB}$ `\overline{AB}` |$\overlinesegment{AB}$ `\overlinesegment{AB}`
|
||||
|$\hat{\theta}$ `\hat{\theta}`|$\underline{AB}$ `\underline{AB}` |$\underlinesegment{AB}$ `\underlinesegment{AB}`
|
||||
|$\widehat{ac}$ `\widehat{ac}`|$\widecheck{ac}$ `\widecheck{ac}` |
|
||||
|
||||
***Accent functions inside \\text{…}***
|
||||
|
||||
|||||
|
||||
|:---------------------|:---------------------|:---------------------|:-----
|
||||
|$\text{\'{a}}$ `\'{a}`|$\text{\~{a}}$ `\~{a}`|$\text{\.{a}}$ `\.{a}`|$\text{\H{a}}$ `\H{a}`
|
||||
|$\text{\`{a}}$ <code>\\`{a}</code>|$\text{\={a}}$ `\={a}`|$\text{\"{a}}$ `\"{a}`|$\text{\v{a}}$ `\v{a}`
|
||||
|$\text{\^{a}}$ `\^{a}`|$\text{\u{a}}$ `\u{a}`|$\text{\r{a}}$ `\r{a}`|
|
||||
|
||||
See also [letters](#letters)
|
||||
|
||||
## Delimiters
|
||||
|
||||
||||||
|
||||
|:-----------------------------------|:---------------------------------------|:----------|:-------------------------------------------------------|:-----
|
||||
|$(~)$ `( )` |$\lparen~\rparen$ `\lparen`<br>$~~~~$`\rparen`|$⌈~⌉$ `⌈ ⌉`|$\lceil~\rceil$ `\lceil`<br>$~~~~~$`\rceil` |$\uparrow$ `\uparrow`
|
||||
|$[~]$ `[ ]` |$\lbrack~\rbrack$ `\lbrack`<br>$~~~~$`\rbrack`|$⌊~⌋$ `⌊ ⌋`|$\lfloor~\rfloor$ `\lfloor`<br>$~~~~~$`\rfloor` |$\downarrow$ `\downarrow`
|
||||
|$\{ \}$ `\{ \}`|$\lbrace \rbrace$ `\lbrace`<br>$~~~~$`\rbrace`|$⎰⎱$ `⎰⎱` |$\lmoustache \rmoustache$ `\lmoustache`<br>$~~~~$`\rmoustache`|$\updownarrow$ `\updownarrow`
|
||||
|$⟨~⟩$ `⟨ ⟩` |$\langle~\rangle$ `\langle`<br>$~~~~$`\rangle`|$⟮~⟯$ `⟮ ⟯`|$\lgroup~\rgroup$ `\lgroup`<br>$~~~~~$`\rgroup` |$\Uparrow$ `\Uparrow`
|
||||
|$\vert$ <code>|</code> |$\vert$ `\vert` |$┌ ┐$ `┌ ┐`|$\ulcorner \urcorner$ `\ulcorner`<br>$~~~~$`\urcorner` |$\Downarrow$ `\Downarrow`
|
||||
|$\Vert$ <code>\|</code> |$\Vert$ `\Vert` |$└ ┘$ `└ ┘`|$\llcorner \lrcorner$ `\llcorner`<br>$~~~~$`\lrcorner` |$\Updownarrow$ `\Updownarrow`
|
||||
|$\lvert~\rvert$ `\lvert`<br>$~~~~$`\rvert`|$\lVert~\rVert$ `\lVert`<br>$~~~~~$`\rVert` |`\left.`| `\right.` |$\backslash$ `\backslash`
|
||||
|$\lang~\rang$ `\lang`<br>$~~~~$`\rang`|$\lt~\gt$ `\lt \gt`|$⟦~⟧$ `⟦ ⟧`|$\llbracket~\rrbracket$ `\llbracket`<br>$~~~~$`\rrbracket`|$\lBrace~\rBrace$ `\lBrace \rBrace`
|
||||
|
||||
**Delimiter Sizing**
|
||||
|
||||
$\left(\LARGE{AB}\right)$ `\left(\LARGE{AB}\right)`
|
||||
|
||||
$( \big( \Big( \bigg( \Bigg($ `( \big( \Big( \bigg( \Bigg(`
|
||||
|
||||
||||||
|
||||
|:--------|:------|:--------|:-------|:------|
|
||||
|`\left` |`\big` |`\bigl` |`\bigm` |`\bigr`
|
||||
|`\middle`|`\Big` |`\Bigl` |`\Bigm` | `\Bigr`
|
||||
|`\right` |`\bigg`|`\biggl` |`\biggm`|`\biggr`
|
||||
| |`\Bigg`|`\Biggl` |`\Biggm`|`\Biggr`
|
||||
|
||||
</div>
|
||||
|
||||
## Environments
|
||||
|
||||
<div class="katex-cards" id="environments">
|
||||
|
||||
|||||
|
||||
|:---------------------|:---------------------|:---------------------|:--------
|
||||
|$\begin{matrix} a & b \\ c & d \end{matrix}$ | `\begin{matrix}`<br> `a & b \\`<br> `c & d`<br>`\end{matrix}` |$\begin{array}{cc}a & b\\c & d\end{array}$ | `\begin{array}{cc}`<br> `a & b \\`<br> `c & d`<br>`\end{array}`
|
||||
|$\begin{pmatrix} a & b \\ c & d \end{pmatrix}$ |`\begin{pmatrix}`<br> `a & b \\`<br> `c & d`<br>`\end{pmatrix}` |$\begin{bmatrix} a & b \\ c & d \end{bmatrix}$ | `\begin{bmatrix}`<br> `a & b \\`<br> `c & d`<br>`\end{bmatrix}`
|
||||
|$\begin{vmatrix} a & b \\ c & d \end{vmatrix}$ |`\begin{vmatrix}`<br> `a & b \\`<br> `c & d`<br>`\end{vmatrix}` |$\begin{Vmatrix} a & b \\ c & d \end{Vmatrix}$ |`\begin{Vmatrix}`<br> `a & b \\`<br> `c & d`<br>`\end{Vmatrix}`
|
||||
|$\begin{Bmatrix} a & b \\ c & d \end{Bmatrix}$ |`\begin{Bmatrix}`<br> `a & b \\`<br> `c & d`<br>`\end{Bmatrix}`|$\def\arraystretch{1.5}\begin{array}{c:c:c} a & b & c \\ \hline d & e & f \\ \hdashline g & h & i \end{array}$|`\def\arraystretch{1.5}`<br> `\begin{array}{c:c:c}`<br> `a & b & c \\ \hline`<br> `d & e & f \\`<br> `\hdashline`<br> `g & h & i`<br>`\end{array}`
|
||||
|$\begin{aligned} a&=b+c \\ d+e&=f \end{aligned}$ |`\begin{aligned}`<br> `a&=b+c \\`<br> `d+e&=f`<br>`\end{aligned}`|$\begin{alignedat}{2}10&x+&3&y=2\\3&x+&13&y=4\end{alignedat}$ |`\begin{alignedat}{2}`<br> `10&x+ &3&y = 2 \\`<br> ` 3&x+&13&y = 4`<br>`\end{alignedat}`
|
||||
|$\begin{gathered} a=b \\ e=b+c \end{gathered}$ |`\begin{gathered}`<br> `a=b \\ `<br> `e=b+c`<br>`\end{gathered}`|$x = \begin{cases} a &\text{if } b \\ c &\text{if } d \end{cases}$ |`x = \begin{cases}`<br> `a &\text{if } b \\`<br> `c &\text{if } d`<br>`\end{cases}`
|
||||
|
||||
</div>
|
||||
|
||||
KaTeX also supports `darray` and `dcases`.
|
||||
|
||||
Acceptable line separators include: `\\`, `\cr`, `\\[distance]`, and `\cr[distance]`. *Distance* can be written with any of the [KaTeX units](#units).
|
||||
|
||||
The `{array}` environment supports `|` and `:` vertical separators.
|
||||
|
||||
The `{array}` environment does not yet support `\cline` or `\multicolumn`.
|
||||
|
||||
<div class="katex-hopscotch">
|
||||
|
||||
## HTML
|
||||
|
||||
|||
|
||||
|:----------------|:-------------------|
|
||||
| $\href{https://katex.org/}{\KaTeX}$ | `\href{https://katex.org/}{\KaTeX}` |
|
||||
| $\url{https://katex.org/}$ | `\url{https://katex.org/}` |
|
||||
|
||||
## Letters and Unicode
|
||||
|
||||
**Greek Letters**
|
||||
|
||||
Direct Input: $Α Β Γ Δ Ε Ζ Η Θ Ι \allowbreak Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω$
|
||||
$\allowbreak α β γ δ ϵ ζ η θ ι κ λ μ ν ξ o π \allowbreak ρ σ τ υ ϕ χ ψ ω ε ϑ ϖ ϱ ς φ$
|
||||
|
||||
|||||
|
||||
|---------------|-------------|-------------|---------------|
|
||||
| $\Alpha$ `\Alpha` | $\Beta$ `\Beta` | $\Gamma$ `\Gamma`| $\Delta$ `\Delta`
|
||||
| $\Epsilon$ `\Epsilon` | $\Zeta$ `\Zeta` | $\Eta$ `\Eta` | $\Theta$ `\Theta`
|
||||
| $\Iota$ `\Iota` | $\Kappa$ `\Kappa` | $\Lambda$ `\Lambda` | $\Mu$ `\Mu`
|
||||
| $\Nu$ `\Nu` | $\Xi$ `\Xi` | $\Omicron$ `\Omicron` | $\Pi$ `\Pi`
|
||||
| $\Rho$ `\Rho` | $\Sigma$ `\Sigma` | $\Tau$ `\Tau` | $\Upsilon$ `\Upsilon`
|
||||
| $\Phi$ `\Phi` | $\Chi$ `\Chi` | $\Psi$ `\Psi` | $\Omega$ `\Omega`
|
||||
| $\varGamma$ `\varGamma`| $\varDelta$ `\varDelta` | $\varTheta$ `\varTheta` | $\varLambda$ `\varLambda` |
|
||||
| $\varXi$ `\varXi`| $\varPi$ `\varPi` | $\varSigma$ `\varSigma` | $\varUpsilon$ `\varUpsilon` |
|
||||
| $\varPhi$ `\varPhi` | $\varPsi$ `\varPsi`| $\varOmega$ `\varOmega` ||
|
||||
| $\alpha$ `\alpha`| $\beta$ `\beta` | $\gamma$ `\gamma` | $\delta$ `\delta`|
|
||||
| $\epsilon$ `\epsilon` | $\zeta$ `\zeta` | $\eta$ `\eta`| $\theta$ `\theta`|
|
||||
| $\iota$ `\iota` | $\kappa$ `\kappa` | $\lambda$ `\lambda`| $\mu$ `\mu`|
|
||||
| $\nu$ `\nu`| $\xi$ `\xi` | $\omicron$ `\omicron` | $\pi$ `\pi`|
|
||||
| $\rho$ `\rho` | $\sigma$ `\sigma` | $\tau$ `\tau`| $\upsilon$ `\upsilon` |
|
||||
| $\phi$ `\phi` | $\chi$ `\chi`| $\psi$ `\psi`| $\omega$ `\omega`|
|
||||
| $\varepsilon$ `\varepsilon` | $\varkappa$ `\varkappa` | $\vartheta$ `\vartheta` | $\thetasym$ `\thetasym`
|
||||
| $\varpi$ `\varpi`| $\varrho$ `\varrho` | $\varsigma$ `\varsigma` | $\varphi$ `\varphi`
|
||||
| $\digamma $ `\digamma`
|
||||
|
||||
**Other Letters**
|
||||
|
||||
||||||
|
||||
|:----------|:----------|:----------|:----------|:----------|
|
||||
|$\imath$ `\imath`|$\nabla$ `\nabla`|$\Im$ `\Im`|$\Reals$ `\Reals`|$\text{\OE}$ `\text{\OE}`
|
||||
|$\jmath$ `\jmath`|$\partial$ `\partial`|$\image$ `\image`|$\wp$ `\wp`|$\text{\o}$ `\text{\o}`
|
||||
|$\aleph$ `\aleph`|$\Game$ `\Game`|$\Bbbk$ `\Bbbk`|$\weierp$ `\weierp`|$\text{\O}$ `\text{\O}`
|
||||
|$\alef$ `\alef`|$\Finv$ `\Finv`|$\N$ `\N`|$\Z$ `\Z`|$\text{\ss}$ `\text{\ss}`
|
||||
|$\alefsym$ `\alefsym`|$\cnums$ `\cnums`|$\natnums$ `\natnums`|$\text{\aa}$ `\text{\aa}`|$\text{\i}$ `\text{\i}`
|
||||
|$\beth$ `\beth`|$\Complex$ `\Complex`|$\R$ `\R`|$\text{\AA}$ `\text{\AA}`|$\text{\j}$ `\text{\j}`
|
||||
|$\gimel$ `\gimel`|$\ell$ `\ell`|$\Re$ `\Re`|$\text{\ae}$ `\text{\ae}`
|
||||
|$\daleth$ `\daleth`|$\hbar$ `\hbar`|$\real$ `\real`|$\text{\AE}$ `\text{\AE}`
|
||||
|$\eth$ `\eth`|$\hslash$ `\hslash`|$\reals$ `\reals`|$\text{\oe}$ `\text{\oe}`
|
||||
|
||||
Direct Input: $∂ ∇ ℑ Ⅎ ℵ ℶ ℷ ℸ ⅁ ℏ ð$
|
||||
ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝÞßàáâãäåçèéêëìíîïðñòóôöùúûüýþÿ
|
||||
|
||||
</div>
|
||||
<div class="katex-cards" id="math-alpha">
|
||||
|
||||
**Unicode Mathematical Alphanumeric Symbols**
|
||||
|
||||
| Item | Range | Item | Range |
|
||||
|-------------|---------------------|-------------------|---------------|
|
||||
| Bold | $\text{𝐀-𝐙 𝐚-𝐳 𝟎-𝟗}$ | Double-struck | $\text{𝔸-}ℤ\ 𝕜$
|
||||
| Italic | $\text{𝐴-𝑍 𝑎-𝑧}$ | Sans serif | $\text{𝖠-𝖹 𝖺-𝗓 𝟢-𝟫}$
|
||||
| Bold Italic | $\text{𝑨-𝒁 𝒂-𝒛}$ | Sans serif bold | $\text{𝗔-𝗭 𝗮-𝘇 𝟬-𝟵}$
|
||||
| Script | $\text{𝒜-𝒵}$ | Sans serif italic | $\text{𝘈-𝘡 𝘢-𝘻}$
|
||||
| Fractur | $\text{𝔄-}ℨ\text{ 𝔞-𝔷}$| Monospace | $\text{𝙰-𝚉 𝚊-𝚣 𝟶-𝟿}$
|
||||
|
||||
</div>
|
||||
<div class="katex-hopscotch">
|
||||
|
||||
**Unicode**
|
||||
|
||||
The letters listed above will render in any KaTeX rendering mode.
|
||||
|
||||
If the KaTeX rendering mode is set to `strict: false` or `strict:"warn"` (default), then KaTeX will accept all Unicode letters. The letters not listed above will be rendered from system fonts, not KaTeX-supplied fonts, so their typography may clash. They may also cause small vertical alignment issues. KaTeX has detailed metrics for glyphs in Latin, Greek, and Cyrillic, but other glyphs are treated as if they are each as tall as the letter M.
|
||||
|
||||
For Persian composite characters, a user-supplied [plug-in](https://github.com/HosseinAgha/persian-katex-plugin) is under development.
|
||||
|
||||
## Layout
|
||||
|
||||
### Annotation
|
||||
|
||||
|||
|
||||
|:------------------------------|:-----
|
||||
|$\cancel{5}$ `\cancel{5}`|$\overbrace{a+b+c}^{\text{note}}$ `\overbrace{a+b+c}^{\text{note}}`
|
||||
|$\bcancel{5}$ `\bcancel{5}` |$\underbrace{a+b+c}_{\text{note}}$ `\underbrace{a+b+c}_{\text{note}}`
|
||||
|$\xcancel{ABC}$ `\xcancel{ABC}`|$\not =$ `\not =`
|
||||
|$\sout{abc}$ `\sout{abc}`|$\boxed{\pi=\frac c d}$ `\boxed{\pi=\frac c d}`
|
||||
|
||||
`\tag{hi} x+y^{2x}`
|
||||
$$\tag{hi} x+y^{2x}$$
|
||||
|
||||
`\tag*{hi} x+y^{2x}`
|
||||
$$\tag*{hi} x+y^{2x}$$
|
||||
|
||||
### Line Breaks
|
||||
|
||||
KaTeX 0.10.0+ will insert automatic line breaks in inline math after relations or binary operators such as “=” or “+”. These can be suppressed by `\nobreak` or by placing math inside a pair of braces, as in `{F=ma}`. `\allowbreak` will allow automatic line breaks at locations other than relations or operators.
|
||||
|
||||
Hard line breaks are `\\` and `\newline`.
|
||||
|
||||
In display math, KaTeX does not insert automatic line breaks. It ignores display math hard line breaks when rendering option `strict: true`.
|
||||
|
||||
### Vertical Layout
|
||||
|
||||
||||
|
||||
|:--------------|:----------------------------------------|:-----
|
||||
|$x_n$ `x_n` |$\stackrel{!}{=}$ `\stackrel{!}{=}` |$a \atop b$ `a \atop b`
|
||||
|$e^x$ `e^x` |$\overset{!}{=}$ `\overset{!}{=}` |$a\raisebox{0.25em}{b}c$ `a\raisebox{0.25em}{b}c`
|
||||
|$_u^o $ `_u^o `|$\underset{!}{=}$ `\underset{!}{=}`
|
||||
|
||||
The second argument of `\raisebox` can contain math if it is nested within `$…$` delimiters, as in `\raisebox{0.25em}{$\frac a b$}`
|
||||
|
||||
### Overlap and Spacing
|
||||
|
||||
|||
|
||||
|:-------|:-------|
|
||||
|${=}\mathllap{/\,}$ `{=}\mathllap{/\,}` | $\left(x^{\smash{2}}\right)$ `\left(x^{\smash{2}}\right)`
|
||||
|$\mathrlap{\,/}{=}$ `\mathrlap{\,/}{=}` | $\sqrt{\smash[b]{y}}$ `\sqrt{\smash[b]{y}} `
|
||||
|
||||
$\displaystyle\sum_{\mathclap{1\le i\le j\le n}} x_{ij}$ `\sum_{\mathclap{1\le i\le j\le n}} x_{ij}`
|
||||
|
||||
KaTeX also supports `\llap`, `\rlap`, and `\clap`, but they will take only text, not math, as arguments.
|
||||
|
||||
</div>
|
||||
<div class="katex-cards" id="spacing-tbl">
|
||||
|
||||
**Spacing**
|
||||
|
||||
| Function | Produces | Function | Produces|
|
||||
|:----------------|:-------------------|:---------------------|:--------------------------------------|
|
||||
| `\,` | ³∕₁₈ em space | `\kern{distance}` | space, width = *distance*
|
||||
| `\thinspace` | ³∕₁₈ em space | `\mkern{distance}` | space, width = *distance*
|
||||
| `\>` | ⁴∕₁₈ em space | `\mskip{distance}` | space, width = *distance*
|
||||
| `\:` | ⁴∕₁₈ em space | `\hskip{distance}` | space, width = *distance*
|
||||
| `\medspace` | ⁴∕₁₈ em space | `\hspace{distance}` | space, width = *distance*
|
||||
| `\;` | ⁵∕₁₈ em space | `\hspace*{distance}` | space, width = *distance*
|
||||
| `\thickspace` | ⁵∕₁₈ em space | `\phantom{content}` | space the width and height of content
|
||||
| `\enspace` | ½ em space | `\hphantom{content}` | space the width of content
|
||||
| `\quad` | 1 em space | `\vphantom{content}` | a strut the height of content
|
||||
| `\qquad` | 2 em space | `\!` | – ³∕₁₈ em space
|
||||
| `~` | non-breaking space | `\negthinspace` | – ³∕₁₈ em space
|
||||
| `\<space>` | space | `\negmedspace` | – ⁴∕₁₈ em space
|
||||
| `\nobreakspace` | non-breaking space | `\negthickspace` | – ⁵∕₁₈ em space
|
||||
| `\space` | space |
|
||||
|
||||
</div>
|
||||
|
||||
**Notes:**
|
||||
|
||||
`distance` will accept any of the [KaTeX units](#units).
|
||||
|
||||
`\kern`, `\mkern`, `\mskip`, and `\hspace` accept unbraced distances, as in: `\kern1em`.
|
||||
|
||||
`\mkern` and `\mskip` will not work in text mode and both will write a console warning for any unit except `mu`.
|
||||
|
||||
<div class="katex-hopscotch">
|
||||
|
||||
## Logic and Set Theory
|
||||
|
||||
|||||
|
||||
|:--------------------|:--------------------------|:----------------------------|:-----
|
||||
|$\forall$ `\forall` |$\complement$ `\complement`|$\therefore$ `\therefore` |$\emptyset$ `\emptyset`
|
||||
|$\exists$ `\exists` |$\subset$ `\subset` |$\because$ `\because` |$\empty$ `\empty`
|
||||
|$\exist$ `\exist` |$\supset$ `\supset` |$\mapsto$ `\mapsto` |$\varnothing$ `\varnothing`
|
||||
|$\nexists$ `\nexists`|$\mid$ `\mid` |$\to$ `\to` |$\implies$ `\implies`
|
||||
|$\in$ `\in` |$\land$ `\land` |$\gets$ `\gets` |$\impliedby$ `\impliedby`
|
||||
|$\isin$ `\isin` |$\lor$ `\lor` |$\leftrightarrow$ `\leftrightarrow`|$\iff$ `\iff`
|
||||
|$\notin$ `\notin` |$\ni$ `\ni` |$\notni$ `\notni` |$\neg$ `\neg` or `\lnot`
|
||||
|
||||
Direct Input: $∀ ∴ ∁ ∵ ∃ ∣ ∈ ∉ ∋ ⊂ ⊃ ∧ ∨ ↦ → ← ↔ ¬$ ℂ ℍ ℕ ℙ ℚ ℝ
|
||||
|
||||
## Macros
|
||||
|
||||
|||
|
||||
|:-------------------------------------|:------
|
||||
|$\def\foo{x^2} \foo + \foo$ | `\def\foo{x^2} \foo + \foo`
|
||||
|$\gdef\bar#1{#1^2} \bar{y} + \bar{y}$ | `\gdef\bar#1{#1^2} \bar{y} + \bar{y}`
|
||||
| | `\global\def\macroname#1#2…{definition}`
|
||||
| | `\newcommand\macroname[numargs]{definition}`
|
||||
| | `\renewcommand\macroname[numargs]{definition}`
|
||||
| | `\providecommand\macroname[numargs]{definition}`
|
||||
|
||||
Macros can also be defined in the KaTeX [rendering options](options.md).
|
||||
|
||||
Macros accept up to nine arguments: #1, #2, etc.
|
||||
|
||||
`\gdef` and `\global\def` macros will persist between math expressions.
|
||||
|
||||
Available functions include:
|
||||
|
||||
`\char` `\mathchoice` `\TextOrMath` `\@ifstar` `\@ifnextchar` `\@firstoftwo` `\@secondoftwo` `\relax`
|
||||
|
||||
@ is a valid character for commands, as if `\makeatletter` were in effect.
|
||||
|
||||
## Operators
|
||||
|
||||
### Big Operators
|
||||
|
||||
|||||
|
||||
|------------------|-------------------------|--------------------------|--------------|
|
||||
| $\sum$ `\sum` | $\prod$ `\prod` | $\bigotimes$ `\bigotimes`| $\bigvee$ `\bigvee`
|
||||
| $\int$ `\int` | $\coprod$ `\coprod` | $\bigoplus$ `\bigoplus` | $\bigwedge$ `\bigwedge`
|
||||
| $\iint$ `\iint` | $\intop$ `\intop` | $\bigodot$ `\bigodot` | $\bigcap$ `\bigcap`
|
||||
| $\iiint$ `\iiint`| $\smallint$ `\smallint` | $\biguplus$ `\biguplus` | $\bigcup$ `\bigcup`
|
||||
| $\oint$ `\oint` | $\oiint$ `\oiint` | $\oiiint$ `\oiiint` | $\bigsqcup$ `\bigsqcup`
|
||||
|
||||
Direct Input: $∫ ∬ ∭ ∮ ∏ ∐ ∑ ⋀ ⋁ ⋂ ⋃ ⨀ ⨁ ⨂ ⨄ ⨆$
|
||||
|
||||
### Binary Operators
|
||||
|
||||
|||||
|
||||
|-------------|-------------------|-------------------|--------------------|
|
||||
| $+$ `+`| $\cdot$ `\cdot` | $\gtrdot$ `\gtrdot`| $x \pmod a$ `x \pmod a`|
|
||||
| $-$ `-`| $\cdotp$ `\cdotp` | $\intercal$ `\intercal` | $x \pod a$ `x \pod a` |
|
||||
| $/$ `/`| $\centerdot$ `\centerdot`| $\land$ `\land` | $\rhd$ `\rhd` |
|
||||
| $*$ `*`| $\circ$ `\circ` | $\leftthreetimes$ `\leftthreetimes` | $\rightthreetimes$ `\rightthreetimes` |
|
||||
| $\amalg$ `\amalg` | $\circledast$ `\circledast` | $\ldotp$ `\ldotp` | $\rtimes$ `\rtimes` |
|
||||
| $\And$ `\And`| $\circledcirc$ `\circledcirc` | $\lor$ `\lor`| $\setminus$ `\setminus` |
|
||||
| $\ast$ `\ast`| $\circleddash$ `\circleddash` | $\lessdot$ `\lessdot` | $\smallsetminus$ `\smallsetminus`|
|
||||
| $\barwedge$ `\barwedge` | $\Cup$ `\Cup`| $\lhd$ `\lhd`| $\sqcap$ `\sqcap` |
|
||||
| $\bigcirc$ `\bigcirc` | $\cup$ `\cup`| $\ltimes$ `\ltimes`| $\sqcup$ `\sqcup` |
|
||||
| $\bmod$ `\bmod` | $\curlyvee$ `\curlyvee` | $x \mod a$ `x\mod a`| $\times$ `\times` |
|
||||
| $\boxdot$ `\boxdot`| $\curlywedge$ `\curlywedge` | $\mp$ `\mp` | $\unlhd$ `\unlhd` |
|
||||
| $\boxminus$ `\boxminus` | $\div$ `\div`| $\odot$ `\odot` | $\unrhd$ `\unrhd` |
|
||||
| $\boxplus$ `\boxplus` | $\divideontimes$ `\divideontimes` | $\ominus$ `\ominus`| $\uplus$ `\uplus` |
|
||||
| $\boxtimes$ `\boxtimes` | $\dotplus$ `\dotplus` | $\oplus$ `\oplus` | $\vee$ `\vee` |
|
||||
| $\bullet$ `\bullet`| $\doublebarwedge$ `\doublebarwedge` | $\otimes$ `\otimes`| $\veebar$ `\veebar` |
|
||||
| $\Cap$ `\Cap`| $\doublecap$ `\doublecap`| $\oslash$ `\oslash`| $\wedge$ `\wedge` |
|
||||
| $\cap$ `\cap`| $\doublecup$ `\doublecup`| $\pm$ `\pm` or `\plusmn` | $\wr$ `\wr` |
|
||||
|
||||
Direct Input: $+ - / * ⋅ ± × ÷ ∓ ∔ ∧ ∨ ∩ ∪ ≀ ⊎ ⊓ ⊔ ⊕ ⊖ ⊗ ⊘ ⊙ ⊚ ⊛ ⊝$
|
||||
|
||||
### Fractions and Binomials
|
||||
|
||||
||||
|
||||
|:--------------------------|:----------------------------|:-----
|
||||
|$\frac{a}{b}$ `\frac{a}{b}`|$\tfrac{a}{b}$ `\tfrac{a}{b}`|$\genfrac ( ] {2pt}{1}a{a+1}$ `\genfrac ( ] {2pt}{1}a{a+1}`
|
||||
|${a \over b}$ `{a \over b}`|$\dfrac{a}{b}$ `\dfrac{a}{b}`|${a \above{2pt} b+1}$ `{a \above{2pt} b+1}`
|
||||
|$a/b$ `a/b` | |$\cfrac{a}{1 + \cfrac{1}{b}}$ `\cfrac{a}{1 + \cfrac{1}{b}}`
|
||||
|
||||
||||
|
||||
|:------------------------------|:------------------------------|:--------
|
||||
|$\binom{n}{k}$ `\binom{n}{k}` |$\dbinom{n}{k}$ `\dbinom{n}{k}`|${n\brace k}$ `{n\brace k}`
|
||||
|${n \choose k}$ `{n \choose k}`|$\tbinom{n}{k}$ `\tbinom{n}{k}`|${n\brack k}$ `{n\brack k}`
|
||||
|
||||
### Math Operators
|
||||
|
||||
|||||
|
||||
|-----------|---------|-----------------|-----------|
|
||||
| $\arcsin$ `\arcsin` | $\cotg$ `\cotg` | $\ln$ `\ln` | $\det$ `\det` |
|
||||
| $\arccos$ `\arccos` | $\coth$ `\coth` | $\log$ `\log` | $\gcd$ `\gcd` |
|
||||
| $\arctan$ `\arctan` | $\csc$ `\csc` | $\sec$ `\sec` | $\inf$ `\inf` |
|
||||
| $\arctg$ `\arctg` | $\ctg$ `\ctg` | $\sin$ `\sin` | $\lim$ `\lim` |
|
||||
| $\arcctg$ `\arcctg` | $\cth$ `\cth` | $\sinh$ `\sinh`| $\liminf$ `\liminf` |
|
||||
| $\arg$ `\arg` | $\deg$ `\deg` | $\sh$ `\sh` | $\limsup$ `\limsup` |
|
||||
| $\ch$ `\ch` | $\dim$ `\dim` | $\tan$ `\tan` | $\max$ `\max` |
|
||||
| $\cos$ `\cos` | $\exp$ `\exp` | $\tanh$ `\tanh`| $\min$ `\min` |
|
||||
| $\cosec$ `\cosec` | $\hom$ `\hom` | $\tg$ `\tg` | $\Pr$ `\Pr` |
|
||||
| $\cosh$ `\cosh`| $\ker$ `\ker` | $\th$ `\th` | $\sup$ `\sup` |
|
||||
| $\cot$ `\cot` | $\lg$ `\lg`| $\operatorname{f}$ `\operatorname{f}` | $\argmax$ `\argmax` |
|
||||
|$\argmin$ `\argmin`|
|
||||
|
||||
Functions on the right column of this table can take `\limits`.
|
||||
|
||||
### \sqrt
|
||||
|
||||
$\sqrt{x}$ `\sqrt{x}`
|
||||
|
||||
$\sqrt[3]{x}$ `\sqrt[3]{x}`
|
||||
|
||||
## Relations
|
||||
|
||||
$\stackrel{!}{=}$ `\stackrel{!}{=}`
|
||||
|
||||
|||||
|
||||
|:----------------------------|:--------------------------------|:--------------------------------|:-----
|
||||
|$=$ `=` |$\eqcirc$ `\eqcirc` |$\lesseqgtr$ `\lesseqgtr` |$\sqsupset$ `\sqsupset`
|
||||
|$<$ `<` |$\eqcolon$ `\eqcolon`|$\lesseqqgtr$ `\lesseqqgtr`|$\sqsupseteq$ `\sqsupseteq`
|
||||
|$>$ `>` |$\Eqcolon$ `\Eqcolon`|$\lessgtr$ `\lessgtr`|$\Subset$ `\Subset`
|
||||
|$:$ `:` |$\eqqcolon$ `\eqqcolon` |$\lesssim$ `\lesssim`|$\subset$ `\subset` or `\sub`
|
||||
|$\approx$ `\approx` |$\Eqqcolon$ `\Eqqcolon` |$\ll$ `\ll` |$\subseteq$ `\subseteq` or `\sube`
|
||||
|$\approxeq$ `\approxeq`|$\eqsim$ `\eqsim` |$\lll$ `\lll` |$\subseteqq$ `\subseteqq`
|
||||
|$\asymp$ `\asymp`|$\eqslantgtr$ `\eqslantgtr`|$\llless$ `\llless` |$\succ$ `\succ`
|
||||
|$\backepsilon$ `\backepsilon`|$\eqslantless$ `\eqslantless` |$\lt$ `\lt` |$\succapprox$ `\succapprox`
|
||||
|$\backsim$ `\backsim` |$\equiv$ `\equiv` |$\mid$ `\mid` |$\succcurlyeq$ `\succcurlyeq`
|
||||
|$\backsimeq$ `\backsimeq` |$\fallingdotseq$ `\fallingdotseq`|$\models$ `\models` |$\succeq$ `\succeq`
|
||||
|$\between$ `\between` |$\frown$ `\frown` |$\multimap$ `\multimap` |$\succsim$ `\succsim`
|
||||
|$\bowtie$ `\bowtie` |$\ge$ `\ge` |$\owns$ `\owns`|$\Supset$ `\Supset`
|
||||
|$\bumpeq$ `\bumpeq` |$\geq$ `\geq` |$\parallel$ `\parallel` |$\supset$ `\supset`
|
||||
|$\Bumpeq$ `\Bumpeq` |$\geqq$ `\geqq`|$\perp$ `\perp`|$\supseteq$ `\supseteq` or `\supe`
|
||||
|$\circeq$ `\circeq` |$\geqslant$ `\geqslant` |$\pitchfork$ `\pitchfork` |$\supseteqq$ `\supseteqq`
|
||||
|$\colonapprox$ `\colonapprox`|$\gg$ `\gg` |$\prec$ `\prec`|$\thickapprox$ `\thickapprox`
|
||||
|$\Colonapprox$ `\Colonapprox`|$\ggg$ `\ggg` |$\precapprox$ `\precapprox`|$\thicksim$ `\thicksim`
|
||||
|$\coloneq$ `\coloneq` |$\gggtr$ `\gggtr` |$\preccurlyeq$ `\preccurlyeq` |$\trianglelefteq$ `\trianglelefteq`
|
||||
|$\Coloneq$ `\Coloneq` |$\gt$ `\gt` |$\preceq$ `\preceq` |$\triangleq$ `\triangleq`
|
||||
|$\coloneqq$ `\coloneqq`|$\gtrapprox$ `\gtrapprox` |$\precsim$ `\precsim`|$\trianglerighteq$ `\trianglerighteq`
|
||||
|$\Coloneqq$ `\Coloneqq`|$\gtreqless$ `\gtreqless` |$\propto$ `\propto` |$\varpropto$ `\varpropto`
|
||||
|$\colonsim$ `\colonsim`|$\gtreqqless$ `\gtreqqless`|$\risingdotseq$ `\risingdotseq` |$\vartriangle$ `\vartriangle`
|
||||
|$\Colonsim$ `\Colonsim`|$\gtrless$ `\gtrless`|$\shortmid$ `\shortmid` |$\vartriangleleft$ `\vartriangleleft`
|
||||
|$\cong$ `\cong` |$\gtrsim$ `\gtrsim` |$\shortparallel$ `\shortparallel`|$\vartriangleright$ `\vartriangleright`
|
||||
|$\curlyeqprec$ `\curlyeqprec`|$\in$ `\in` or `\isin` |$\sim$ `\sim` |$\vcentcolon$ `\vcentcolon`
|
||||
|$\curlyeqsucc$ `\curlyeqsucc`|$\Join$ `\Join`|$\simeq$ `\simeq` |$\vdash$ `\vdash`
|
||||
|$\dashv$ `\dashv`|$\le$ `\le` |$\smallfrown$ `\smallfrown`|$\vDash$ `\vDash`
|
||||
|$\dblcolon$ `\dblcolon`|$\leq$ `\leq` |$\smallsmile$ `\smallsmile`|$\Vdash$ `\Vdash`
|
||||
|$\doteq$ `\doteq`|$\leqq$ `\leqq`|$\smile$ `\smile` |$\Vvdash$ `\Vvdash`
|
||||
|$\Doteq$ `\Doteq`|$\leqslant$ `\leqslant` |$\sqsubset$ `\sqsubset` |
|
||||
|$\doteqdot$ `\doteqdot`|$\lessapprox$ `\lessapprox`|$\sqsubseteq$ `\sqsubseteq`|
|
||||
|
||||
|
||||
Direct Input: $= < > : ∈ ∋ ∝ ∼ ∽ ≂ ≃ ≅ ≈ ≊ ≍ ≎ ≏ ≐ ≑ ≒ ≓ ≖ ≗ ≜ ≡ ≤ ≥ ≦ ≧ ≫ ≬ ≳ ≷ ≺ ≻ ≼ ≽ ≾ ≿ ⊂ ⊃ ⊆ ⊇ ⊏ ⊐ ⊑ ⊒ ⊢ ⊣ ⊩ ⊪ ⊸ ⋈ ⋍ ⋐ ⋑ ⋔ ⋙ ⋛ ⋞ ⋟ ⌢ ⌣ ⩾ ⪆ ⪌ ⪕ ⪖ ⪯ ⪰ ⪷ ⪸ ⫅ ⫆ ≲ ⩽ ⪅ ≶ ⋚ ⪋ ⟂ ⊨$ `≔ ≕ ⩴`
|
||||
|
||||
### Negated Relations
|
||||
|
||||
$\not =$ `\not =`
|
||||
|
||||
|||||
|
||||
|--------------|-------------------|---------------------|------------------|
|
||||
| $\gnapprox$ `\gnapprox` | $\ngeqslant$ `\ngeqslant`| $\nsubseteq$ `\nsubseteq` | $\precneqq$ `\precneqq`|
|
||||
| $\gneq$ `\gneq`| $\ngtr$ `\ngtr` | $\nsubseteqq$ `\nsubseteqq` | $\precnsim$ `\precnsim`|
|
||||
| $\gneqq$ `\gneqq` | $\nleq$ `\nleq` | $\nsucc$ `\nsucc`| $\subsetneq$ `\subsetneq` |
|
||||
| $\gnsim$ `\gnsim` | $\nleqq$ `\nleqq` | $\nsucceq$ `\nsucceq` | $\subsetneqq$ `\subsetneqq` |
|
||||
| $\gvertneqq$ `\gvertneqq` | $\nleqslant$ `\nleqslant`| $\nsupseteq$ `\nsupseteq` | $\succnapprox$ `\succnapprox`|
|
||||
| $\lnapprox$ `\lnapprox` | $\nless$ `\nless` | $\nsupseteqq$ `\nsupseteqq` | $\succneqq$ `\succneqq`|
|
||||
| $\lneq$ `\lneq`| $\nmid$ `\nmid` | $\ntriangleleft$ `\ntriangleleft` | $\succnsim$ `\succnsim`|
|
||||
| $\lneqq$ `\lneqq` | $\notin$ `\notin` | $\ntrianglelefteq$ `\ntrianglelefteq` | $\supsetneq$ `\supsetneq` |
|
||||
| $\lnsim$ `\lnsim` | $\notni$ `\notni` | $\ntriangleright$ `\ntriangleright`| $\supsetneqq$ `\supsetneqq` |
|
||||
| $\lvertneqq$ `\lvertneqq` | $\nparallel$ `\nparallel`| $\ntrianglerighteq$ `\ntrianglerighteq` | $\varsubsetneq$ `\varsubsetneq` |
|
||||
| $\ncong$ `\ncong` | $\nprec$ `\nprec` | $\nvdash$ `\nvdash` | $\varsubsetneqq$ `\varsubsetneqq` |
|
||||
| $\ne$ `\ne` | $\npreceq$ `\npreceq` | $\nvDash$ `\nvDash` | $\varsupsetneq$ `\varsupsetneq` |
|
||||
| $\neq$ `\neq` | $\nshortmid$ `\nshortmid`| $\nVDash$ `\nVDash` | $\varsupsetneqq$ `\varsupsetneqq` |
|
||||
| $\ngeq$ `\ngeq`| $\nshortparallel$ `\nshortparallel` | $\nVdash$ `\nVdash` |
|
||||
| $\ngeqq$ `\ngeqq` | $\nsim$ `\nsim` | $\precnapprox$ `\precnapprox`|
|
||||
|
||||
Direct Input: $∉ ∌ ∤ ∦ ≁ ≆ ≠ ≨ ≩ ≮ ≯ ≰ ≱ ⊀ ⊁ ⊈ ⊉ ⊊ ⊋ ⊬ ⊭ ⊮ ⊯ ⋠ ⋡ ⋦ ⋧ ⋨ ⋩ ⋬ ⋭ ⪇ ⪈ ⪉ ⪊ ⪵ ⪶ ⪹ ⪺ ⫋ ⫌$
|
||||
|
||||
### Arrows
|
||||
|
||||
||||
|
||||
|:----------|:----------|:----------|
|
||||
|$\circlearrowleft$ `\circlearrowleft`|$\leftharpoonup$ `\leftharpoonup`|$\rArr$ `\rArr`
|
||||
|$\circlearrowright$ `\circlearrowright`|$\leftleftarrows$ `\leftleftarrows`|$\rarr$ `\rarr`
|
||||
|$\curvearrowleft$ `\curvearrowleft`|$\leftrightarrow$ `\leftrightarrow`|$\restriction$ `\restriction`
|
||||
|$\curvearrowright$ `\curvearrowright`|$\Leftrightarrow$ `\Leftrightarrow`|$\rightarrow$ `\rightarrow`
|
||||
|$\Darr$ `\Darr`|$\leftrightarrows$ `\leftrightarrows`|$\Rightarrow$ `\Rightarrow`
|
||||
|$\dArr$ `\dArr`|$\leftrightharpoons$ `\leftrightharpoons`|$\rightarrowtail$ `\rightarrowtail`
|
||||
|$\darr$ `\darr`|$\leftrightsquigarrow$ `\leftrightsquigarrow`|$\rightharpoondown$ `\rightharpoondown`
|
||||
|$\dashleftarrow$ `\dashleftarrow`|$\Lleftarrow$ `\Lleftarrow`|$\rightharpoonup$ `\rightharpoonup`
|
||||
|$\dashrightarrow$ `\dashrightarrow`|$\longleftarrow$ `\longleftarrow`|$\rightleftarrows$ `\rightleftarrows`
|
||||
|$\downarrow$ `\downarrow`|$\Longleftarrow$ `\Longleftarrow`|$\rightleftharpoons$ `\rightleftharpoons`
|
||||
|$\Downarrow$ `\Downarrow`|$\longleftrightarrow$ `\longleftrightarrow`|$\rightrightarrows$ `\rightrightarrows`
|
||||
|$\downdownarrows$ `\downdownarrows`|$\Longleftrightarrow$ `\Longleftrightarrow`|$\rightsquigarrow$ `\rightsquigarrow`
|
||||
|$\downharpoonleft$ `\downharpoonleft`|$\longmapsto$ `\longmapsto`|$\Rrightarrow$ `\Rrightarrow`
|
||||
|$\downharpoonright$ `\downharpoonright`|$\longrightarrow$ `\longrightarrow`|$\Rsh$ `\Rsh`
|
||||
|$\gets$ `\gets`|$\Longrightarrow$ `\Longrightarrow`|$\searrow$ `\searrow`
|
||||
|$\Harr$ `\Harr`|$\looparrowleft$ `\looparrowleft`|$\swarrow$ `\swarrow`
|
||||
|$\hArr$ `\hArr`|$\looparrowright$ `\looparrowright`|$\to$ `\to`
|
||||
|$\harr$ `\harr`|$\Lrarr$ `\Lrarr`|$\twoheadleftarrow$ `\twoheadleftarrow`
|
||||
|$\hookleftarrow$ `\hookleftarrow`|$\lrArr$ `\lrArr`|$\twoheadrightarrow$ `\twoheadrightarrow`
|
||||
|$\hookrightarrow$ `\hookrightarrow`|$\lrarr$ `\lrarr`|$\Uarr$ `\Uarr`
|
||||
|$\iff$ `\iff`|$\Lsh$ `\Lsh`|$\uArr$ `\uArr`
|
||||
|$\impliedby$ `\impliedby`|$\mapsto$ `\mapsto`|$\uarr$ `\uarr`
|
||||
|$\implies$ `\implies`|$\nearrow$ `\nearrow`|$\uparrow$ `\uparrow`
|
||||
|$\Larr$ `\Larr`|$\nleftarrow$ `\nleftarrow`|$\Uparrow$ `\Uparrow`
|
||||
|$\lArr$ `\lArr`|$\nLeftarrow$ `\nLeftarrow`|$\updownarrow$ `\updownarrow`
|
||||
|$\larr$ `\larr`|$\nleftrightarrow$ `\nleftrightarrow`|$\Updownarrow$ `\Updownarrow`
|
||||
|$\leadsto$ `\leadsto`|$\nLeftrightarrow$ `\nLeftrightarrow`|$\upharpoonleft$ `\upharpoonleft`
|
||||
|$\leftarrow$ `\leftarrow`|$\nrightarrow$ `\nrightarrow`|$\upharpoonright$ `\upharpoonright`
|
||||
|$\Leftarrow$ `\Leftarrow`|$\nRightarrow$ `\nRightarrow`|$\upuparrows$ `\upuparrows`
|
||||
|$\leftarrowtail$ `\leftarrowtail`|$\nwarrow$ `\nwarrow`
|
||||
|$\leftharpoondown$ `\leftharpoondown`|$\Rarr$ `\Rarr`
|
||||
|
||||
Direct Input: $← ↑ → ↓ ↔ ↕ ↖ ↗ ↘ ↙ ↚ ↛ ↞ ↠ ↢ ↣ ↦ ↩ ↪ ↫ ↬ ↭ ↮ ↰ ↱↶ ↷ ↺ ↻ ↼ ↽ ↾ ↾ ↿ ⇀ ⇁ ⇂ ⇃ ⇄ ⇆ ⇇ ⇈ ⇉ ⇊ ⇋ ⇌⇍ ⇎ ⇏ ⇐ ⇑ ⇒ ⇓ ⇔ ⇕ ⇚ ⇛ ⇝ ⇠ ⇢ ⟵ ⟶ ⟷ ⟸ ⟹ ⟺ ⟼$ ↽
|
||||
|
||||
**Extensible Arrows**
|
||||
|
||||
|||
|
||||
|:----------------------------------------------------|:-----
|
||||
|$\xleftarrow{abc}$ `\xleftarrow{abc}` |$\xrightarrow[under]{over}$ `\xrightarrow[under]{over}`
|
||||
|$\xLeftarrow{abc}$ `\xLeftarrow{abc}` |$\xRightarrow{abc}$ `\xRightarrow{abc}`
|
||||
|$\xleftrightarrow{abc}$ `\xleftrightarrow{abc}` |$\xLeftrightarrow{abc}$ `\xLeftrightarrow{abc}`
|
||||
|$\xhookleftarrow{abc}$ `\xhookleftarrow{abc}` |$\xhookrightarrow{abc}$ `\xhookrightarrow{abc}`
|
||||
|$\xtwoheadleftarrow{abc}$ `\xtwoheadleftarrow{abc}` |$\xtwoheadrightarrow{abc}$ `\xtwoheadrightarrow{abc}`
|
||||
|$\xleftharpoonup{abc}$ `\xleftharpoonup{abc}` |$\xrightharpoonup{abc}$ `\xrightharpoonup{abc}`
|
||||
|$\xleftharpoondown{abc}$ `\xleftharpoondown{abc}` |$\xrightharpoondown{abc}$ `\xrightharpoondown{abc}`
|
||||
|$\xleftrightharpoons{abc}$ `\xleftrightharpoons{abc}`|$\xrightleftharpoons{abc}$ `\xrightleftharpoons{abc}`
|
||||
|$\xtofrom{abc}$ `\xtofrom{abc}` |$\xmapsto{abc}$ `\xmapsto{abc}`
|
||||
|$\xlongequal{abc}$ `\xlongequal{abc}`
|
||||
|
||||
Extensible arrows all can take an optional argument in the same manner<br>as `\xrightarrow[under]{over}`.
|
||||
|
||||
## Style, Color, Size, and Font
|
||||
|
||||
**Class Assignment**
|
||||
|
||||
`\mathbin` `\mathclose` `\mathinner` `\mathop`<br>
|
||||
`\mathopen` `\mathord` `\mathpunct` `\mathrel`
|
||||
|
||||
**Color**
|
||||
|
||||
$\color{blue} F=ma$ `\color{blue} F=ma`
|
||||
|
||||
Note that KaTeX `\color` acts like a switch. This aligns with LaTeX and differs from MathJax.
|
||||
Other KaTeX color functions expect the content to be a function argument:
|
||||
|
||||
$\textcolor{blue}{F=ma}$ `\textcolor{blue}{F=ma}`<br>
|
||||
$\textcolor{#228B22}{F=ma}$ `\textcolor{#228B22}{F=ma}`<br>
|
||||
$\colorbox{aqua}{A}$ `\colorbox{aqua}{A}`<br>
|
||||
$\fcolorbox{red}{aqua}{A}$ `\fcolorbox{red}{aqua}{A}`
|
||||
|
||||
For color definition, KaTeX color functions will accept the standard HTML [predefined color names](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Color_keywords). They will also accept an RGB argument in CSS hexadecimal style. The "#" is optional before a six-digit specification.
|
||||
|
||||
**Font**
|
||||
|
||||
||||
|
||||
|:------------------------------|:------------------------------|:-----
|
||||
|$\mathrm{Ab0}$ `\mathrm{Ab0}` |$\mathbf{Ab0}$ `\mathbf{Ab0}` |$\mathit{Ab0}$ `\mathit{Ab0}`
|
||||
|$\mathnormal{Ab0}$ `\mathnormal{Ab0}`|$\textbf{Ab0}$ `\textbf{Ab0}` |$\textit{Ab0}$ `\textit{Ab0}`
|
||||
|$\textrm{Ab0}$ `\textrm{Ab0}` |$\bf Ab0$ `\bf Ab0` |$\it Ab0$ `\it Ab0`
|
||||
|$\rm Ab0$ `\rm Ab0` |$\bold{Ab0}$ `\bold{Ab0}` |$\textup{Ab0}$ `\textup{Ab0}`
|
||||
|$\textnormal{Ab0}$ `\textnormal{Ab0}`|$\boldsymbol{Ab0}$ `\boldsymbol{Ab}`|$\Bbb{AB}$ `\Bbb{AB}`
|
||||
|$\text{Ab0}$ `\text{Ab0}` |$\bm{Ab0}$ `\bm{Ab0}` |$\mathbb{AB}$ `\mathbb{AB}`
|
||||
|$\mathsf{Ab0}$ `\mathsf{Ab0}` |$\textmd{Ab0}$ `\textmd{Ab0}` |$\frak{Ab0}$ `\frak{Ab0}`
|
||||
|$\textsf{Ab0}$ `\textsf{Ab0}` |$\mathtt{Ab0}$ `\mathtt{Ab0}` |$\mathfrak{Ab0}$ `\mathfrak{Ab0}`
|
||||
|$\sf Ab0$ `\sf Ab0` |$\texttt{Ab0}$ `\texttt{Ab0}` |$\mathcal{AB0}$ `\mathcal{AB0}`
|
||||
| |$\tt Ab0$ `\tt Ab0` |$\mathscr{AB}$ `\mathscr{AB}`
|
||||
|
||||
One can stack font family, font weight, and font shape by using the `\textXX` versions of the font functions. So `\textsf{\textbf{H}}` will produce $\textsf{\textbf{H}}$. The other versions do not stack, e.g., `\mathsf{\mathbf{H}}` will produce $\mathsf{\mathbf{H}}$.
|
||||
|
||||
In cases where KaTeX fonts do not have a bold glyph, `\pmb` can simulate one. For example, `\pmb{\mu}` renders as : $\pmb{\mu}$
|
||||
|
||||
**Size**
|
||||
|
||||
|||
|
||||
|:----------------------|:-----
|
||||
|$\Huge AB$ `\Huge AB` |$\normalsize AB$ `\normalsize AB`
|
||||
|$\huge AB$ `\huge AB` |$\small AB$ `\small AB`
|
||||
|$\LARGE AB$ `\LARGE AB`|$\footnotesize AB$ `\footnotesize AB`
|
||||
|$\Large AB$ `\Large AB`|$\scriptsize AB$ `\scriptsize AB`
|
||||
|$\large AB$ `\large AB`|$\tiny AB$ `\tiny AB`
|
||||
|
||||
|
||||
**Style**
|
||||
|
||||
||
|
||||
|:-------------------------------------------------------|
|
||||
|$\displaystyle\sum_{i=1}^n$ `\displaystyle\sum_{i=1}^n`
|
||||
|$\textstyle\sum_{i=1}^n$ `\textstyle\sum_{i=1}^n`
|
||||
|$\scriptstyle x$ `\scriptstyle x` (The size of a first sub/superscript)
|
||||
|$\scriptscriptstyle x$ `\scriptscriptstyle x` (The size of subsequent sub/superscripts)
|
||||
|$\lim\limits_x$ `\lim\limits_x`
|
||||
|$\lim\nolimits_x$ `\lim\nolimits_x`
|
||||
|$\verb!x^2!$ `\verb!x^2!`
|
||||
|
||||
`\text{…}` will accept nested `$…$` fragments and render them in math mode.
|
||||
|
||||
## Symbols and Punctuation
|
||||
|
||||
||||
|
||||
|:----------|:----------|:----------|
|
||||
|`% comment`|$\dots$ `\dots`|$\KaTeX$ `\KaTeX`
|
||||
|$\%$ `\%`|$\cdots$ `\cdots`|$\LaTeX$ `\LaTeX`
|
||||
|$\#$ `\#`|$\ddots$ `\ddots`|$\TeX$ `\TeX`
|
||||
|$\&$ `\&`|$\ldots$ `\ldots`|$\nabla$ `\nabla`
|
||||
|$\_$ `\_`|$\vdots$ `\vdots`|$\infty$ `\infty`
|
||||
|$\text{\textunderscore}$ `\text{\textunderscore}`|$\dotsb$ `\dotsb`|$\infin$ `\infin`
|
||||
|$\text{--}$ `\text{--}`|$\dotsc$ `\dotsc`|$\checkmark$ `\checkmark`
|
||||
|$\text{\textendash}$ `\text{\textendash}`|$\dotsi$ `\dotsi`|$\dag$ `\dag`
|
||||
|$\text{---}$ `\text{---}`|$\dotsm$ `\dotsm`|$\dagger$ `\dagger`
|
||||
|$\text{\textemdash}$ `\text{\textemdash}`|$\dotso$ `\dotso`|$\text{\textdagger}$ `\text{\textdagger}`
|
||||
|$\text{\textasciitilde}$ `\text{\textasciitilde}`|$\sdot$ `\sdot`|$\ddag$ `\ddag`
|
||||
|$\text{\textasciicircum}$ `\text{\textasciicircum}`|$\mathellipsis$ `\mathellipsis`|$\ddagger$ `\ddagger`
|
||||
|$`$ <code>`</code>|$\text{\textellipsis}$ `\text{\textellipsis}`|$\text{\textdaggerdbl}$ `\text{\textdaggerdbl}`
|
||||
|$\text{\textquoteleft}$ `text{\textquoteleft}`|$\Box$ `\Box`|$\Dagger$ `\Dagger`
|
||||
|$\lq$ `\lq`|$\square$ `\square`|$\angle$ `\angle`
|
||||
|$\text{\textquoteright}$ `\text{\textquoteright}`|$\blacksquare$ `\blacksquare`|$\measuredangle$ `\measuredangle`
|
||||
|$\rq$ `\rq`|$\triangle$ `\triangle`|$\sphericalangle$ `\sphericalangle`
|
||||
|$\text{\textquotedblleft}$ `\text{\textquotedblleft}`|$\triangledown$ `\triangledown`|$\top$ `\top`
|
||||
|$"$ `"`|$\triangleleft$ `\triangleleft`|$\bot$ `\bot`
|
||||
|$\text{\textquotedblright}$ `\text{\textquotedblright}`|$\triangleright$ `\triangleright`|$\$$ `\$`
|
||||
|$\colon$ `\colon`|$\bigtriangledown$ `\bigtriangledown`|$\text{\textdollar}$ `\text{\textdollar}`
|
||||
|$\backprime$ `\backprime`|$\bigtriangleup$ `\bigtriangleup`|$\pounds$ `\pounds`
|
||||
|$\prime$ `\prime`|$\blacktriangle$ `\blacktriangle`|$\mathsterling$ `\mathsterling`
|
||||
|$\text{\textless}$ `\text{\textless}`|$\blacktriangledown$ `\blacktriangledown`|$\text{\textsterling}$ `\text{\textsterling}`
|
||||
|$\text{\textgreater}$ `\text{\textgreater}`|$\blacktriangleleft$ `\blacktriangleleft`|$\yen$ `\yen`
|
||||
|$\text{\textbar}$ `\text{\textbar}`|$\blacktriangleright$ `\blacktriangleright`|$\surd$ `\surd`
|
||||
|$\text{\textbardbl}$ `\text{\textbardbl}`|$\diamond$ `\diamond`|$\degree$ `\degree`
|
||||
|$\text{\textbraceleft}$ `\text{\textbraceleft}`|$\Diamond$ `\Diamond`|$\text{\textdegree}$ `\text{\textdegree}`
|
||||
|$\text{\textbraceright}$ `\text{\textbraceright}`|$\lozenge$ `\lozenge`|$\mho$ `\mho`
|
||||
|$\text{\textbackslash}$ `\text{\textbackslash}`|$\blacklozenge$ `\blacklozenge`|$\diagdown$ `\diagdown`
|
||||
|$\text{\P}$ `\text{\P}`|$\star$ `\star`|$\diagup$ `\diagup`
|
||||
|$\text{\S}$ `\text{\S}`|$\bigstar$ `\bigstar`|$\flat$ `\flat`
|
||||
|$\text{\sect}$ `\text{\sect}`|$\clubsuit$ `\clubsuit`|$\natural$ `\natural`
|
||||
|$\copyright$ `\copyright`|$\clubs$ `\clubs`|$\sharp$ `\sharp`
|
||||
|$\circledR$ `\circledR`|$\diamondsuit$ `\diamondsuit`|$\heartsuit$ `\heartsuit`
|
||||
|$\text{\textregistered}$ `\text{\textregistered}`|$\diamonds$ `\diamonds`|$\hearts$ `\hearts`
|
||||
|$\circledS$ `\circledS`|$\spadesuit$ `\spadesuit`|$\spades$ `\spades`
|
||||
|$\text{\textcircled a}$ `\text{\textcircled a}`|$\maltese$ `\maltese`||
|
||||
|
||||
Direct Input: $£ ¥ ∇ ∞ · ∠ ∡ ∢ ♠ ♡ ♢ ♣ ♭ ♮ ♯ ✓ … ⋮ ⋯ ⋱ !$ ‼
|
||||
|
||||
## Units
|
||||
|
||||
In KaTeX, units are proportioned as they are in TeX.<br>
|
||||
KaTeX units are different than CSS units.
|
||||
|
||||
</div>
|
||||
<div class="katex-cards" id="unit-tbl">
|
||||
|
||||
| KaTeX Unit | Value | KaTeX Unit | Value |
|
||||
|:---|:---------------------|:---|:----------------|
|
||||
| em | CSS em | bp | 1/72 inch × F × G|
|
||||
| ex | CSS ex | pc | 12 KaTeX pt|
|
||||
| mu | 1/18 CSS em | dd | 1238/1157 KaTeX pt |
|
||||
| pt | 1/72.27 inch × F × G | cc | 14856/1157 KaTeX pt |
|
||||
| mm | 1 mm × F × G | nd | 685/642 KaTeX pt |
|
||||
| cm | 1 cm × F × G | nc | 1370/107 KaTeX pt|
|
||||
| in | 1 inch × F × G | sp | 1/65536 KaTeX pt |
|
||||
|
||||
</div>
|
||||
|
||||
where:
|
||||
|
||||
<div style="margin-left: 1.5em;">
|
||||
|
||||
F = (font size of surrounding HTML text)/(10 pt)
|
||||
|
||||
G = 1.21 by default, because KaTeX font-size is normally 1.21 × the surrounding font size. This value [can be overridden](font.md#font-size-and-lengths) by the CSS of an HTML page.
|
||||
|
||||
</div>
|
||||
|
||||
The effect of style and size:
|
||||
|
||||
<div class="katex-cards" id="unit-blocks">
|
||||
|
||||
| Unit | textstyle | scriptscript | huge |
|
||||
|:------:|:-----------------:|:------------:|:------:|
|
||||
|em or ex|$\rule{1em}{1em}$ |$\scriptscriptstyle\rule{1em}{1em}$ |$\huge\rule{1em}{1em}$
|
||||
| mu |$\rule{18mu}{18mu}$|$\scriptscriptstyle\rule{18mu}{18mu}$|$\huge\rule{18mu}{18mu}$
|
||||
| others |$\rule{10pt}{10pt}$|$\scriptscriptstyle\rule{10pt}{10pt}$|$\huge\rule{10pt}{10pt}$
|
||||
|
||||
</div>
|
@@ -1,4 +1,5 @@
|
||||
[
|
||||
"0.10.2",
|
||||
"0.10.1",
|
||||
"0.10.0"
|
||||
]
|
||||
|
Reference in New Issue
Block a user