/claim #741 /fixes #741
Description:
This PR adds a new custom block for rendering LaTeX equations using KaTeX, addressing the feature request in #741. The block provides a user-friendly interface for inputting and editing mathematical expressions directly in the editor, similar to Notion’s equation feature.
New Block Implementation: Added packages/core/src/blocks/Equation/block.ts defining the equation block spec.
props.latex.<div class="equation" data-latex="..."> from HTML.Integration:
packages/core/src/blocks/index.ts.defaultBlockSpecs in packages/core/src/blocks/defaultBlocks.ts for default schema inclusion.defaultBlocks.ts from the Equation block file.Dependencies: Added katex to @blocknote/core dependencies for rendering.
Keyboard Shortcut: Cmd/Ctrl + Alt + E to insert a new equation block at the cursor position.
TypeScript Fixes: Adjusted spec structure using createBlockSpec with proper overloads to resolve type errors.
Excellencedev
@Excellencedev
BlockNote
@BlockNote