ID #1038

How to resolve this problem: Failed to parse (PNG conversion failed; check for correct installation of latex, dvips, gs, and convert) in MediaWiki when I try to enable math?

If you have this problem, some solutions might work for you, but none worked in my case.

1. it may be the case thatlatex.fmt is not identified. One solution proposed is to add latex.fmt to /images/math. To locate this file, try us ethe command locate. If sometimes it is missing, you have to generate your own. Solution: find latex.ltx and regenerate (Google to find the commands). Otherwise, you can also generate it by typing: texconfig init latex. BTW, texconfig can give you a GUI for refresh the configuration etc.

2. you have no permission to write to the image directory. Solution, change the permission of images to 777.

3. someone also resolved this by typing: fmtutil-sys --all (the configuration of tex is problematic)

4. texvc is not working properly? change $wgTexvc = '/usr/bin/texvc' in the LocalSetting.php. Or find its default location used in /includes/math.php, and then change it!

5. the solution in my case: for latex, dvipng, and dvips commands, use the absolute path in the file math/render.ml (convert is specified in the localsettings.php, and normally it is available in the host server under /usr/bin/, so no need to use its absolute path.) Recompile everthing under  math/, then I saw the png files correctly rendered.

 

Categories for this entry

Tags: latex

Related entries:

You can comment this FAQ