toeverything / AFFiNE

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
https://affine.pro
Other
40.48k stars 2.61k forks source link

LaTeX support #5807

Open lucaszischka opened 7 months ago

lucaszischka commented 7 months ago

Description

Many (Markdown) editors support LaTeX for rendering Math equations. For example GitHub (only inline), Obsidian, Zettlr, AppFlowy and MarkText.


To clear up confusion, im referring to "full block" latex support, as inline has been implemented in https://github.com/toeverything/blocksuite/pull/5909 and only hasn't made it to AFFiNE jet.

Note that this is only supported as an extension example based on the framework, require some more time to further land it in AFFiNE.

Following https://github.com/toeverything/blocksuite/issues/3014 has been marked as resolved, just as the duplicates https://github.com/toeverything/AFFiNE/issues/512 https://github.com/toeverything/AFFiNE/issues/4916 https://github.com/toeverything/blocksuite/issues/3282 https://github.com/toeverything/blocksuite/issues/3432 https://github.com/toeverything/blocksuite/issues/4158 https://github.com/toeverything/blocksuite/issues/5569 https://github.com/toeverything/blocksuite/pull/5442


To my understanding the inline LaTeX support was (or currently is) missing as there was no support to add custom inline nodes. However it looks like $$ full line LaTeX equation $$ went unnoticed, as it could be implemented as a normal block (I hope).

Therefore im opening this issue, as this feature does not seem to be on the roadmap and also neither LaTeX support is found in AFFiNE jet, so it might me good to have an issue open to prevent further duplicates from people not looking at closed issues.


Anyway thank you for this amazing app, can't wait to switch ❤️!

Use case

People who would like to write down Math equations (for example Math, IT Students or Profs).

Anything else?

Except for the substitution method the term has to look like this: $$T(n)=a\times T(\frac{n}{b})+f(n),\qquad\text{with $T(1)=1$}$$

In this example I showcase full line LaTeX with a nested inline LaTeX (T(1)=1) which is commonly also supported by other editors. Unfortunately the inline one is rendered by GitHub and escaping the $ by backslash does not seem to work.

Are you willing to submit a PR?

ryanrpj commented 6 months ago

BlockSuite v0.11.0 was released three weeks ago, and brings with it LaTeX support. Yay! toeverything/blocksuite#5909. However, AFFiNE v0.12.0 was released today, three weeks later, and, to my surprise, LaTeX support is still missing. Can anybody give us some update on this?

To give some context, I'm trying to use the same syntax documented on the supra mentioned PR: $a=b^2$.

Am I doing something wrong, or this feature hasn't made its way into AFFiNE yet?

hwangdev97 commented 6 months ago

Yes, BlockSuite now supports basic inline styles, but it is a developer-oriented suite, whereas AFFiNE is a product designed for users.

I understand the demand for Latex, and its implementation in AFFiNE primarily involves two aspects:

  1. Inline LaTex Styles: BlockSuite has already implemented basic inline styles. However, support for particularly complex styles might disrupt the standard layout, requiring future fixes.

  2. Independent LaTex Block: We have not yet completed this feature. We aim for it to render independently as a block, with its own toolbar for control and the ability to be placed anywhere on the whiteboard after dragging.

We are aware of the significant interest in this feature and will prioritize it. We plan to introduce this functionality in the upcoming versions.

notpaulmartin commented 2 weeks ago

Any update on this?

UyCode commented 2 weeks ago

still does not support inline or block math equation rendering

hwangdev97 commented 1 week ago

coming https://github.com/toeverything/blocksuite/pull/8177