| Summary: | Kile: syntax highlighting failed to match aligned environment within equation | ||
|---|---|---|---|
| Product: | [Applications] kile | Reporter: | outermeasure |
| Component: | editor | Assignee: | Michel Ludwig <michel.ludwig> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | normal | CC: | fmeier868, houstontyoung, nibgonz, raphael.kde |
| Priority: | NOR | ||
| Version First Reported In: | 2.9.92 | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
screenshot
Folding for cases/dcases Folding for split Updated LaTeX syntax highlighting file Diff from original latex.xml to new one Updated LaTeX syntax highlighting file (take two) Diff from original latex.xml to new one (take two) |
||
The bug also show up in
\begin{equation}
\begin{cases}
(something)
\end{cases}
\end{equation}
and similar.
Same behavior for me; note the folding region on attached screenshots. Kile 2.1.0 KDE 4.7.2 Ubuntu 11.04 Created attachment 70866 [details]
Folding for cases/dcases
Created attachment 70867 [details]
Folding for split
Here is a fix: I made some changes in the latex.xml file; the changed version is attached below, along with a diff from the original to the new one. Just put the new latex.xml in ~/.kde/share/apps/katepart/syntax/ and restart kile. Created attachment 83296 [details]
Updated LaTeX syntax highlighting file
Summary of changes:
- fixed "EndEnvironment" and replaced "MathFindEnd" with "EndMathEnv" contexts: this fixes the bug
- fixed "BeginEnvironment" context: removed pmatrix and friends from line pointing to "MathModeEnv"
- added highlighting for commands \Cref (from cleveref package) and \shortintertext (from mathtools package)
- added a new itemData "Reference" that is used for labels and citations; originally these share highlighting with "Environment"
Created attachment 83298 [details]
Diff from original latex.xml to new one
Created attachment 83299 [details]
Updated LaTeX syntax highlighting file (take two)
Created attachment 83300 [details]
Diff from original latex.xml to new one (take two)
I have adapted the patch to current version 1.55 of latex.xml and sent it to the maintainer of Kile (Michel Ludwig) to commit it. Dear Bug Submitter, This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond. Thank you for helping us make KDE software even better for everyone! Dear Bug Submitter, This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand. Thank you for helping us make KDE software even better for everyone! I haven't used Kile in several years and don't use LaTeX much anymore. I just ran into this issue in the latest Kate with the following text:
\begin{align}
\begin{aligned}
\end{aligned}
\end{align}
Still current in Kile version 2.9.92. *** This bug has been marked as a duplicate of bug 410477 *** |
Created attachment 60439 [details] screenshot Version: 2.1b5 (using KDE 4.6.2) OS: Linux Kile's syntax highlighting failed to match the \begin{aligned} with \end{aligned} if this block lie within an \begin{equation}...\end{equation}. Also happens if it is within equation*, gather; and probably other amsmath defined environments too. Doesn't happen within \[ ... \] or \( ... \). Reproducible: Always Steps to Reproduce: minimum example: \begin{equation} \begin{aligned} a & b\\ c & d \end{aligned} \end{equation} Actual Results: The \end{aligned} isn't recognised --- the "\end{align" is usual colour (the default seems to be red for \end, black for {, and blue for align) but then "ed}" appears in green. Also, folding the \begin{aligned} line folds up to and including the \end{equation}, and if you try to fold the \begin{equation} it will fold to at least the end of the next \begin{...}\end{...} (this seems to vary... haven't been able to determine a rule yet). See screenshot attached for a slightly more complicated example. Expected Results: The syntax highlighting should be aware that the \end{aligned} match the \begin{aligned}, etc. OS: Linux (x86_64) release 2.6.37-hardened-r7 Compiler: x86_64-pc-linux-gnu-gcc (Hardend amd64 Gentoo)