Project: I want to build a LaTeX-to-MathML translator in PHP. What for? Because I'm a mathematician, and I want to post math on my Drupal site. It does not have to translate all LaTeX, since the basic material at the document level is skillfully processed by CMS and will not be written in LaTeX for starters; he just needs to translate the math written in LaTeX into the math written in MathML. Although it seems to me that I have shown due diligence, it seems that this no longer exists. Maybe I'm wrong - if you know something that will serve this purpose, be sure to let me know in advance. But, believing that this does not exist, I think I should write it myself.
Here's what, however: I have never done anything so ambitious. I donβt know where to start. I have used PHP for many years, but just to make the standard "build CMS with PHP and MySQL." I have never attempted to do something like complex, like translating from one language to another.
I'm just stupid enough to treat it with regular expressions. After all, LaTeX is a much more formal language, and it does not allow almost kinds of pathological marginal cases, as they say, HTML. But, on the other hand, I'm smart enough to understand that this is probably a terrible idea: now I have two problems, and I'm sure I do not want to end up like this guy .
So, if this is not the way (right?), What is it? How do I start thinking about this problem? I am essentially writing the LaTeX compiler in PHP, and if so, what do I need to know to do this (for example, should I just read the Purple Dragon book first?)?
I am very excited and rather intimidated by the prospect of this project, but, hey, we all study programmers, right? If we donβt need something, we go and build it, necessity is the mother ... you understand. Many thanks to everyone for all that you can offer.
php parsing latex
Alex basson
source share