# MediaWiki and the Case of the Sporadic LaTeX Failure

Jul 20, 07:46 AM

I recently upgraded to MediaWiki 1.21 for my personal wiki, and I was annoyed to see that LaTeX support was removed, though it and MathJax are available as extensions.

Once I installed it, I was vexed by sporadic failures in typesetting — texvc would succeed in producing an image about 20% of the time.

Eventually, I found out why — the memory limits on the wfShellExec call were set pretty low, and so most of the time it would fail to malloc the memory it needed.

Increasing the global default for shell calls in LocalSettings.php fixed this:

\$wgMaxShellMemory = 402400;

If you’re having the same problem, give it a try.