8000 docs: introduce KaTeX local copy plugin & Temml for math by tats-u · Pull Request #11115 · facebook/docusaurus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

docs: introduce KaTeX local copy plugin & Temml for math #11115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions project-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Csapo
Csvg
Dabit
dabit
daiji
Daishi
Datagit
datagit
Expand Down Expand Up @@ -148,6 +149,7 @@ Markprompt
markprompt
Massoud
mathjax
mathml
maxlynch
maxresdefault
MDAST
Expand Down Expand Up @@ -310,6 +312,8 @@ swizzlable
Sébastien
Tagkey
Teik
Temml
temml
Therox
thisweekinreact
toplevel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,24 @@ export default {
],
};
```

You can use the third-party [@tats-u/docusaurus-plugin-copy-katex-assets](https://github.com/tats-u/docusarusu-copy-katex-assets) plugin to copy the `katex.min.css` and `fonts` directory to your site's `assets` directory.

### MathML or Temml instead of KaTeX {#mathml}

You can use the [`@daiji256/rehype-mathml`](https://www.npmjs.com/package/@daiji256/rehype-mathml) plugin instead of `rehype-katex`:

- When you want to use another math font other than Latin Modern Math
- When you want to reduce the download size to a minimum by compromising with local fonts
- When you want to reduce the number of files to be served
- When you want to use $LaTeX$ syntax available not in KaTeX but in Temml

After installing and activating the plugin, [put Temml assets](https://temml.org/docs/en/administration) in your site's `static` directory, and replace the stylesheet's `href` from the CDN URL of `katex.min.css` to your local path of the Temml CSS (say, `/temml/temml.min.css`) in `docusaurus.config.js`.

You can use the third-party [@tats-u/docusaurus-plugin-copy-temml-assets](https://github.com/tats-u/docusaurus-copy-temml-assets) plugin to copy the Temml assets to your site's `assets` directory.

:::note

Temml recommends the Latin Modern font for better display, but its WOFF2 font file is larger than the entire KaTeX font bundle. Unless you prefer fonts other than Latin Modern (e.g. local fonts or [Noto Sans Math](https://fonts.google.com/noto/specimen/Noto+Sans+Math)) or the compliance to the standards, or need the support of TeX features supported only by Temml, KaTeX is the better choice.

:::
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,24 @@ export default {
],
};
```

You can use the third-party [@tats-u/docusaurus-plugin-copy-katex-assets](https://github.com/tats-u/docusarusu-copy-katex-assets) plugin to copy the `katex.min.css` and `fonts` directory to your site's `assets` directory.

### MathML or Temml instead of KaTeX {#mathml}

You can use the [`@daiji256/rehype-mathml`](https://www.npmjs.com/package/@daiji256/rehype-mathml) plugin instead of `rehype-katex`:

- When you want to use another math font other than Latin Modern Math
- When you want to reduce the download size to a minimum by compromising with local fonts
- When you want to reduce the number of files to be served
- When you want to use $LaTeX$ syntax available not in KaTeX but in Temml

After installing and activating the plugin, [put Temml assets](https://temml.org/docs/en/administration) in your site's `static` directory, and replace the stylesheet's `href` from the CDN URL of `katex.min.css` to your local path of the Temml CSS (say, `/temml/temml.min.css`) in `docusaurus.config.js`.

You can use the third-party [@tats-u/docusaurus-plugin-copy-temml-assets](https://github.com/tats-u/docusaurus-copy-temml-assets) plugin to copy the Temml assets to your site's `assets` directory.

:::note

Temml recommends the Latin Modern font for better display, but its WOFF2 font file is larger than the entire KaTeX font bundle. Unless you prefer fonts other than Latin Modern (e.g. local fonts or [Noto Sans Math](https://fonts.google.com/noto/specimen/Noto+Sans+Math)) or the compliance to the standards, or need the support of TeX features supported only by Temml, KaTeX is the better choice.

:::
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,24 @@ export default {
],
};
```

You can use the third-party [@tats-u/docusaurus-plugin-copy-katex-assets](https://github.com/tats-u/docusarusu-copy-katex-assets) plugin to copy the `katex.min.css` and `fonts` directory to your site's `assets` directory.

### MathML or Temml instead of KaTeX {#mathml}

You can use the [`@daiji256/rehype-mathml`](https://www.npmjs.com/package/@daiji256/rehype-mathml) plugin instead of `rehype-katex`:

- When you want to use another math font other than Latin Modern Math
- When you want to reduce the download size to a minimum by compromising with local fonts
- When you want to reduce the number of files to be served
- When you want to use $LaTeX$ syntax available not in KaTeX but in Temml

After installing and activating the plugin, [put Temml assets](https://temml.org/docs/en/administration) in your site's `static` directory, and replace the stylesheet's `href` from the CDN URL of `katex.min.css` to your local path of the Temml CSS (say, `/temml/temml.min.css`) in `docusaurus.config.js`.

You can use the third-party [@tats-u/docusaurus-plugin-copy-temml-assets](https://github.com/tats-u/docusaurus-copy-temml-assets) plugin to copy the Temml assets to your site's `assets` directory.

:::note

Temml recommends the Latin Modern font for better display, but its WOFF2 font file is larger than the entire KaTeX font bundle. Unless you prefer fonts other than Latin Modern (e.g. local fonts or [Noto Sans Math](https://fonts.google.com/noto/specimen/Noto+Sans+Math)) or the compliance to the standards, or need the support of TeX features supported only by Temml, KaTeX is the better choice.

:::
Loading