We use latex in the backend of a web application which stores exercises. To make exercises easier to find, we thought about implementing a source-code search.
But we stumbled upon a lot of problems because there are many ways to typeset the exact same math-formular:
x_i^2
x^2_i
x_{i}^2
...
Is there any way to transform tex code in a robust way into a plain string? Or can something like this be extracted from a pdf or dvi file? Or maybe even generated while compiling the document?
\tracingallin your .tex file gives identical output for all of the above in the .log file, but it will be messy to work with! – Fintan May 24 '20 at 04:06%---Exercise:start.etc). Makes regex possible. – Cicada May 24 '20 at 10:42