ФреймворкJavaScript
Формула: LaTeX в строке
Renders inline math (LaTeX) with KaTeX. Activated with Cmd/Ctrl+Shift+E — wraps the selected text, or a formula typed into the popover input, in a `<span data-latex="...">`. The LaTeX source is kept in the `data-latex` attribute so the formula round-trips through save/load, while the rendered KaTeX markup is regenerated on load.
Импорт
TypeScript
import { Equation } from '@bloklabs/core/tools';Формат данных
TypeScript
// Stored as HTML inside the block's text field.
// The LaTeX source lives in the data-latex attribute:
// '<span data-latex="E = mc^2"></span>'JSON
{
"type": "paragraph",
"data": {
"text": "Einstein wrote <span data-latex=\"E = mc^2\"></span>"
}
}Пример использования
TypeScript
import { Blok } from '@bloklabs/core';
import { Equation } from '@bloklabs/core/tools';
const editor = new Blok({
holder: 'editor',
tools: {
equation: Equation,
},
});