On Fri, Mar 20, 2015 at 4:54 PM, Muhammad Mohsin Khan Niazi
<[email protected]> wrote:
>
> Parse the returned string to convert each Latex symbol/function to
> corresponding Sage symbol/function:
In my eyes, this is a really bad idea. The underlying problem is, that
LaTeX does no longer encode the semantic meaning of the equation. It
is "only" a way to encode the graphical layout how all symbols should
be placed in the paper or screen. Hence, this is a destructive step --
i.e. where essential information is lost -- and you can only recover
it by either applying some heuristics or in bad cases, you are out of
luck. There is also a great deal of ambiguity, which makes it even
harder. It seems that in the case of mathquill they are doing some
back-and-forth transformations, but they are limited to their inherent
subset of allowed representations to make it work.
My suggestion is to write a new function, alongside this
LaTeX-ification of the expression, which does produce the symbolic
expression. (Or stop with an error, if it encounters a case which is
not covered).
So, I don't know the MathQuill API at all. From a quick look at the
source code, I think there should be either a $(...).mathquill("sage")
command in the public API, or (thanks to prototyping) you could
create a $(...).mathquill2sage() and then try to replicate the inner
workings of the .mathquill("latex") operation.
I hope it is clear what I mean?
There is a mapping of symbols, e.g. here at the bottom are the
trigonometric functions.
https://github.com/mathquill/mathquill/blob/master/src/symbols.js
I think something like that for SageMath needs to be done too, but of
course, just for the operations which do actually exist in SageMath.
-- harald
--
You received this message because you are subscribed to the Google Groups
"sage-gsoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-gsoc.
For more options, visit https://groups.google.com/d/optout.