[pdftex] TeX output as Java graphic

Todd O'Bryan toddobryan at mac.com
Fri Dec 5 03:33:44 CET 2003

This may not be the right place to ask this question, but I'll ask 
anyway and have someone re-direct me...

I teach computer programming in a high school, and I have several 
seniors who've had two years of programming before, so I have them all 
working on projects that I think would be useful to the world at large.

One group is working on an algebra tutor, and for that group, I have my 
heart set on math that looks good.

We're coding in Java, and I'd like a way to get pretty math in a 
generic graphic environment. PDF is probably not the way to go since 
(as far as I know; I'm a relative neophyte) it doesn't have a 
reasonable way to interact graphically with images. I've thought about 
writing routines that hard code Java graphics calls, but it seems like 
then we'd be creating stuff that would only be useful in Java. I've 
also thought about writing SVG and then using something like Batik to 
display the SVG easily.

Here's my question: Knuth's algorithms are just about the prettiest 
thing I'm likely to find anywhere, even after 20 years. I have a copy 
of _TeX: The Program_, and a student who got a perfect score on the ACT 
who's interested enough in the project that he's willing to learn some 
Pascal and wade through the problem.

How hard would it be to pull out the code from TeX that typesets small 
snippets of text (the primitives, I guess it would be) so that I could 
pass a string like "$x^2+y^2=25$" (or its MathML equivalent) and a 
starting point and have that small image be typeset correctly at that 
point. Is anyone aware of anybody doing something like this or leaning 
in that direction?

I've looked at MathML and I must say I'm rather disappointed in the 
lack of open source tools, and the relatively low quality of the 
renderers that currently exist. Maybe I've missed something. If so, 
please correct me. If not, would someone be willing to answer questions 
about how everything hangs together in TeX so my student and I could 
get a handle on what data structure we'd need to set up and which 
primitives we'd have to implement so that we could do small snippets of 
arbitrary math fairly easily.

Todd O'Bryan

More information about the pdftex mailing list