MyBB Community Forums

Full Version: Mathematical formulas
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Due to the academic use of the forum I'm building, it would be very useful I the users could include mathematical formulas inside the messages.

Is there any mod or plugin to do that?

If not, in the same computer where I host the forum, I have already installed a wiki that (like Wikipedia) use the program texvc to generate png images from formulas written in TeX language.

The syntax inside the wiki is something like

<math>\frac{1}{3}+\frac{1}{6}=\frac{1}{2}</math>

that produces the result

[Image: b2865d57e0b34d656db49cab1f06a448.png]

This software, texvc, admits command-line orders like

texvc /home/wiki/tmp /home/wiki/math "\frac{1}{3}+\frac{1}{6}=\frac{1}{2}" iso-8859-1

so, my idea would be to allow for MyBB to admit inline equations and convert the equations into png images, in the same way that the wiki hosted in the same computer is doing.

Do you think that can be done in a more or less easy way? I assume that it would work using an adequate MyCode.
I have a reasonable knowledge of php, so if you can point to me to the way to create the plugin (if it doesn't exist yet, of course), I would be very grateful.
I managed with the same problem using mimetex. I don't know how texvc works but I suppose it's similar.
You can create MyCode which would change [tex]your_syntax[/tex] to <img src=\"http://www.forkosh.dreamhost.com/mimetex.cgi?your_syntax\" align=\"middle\" /> (that's the public mimetex server which can be used by everybody. Your equation will look like [Image: mimetex.cgi?\frac%7B1%7D%7B3%7D+\frac%7B1%7D%7B6%7D=\frac%7B1%7D%7B2%7D]) or you can install mimetex on your server and do the same except using your address instead of forkosh's one.
More about mimetex at http://www.forkosh.com/mimetex.html
I assume texvc works somehow similar.