flatnotes icon indicating copy to clipboard operation
flatnotes copied to clipboard

LaTex Support

Open divin opened this issue 1 year ago • 3 comments

Would it possible to add LaTex support? Not sure how Flatenotes works under the hood, but maybe it's enough to add this to the head:

<script src = "https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id = "MathJax-script" async src = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

divin avatar Apr 07 '23 06:04 divin

Thanks for the suggestion 👍🏻.

This would need some consideration. If there's the demand and I have the time I'll take a look.

dullage avatar Apr 08 '23 16:04 dullage

On that note, it might be worth looking into KaTeX: https://katex.org/ It is basically like MathJAX, but faster and more lightweight.

And yea, I agree, support to add LaTeX-styled formulas would be great.

dominikheinz avatar Apr 17 '23 00:04 dominikheinz

for anyone who might want to work on this i found this useful sandbox of someone using customHTMLRenderer and KaTeX to create this feature. I tried doing the same but I got some weird results as it rendered the math properly but it was rendered 3 times and sometimes without the right font, perhaps this is a styling issue as i got an error when trying to import katek.css

pbogre avatar Jul 02 '23 16:07 pbogre