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%2FOffl...
and
https://git.wikimedia.org/summary/mediawiki%2Fextensions%2FCollection%2FOffl...
to see if they are useful to you. --scott