Skip to content

Added shortintertext as text context.#2586

Merged
lervag merged 1 commit intolervag:masterfrom
senesc:master
Dec 1, 2022
Merged

Added shortintertext as text context.#2586
lervag merged 1 commit intolervag:masterfrom
senesc:master

Conversation

@senesc
Copy link
Copy Markdown
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
Copy Markdown
Owner

lervag commented Nov 28, 2022

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

@senesc
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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