-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing \sin2x seems incorrect #35
Comments
Hi I've just come up against this issue again. Is there an easy (or even hard) way to change this behaviour? Thanks. |
Right now, no -- but there is some activity on math-expressions with the folks at UMinnesota like @dqnykamp so I expect that there is some hope here. I don't know how much of the parser one would want to expose to clients of the library. I think you're saying that "trig-function numeric-constant variable" should be parsed as "trig-function ( constant * variable )" since the current behavior is causing confusion. But something like "sqrt2x" should probably mean "sqrt(2) x". Maybe trig functions are the special case here. |
Thanks for the reply @kisonecat . Yes, I definitely think that "trig-function constant variable" should be parsed as "trig-function (constant * variable)". I don't think the constant necessarily has to be numeric though. e.g. I would probably go a step further to say that implied multiplication (without a multiplication symbol) should be done before any other operations in an expression, except for exponents. Therefore, it would apply to all functions and not just trig ones. e.g. How far this can be taken is debatable, e.g. What I'm really after is parsing to match up with what someone at school level math, using school textbooks, would expect. I'm quite happy to have a hack in the parser code if you have any pointers on how this might be achieved. Thanks. |
I'm parsing Latex expressions such as:
At the moment MathExpressions treats this as:
However, I would expect it to be treated as:
The text was updated successfully, but these errors were encountered: