Environment
- TeXstudio: 4.9.2
- Qt: 6.10.2
- OS: macOS 15.7.3
- TeX distribution: BasicTeX 2025 (irrelevant)
Expected behavior
Multiline \boxed{} used in math mode doesn't break highlighting.
Actual behavior
It breaks highlighting for some closing delimiters.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
% ok
\[
\boxed{}
\]
% "\]" raises "Unrecognized command"
\[
\boxed{
}
\]
\end{document}
\documentclass{article}
\usepackage{amsmath}
\begin{document}
% ok
$
\boxed{}
$
% "\end{document}" raises "closing environment which has not been opened"
$
\boxed{
}
$
\end{document}
More info
\boxed from amsmath package has cwl entry
Other commands having formula arguments share the same issue, for example the \ch from chemformula package. So this is caused by handling of cwl command arguments named formula or ending with %formula.
Environment
Expected behavior
Multiline
\boxed{}used in math mode doesn't break highlighting.Actual behavior
It breaks highlighting for some closing delimiters.
More info
\boxedfromamsmathpackage has cwl entryOther commands having
formulaarguments share the same issue, for example the\chfromchemformulapackage. So this is caused by handling of cwl command arguments namedformulaor ending with%formula.