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

Still convert invalid expressions to LaTeX? #7

Closed
Throvn opened this issue Nov 20, 2021 · 2 comments
Closed

Still convert invalid expressions to LaTeX? #7

Throvn opened this issue Nov 20, 2021 · 2 comments

Comments

@Throvn
Copy link

Throvn commented Nov 20, 2021

Hey @ram6ler,
first of all thank you for this great package!

I want to write a simple calculator where the input of the user gets parsed into latex in real time.
If the user didn't finish the equation yet, I would still be able to show the (until now) typed equation.
Is it possible to bypass the checking of valid expressions before parsing? (Only for parsing, not for interpreting :P)

Thank you so much in advance, and as I said: awesome package!
Keep up the good work!

Best Regards,
Louis :)

@Throvn Throvn changed the title Convert invalid expressions to LaTeX? Still convert invalid expressions to LaTeX? Nov 20, 2021
@ram6ler
Copy link
Owner

ram6ler commented Nov 21, 2021

Hi,

Thanks for your interest in this library.

Hmm. That would be tough at this stage... Basically, the TeX expressions are generated by recursively going through the tree (similarly to the way expressions are evaluated) but that's only possible once the tree has been constructed...

What you might try is attempt to build the tree from the expression whenever there is an edit; if the expression is valid, update the TeX, otherwise keep the most recent TeX that worked or show that the expression is invalid (which is, for example, how the Pages TeX editor works).

Sorry I can't be of more help than that.

@ram6ler ram6ler closed this as completed Nov 23, 2021
@Throvn
Copy link
Author

Throvn commented Nov 24, 2021

Thank, you so much!
Since I only have to do really basic calculations, I wrote a little regex latex parser for myself and I'm quite happy with it.
I understand that it would make no sense on implementing this in this package :)

Thank you for the fast reply!! You have been of great help.

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

No branches or pull requests

2 participants