editor icon indicating copy to clipboard operation
editor copied to clipboard

LaTeX support?

Open Tapwatero opened this issue 1 year ago • 10 comments

Hello, I am wondering if MDX supports LaTeX markdown for mathematics - if so I would appreciate documentation or a link to such documentation as I could not find it - if not the implemenation would not go unused.

Tapwatero avatar Aug 31 '23 16:08 Tapwatero

You're not wrong, there's no such support at the moment. This has been requested before - I wonder how would you like to see the editing experience? To clarify what I mean, rendering the resulting latex is pretty much straightforward, but how would you like to get the editing going - like some form of a source code?

petyosi avatar Aug 31 '23 17:08 petyosi

I think latex needs to be writable not as a toolbar button, so I could write the maths and when im off the line or something along those lines - it would be rendered. Let me know if this is not clear enough, I don't know how to explain it

Tapwatero avatar Sep 01 '23 19:09 Tapwatero

Any progress here?

JojoDevel avatar Dec 03 '23 13:12 JojoDevel

Hey, if you're still searching for it, you should try using MathLive inside the editor, I just did that. Make a component with a radix dialog, a button with the same classes as the toolbar button with an svg icon inside it and insert a inside it. After you're done, just get the value of the math-field and insertMarkdown it into the editor. Check their documentation on their website, it's a pretty good LaTeX editor

hahhen avatar Jan 21 '24 15:01 hahhen

you should try using MathLive inside the editor, I just did that.

MathLive was the first thing coming to my mind, too. Do you happen to have an example of integrating MathLive with MDXEditor?

tumidi avatar Feb 29 '24 03:02 tumidi

you should try using MathLive inside the editor, I just did that.

MathLive was the first thing coming to my mind, too. Do you happen to have an example of integrating MathLive with MDXEditor?

Actually, yes! You can check my github, it's in https://github.com/hahhen/forum_teste/tree/main/src/components/editor

Actually, it's not a proper MDXEditor plugin, since it doesn't implement the plugin functionalities, but it works well enough

hahhen avatar Feb 29 '24 19:02 hahhen

does anyone have an example on how to do this? the link posted above seems to be deleted. also it's mentioned that "rendering is straightforward", how can I do it?

mohad12211 avatar Sep 18 '24 09:09 mohad12211

https://github.com/hahhen/cpsforum/blob/master/src%2Fcomponents%2Feditor%2Finsertmathlive.jsx

hahhen avatar Sep 18 '24 11:09 hahhen

thanks, but renderMathInElement doesn't seem to be working, how can I get rendering to work properly?

mohad12211 avatar Sep 18 '24 14:09 mohad12211

Refer to the mathlive documentation: renderMathInElement renders based on the element id that is sent as the function's parameter. My editor is wrapped by a div of which id is "editor". If anything else bugs, you can check my editor and sort it out, it's in the same folder as the insertMathLive

hahhen avatar Sep 18 '24 14:09 hahhen