It's very impressive how far you can get with regexes, but wanted to flag there is a Python parser for .tex/.latex you can check out here:
https://github.com/alvinwan/TexSoup
It used to choke on some syntax elements, but works for 95% + of what you might find.
Very clean API reminiscent of BeautifulSoup parsers for HTML.
It's very impressive how far you can get with regexes, but wanted to flag there is a Python parser for .tex/.latex you can check out here:
https://github.com/alvinwan/TexSoup
It used to choke on some syntax elements, but works for 95% + of what you might find.
Very clean API reminiscent of BeautifulSoup parsers for HTML.