Bug 428262

Summary: Problem in Syntax Highlighting LaTeX
Product: [Frameworks and Libraries] frameworks-syntax-highlighting Reporter: Christian Saemann <christian.saemann>
Component: syntaxAssignee: KWrite Developers <kwrite-bugs-null>
Status: REPORTED ---    
Severity: normal CC: jonathan.poelen, walter.von.entferndt
Priority: NOR    
Version First Reported In: 5.75.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: rendered with ksyntaxhighlighter 5.245.0

Description Christian Saemann 2020-10-26 08:56:52 UTC
Syntax highlighting is in math mode after \end{equation} when using resizebox in equation.

STEPS TO REPRODUCE
1. Enter the following lines somewhere in a LaTeX file
\begin{equation}
    \resizebox{\hsize}{!}{
        $\begin{pmatrix}
            3
        \end{pmatrix}$}~.
\end{equation}
Hello

2. The editor highlighting is that of math mode after this, i.e. "Hello" is highlighted as math.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.20.1
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1
Comment 1 Jonathan Poelen 2025-06-01 16:03:12 UTC
There have been many changes since 2020, and the behavior is no longer the same as originally indicated. "Hello" is displayed correctly in "Normal Text", but the 2 "$" are displayed in "Error". It remains to be seen whether this causes another problem.
Comment 2 Jonathan Poelen 2025-06-01 16:05:22 UTC
Created attachment 181956 [details]
rendered with ksyntaxhighlighter 5.245.0