To follow up on my other posts in this thread, the code written by Eylon Caspi for a class project, to translate from TeX to (lisp) is now in http://www.cs.berkeley.edu/~fateman/papers/parsetex-public.tar
There are files in this project which we used which we cannot publish because the copyright is held by the publishers of the Gradshteyn table of integrals. These were the test cases we used. There is also web page / translated from powerpoint to html in that directory, named parse_tex . This (in my view) rather nice project was presented in a poster session at some ISSAC conference. Thanks to Eylon Caspi for providing the programs. Oh, by the way, in case you have not read any of the material, let me just point out that in translating from TeX to "math", you may encounter a(b+c) or f(x+y). How are you to know that the first one means a*(b+c) and the second means apply(f,x+y). Or does it? RJF On May 14, 10:56 am, rjf <fate...@gmail.com> wrote: > It is possible to define a a program that will take a single language > and produce from it either TeX, Lisp, Sage, Mathematica, Maple, > Maxima, MathML, etc. > > That does not solve the problem of taking some random TeX formula, not > using that language of macros etc, and converting it into a CAS > formula. > > The newer version of Gradshteyn has, as its base, all of the formulas > in such a language, and there is a translator into some CAS. I think > the translator is written in TeX. > This was done by hand, and using it makes it rather simple to produce > (sort of) code in any CAS. See the paper for why I say "sort of". > > I don't have the code for Caspi's project; I've asked him to post it > though. > > As for whether more recent work has surpassed it... I think that a > program that works in 1997 might still work just fine. And the design > is probably OK too. Reminds me of the quip.. > > "Algol 60 was not only an improvement on its predecessors, but also > on nearly all its successors. > -- C. A. R. Hoare" > > Now if you want to switch back and forth, starting with the CAS, then > it is quite easy. You embed the CAS code into the TeX so that > translating back is simply extracting a comment. > > e.g. > \int_a^bf(x)dx % maxima% integrate(f(x),x,a,b) > > RJF > > On May 14, 9:23 am, daly <d...@axiom-developer.org> wrote: > > > > > > > > > Since TeX is turing complete and allows macros, > > would it be possible to create a set of macros > > that are not ambiguous? For instance, an integral > > macro that specifies the limits and differential > > variable? > > > \integrate{0}{\infty}{r}{sin(\theta)} > > > In this case it seems to me that the latex macros > > would closely approximate the actual linear input > > to the CAS. > > > Tim Daly > > > On Sat, 2011-05-14 at 08:25 -0700, rjf wrote: > > > Look at > > >http://moralfiber.org/eylon/berkeley/cs282/ > > > to see a paper, > > > Parsing Mathematics Typeset in TeX > > > that successfully parsed many many formulas > > > from Gradshteyn and Rhyzik, a table of integrals. > > > > The result was Lisp, which presumably could be Maxima. > > > If you have a result in Maxima, presumably Sage can make sense of it. > > > > Or the same design can directly produce whatever Sage-speak you had in > > > mind. -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org