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

Added shortintertext as text context. #2586

Merged
merged 1 commit into from
Dec 1, 2022
Merged

Added shortintertext as text context. #2586

merged 1 commit into from
Dec 1, 2022

Conversation

senesc
Copy link
Contributor

@senesc senesc commented Nov 28, 2022

Currently the content of \shortintertext{} is consideted math context by the plugin. With this PR I added shortintertext to the "Text Inside Math regions" patterns.

@lervag
Copy link
Owner

lervag commented Nov 28, 2022

Can you provide a minimal example document that is relevant here?

@senesc
Copy link
Contributor Author

senesc commented Nov 28, 2022

Sure!

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}

\begin{document}
\begin{gather*}
	e^{i \pi} + 1 = 0
	\shortintertext{This is an example of shortintertext}
	e^{i \pi} + 1 = 0
\end{gather*}
\end{document}

@lervag
Copy link
Owner

lervag commented Nov 29, 2022

Cool, thanks. Now, \shortintertext is a command from the mathtools package, so we should not define this in core.vim. Instead, we need to update this file:

https://github.com/lervag/vimtex/blob/master/autoload/vimtex/syntax/p/mathtools.vim

In addition, I would kindly ask that you update the corresponding test file with a minimal example (just add an equation with the relevant command):

https://github.com/lervag/vimtex/blob/master/test/test-syntax/test-mathtools.tex

Allows for shortintertext content to be recognized as text.
@senesc
Copy link
Contributor Author

senesc commented Nov 30, 2022

Thanks for your input! I updated the correct file and added an example to the test folder. Hope everything is okay now

@lervag lervag merged commit e4ed9ba into lervag:master Dec 1, 2022
@lervag
Copy link
Owner

lervag commented Dec 1, 2022

Thanks; I've merged (and then applied some minor adjustments).

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