Any recommendations on how I can get mathematical equations into my resulting html? (Besides using x^2^ type markup.) I figure I could parse out equation text from my main text before RedCloth ever sees it... and then maybe create png''s somehow from it, putting the links to them back into the main text before handing it over to RC. But I don''t know of a util that will generate equations for me. I''ve used LaTeX in the past, but that seems like an awful large program to install and crank up just for a few equations, since I don''t need it for any document layout. (Note though, I think TeX output is *beautiful*.) I''ve heard groff can make equations... But again, I don''t need full document typesetting. Also, groff plus macros also seems like a pretty big package... Lout is another one I''ve come across, but I''m not even sure I can get png''s out of that. Is there some plugin for RC for rendering equations? Thanks, ---John
Hi John,> Is there some plugin for RC for rendering equations?Strictly off-topic, I don''t know how to do this in RedCloth but I''ve heard good thing about jsMath[1]. As the name implies it''s a javascript package for rendering math equations on web pages. Never used, just heard about it. Cheers, Assaph [1] http://www.math.union.edu/~dpvc/jsMath/
On 6/17/06, Assaph Mehr <assaph at gmail.com> wrote:> Hi John, > > > Is there some plugin for RC for rendering equations? > > Strictly off-topic, I don''t know how to do this in RedCloth but I''ve > heard good thing about jsMath[1].Wow. Seems like a pretty extensive system. It''s interesting to see how much html gets produced by jsMath to render the equations. It''s quite a lot. Also, jsMath seems a bit slow. I think I''ll keep looking for a way to just just create some png''s ahead of time. Thanks for the input! ---John
AFAIK, the simplest way is to use texi2dvi + dvi2png to generate a png file from a TeX source. This is what I did in a rails project, and it worked fine and was very easy to implement. Jean-Etienne -- Woa! Kft www.novAgora.hu "All you need in this life is ignorance and confidence; then success is sure.", Mark Twain John Gabriele wrote:> On 6/17/06, Assaph Mehr <assaph at gmail.com> wrote: > >> Hi John, >> >> >>> Is there some plugin for RC for rendering equations? >>> >> Strictly off-topic, I don''t know how to do this in RedCloth but I''ve >> heard good thing about jsMath[1]. >> > > Wow. Seems like a pretty extensive system. > > It''s interesting to see how much html gets produced by jsMath to > render the equations. It''s quite a lot. Also, jsMath seems a bit slow. > I think I''ll keep looking for a way to just just create some png''s > ahead of time. > > Thanks for the input! > > ---John > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards > > >
On 6/18/06, Jean-Etienne Durand <etienne.durand at woa.hu> wrote:> AFAIK, the simplest way is to use texi2dvi + dvi2png to generate a png > file from a TeX source. This is what I did in a rails project, and it > worked fine and was very easy to implement. > > Jean-EtienneInteresting. I''ve never tried using texinfo... Just now I tried creating a simple LaTeX file: \documentclass{article} \begin{document} \[ a_{i}^{2} + b_{j}^{2} = c_{k}^{2} \] \end{document} and got a dvi from that, but dvipng gives me a rather large png: http://www.simisen.com/jmg/temp/foo1.png I''d need a way to clip the equation out of the big image... Jeane-Etienne, did you just create a very small texinfo source file and process that, or was there some trick involved to get the png''s to come out sized correctly -- each containing just one equation (rather than a whole page)? ---John
On 6/18/06, I wrote:> On 6/18/06, Jean-Etienne Durand <etienne.durand at woa.hu> wrote: > > AFAIK, the simplest way is to use texi2dvi + dvi2png to generate a png > > file from a TeX source. This is what I did in a rails project, and it > > worked fine and was very easy to implement. > > > > Jean-Etienne > > Interesting. I''ve never tried using texinfo... > > Just now I tried creating a simple LaTeX file: > > \documentclass{article} > \begin{document} > \[ a_{i}^{2} + b_{j}^{2} = c_{k}^{2} \] > \end{document} > > and got a dvi from that, but dvipng gives me a rather large png: > http://www.simisen.com/jmg/temp/foo1.png > > I''d need a way to clip the equation out of the big image... > > Jeane-Etienne, did you just create a very small texinfo source file > and process that, or was there some trick involved to get the png''s to > come out sized correctly -- each containing just one equation (rather > than a whole page)?Whoops. Ah. Ok, I just needed to shut off page numbering with \pagestyle{empty} before the \begin line. Then I get http://www.simisen.com/jmg/temp/foo2.png , and probably just need to fiddle with margins to get it centered correctly. Sweet! I think Textile plus this method of adding equations should work very well. Thanks again for the suggestion! ---John
> probably just need to fiddle with margins to get it centered correctly.The problem of getting png images of equations with LaTeX formatting has been solved literally hundreds of times previously; don''t waste your time reworking this wheel! 1) Google for "latex equation png", or 2) look at how html2latex (tried and true) or hevea (maintained and configurable) do it, or 3) use http://redsymbol.net/software/l2p/ Iain.