Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
The Internet

Editing Complex Equations For Conversion Into HTML? 13

sakul asks: "I'm working for an online education company, and I'm looking for an easy way to allow teachers to type in equations and math symbols and have them converted into images for display on webpages. These teachers are used to using graphing calculators and they can understand having to write out things like (a^2)/3 but not that LaTex \frac{a^2}{3}. I've looked at that Java Equation editior that WebEq makes, but entering all those equations by hand is really hard, and it only generates MathML, which makes it basically impossible to go back and edit the equations once they've been typed in. I know that other people out there have delt with this problem, but I can't find a soultion anywhere." Perhaps some form of preprocessor can be written that can take an HTML file and expand the equations in one form "(a ^ 2)/3" and convert it on-the-fly into MathML at display time? There are plenty of solutions out there that one could use to pull this off.
This discussion has been archived. No new comments can be posted.

Editing Complex Equations For Conversion Into HTML?

Comments Filter:
  • When properly layed out, there is a _lot_ of information conveyed, which are the constants, parameters, the variables. The function 'family' can be recognized at a glance. This is a good thing.


    being able to translate it into a better notation forces you to memorize it; this is a good thing

    Oh. We tend to prefer comprehension not memorization at our .edu

    P.

  • lessse,

    w(x2|x1) = (1/(sqrt(2pi)(1-rho^2)sigma2))e(-1/2[x2-{mu2+rho(s igma2/sigma1)(x1-mu1)}/(sigma2 sqrt(1-rho^2))]^2)

    hmmm, yes, this _is_ the conditional bivariate normal probability function (right?)

    P.
    (who should be doing stats assgt right now)
  • Write a script to convert the "graphing calculator" representation to LaTeX format. This shouldn't be too hard. Then have your script render the LaTeX source to DVI, and convert that to GIF and save in a temporary file. Then your CGI on the server side sends the name of this temporary file in HTML.

    But you wanted to be able to edit your equations after they're written. So store in a database the one-line representation of the equation along with the LaTeX code. That way, when you push "Edit," you get a form with the one-line representation; when you submit the change, the LaTeX and temporary image are modified as well.

    Of course, what exactly you are doing with these equations has some impact on how you implement the above....

  • I assume that you were trying to right out the quadratic formula, in which case you got it wrong. It should read: "(-b +- sqrt(b^2-4ac))/2a = 0
  • Really, how hard is it to understand that?

    I admit, my mathematics background isn't great, and I've never seen the background for that formula, but I'm still able to translate it into more standard notation. Besides, being able to translate it into a better notation forces you to memorize it; this is a good thing.

  • by ffsnjb ( 238634 )
    but whats wrong with just typing out "-b +- sqrt(b^2 -4ac) / 2a"? I think most people should be able to recognize this, if they have any middleschool math knowledge at all...

  • The quadratic formula does not have to be expressed as an equation, as it is true by itself. Its usage involves setting it equal to 0 and solving from there. Or maybe it just doesn't matter... Fuck math, I'm an accountant.:)

    end sarcasm

  • I usually just enter the equation into my TI-89 and then hook it up to my PC with the TI-Graph Link cable. Then I take the Graph Link program and take a screen capture (screenshot) of my calculator with the equation.

    This can also be done with the TI calculator emulator Virtual TI. This program can be downloaded at ticalc.org [ticalc.org]

  • by Anonymous Coward
    see http://www.w3.org/Math/iandi/ - Amaya has a wysiswyg editor for mathml thats pretty usable - and you certainly can "go back and edit the equations once they've been typed in" also "EzMath: an easy-to-use input format based on how people speak expressions. EzMath also provides a convenient way to author MathML"
  • One more thing, I forgot to mention the obvious thing about THX-1138. You enter the equation in the handwritten-like notation (free-form, multiline) at the top, then hit "Numpad =" (or Math -> Evaluate from the menu) and it will spit out the one-line version (e.g., "5/(2+3)") at the bottom (and evaluate it if possible). You could then cut'n paste this in your entry box.

    -- Bryan "TheBS" Smith

  • SVG (Scalable Vector Graphics) [w3.org] is the preferred W3C [w3.org] standard for vector graphics. I recommend converting to this standard instead. You can get Adobe's free SVG viewer for Netscape/IE [adobe.com] (Mac/Windows-only though). Mozilla also comes with SVG support (although you usually have to add it in yourself from the codebase -- haven't checked the latest 0.8 for inclusion though). There are numerous programs for UNIX that do SVG import/export (almost all the major Qt/GTK+ vector graphics programs do), and support seems to be increasing in Windows programs (although I haven't seen it in Visio, but I might be one version back now).

    -- Bryan "TheBS" Smith

  • by Pingster ( 14864 ) on Monday March 19, 2001 @03:10AM (#356403) Homepage

    This problem was solved five years ago by MINSE (a Medium-Independent Notation for Structured Expressions). It's not just a design, it's a working implementation. See http://www.lfw.org/math [lfw.org] for details, or visit a demo page [uwaterloo.ca] to see output (compare it to the HTML source of the same page [lfw.org]).

    Summary: enter equations like sane people do, e.g. "a*x^2 + b*x + c = 0" or "x = (_b +/- 'root(b^2 - 4*a*c))/(2*a)". Type them directly into your HTML; no need to run a converter to generate your pages. They appear in your web pages, look much, much better than LaTeX2HTML because they're antialiased, and anyone with a browser can see them without installing any software. Even text browsers work -- they get an ASCII art rendering [uwaterloo.ca]!

    Presented to the W3C but sadly ignored. At first it was rejected because they thought extensibility was unnecessary; then after they realized extensibility was critical, threw out their design and started over, they ignored MINSE because it wasn't XML. But there's one little point they missed: it actually works. Five years later, MathML is still vapourware -- and even if it did work, it would be completely unusable by teachers.

  • by BitMan ( 15055 ) on Sunday March 18, 2001 @03:50AM (#356404)

    Being out of college now, I don't run into this too much. And my trusty HP 48/49 RPN calculator keeps me from writing too much down when I do. But this is an interesting question that I will probably pursue for you (because I want to do it for myself since I regularly consider switching to teaching). In the meantime, I offer these leads (feel free to contact me directly), although it's NOT a direct answer to your question.

    As you mentioned, LaTeX is less than ideal. But even those that do not like LaTeX like LyX [lyx.org]. LyX is a WYSIWYM (what you see is what you mean) TeX/LaTeX, SGML/DocBook, HTML, etc... editor for UNIX (and Windows if you have an X-Server like eXceed). It can export HTML c/o its integrated (as of v1.1.6) TTH (TeX to HTML) export. TTH produces multiline equations usually in standard HTML. So I guess using LyX and its export, people can generate HTML and cut'n paste the resulting HTML into their text box on your site (or export and cut'n paste LaTeX for that matter). Maybe you can take the LyX/TTH source (which is GPL) and tailor the app.

    Another interesting program that I think does NOT have HTML export features (but is interesting none-the-less) is Net Planet Software's [newplanetsoftware.com] THX-1138 [newplanetsoftware.com]. NPS has a clean X-Windows C++ framework called JX [newplanetsoftware.com] built right atop of plain'ole Xlib. THX-1138 is a "quickie, but goodie" program written in this framework and is a nice, equation writing features. Although I did not see an HTML export feature, it can export EPS (encapsulated postscript -- a size-efficient vector graphics format for printing) which can be used for conversion to another graphic format -- like a small, vector-based graphic format (so you don't have to worry about size/resolution issues with bitmap graphics).

    I'm sure there are many, many other examples, probably ones not so UNIX-focused either (I run Linux 100% of the time -- and support UNIX at work -- sorry). I'll let you know if I find anything else.

    -- Bryan "TheBS" Smith

Love may laugh at locksmiths, but he has a profound respect for money bags. -- Sidney Paternoster, "The Folly of the Wise"

Working...