R – LaTeX equations in Ruby on Rails

latexruby-on-rails

How can I render LaTeX stuff like

\frac{1}{2}

in a Ruby on Rails application? I mean to get an image?
Thanks!

Best Answer

To render LaTeX for the web, it looks to me like mathTeX is the application of choice. There are many other options, all of which seem to build on dvipng as a foundation. MathTeX appears to be the most polished and capable, and it is easy to configure as a CGI service, so your Rails application can generated ordinary HTML <img> tags with rather complex src attributes.

EDIT: Having installed mathTeX, I can say that the code is inflexible, that it violates the Linux Filesystem Hierarchy standard, and that it is amateur work—in both the good and bad senses of that word. The code is so complex that there are no obvious faults. I will be looking for alternatives.