Moving moodle to another system, the math formulas render much larger

Moving moodle to another system, the math formulas render much larger

by Diane Soini -
Number of replies: 3

We are trying to move our moodle to another system. Math formulas render significantly larger on the new system. We've tried to ensure both imagemagick and tex binaries are located in the same location (/usr/bin/latex and /usr/bin/imagemagick). We've also got the mimetex.linux, mimetex.freebsd and mimetex.darwin files within the tex filter's directory. As I understand it, our previous developer had replaced the original 32-bit versions with 64-bit versions. Our old OS is Redhat 7.5 and our new one is Centos 7.5. We are using a copy of our database so the settings in moodle are identical.

Any thoughts on what might be making the size of the images much bigger on the Centos system?

Average of ratings: -
In reply to Diane Soini

Re: Moving moodle to another system, the math formulas render much larger

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Given that you have to change anyway, why don't you just switch to using the MathJax filter? Nicer looking equations that way.

Average of ratings: Useful (1)
In reply to Diane Soini

Re: Moving moodle to another system, the math formulas render much larger

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Diane,

As Tim mentions, a switch to the MathJax filter will give much nicer looking equations. Meanwhile you might want to compare a hard coded setting in the tex filter for your two systems. Look at about line 61 or ...yourmoodle/filter/tex/pix.php

if you see this: $texexp = '\Large '.$texexp; in the new site, try changing the '\Large' to '\small' or any of these:

\tiny
\scriptsize
\footnotesize - this one doesn't seem to work anymore in my setup
\small
\normalsize
\large
\Large
\LARGE
\huge
\Huge

In reply to Diane Soini

Re: Moving moodle to another system, the math formulas render much larger

by Diane Soini -

Seems the reply to almost every forum anywhere is always "use something else" (which never actually answers the question), I'll reply to myself in case anyone in the future needs help.

I'm no sysadmin, but I did a search through the system of everywhere there are tex, texlive and latex things installed. It ended up being that our /usr/share/texlive directory had discrepancies and the settings for TeX notation in moodle showed where various executables should be installed, but those were also missing. Our sysadmin figured out how to get those items installed. Installing packages can be tricky, apparently, making sure they get all the parts. I'm just glad he fixed it.

The way I was able to test this was to export a course with some math formulas, then import it into the new system. That generated the image with the same hash in the filter/tex dir in the moodle filesystem. They were a different size, different bytes and the physical appearance was bigger. Once the sysadmin got the packages installed correctly, I deleted the images so they'd be regenerated and voila! It was fixed.

Average of ratings: Useful (2)