diff --git a/LaTeX/LaTeX.sublime-syntax b/LaTeX/LaTeX.sublime-syntax index 94a81ac124..2e87c1d1c8 100644 --- a/LaTeX/LaTeX.sublime-syntax +++ b/LaTeX/LaTeX.sublime-syntax @@ -634,16 +634,31 @@ contexts: 4: variable.parameter.function.latex 5: punctuation.definition.group.brace.end.tex push: block-math-begin-end-command-body + - match: |- + (?x) + ((\\)begin) + \s* (\{) \s* ( IEEEeqnarray\*? ) \s* (\}) + (?: \s* (\{) \s* ( {{letter}}+ ) \s* (\}) )? + captures: + 1: support.function.begin.latex keyword.control.flow.begin.latex + 2: punctuation.definition.backslash.latex + 3: punctuation.definition.group.brace.begin.tex + 4: variable.parameter.function.latex + 5: punctuation.definition.group.brace.end.tex + 6: punctuation.definition.group.brace.begin.tex + 7: variable.parameter.function.latex + 8: punctuation.definition.group.brace.end.tex + push: block-math-begin-end-command-body block-math-begin-end-command-body: - - meta_content_scope: meta.environment.math.block.be.latex markup.math.block + - meta_content_scope: meta.environment.math.block.latex markup.math.block - include: block-math-begin-end-command-end - include: math-content block-math-begin-end-command-end: - match: ((\\)end)(\{)\s*(\4)\s*(\}) captures: - 1: support.function.end.latex keyword.control.flow.begin.latex + 1: support.function.end.latex keyword.control.flow.end.latex 2: punctuation.definition.backslash.latex 3: punctuation.definition.group.brace.begin.tex 4: variable.parameter.function.latex diff --git a/LaTeX/tests/syntax_test_latex.tex b/LaTeX/tests/syntax_test_latex.tex index 271c755bc3..85c382e019 100644 --- a/LaTeX/tests/syntax_test_latex.tex +++ b/LaTeX/tests/syntax_test_latex.tex @@ -784,6 +784,13 @@ \subsubsection{name} % ^^^^^^^^^^ markup.math.inline - string % ^ punctuation.definition.string.end.tex - markup.math.inline + $\verb!$! \alpha$ +%^ meta.environment.math.inline.dollar.tex string.other.math.tex punctuation.definition.string.begin.tex +% ^^^^^^^^^^^^^^^ meta.environment.math.inline.dollar.tex markup.math.inline +% ^ markup.raw.verb.latex +% ^^^^^^ keyword.other.math.greek.tex +% ^ meta.environment.math.inline.dollar.tex string.other.math.tex punctuation.definition.string.end.tex + $$f(x) = x^2$$ %^^ string.other.math.tex punctuation.definition.string.begin.tex %^^^^^^^^^^^^^^ meta.environment.math.block.dollar.tex @@ -838,21 +845,61 @@ \subsubsection{name} % ^^^^^^^^ variable.parameter.function.latex % ^ punctuation.definition.group.brace.end.tex f(x) = x^2 -% <- meta.environment.math.block.be.latex variable.other.math.tex +% <- meta.environment.math.block.latex variable.other.math.tex %^^^^^^^^^ meta.environment.math.block \end{equation} -% <- support.function.end.latex keyword.control.flow.begin.latex punctuation.definition.backslash.latex -%^^^ support.function.end.latex keyword.control.flow.begin.latex +% <- support.function.end.latex keyword.control.flow.end.latex punctuation.definition.backslash.latex +%^^^ support.function.end.latex keyword.control.flow.end.latex % ^ punctuation.definition.group.brace.begin.tex % ^^^^^^^^ variable.parameter.function.latex % ^ punctuation.definition.group.brace.end.tex +\begin{equation*} +% <- support.function.begin.latex keyword.control.flow.begin.latex punctuation.definition.backslash.latex +%^^^^^ support.function.begin.latex keyword.control.flow.begin.latex +% ^ punctuation.definition.group.brace.begin.tex +% ^^^^^^^^^ variable.parameter.function.latex +% ^ punctuation.definition.group.brace.end.tex +f(x) = x^2 +% <- meta.environment.math.block.latex variable.other.math.tex +%^^^^^^^^^ meta.environment.math.block +\end{equation*} +% <- support.function.end.latex keyword.control.flow.end.latex punctuation.definition.backslash.latex +%^^^ support.function.end.latex keyword.control.flow.end.latex +% ^ punctuation.definition.group.brace.begin.tex +% ^^^^^^^^^ variable.parameter.function.latex +% ^ punctuation.definition.group.brace.end.tex -$\verb!$! \alpha$ -%^^^^^^^^^^^^^^^ meta.environment.math.inline.dollar.tex markup.math.inline -% ^ markup.raw.verb.latex -% ^^^^^^ keyword.other.math.greek.tex +\begin{IEEEeqnarray} +%^^^^^ support.function.begin.latex keyword.control.flow.begin.latex +% ^ punctuation.definition.group.brace.begin.tex +% ^^^^^^^^^^^^ variable.parameter.function.latex +% ^ punctuation.definition.group.brace.end.tex +f(x) = x^2 +% <- meta.environment.math.block.latex variable.other.math.tex +%^^^^^^^^^ meta.environment.math.block +\end{IEEEeqnarray} +%^^^ support.function.end.latex keyword.control.flow.end.latex +% ^ punctuation.definition.group.brace.begin.tex +% ^^^^^^^^^^^^ variable.parameter.function.latex +% ^ punctuation.definition.group.brace.end.tex +\begin{IEEEeqnarray}{c} +%^^^^^ support.function.begin.latex keyword.control.flow.begin.latex +% ^ punctuation.definition.group.brace.begin.tex +% ^^^^^^^^^^^^ variable.parameter.function.latex +% ^ punctuation.definition.group.brace.end.tex +% ^ punctuation.definition.group.brace.begin.tex +% ^ variable.parameter.function.latex +% ^ punctuation.definition.group.brace.end.tex +f(x) = x^2 +% <- meta.environment.math.block.latex variable.other.math.tex +%^^^^^^^^^ meta.environment.math.block +\end{IEEEeqnarray} +%^^^ support.function.end.latex keyword.control.flow.end.latex +% ^ punctuation.definition.group.brace.begin.tex +% ^^^^^^^^^^^^ variable.parameter.function.latex +% ^ punctuation.definition.group.brace.end.tex %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Boxes