Equation editor

D

DrX

Can I create a Macro to translate from symbolic notation in math to text, or
vise versa? I would like to be able to type in text in English, and have the
macro convert it into equation form, or vise versa.

I.E. since Im doing a lot of math, Id like to type in something like "The
Integral of f with respect to x - and have it put that into equation editor
using the proper symbols.
 
R

Robert M. Franz (RMF)

Hi DrX
Can I create a Macro to translate from symbolic notation in math to text, or
vise versa? I would like to be able to type in text in English, and have the
macro convert it into equation form, or vise versa.

I.E. since Im doing a lot of math, Id like to type in something like "The
Integral of f with respect to x - and have it put that into equation editor
using the proper symbols.

So, you would have to code something (sophisticated) which parses what
you write and converts it into Word fields to match your desired
expression (or to create the EquationEdit object from it -- but I don't
think there is an easy programmatic access from Word into EE, since OLE
objects seem to be pretty much black boxes as far as the receiving
application is concerned).

You would have to define the whole "grammar" of your new
formula-description language. Sounds pretty enormous a task, and it
could become a constant work-in-progress since you might find other math
symbols/expressions you want to describe as time goes by.

I don't say it cannot be done, but I don't see a "business case" for it,
especially since

- you can either click your way through EE pretty easily (yes, it's not
as fast as typing, but OTOH you don't have to learn or build a whole
syntax), or
- for the really typing fans, you might use something like LaTeX in the
first place.

I'm sure you could even keep Word if that's your desire, create all
equations in TeX and export them into something you can then insert in
Word again.

0.2cents
Robert
 
D

DrX

creating a parser is about what I want.

You see, Outside of the OFFICE package, Id like to learn how to make a
parser, so I can then create my own compiler. I don't want to get overyly
specific about it - in that the one I want , as you said , would be very
comples.

Yes, Id like to learn how to define my own language.
 
J

Jay Freedman

DrX said:
creating a parser is about what I want.

You see, Outside of the OFFICE package, Id like to learn how to make a
parser, so I can then create my own compiler. I don't want to get
overyly specific about it - in that the one I want , as you said ,
would be very comples.

Yes, Id like to learn how to define my own language.

This is _not_ the kind of project you should try to do in VBA. :)

There are entire college-level courses on the subject of parsers and
compilers. Probably the most popular textbook for it is "Compilers" by Aho,
Sethi, and Ullman
(http://www.amazon.com/gp/product/0201100886/002-0947409-0647224?v=glance&n=283155),
better known as "the dragon book".

As Bob pointed out, the Equation Editor in Word 2003 doesn't have an
interface for control by VBA, so that's pretty much a dead issue from the
start. You might want to try out the Word 2007 beta, which has a new editor.
There you can write linear text (not quite the English description you had
in mind, but at least it's all text) and then tell it to switch to math
mode. OpenOffice Writer also has a linear text entry method for its equation
editor.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top