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

Fix x'^2 #636

Merged
merged 3 commits into from
Jan 19, 2017
Merged

Fix x'^2 #636

merged 3 commits into from
Jan 19, 2017

Conversation

edemaine
Copy link
Member

@edemaine edemaine commented Jan 19, 2017

Fix for #634. Basically, ' should be treated like a superscript constructor, where any number of 's become \primes in the superscript, and an optional following ^... can define the rest of the superscript. As a result, x^2' does not work (double superscript), and nor does x'_2' (double superscript). All error behaviors now correctly match LaTeX. (x'_2' was accepted by KaTeX previously, but that was incorrect.)

@edemaine edemaine mentioned this pull request Jan 19, 2017
@gagern
Copy link
Collaborator

gagern commented Jan 19, 2017

Great! Very quick response, nice code, and it even does the same thing as LaTeX for input like $$\sum'^x$$ or $x'^{x'^{x'^{x'}}}$. The failing 1'_2^3 was not something I would have expected before your explanation, but it does make sense now and it is consistent with LaTeX, too. I'll accept this PR.

@gagern gagern merged commit a738185 into KaTeX:master Jan 19, 2017
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

Successfully merging this pull request may close these issues.

2 participants