The new PDF rendering pipeline includes a new wikitext to latex
converter, based on the Parsoid parser. You might want to check out:
https://git.wikimedia.org/summary/mediawiki%2Fextensions%2FCollection%2FOff…
and
https://git.wikimedia.org/summary/mediawiki%2Fextensions%2FCollection%2FOff…
to see if they are useful to you.
--scott