-
Notifications
You must be signed in to change notification settings - Fork 47
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
Math formatted columns in tabular environment handled incorrectly #155
Comments
You're right, the issue is caused by the curly brackets containing the end mathmode delimiter. As curly brackets are scoped to their own rules, their contents are effectivlely hidden from any outside rules. For example, look at the following (broken) latex: \( this is math {\)} this is still math \) this is not math Pasting that into atom will display the same issue as yours. Unfortunately, it is difficult to avoid this behaviour. A possible general solution would be to stop scoping individual appearances of @yudai-nkt I don't mind the second option. It's not the best solution, and could lead to invalid highlighting for other reasons, but I think mathmode tables are common enough to justify it. |
Alternatively, mathmode could be optionally ended by an (unbalanced) text $ math $
text $ math { still math } $
text $ math { still math \text{text $ deeper math $ }} $ but the following will break text $ math {$}
text $ math {$ deeper math $} $
text {$} math {$} Therefore, I believe that ending mathmode with However, this approach hinges on being able to reliably balance And whatever fix is implemented, this is the kind of thing that needs ... shudders in apprehension ... specs. |
@Aerijo Isn't there any way to simply ignore scopes when trying to start and end math mode, just highlighting everything between |
It's true that math can need unbalanced Plus, it would still look wrong in your example, as the |
@yudai-nkt What do you think about this? I've yet to find a problem with it, and it's quite easy to implement. It serves as a sort of 'failsafe', such that even if the construction is valid (like in this issue), the error does not propagate across the file. |
This issue is about a very specific use case but I think it is common enough to make an issue. The screenshot below demonstrates the problem.
That is, when specifying columns to be in math mode using the
tabular
environment of thearray
package, you have to write>{\(}c<{\)}
but the syntax highlighter does not recognize the\)
that ends math mode. Perhaps this occurs because the{
starts a new scope before\)
but I do not know how the highlighter works. Can someone please take a look at it?The text was updated successfully, but these errors were encountered: