This is the best* TeX-based mathematical plugin for CKEditor 5. You can use it to insert, edit and view mathematical equation and formulas. This plugin supports MathJax, KaTeX and custom typesetting engines.
This is the best* TeX-based mathematical plugin for CKEditor 5. You can use it to insert, edit and view mathematical equation and formulas. This plugin supports MathJax, KaTeX and custom typesetting engines.
Copy __theme/ckeditor5-math__ folder from [https://github.com/isaul32/ckeditor5-theme-lark](https://github.com/isaul32/ckeditor5-theme-lark) to your lark theme repository fork or install
Copy __theme/ckeditor5-math__ folder from [https://github.com/isaul32/ckeditor5-theme-lark](https://github.com/isaul32/ckeditor5-theme-lark) to your lark theme repository or install
Styles requires PostCSS like official CKEditor 5 plugins.
Styles requires PostCSS like offical CKEditor plugins.
## Configuration & Usage
## Configuration & Usage
@ -61,14 +97,19 @@ InlineEditor.defaultConfig = {
### Available typesetting engines
### Available typesetting engines
__MathJax__
__MathJax__
- Tested by using version __2.7.5__ and __TeX-MML-AM_HTMLorMML__ configuration. It has also experimental (__CHTML__, __SVG__) support for __3.0.0__ or newer version.
- Tested by using version __latest 2.7__.
- Also has experimental (__CHTML__, __SVG__) support for __3.0.0__ or newer version.
- Use __\\( \\)__ delimiters for inline and __\\[ \\]__ delimiters for display
- Use __\\( \\)__ delimiters for inline and __\\[ \\]__ delimiters for display
It's possible to implement with engine config. For example, this feature can be used when use back end rendering.
It's possible to implement with engine config. For example, this feature can be used when use back end rendering.
```js
```js
InlineEditor.defaultConfig = {
InlineEditor.defaultConfig = {
@ -100,16 +141,17 @@ Supported input and output formats are:
### Paste support
### Paste support
#### Plain TeX paste
#### From plain text
Paste equations with __delimiters__. For example:
Paste TeX equations with __delimiters__. For example:
__\\[__ x=\frac{-b\pm\sqrt{b^2-4ac}}{2a} __\\]__
__\\[__ x=\frac{-b\pm\sqrt{b^2-4ac}}{2a} __\\]__
or
or
__\\(__ x=\frac{-b\pm\sqrt{b^2-4ac}}{2a} __\\)__
__\\(__ x=\frac{-b\pm\sqrt{b^2-4ac}}{2a} __\\)__
#### Paste support from Microsoft Word
#### From Microsoft Word
Use [__paste from office__](https://github.com/isaul32/ckeditor5-paste-from-office) fork instead of offical.
Use [__paste from office__](https://github.com/isaul32/ckeditor5-paste-from-office) fork instead of official. This feature is __experimental__ and might not work always (look source code).
__.ck-reset_all *__ css rules from ckeditor5-ui and ckeditor5-theme-lark break rendering in preview mode.
My solution for this is use rendering element outside of CKEditor DOM and place it right place by using absolute position. Alternative solution could be using iframe, but then we have to copy typesetting engine's scripts and styles to child document.
## Todo
## Todo
- Fix KaTex preview
- MathML input and output when using MathJax version 3
- MathML input and output when using MathJax version 3