zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
26.9k stars 1.88k forks source link

LaTeX full compiler and renderer support #4272

Open CrO2Cl2 opened 1 year ago

CrO2Cl2 commented 1 year ago

Describe feature

I have been using the KaTeX math for a while, the option to fully integrate a LaTeX compiler and renderer as a Note type would be very useful, as I mainly use Overleaf for now, but would love to also be able to dysplay the LaTeX without using a PDF

Additional Information

No response

meichthys commented 1 year ago

Unfortunately this will likely not happen as things currently stand. This feature would be dependent upon ckeditor5 which Trilium uses and the MathType editor plugin for ckeditor5 is a premium feature: https://ckeditor.com/docs/ckeditor5/latest/features/math-equations.html

zerebos commented 1 year ago

In theory it could be done as a separate note type, but as @meichthys said, it's very unlikely to be integrated to text notes due to it being locked behind premium.

CrO2Cl2 commented 1 year ago

we already have the KaTeX for the text notes, I was thinking of just being able to import a .tex file and it gets rendered as it should, as this would make my school life 1000x easier

zerebos commented 1 year ago

Ah then that would definitely be a separate note, and this is something a plugin/widget of some kind could add. Doesn't sound too difficult in theory.

CrO2Cl2 commented 1 year ago

and in practice? JS is one of the languages that I dont know anything about

zerebos commented 1 year ago

Well I cannot tinker around with it at the moment as I am at work, but I know it wouldn't be too difficult to do something similar to https://github.com/rauenzi/Trilium-MarkdownPreview but for KaTeX/LaTeX

zerebos commented 1 year ago

Definitely possible to do something like that

https://github.com/zadam/trilium/assets/6865942/0a365540-3a0b-45bf-ace3-a6af9a64a97a

CrO2Cl2 commented 1 year ago

would you mind sharing the code that you Used for this?

zerebos commented 1 year ago

Sure, let me just clean up the code a bit first and I'll share it publicly

zerebos commented 1 year ago

@CrO2Cl2 Here, you can grab it (with instructions) here https://github.com/rauenzi/Trilium-LaTeXPreview#installation