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

Support for cases* environment from mathtools package #3687

Open
cmcho-connect-ust-hk opened this issue Oct 12, 2024 · 3 comments
Open

Support for cases* environment from mathtools package #3687

cmcho-connect-ust-hk opened this issue Oct 12, 2024 · 3 comments
Labels
bug Deficiencies in TeXiFy behaviour. parser Issues for which significant changes in the parser are needed

Comments

@cmcho-connect-ust-hk
Copy link

cmcho-connect-ust-hk commented Oct 12, 2024

Environment

IntelliJ IDEA 2024.2.3 (Ultimate Edition) on Windows and TeXiFy IDEA 0.9.7.

Steps to reproduce

Input the following minimal example in any .tex file:

\documentclass{article}
\usepackage{mathtools} % Package with provides the cases* environment
\begin{document}
	\begin{itemize}
		\item Testing
		\item one
		\item two three
		\item $\begin{cases*}
			 1 & if $p \equiv 1 \pmod 4$ \\
			-1 & if $p \equiv 3 \pmod 4$
		\end{cases*}$.
	\end{itemize}
\end{document}

Expected behavior

No problems should be detected by the plugin.

The second row (after the & character) in the cases* environment should be highlighted in normal LaTeX text style as well.

Actual behavior

Several problems are incorrectly detected, which were the following:

  • "DefaultEnvironment name does not match with the name in \end."
  • <no math content>, LatexTokenType.&, LatexTokenType.*, [...] or LatexTokenType.\end expected, got '$'
  • <no math content> or LatexTokenType.INLINE_MATH_END expected, got '\end'

The text highlighting is also incorrect.

image

@cmcho-connect-ust-hk cmcho-connect-ust-hk added bug Deficiencies in TeXiFy behaviour. untriaged Issue type still needs to be triaged or verified. labels Oct 12, 2024
@xchatiii
Copy link

Damn... accidentally used my university account.

@xchatiii
Copy link

xchatiii commented Oct 12, 2024

mathtools Documentation 2024/10/24 Section 3.4.3 More cases-like environments:

\begin{cases*} 〈math_column〉 & 〈text_column〉 \end{cases*}

@PHPirates PHPirates added parser Issues for which significant changes in the parser are needed and removed untriaged Issue type still needs to be triaged or verified. labels Oct 21, 2024
@PHPirates
Copy link
Collaborator

Thanks for reporting this, for the record: the second column is a text column only for the starred environments (cases is provided by amsmath but cases* by mathtools), also for dcases*, rcases* and drcases*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Deficiencies in TeXiFy behaviour. parser Issues for which significant changes in the parser are needed
Projects
None yet
Development

No branches or pull requests

3 participants