A fellow student and I are working on connecting LyX to MuPAD (A partially
open-source, free for non comercial use, computer algebra system) so
user's can evaluate mathematical expressions in the middle of a document.
I'd like some comments on possible user interfaces for this.
In the initial stages, only a text interface will be available. A user
will type an expression exactly the way the would into MuPAD. Then they
will somehow tell LyX to evaluate it, and then they will be able to
include MuPAD's results in their document.
Two ideas I have for this are:
1. The types the expression. Selects the expression. Uses the copy to
clipboard function. Tells LyX to evaluate the clipboard. Then when they
use the paste from clipboard function, they would instead be pasting
MuPAD's results instead of the expression they coppied.
2. The user inserts a text inset of some kind (similar to a
footnote). Enters their expression into the inset. Tells LyX to evaluate
the inset. Then LyX adds a paragraph after the inset containg the
results.
Here are my thoughts on these: Number 1 would probably be easier to
implement. Also, spawning the evalutation as a separate thread is
planned for later stages of the development so the user can continue
typing while MuPAD is number crunching. It seems easier to put the
results back into the clipboard in the background than into the buffer
while the user is working on it.
Number 2 might be a little bit more along the lines of WYSIWYM because the
user doesn't have to think about where they want the results in the
document, they simply appear right after the expression. I don't know if
this flexability is good or bad. When multithreading is introduced, this
option has the advantage of not taking over the clipboard during
expresssion evaluation. Although, I suppose adding a separate clipboard
buffer explicitly for MuPAD evaluation would be an option too.
What do you guys think?
Thanks
--------------------------------------------------------------------------------
Martin Muggli
Senior in Mathematics and Computer Science
Colorado School of Mines