Skip to content
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

Parse piped expressions to Maxima's abs function #28

Closed
mattvague opened this issue Feb 16, 2019 · 3 comments
Closed

Parse piped expressions to Maxima's abs function #28

mattvague opened this issue Feb 16, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@mattvague
Copy link

mattvague commented Feb 16, 2019

Would be really nice if tex2max supported parsing strings like ln|x| and transpiled them to ln(abs(x)). Seems doable, and I don't mind taking this on as I need it as soon as possible but if I could get some advice on where/how to start that'd be awesome. Thanks!

@mattvague mattvague added the enhancement New feature or request label Feb 16, 2019
andstor added a commit that referenced this issue Feb 18, 2019
This gives basic support for absolute value signs.
Complex nested absolute functions might fail.
See #28
@andstor
Copy link
Member

andstor commented Feb 18, 2019

I have added some basic support for absolute value symbols in the branch feat/abs.

However, since we have based grouping of expressions on the distinction of opening "(" and closing parenthesis ")", braces and brackets, parsing "|" symbols is considerably more difficult. We should make use of the "\left" and "\right" macros to determin if it is a opening or closing pipe. Other macros that should be supported must also be researched further.

Please, feel free to try to fix the problems marked with "TODO" in the post-parser.js file. Alternativley, implement the "\left" and "\right" macros.

@mattvague
Copy link
Author

@andstor Ah, awesome thank you! Yeah I imagined that was why it wasn't in master. I'll take a look and see how hard I think it would be.

One thing I was noticing is I didn't see any unit tests, was wondering if you thought that might be something worth adding to ease development and prevent regressions?

@andstor
Copy link
Member

andstor commented Feb 21, 2019

@mattvague Yes, we should definitely add unit testing. I have created an issue #29. Help would be much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants