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

Treating \tag{} like \text{} for Snippets #2644

Closed
EmperorEntropy opened this issue Feb 24, 2023 · 1 comment
Closed

Treating \tag{} like \text{} for Snippets #2644

EmperorEntropy opened this issue Feb 24, 2023 · 1 comment

Comments

@EmperorEntropy
Copy link

Is your feature request related to a problem? Please describe it.
My feature request is related to the fact that I utilize Ultisnips a lot for LaTeX writing. Specifically, I write with equations a lot with the amsmath package, and one of the LaTeX commands found in the package amsmath is the \tag{} command which is used to neatly label each line in environments like align*. As far as I know, its behavior is identical to that of \text{} with the sole purpose of labeling equations.

I set up a context with vimtex#syntax#in_mathzone() for my snippets to auto expand, but a constant annoyance is that my snippets will also expand within \tag{}. For example, I defined a snippet for "lim" to expand into \lim\limits_{$1}^{$2}$0. Typing "lim" in \text{} does not trigger the snippet, but it does in \tag{}.

Describe the solution you'd like
I would like vimtex#syntax#in_mathzone() to exclude \tag{} if that is the right term, so my snippets won't auto expand inside of the command. If doing so is too much of a hassle, then I am open to other solutions that don't involve modifying mathzone, but I am unsure if any exist.

Describe alternatives you've considered
An alternative would be to utilize \text{} instead of \tag{} to label my equations; however, due to personal preference, laziness, and habit, I am more used to \tag{} than \text{} for equations. So, it would benefit me immensely (and possibly other people?) if mathzone was modified so that\tag{} won't trigger the snippets.

Anyway, thank you for creating such an amazing plugin, and thank you for considering this rather odd suggestion!

lervag added a commit that referenced this issue Feb 24, 2023
@lervag
Copy link
Owner

lervag commented Feb 24, 2023

Thanks for a well explained issue/feature request. I believe I've fixed this now so that arg in \tag{arg} is no longer recognized by vimtex#syntax#in_mathzone as math environment.

Anyway, thank you for creating such an amazing plugin, and thank you for considering this rather odd suggestion!

Glad you like it!

@lervag lervag closed this as completed Feb 24, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants