skiadas / md2ptx

1 stars 2 forks source link

Parse latex math #4

Open oscarlevin opened 6 hours ago

oscarlevin commented 6 hours ago

It should be pretty easy to look for single or double dollar signs, and \(....\) or \[...\] and convert these to <m>...</m> and <me>...</me>. I'm happy to try to contribute that soon so I can learn about how it works.

skiadas commented 6 hours ago

Hm yeah you can probably wrap them into a new function around the fixQuotes output. I think the only tricky bit would be recognizing cases where a dollar sign is just a dollar amount, like we have $100 and we want to add to it $20. Not sure what a good heuristic there would be. Probably the best thing would be to expect that the closing dollar sign is not preceded by whitespace, and the first dollar sign is preceded?