Custom Block for Katex #2513
Replies: 18 comments
-
|
This would be great! It should be possible with Custom Inline Content (https://www.blocknotejs.org/docs/custom-schemas/custom-inline-content), although it might need custom prosemirror handling, not sure. It's not on our roadmap atm, but I'd definitely welcome a PR for this! |
Beta Was this translation helpful? Give feedback.
-
|
/attempt #741
|
Beta Was this translation helpful? Give feedback.
-
|
Maybe I can give this a try? |
Beta Was this translation helpful? Give feedback.
-
katex_demo.mp4I customized Custom Block using sample of Formatting Toolbar. |
Beta Was this translation helpful? Give feedback.
-
|
💡 @jkcs submitted a pull request that claims the bounty. You can visit your bounty board to reward. |
Beta Was this translation helpful? Give feedback.
-
|
/attempt #741 Options |
Beta Was this translation helpful? Give feedback.
-
|
is still open? |
Beta Was this translation helpful? Give feedback.
-
|
/attempt #741 |
Beta Was this translation helpful? Give feedback.
-
|
There is a Tiptap extension, but it requires Tiptap 3.x: https://tiptap.dev/docs/editor/extensions/nodes/mathematics |
Beta Was this translation helpful? Give feedback.
-
|
/attempt #741 |
Beta Was this translation helpful? Give feedback.
-
|
fyi, we're removing the bounty for now. Sorry about this (see #2019 (comment)) |
Beta Was this translation helpful? Give feedback.
-
|
@YousefED just fyi: #1987 (comment) this may be useful to this |
Beta Was this translation helpful? Give feedback.
-
@bgreenlee Support for Tiptap v3 was added in v0.39.0. Anybody want to give it a shot? |
Beta Was this translation helpful? Give feedback.
-
|
Subject: Ready for Review - Full Implementation with KaTeX & Error Handling Hi! I have implemented the Custom Math Block as requested. I created a complete demo project that satisfies all requirements:
🔗 Project Repository & Demo: https://github.com/kaunteyaarjun/blocknote-katex-block Key Features: Production Ready: Fully typed with TypeScript. Error Safe: If a user types invalid LaTeX, the block catches the error instead of crashing the editor. Visual Style: Clean, Notion-like interface with click-to-edit functionality. I am ready to open a PR to merge this into the main codebase. Let me know if you'd like me to proceed! |
Beta Was this translation helpful? Give feedback.
-
|
/attempt |
Beta Was this translation helpful? Give feedback.
-
|
/attempt #2019 |
Beta Was this translation helpful? Give feedback.
-
|
Problem: As noted, the lack of a dedicated equation block is a significant gap for users who need to include mathematical notation in their documents. The current text blocks don't support seamless LaTeX input and rendering. Solution: Implementing a block similar to the example in the attached screenshot would be ideal. This would allow users to input and edit LaTeX code directly within the editor, with the equation rendering cleanly in the document. This would bring BlockNote on par with other modern editors (like Notion) and make it much more usable for a wider audience, including academics, engineers, and scientists. |
Beta Was this translation helpful? Give feedback.
-
|
related: #2456 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.

Right now, the default blocks provide useful support for text editing. However, there is a limitation in the editor's versatility: it lacks a dedicated block for inputting equations. This makes it difficult for users who need to include mathematical expressions and equations in their documents, similar to the functionality available in Notion. The current options do not support a seamless way to input and display LaTeX equations within the text editor, which is a significant drawback for users in academia, research, or any field that requires mathematical documentation.
Describe the solution you'd like
I would like to have a custom block that allows users to input equations directly into the editor. This block should support LaTeX formatting so that users can type LaTeX code and have it rendered properly as mathematical notation within the document. Ideally, this block would function similarly to Notion's equation input feature, providing a user-friendly interface for entering and editing equations.
Describe alternatives you've considered
Building a block that directly converts the text input into LaTeX code. This approach would allow users to type their equations as plain text and have it automatically converted to LaTeX for rendering.
Implementing a text field that appears from a dropdown menu in the block selection options. Users could input LaTeX code into this field, and it would render the equation in the current editing location.
Additional context
Adding this feature would greatly enhance the usability of the text editor for users who need to include complex mathematical expressions in their documents. It would make the editor more versatile and user-friendly, especially for those in scientific and technical fields.
Beta Was this translation helpful? Give feedback.
All reactions