mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-04 18:58:39 +00:00
chore: rename branch master to main (#3376)
* chore: rename branch master to main * ci: update semantic-release config * ci: run semantic release only on main
This commit is contained in:
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -2,9 +2,9 @@ name: CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ main ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ main ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
4
.github/workflows/codeql-analysis.yml
vendored
4
.github/workflows/codeql-analysis.yml
vendored
@@ -2,9 +2,9 @@ name: "CodeQL"
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ main ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ main ]
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * 1'
|
- cron: '0 0 * * 1'
|
||||||
|
|
||||||
|
2
.github/workflows/fonts.yml
vendored
2
.github/workflows/fonts.yml
vendored
@@ -2,7 +2,7 @@ name: Fonts
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
branches: [ master ]
|
branches: [ main ]
|
||||||
types: [ labeled ] # 'build fonts' label
|
types: [ labeled ] # 'build fonts' label
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
4
.github/workflows/screenshotter.yml
vendored
4
.github/workflows/screenshotter.yml
vendored
@@ -2,9 +2,9 @@ name: Screenshotter
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ main ]
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
branches: [ master ]
|
branches: [ main ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
screenshotter:
|
screenshotter:
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"branches": "main",
|
||||||
"plugins": [
|
"plugins": [
|
||||||
["@semantic-release/commit-analyzer", {
|
["@semantic-release/commit-analyzer", {
|
||||||
"releaseRules": [
|
"releaseRules": [
|
||||||
|
@@ -93,7 +93,7 @@ You can view the report in `coverage/lcov-report/index.html`.
|
|||||||
|
|
||||||
To ensure the final output looks good, we screenshot different expressions.
|
To ensure the final output looks good, we screenshot different expressions.
|
||||||
These tests can be run by using the
|
These tests can be run by using the
|
||||||
[screenshotter docker](https://github.com/KaTeX/KaTeX/tree/master/dockers/screenshotter).
|
[screenshotter docker](https://github.com/KaTeX/KaTeX/tree/main/dockers/screenshotter).
|
||||||
|
|
||||||
The screenshot tests should be run if you add anything more significant than
|
The screenshot tests should be run if you add anything more significant than
|
||||||
individual symbols. These tests are not automatically run, so please remember!
|
individual symbols. These tests are not automatically run, so please remember!
|
||||||
@@ -107,7 +107,7 @@ created it, add a screenshot test. See
|
|||||||
[ss_data.yaml](test/screenshotter/ss_data.yaml).
|
[ss_data.yaml](test/screenshotter/ss_data.yaml).
|
||||||
|
|
||||||
You can use our
|
You can use our
|
||||||
[texcmp](https://github.com/KaTeX/KaTeX/tree/master/dockers/texcmp) tool
|
[texcmp](https://github.com/KaTeX/KaTeX/tree/main/dockers/texcmp) tool
|
||||||
to compare the outputs of a screenshot test as generated by KaTeX and LaTeX.
|
to compare the outputs of a screenshot test as generated by KaTeX and LaTeX.
|
||||||
It's often useful to attach the resulting "visual diff" to your pull request
|
It's often useful to attach the resulting "visual diff" to your pull request
|
||||||
with a new feature.
|
with a new feature.
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
# [<img src="https://katex.org/img/katex-logo-black.svg" width="130" alt="KaTeX">](https://katex.org/)
|
# [<img src="https://katex.org/img/katex-logo-black.svg" width="130" alt="KaTeX">](https://katex.org/)
|
||||||
[](https://www.npmjs.com/package/katex)
|
[](https://www.npmjs.com/package/katex)
|
||||||
[](https://github.com/semantic-release/semantic-release)
|
[](https://github.com/semantic-release/semantic-release)
|
||||||
[](https://github.com/KaTeX/KaTeX/actions?query=workflow%3ACI)
|
[](https://github.com/KaTeX/KaTeX/actions?query=workflow%3ACI)
|
||||||
[](https://codecov.io/gh/KaTeX/KaTeX)
|
[](https://codecov.io/gh/KaTeX/KaTeX)
|
||||||
[](https://github.com/KaTeX/KaTeX/discussions)
|
[](https://github.com/KaTeX/KaTeX/discussions)
|
||||||
[](https://www.jsdelivr.com/package/npm/katex)
|
[](https://www.jsdelivr.com/package/npm/katex)
|
||||||

|

|
||||||
|
@@ -41,6 +41,6 @@ variable to `"true"` or `"false"`, respectively.
|
|||||||
|
|
||||||
The default build of KaTeX expects the KaTeX fonts to be located in a directory called `fonts` which is a sibling of the `katex.min.css` stylesheet. This can be changed as follows:
|
The default build of KaTeX expects the KaTeX fonts to be located in a directory called `fonts` which is a sibling of the `katex.min.css` stylesheet. This can be changed as follows:
|
||||||
|
|
||||||
1. At the top of the [fonts.less](https://github.com/KaTeX/KaTeX/blob/master/src/fonts.less) file, set `@font-folder` to the location of your fonts. You can use relative or absolute paths, so setting it to `"/fonts"` would cause it to search for the fonts in a root `fonts` folder, while `"../fonts"` would search in a `fonts` directory one level above the `katex.min.css` file.
|
1. At the top of the [fonts.less](https://github.com/KaTeX/KaTeX/blob/main/src/fonts.less) file, set `@font-folder` to the location of your fonts. You can use relative or absolute paths, so setting it to `"/fonts"` would cause it to search for the fonts in a root `fonts` folder, while `"../fonts"` would search in a `fonts` directory one level above the `katex.min.css` file.
|
||||||
2. Rebuild KaTeX by running `yarn build` from the top-level directory.
|
2. Rebuild KaTeX by running `yarn build` from the top-level directory.
|
||||||
3. Use the newly generated `dist/katex.min.css` file, and place the fonts where you indicated.
|
3. Use the newly generated `dist/katex.min.css` file, and place the fonts where you indicated.
|
||||||
|
@@ -7,9 +7,9 @@ title: Extensions & Libraries
|
|||||||
These extensions are provided by KaTeX.
|
These extensions are provided by KaTeX.
|
||||||
|
|
||||||
- [Auto-render](autorender.md): Automatically renders all of the math inside text
|
- [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
|
- [Copy-tex](https://github.com/KaTeX/KaTeX/tree/main/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`
|
- [`math/tex` Custom Script Type](https://github.com/KaTeX/KaTeX/tree/main/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
|
- [mhchem](https://github.com/KaTeX/KaTeX/tree/main/contrib/mhchem): Write beautiful chemical equations easily
|
||||||
|
|
||||||
## Libraries
|
## Libraries
|
||||||
|
|
||||||
|
@@ -88,7 +88,7 @@ Note, however, that you do not need to include `katex.js` on the client.
|
|||||||
|
|
||||||
## Using mhchem extension
|
## Using mhchem extension
|
||||||
|
|
||||||
The [mhchem extension](https://github.com/Khan/KaTeX/tree/master/contrib/mhchem)
|
The [mhchem extension](https://github.com/KaTeX/KaTeX/tree/main/contrib/mhchem)
|
||||||
adds its features by modifying the `katex` module. So you can use KaTeX with
|
adds its features by modifying the `katex` module. So you can use KaTeX with
|
||||||
mhchem in Node as follows:
|
mhchem in Node as follows:
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@ You can provide an object of options as the last argument to [`katex.render` and
|
|||||||
- `fleqn`: `boolean`. If `true`, display math renders flush left with a `2em` left margin, like `\documentclass[fleqn]` in LaTeX with the `amsmath` package.
|
- `fleqn`: `boolean`. If `true`, display math renders flush left with a `2em` left margin, like `\documentclass[fleqn]` in LaTeX with the `amsmath` package.
|
||||||
- `throwOnError`: `boolean`. If `true` (the default), KaTeX will throw a `ParseError` when it encounters an unsupported command or invalid LaTeX. If `false`, KaTeX will render unsupported commands as text, and render invalid LaTeX as its source code with hover text giving the error, in the color given by `errorColor`.
|
- `throwOnError`: `boolean`. If `true` (the default), KaTeX will throw a `ParseError` when it encounters an unsupported command or invalid LaTeX. If `false`, KaTeX will render unsupported commands as text, and render invalid LaTeX as its source code with hover text giving the error, in the color given by `errorColor`.
|
||||||
- `errorColor`: `string`. A color string given in the format `"#XXX"` or `"#XXXXXX"`. This option determines the color that unsupported commands and invalid LaTeX are rendered in when `throwOnError` is set to `false`. (default: `#cc0000`)
|
- `errorColor`: `string`. A color string given in the format `"#XXX"` or `"#XXXXXX"`. This option determines the color that unsupported commands and invalid LaTeX are rendered in when `throwOnError` is set to `false`. (default: `#cc0000`)
|
||||||
- `macros`: `object`. A collection of custom macros. Each macro is a property with a name like `\name` (written `"\\name"` in JavaScript) which maps to a string that describes the expansion of the macro, or a function that accepts an instance of `MacroExpander` as first argument and returns the expansion as a string. `MacroExpander` is an internal API and subject to non-backwards compatible changes. See [`src/defineMacro.js`](https://github.com/KaTeX/KaTeX/blob/master/src/defineMacro.js) for its usage. Single-character keys can also be included in which case the character will be redefined as the given macro (similar to TeX active characters). *This object will be modified* if the LaTeX code defines its own macros via `\gdef`, which enables consecutive calls to KaTeX to share state.
|
- `macros`: `object`. A collection of custom macros. Each macro is a property with a name like `\name` (written `"\\name"` in JavaScript) which maps to a string that describes the expansion of the macro, or a function that accepts an instance of `MacroExpander` as first argument and returns the expansion as a string. `MacroExpander` is an internal API and subject to non-backwards compatible changes. See [`src/defineMacro.js`](https://github.com/KaTeX/KaTeX/blob/main/src/defineMacro.js) for its usage. Single-character keys can also be included in which case the character will be redefined as the given macro (similar to TeX active characters). *This object will be modified* if the LaTeX code defines its own macros via `\gdef`, which enables consecutive calls to KaTeX to share state.
|
||||||
- `minRuleThickness`: `number`. Specifies a minimum thickness, in ems, for fraction lines, `\sqrt` top lines, `{array}` vertical lines, `\hline`, `\hdashline`, `\underline`, `\overline`, and the borders of `\fbox`, `\boxed`, and `\fcolorbox`. The usual value for these items is `0.04`, so for `minRuleThickness` to be effective it should probably take a value slightly above `0.04`, say `0.05` or `0.06`. Negative values will be ignored.
|
- `minRuleThickness`: `number`. Specifies a minimum thickness, in ems, for fraction lines, `\sqrt` top lines, `{array}` vertical lines, `\hline`, `\hdashline`, `\underline`, `\overline`, and the borders of `\fbox`, `\boxed`, and `\fcolorbox`. The usual value for these items is `0.04`, so for `minRuleThickness` to be effective it should probably take a value slightly above `0.04`, say `0.05` or `0.06`. Negative values will be ignored.
|
||||||
- `colorIsTextColor`: `boolean`. In early versions of both KaTeX (<0.8.0) and MathJax, the `\color` function expected the content to be a function argument, as in `\color{blue}{hello}`. In current KaTeX, `\color` is a switch, as in `\color{blue} hello`. This matches LaTeX behavior. If you want the old `\color` behavior, set option `colorIsTextColor` to true.
|
- `colorIsTextColor`: `boolean`. In early versions of both KaTeX (<0.8.0) and MathJax, the `\color` function expected the content to be a function argument, as in `\color{blue}{hello}`. In current KaTeX, `\color` is a switch, as in `\color{blue} hello`. This matches LaTeX behavior. If you want the old `\color` behavior, set option `colorIsTextColor` to true.
|
||||||
- `maxSize`: `number`. All user-specified sizes, e.g. in `\rule{500em}{500em}`, will be capped to `maxSize` ems. If set to `Infinity` (the default), users can make elements and spaces arbitrarily large.
|
- `maxSize`: `number`. All user-specified sizes, e.g. in `\rule{500em}{500em}`, will be capped to `maxSize` ems. If set to `Infinity` (the default), users can make elements and spaces arbitrarily large.
|
||||||
|
@@ -219,7 +219,7 @@ table td {
|
|||||||
|\cdot|$\cdot$||
|
|\cdot|$\cdot$||
|
||||||
|\cdotp|$\cdotp$||
|
|\cdotp|$\cdotp$||
|
||||||
|\cdots|$\cdots$||
|
|\cdots|$\cdots$||
|
||||||
|\ce |${\mathrm{C}{\vphantom{X}}_{\smash[t]{6}}\mathrm{H}{\vphantom{X}}_{\smash[t]{5}}{-}\mathrm{CHO}}$|`\ce{C6H5-CHO}` Requires an [extension](https://github.com/KaTeX/KaTeX/tree/master/contrib/mhchem/)|
|
|\ce |${\mathrm{C}{\vphantom{X}}_{\smash[t]{6}}\mathrm{H}{\vphantom{X}}_{\smash[t]{5}}{-}\mathrm{CHO}}$|`\ce{C6H5-CHO}` Requires an [extension](https://github.com/KaTeX/KaTeX/tree/main/contrib/mhchem/)|
|
||||||
|\cee|<span style="color:firebrick;">Not supported</span>|Deprecated by mhchem
|
|\cee|<span style="color:firebrick;">Not supported</span>|Deprecated by mhchem
|
||||||
|\centerdot|$a\centerdot b$|`a\centerdot b`|
|
|\centerdot|$a\centerdot b$|`a\centerdot b`|
|
||||||
|\cf|<span style="color:firebrick;">Not supported</span>|Deprecated by mhchem;
|
|\cf|<span style="color:firebrick;">Not supported</span>|Deprecated by mhchem;
|
||||||
@@ -868,7 +868,7 @@ use `\ce` instead|
|
|||||||
|\providecommand|$\providecommand\greet{\text{Hello}} \greet$|`\providecommand\greet{\text{Hello}} \greet`|
|
|\providecommand|$\providecommand\greet{\text{Hello}} \greet$|`\providecommand\greet{\text{Hello}} \greet`|
|
||||||
|\psi|$\psi$||
|
|\psi|$\psi$||
|
||||||
|\Psi|$\Psi$||
|
|\Psi|$\Psi$||
|
||||||
|\pu |${123~\mathchoice{\textstyle\frac{\mathrm{kJ}}{\mathrm{mol}}}{\frac{\mathrm{kJ}}{\mathrm{mol}}}{\frac{\mathrm{kJ}}{\mathrm{mol}}}{\frac{\mathrm{kJ}}{\mathrm{mol}}}}$|`\pu{123 kJ//mol}` Requires an [extension](https://github.com/KaTeX/KaTeX/tree/master/contrib/mhchem/)|
|
|\pu |${123~\mathchoice{\textstyle\frac{\mathrm{kJ}}{\mathrm{mol}}}{\frac{\mathrm{kJ}}{\mathrm{mol}}}{\frac{\mathrm{kJ}}{\mathrm{mol}}}{\frac{\mathrm{kJ}}{\mathrm{mol}}}}$|`\pu{123 kJ//mol}` Requires an [extension](https://github.com/KaTeX/KaTeX/tree/main/contrib/mhchem/)|
|
||||||
|
|
||||||
## QR
|
## QR
|
||||||
|
|
||||||
|
@@ -89,7 +89,7 @@ class Footer extends React.Component {
|
|||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
<section className="copyright">
|
<section className="copyright">
|
||||||
Licensed under <a href="https://github.com/KaTeX/KaTeX/blob/master/LICENSE">MIT License</a><br/>
|
Licensed under <a href="https://github.com/KaTeX/KaTeX/blob/main/LICENSE">MIT License</a><br/>
|
||||||
{this.props.config.copyright}
|
{this.props.config.copyright}
|
||||||
</section>
|
</section>
|
||||||
</footer>
|
</footer>
|
||||||
|
@@ -16,7 +16,7 @@ class Users extends React.Component {
|
|||||||
if ((siteConfig.users || []).length === 0) {
|
if ((siteConfig.users || []).length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const editUrl = siteConfig.repoUrl + '/edit/master/website/siteConfig.js';
|
const editUrl = siteConfig.repoUrl + '/edit/main/website/siteConfig.js';
|
||||||
const showcase = siteConfig.users.map((user, i) => {
|
const showcase = siteConfig.users.map((user, i) => {
|
||||||
return (
|
return (
|
||||||
<a href={user.infoLink} key={i}>
|
<a href={user.infoLink} key={i}>
|
||||||
|
@@ -124,7 +124,7 @@
|
|||||||
<a class="ka-logo" href="https://www.khanacademy.org/"><img src="img/khan-academy-white.svg" alt="Khan Academy" width="172" height="28"></a>
|
<a class="ka-logo" href="https://www.khanacademy.org/"><img src="img/khan-academy-white.svg" alt="Khan Academy" width="172" height="28"></a>
|
||||||
<span class="credits">
|
<span class="credits">
|
||||||
Created by <a href="https://github.com/xymostech">Emily Eisenberg</a> and <a href="https://sophiebits.com/">Sophie Alpert</a>
|
Created by <a href="https://github.com/xymostech">Emily Eisenberg</a> and <a href="https://sophiebits.com/">Sophie Alpert</a>
|
||||||
<br><a href="https://github.com/KaTeX/KaTeX/blob/master/LICENSE">MIT License</a> · Built from the hard work of <a href="https://github.com/KaTeX/KaTeX/graphs/contributors">many contributors</a>
|
<br><a href="https://github.com/KaTeX/KaTeX/blob/main/LICENSE">MIT License</a> · Built from the hard work of <a href="https://github.com/KaTeX/KaTeX/graphs/contributors">many contributors</a>
|
||||||
<br>Cross-browser testing via <a href="https://www.browserstack.com"><img src="/img/browserstack-logo.svg" alt="Browserstack"></a>
|
<br>Cross-browser testing via <a href="https://www.browserstack.com"><img src="/img/browserstack-logo.svg" alt="Browserstack"></a>
|
||||||
<br>This site is powered by <a href="https://www.netlify.com">Netlify</a>
|
<br>This site is powered by <a href="https://www.netlify.com">Netlify</a>
|
||||||
</span>
|
</span>
|
||||||
|
@@ -81,7 +81,7 @@
|
|||||||
<span class="credits">
|
<span class="credits">
|
||||||
Created by <a href="https://github.com/xymostech">Emily Eisenberg</a> and <a href="https://sophiebits.com/">Sophie
|
Created by <a href="https://github.com/xymostech">Emily Eisenberg</a> and <a href="https://sophiebits.com/">Sophie
|
||||||
Alpert</a>
|
Alpert</a>
|
||||||
<br><a href="https://github.com/KaTeX/KaTeX/blob/master/LICENSE">MIT License</a> · Built from the hard work of <a
|
<br><a href="https://github.com/KaTeX/KaTeX/blob/main/LICENSE">MIT License</a> · Built from the hard work of <a
|
||||||
href="https://github.com/KaTeX/KaTeX/graphs/contributors">many contributors</a>
|
href="https://github.com/KaTeX/KaTeX/graphs/contributors">many contributors</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user