KQMATH / tex2max

:books: JavaScript library for converting LaTeX math into Maxima code
https://www.npmjs.com/package/tex2max
GNU General Public License v3.0
14 stars 6 forks source link

Operations with functions #57

Open eagarciam opened 4 years ago

eagarciam commented 4 years ago

When i use LaTeX expressions like '\\sin(x)+\\cos(x)', the produced output is 'sin(x)cos(x)', but the output should be 'sin(x)+cos(x)'; the same happends with operators like +,-,*,/ and expressions like \\sin(x)+\\cos(x)+...+\\tan(x) or \\sin(x)+\\frac{3x}{2}. It seems that only happens when the LaTeX expression have a trigonometric function and later an operator.

andstor commented 4 years ago

Thank you @eagarciam !

I am able to reproduce the issue. Will get this fixed in the next version 😉

leonfrischauf commented 4 years ago

When will you expectedly release the new version with this fix? :) Would be very important for us :)

andstor commented 4 years ago

Hi 👋 Sorry this took a while 😅 Release v1.3.1 should resolve this issue!

Also, if you like this project, please consider giving it a star ⭐️

leonfrischauf commented 4 years ago

Thanks so much for this update :) With your help you are empowering one of the biggest math websites in Austria to learn math online especially during home tutoring :)

andstor commented 4 years ago

Cool ! Happy to help 😄 What is the website called?

leonfrischauf commented 4 years ago

Hi, it is app.studyly.com :) - you can test it out by clicking on the blue button :D However your plugin will come in place in a few weeks when we have finished our MathQuill adaptions. There we have a pipeline via MathQuill > Tex2Max (Frontend) > Tree Parsing (Backend) > Maxima functions to evaluate equations, inequalities etc. :)

andstor commented 4 years ago

Nice! Looks like a solid project. Love the UI 🤩

Please give me a heads up when you have finished the implementation (or if you encounter any bugs 😉). If possible, I would love ❤️ to test it!

leonfrischauf commented 4 years ago

Hi, glad you liked it :D it is currently used by over 10 000 students in Austria - will then send you some teacher and student accounts for you to test it out :D

Just a quick question: When a user types in e.g. 3++, we send him that his input is not syntactically correct. Is it possible to show him the part where he made the mistake, e.g. only mark the "++" section?

andstor commented 4 years ago

Hi, glad you liked it :D it is currently used by over 10 000 students in Austria - will then send you some teacher and student accounts for you to test it out :D

Sounds great! 👍

Just a quick question: When a user types in e.g. 3++, we send him that his input is not syntactically correct. Is it possible to show him the part where he made the mistake, e.g. only mark the "++" section?

Assuming you are talking about the error checking done by TeX2Max, then the answer is unfortunately no. There is currently no built-in support for this. The only help you get is a description of the error (although, they are quite detailed). The problem is that the lib currently lacks a proper internal tree. If we had this in place, I believe the location-marking of errors would be simple to implement. A tree structure is therefore high on the todo list. But this would require a complete rewrite of the library, and I don't have time for this right now 😅.

However, it might be doable to implement location-marking of errors without any tree support... If you create a new issue with a proper description of the desired functionality, I might be able to take a look at it (but no promises) 😄

leonfrischauf commented 4 years ago

KK will add an issue :) Thank you so much!!!

Nice greetings from Vienna and all the best! Leon

AziAdFH commented 4 years ago

Same issue with LaTeX \\log(x)-\\sin(x), get unexpected result is log(x)sin(x)

andstor commented 4 years ago

Same issue with LaTeX \\log(x)-\\sin(x), get unexpected result is log(x)sin(x)

Yes, I can confirm this is indeed a bug 🐛 . Will fix it by next release 😉