Parsing TeX to math.js #2693
Replies: 7 comments
-
Thanks for your suggestion! |
Beta Was this translation helpful? Give feedback.
-
I would also like this feature in mathjs, it would be very nice and useful for users who needs a simpler way of typing a mathematical expressions. In this way you might be able to let users type an expression with for example mathquill and parse it to maths js and make it computable. |
Beta Was this translation helpful? Give feedback.
-
hmm I was looking for a feature like this |
Beta Was this translation helpful? Give feedback.
-
@Kreijstal I also needed to convert LaTeX to MathJS. For my purposes, it has been good enough to:
Then the resulting string can be sent to MathJS's parser. This certainly isn't perfect, but it's covered all the use-cases I need. Here's links to my code. It's currently written for Babel with Flow annotations, but wouldn't be too hard to strip those:
|
Beta Was this translation helpful? Give feedback.
-
@ChristopherChudzicki needing to do the same. would love to take a look at what you built if you can share that project again. |
Beta Was this translation helpful? Give feedback.
-
For anyone still looking for a solution to this, I wrote a library here: https://github.com/davidtranhq/tex-math-parser that parses TeX strings into MathJS expression trees. |
Beta Was this translation helpful? Give feedback.
-
Nice, thanks for sharing @davidtranhq ! |
Beta Was this translation helpful? Give feedback.
-
It would be nice, if at some point math.js could parse a subset of TeX into a node tree.
There is absolutely no urgency and it might be possible to take inspiration/use code from other projects for that :
MathJax manages with success to parse a lot of TeX commands and to coerce it into mathml (content and presentationnal).
Some possible applications of such a parser :
...
Beta Was this translation helpful? Give feedback.
All reactions