1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-10-30 06:36:17 +00:00
TiddlyWiki5/plugins/tiddlywiki/katex/usage.tid
lin onetwo 2f817e4293
Update katex to latest 0.15.3 (#6671)
* feat: update snippet fields

https://github.com/Jermolene/TiddlyWiki5/discussions/6670

* chore: upgrade files

* docs: update readme

* fix: usage of mhchem

* fix: add back katex.without-font-face.min.css

https://github.com/Jermolene/TiddlyWiki5/pull/6671#issuecomment-1116287404

* style: format json with 4 space

* style: format json with 1 space

* style: restore old format

* feat: update css by using new one and delete font face

* update developer info

* move implementation notes to plugin

* update TW style tiddler

* update katexdemo edition

* chore: delete unused files

* Update developer.tid

* Update developer.tid

Co-authored-by: pmario <pmariojo@gmail.com>
2022-07-09 08:37:47 +01:00

41 lines
1.5 KiB
Plaintext

title: $:/plugins/tiddlywiki/katex/usage
!! Reference:
# Mathematical typesetting: [ext[https://katex.org/docs/supported.html]]
# Chemical typesetting: [ext[https://mhchem.github.io/MathJax-mhchem/]]
!! Syntax
The usual way to include ~LaTeX is to use `$$` (when copying code examples from the references above, you will need to change from `$` to `$$`). For example:
```
$$\displaystyle f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi$$
```
$$\displaystyle f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi$$
chemical:
```
$$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$
```
$$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$
Single line equations will render in inline mode. If there are newlines between the `$$` delimiters, the equations will be rendered in display mode.
The underlying widget can also be used directly, giving more flexibility:
```
<$latex text="f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi" displayMode="true"></$latex>
```
<$latex text="f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi" displayMode="true"></$latex>
The KaTeX widget is provided under the name `<$latex>` and is also available under the alias `<$katex>`. It's better to use the generic `<$latex>` name unless you are running multiple ~LaTeX plugins and wish to specifically target KaTeX.
!! Macro
Tiddlers with tag `$:/tags/KaTeX/Macro` will be recognized as global KaTeX macros. You can create new macro using the form in the [[config|$:/plugins/tiddlywiki/katex/config]].