Hi. Are there any free classes or libraries that I could use to create
mathematical expressions and then paint them to a GUI component? I
don't mind if this is done indirectly, e.g. by asking for the formula
to be rendered to an image and then painting the image onto a
component. I'd need to be able to create formulae containing fairly
normal stuff such as fractions, roots, powers, functions, summations,
etc.
Thanks in anticipation,
Ross-c
Thomas Weidenfeller - 11 Jan 2006 16:12 GMT
> Hi. Are there any free classes or libraries that I could use to create
> mathematical expressions and then paint them to a GUI component?
You are effectively asking for a math typesetter / math editor, which
can be very complex software. If it doesn't have to be Java, then
perhaps the simplest thing would be to use a typesetter which can do
math (TeX, troff with eqn), "print" to an image and use that.
If it has to be Java, then I think I remember that there is some MathML
Java library out there which could render a formula.
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
Oliver Wong - 11 Jan 2006 16:32 GMT
> Hi. Are there any free classes or libraries that I could use to create
> mathematical expressions and then paint them to a GUI component? I
[quoted text clipped - 3 lines]
> normal stuff such as fractions, roots, powers, functions, summations,
> etc.
Don't know of any libraries specifically for Java, but you may wish to
take a look at MathML. http://www.w3.org/Math/ It's a markup language for
displaying mathematical expressions. There's a list of MathML related
software at http://www.w3.org/Math/Software/ including "converters" that
take MathML as input and output the expression in graphical formats (such as
SVG) which you may then be able to load and paint onto your component.
WebEQ (http://www.dessci.com/en/products/webeq/) in particular is
described as "a collection of Java tools and components for dynamic math
applications and MathML processing." but it isn't free.
- Oliver
Ross Clement (Email address invalid - do not use) - 11 Jan 2006 16:50 GMT
Thanks for the replies here. In the long run it would probably be
better if I looked into MathML. I'm aware of what MathML is, but
haven't ever gotten around to learning it properly. As I'm writing a
hack application for my use only, I'll probably go the externally
rendered latex route for now, but wrap it in a class which could be
swapped out for a MathML renderer at a later time.
Cheers,
Ross-c