Parsing LaTeX would be a heavy task due to LaTeX's innumerable packages.
I would recommend a compiler which translates a subset of a clean math notation (which could be identical to the math subset of LaTeX) to native LaTeX, which includes a lint algorithm, and which also supports special graphics packages (PGF/TikZ for instance).
This approach would keep the compiler small and maintainable while retaining 100% compatibility with LaTeX.
I would recommend a compiler which translates a subset of a clean math notation (which could be identical to the math subset of LaTeX) to native LaTeX, which includes a lint algorithm, and which also supports special graphics packages (PGF/TikZ for instance).
This approach would keep the compiler small and maintainable while retaining 100% compatibility with LaTeX.