Closed ericluap closed 7 years ago
The returned LaTeX does not have the '$' before and after as would normally be had for math mode. I decided to leave them out because the provided 'toTex()' function did not include it. This can easily be added if it turns out it's needed.
Edit: Fixed it!
Realized now that it only simplifies multiplication for variables a-zA-Z when there is a function in Symbols.js for helping with this. I'll make sure to update the identification of the variables once I wake up tomorrow.
Edit: Attempted to use the option {implicit: 'hide'} but it didn't work. I also tried adding custom rules but that just seemed to make everything more confusing. I'm leaving it how it was before.
Turns out there are mathjs options for pretty much everything I added. Off to fix this!
oooo nice - yay mathjs! I'll wait for your fixes before reviewing ^_^
Sadly, the mathjs option didn't work. It only makes the multiplication implicit if it was passed in that way. I'm done with all my fixes.
don't have time to look in depth, but before I review could you move the printing in latex code to print.js
? then we can use it for expressions as well as equations :)
let me know if you have any questions or concerns about that
Added!
oh, and then call that code in the equation code so it's not duplicated ^_^
Of course, thanks for reminding me
You're right, the person calling the function should have control over the explicit/implicit multiplication. I just found it ugly and couldn't help myself but remove it entirely. I'll make sure to fix it all up.
Hahaha. It can be ugly sometimes but sometimes it's good for teaching to show it explicitly. Thanks for cleaning it up
So it turns out flattening the tree, or at least calling TestUtil.flattenAndParse(), makes, only where possible, all the explicit multiplication implicit. So all the explicit multiplication is being hidden anyway.
Should be good now
Follows these steps:
I added some tests for it but I am not sure if I did them correctly. Attempts to resolve #160