Closed Mw3y closed 1 week ago
Try looking in the html conversion code. Also, you can look at https://github.com/siefkenj/latex-parser-playground for an example using the generated HTML with katex.
Thank you very much! I also have another question: while trying out the hast plugin, I noticed that \LaTeX
for example is being translated to macro-LaTeX
. It looks like the content is lost. Is there any workaround to still get the it so as to render it using katex?
Any unrecognized macros are converted that way. KaTeX will only handle math. You can do $\LaTeX$
to activate math mode if you want KaTeX to render it.
Is there a way to automatically toggle math mode for a set of macros?
You can do a replaceNode
and wrap them in math if you like.
Thank you very much!
One last question: I'm trying to render a latex file using vuejs render functions. I'm thinking of using the "hast" representation as a basis for rendering. What do you think about that? Since I'm discovering your project I'm wondering if this is the best way to do it.
Check out https://github.com/rehypejs/rehype-react
Alright thank you very much!
Hello 👋🏻!
I'm currently trying to parse some latex content, process the tree and render it. In the source code of the
hast
module I could see some content related to katex but couldn't figure out how to use it to render something. Could you give me some guidance/examples please?PS: Amazing project! Thank you for developing it!