kile spell checker not aware of latex

Bug #380860 reported by Luca Citi
122
This bug affects 20 people
Affects Status Importance Assigned to Milestone
kile
Fix Released
Medium
kdelibs (Ubuntu)
Invalid
Medium
Unassigned
kile (Ubuntu)
Confirmed
Wishlist
Unassigned

Bug Description

Binary package hint: kile

Hi!
I am using kile 1:2.1.0~svn942443-0ubuntu4 in jaunty.
The spell checker is almost unusable because it seems not to be aware of latex syntax.
Therefore it reports as errors "usepackage", "newcommand", ...
I expected the kile spell checker to parse somehow the text and ignore something like \command.
Previous versions somehow managed to ignore latex commands.
Thanks,
Luca

Revision history for this message
In , Fermat-m (fermat-m) wrote :

Version: 2.1 (using KDE 4.2.2)
OS: Linux
Installed from: Ubuntu Packages

Using kile 2.1, kde 4.2.2 under ubuntu 9.04 Tools->Spelling... the spell correction does not recordnize latex commands, options or comments and wants to correct them. E.g. \textit is suggested to be replaced.

Revision history for this message
In , Darek Gałecki (dgalecki) wrote :

I can confirm, this bug also applies to me.

Revision history for this message
In , p-f (p-f) wrote :

Same problem here (2.0.81 on KDE 4.2.2, kubuntu). Seeing as how Kile is a Latex editor, it's a bit sad that its default spell checker doesn't support Latex markup.

Revision history for this message
Andreas Wenning (andreas-wenning) wrote :

Kile uses the built-in spell checker of KDE, so this might not even be possible as things are structured now. I'll add it as a wishlist item.

Changed in kile (Ubuntu):
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Scmb (seamus) wrote :

If that is the case, why did this bug not affect Kile 1.9? I never had this issue until I upgraded

Revision history for this message
Greg (ggdhines) wrote :

This should really be considered a bug (and hopefully an important one) - it used to work and now it doesn't. I would also be interested in knowing what changed about KDE/Kile that caused this.

Revision history for this message
Andreas Wenning (andreas-wenning) wrote :

Kile 1.9 is from before hardy; do you know if it worked or not in hardy and/or intrepid?

Revision history for this message
Andreas Wenning (andreas-wenning) wrote :

Looks like the answer is here: http://dhaumann.blogspot.com/2009/07/on-fly-spellchecking-in-kate.html

Kile uses katepart, so this also affects Kile. So we'll need to wait for this to arrive most likely in KDE 4.4.

Changed in kdelibs (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Changed in kile (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Jonathan Thomas (echidnaman) wrote :

kdelibs is the KDE3 kdelibs package, but this is a dupe of bug 279081in this case. (Which is perhaps misclassified as kdesdk itself)

Changed in kdelibs (Ubuntu):
status: Triaged → Invalid
Revision history for this message
Luca Citi (knulp79) wrote :

Hi Jonathan,
I am sorry but I disagree with you: this bug is not at all a duplicate of bug 279081.
I am not asking for an on-the-fly spell-checker.
I am asking why with the on the on-request speller, commands like "\usepackage" are reported as errors while in the previous versions they were not.
I also think it is a bug and not an enhancement: it used to work, now it doesn't, making the spell checker in Kile completely unusable.
Nevertheless, by looking at the screenshot at
http://dhaumann.blogspot.com/2009/07/on-fly-spellchecking-in-kate.html
it looks like this patch solves both bugs.
Best,
Luca

Revision history for this message
Andreas Wenning (andreas-wenning) wrote :

@Luca
Code-wise they are correlated it seems; and as it is fixed upstream the bug report mostly needs to act as a place-holder for now, so no need not to merge them.

It looks like the feature got left out initially when re-writing to KDE4. And that it will re-appear in KDE4.4. Currently it is marked as a bug, that is fixed upstream.

Revision history for this message
Vincenzo Ciancia (vincenzo-ml) wrote :

From the other bug report: "The spell check does work in the lates KDE 4.1.*". Starting from this assumption, the problem reported in this bug report is not going to be fixed in bug #279081. We will just see all latex comments underlined in red, this will not change the status of this bug. Kdelibs do not need any tex awareness, kile needs it. The word "latex" does not even appear on the other report and I would be surprised if it was.

Revision history for this message
atoms.h (thomas-pflueger) wrote :

I very much agree that this bug is not a duplicate. My argument goes as follows: spell check does - in priciple - work but is not aware of latex commands. However, recently I tried spell checking in german which was not included in the list. Installing the german aspell dictionary made it work. So somehow Kile must use - and correct me if I'm wrong - aspell.
If I now use the very same .tex document and type
$ aspell -l de -c verysame.tex
guess what, spell checking works perfectly without marking latex commands! I might be wrong but it seems that kile simply does not call aspell in latex mode...or in other words aspell is not aware it is checking a tex file. and this might be a VERY different problem than inline spell checking!

Revision history for this message
ntmikey (loppo) wrote :

This bug definitely has NOTHING to do with bug #279081.
Kile spell checker does work and on-the-fly checking is not an issue here.

What doesn't work is that the spell checker should only check the text and ignore the latex commands. As atoms.h noted,
    aspell -c file.tex
does this correctly.

To see our case, please open the attached file 'kilebug.tex' in Kile and then go to Tools->Spelling.
To see the correct spell checking you can run:
   aspell -c kilebug.tex

Revision history for this message
Vincenzo Ciancia (vincenzo-ml) wrote :

I contacted kile developers directly, they are taking a look at the problem.

Revision history for this message
ntmikey (loppo) wrote :

Hope they fix it soon.

A workaround would be very helpful until the fix makes its way...

Revision history for this message
ntmikey (loppo) wrote :

I've installed the KDE 4.3 RC3 and I see it's been fixed in the Kile version that ships with it.

Revision history for this message
Vincenzo Ciancia (vincenzo-ml) wrote :

Hmm, not fixed for me, can anyone clarify what the difference could be? I am using up-to date karmic. The version of the kile package I am using is 1:2.1.0~svn981319beta1-1ubuntu1 and it says in the about dialog that it's kde 4.3 RC3.

Revision history for this message
ntmikey (loppo) wrote :

Sorry, you are right - not fixed.
I was checking rather simple child document (with no preamble) and spell checker did ignore \chapter, \section, \subsection, \cite, \caption, \label and \ref.
However, it completely failes on preamble (even on \documentclass and \usepackage).
In the document it fails on \includegraphics, \subfloat and \begin{figure}[options], just to mention few.

Revision history for this message
Scmb (seamus) wrote :

One particularly annoying aspect of this bug for me is that the spellchecker flags as misspelled every instance of ending double quotes. That is, every time I write ``something'' it flags the word " something' " as an error. "ignore all", which helps speed up spell checking doesn't help at all here, since every instance is a different word...

Revision history for this message
Scmb (seamus) wrote :

Will this bug be fixed in Ubuntu 9.10?

Revision history for this message
In , Michel Ludwig (michel-ludwig) wrote :

Fixed in kdelibs 4.4 with Kile 2.1.

Revision history for this message
ArTaX (marco-zannoni) wrote :

Why is this bug marked invalid? Thi bug affected also me (ubuntu 9.10) and it is very annoing, it makes spellchecking completely useless...

Revision history for this message
Martin Posch (martin-posch) wrote :

I experience this bug in the final release of Ubuntu 9.10 as well. Is there any workaround?

Revision history for this message
Xavi Ivars (xavi-ivars) wrote :

This is a very annoying bug. I hope it's solved soon

Changed in kile (Ubuntu):
status: Invalid → Confirmed
status: Confirmed → Invalid
Revision history for this message
Erfa (erfa90) wrote :

Indeed, this is a very annoying bug. In the meantime, does anyone know of any other programs that can do spell checking of LaTeX? (or the .dvi/.pdf file for that matter). I've been looking around, not really finding anything.

Revision history for this message
Michele (mikelito) wrote :

Why has theen been marked as invalid? The bug is there, it's a regresion since
it used to work before, many people are experiencing it and it is REALLY annoying....

Ab (1010s1011)
Changed in kile (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
dagurasu (dagurasu15) wrote :

I vote to bump up the importance of this bug and quit marking it invalid. It is clearly seems kile specific as it would be quite impressive if any other part of kde cared or knew anything about latex commands. Kile is a text editor and for a text editor to have a spell check feature that is not un-useable is not merely a "wish" for the wish list. It is a flat out serious bug, especially given that, sadly like many things in kde, it once worked and now doesn't. Even if this is an upstream bug, Kile should not wait for an upstream solution. Given that aspell does work, it is clear that a downstream workaround is surely possible, and moreover that the workaround can't be that complicated.

Revision history for this message
Andreas Wenning (andreas-wenning) wrote :

Kile uses Kate (or rather katepart) for the editing part; and as far as I have been able to gather the spell checking capability is done as part of the katepart. So fixing this is not as trivial as it might seem and involve core KDE; but if you know a fix please provide it!

Revision history for this message
dagurasu (dagurasu15) wrote :

fine.. maybe it isn't THAT simple I didn't mean to be condescending to hard working volunteer programmers, seriously. Maybe the hook to get the latex awareness pushed in is elsewhere, but being that Kile is a text editor of sorts, an extremely core feature like this should probably not be written off as low priority, and should not be written off as invalid(granted it's valid for the moment) just becasue Kile relies on someone else's code to deal with it. To the extent there is any responsibility for free software writers to do anything, it seems the responsibility is on the Kile programmers to get the functionality Kile needs. If they can't get it from Kate, they should get it elsewhere. If it's a bonus feature or minor issue and it was easy to grab functionality from Kate and hope it works someday, fine, but this is not either. Kate is not the only software to ever implement spell checking. If marking it upstream means yeah we're working on it, but we're working on it upstream, then great. It doesn't look like that's the case. If kile programmers just don't have time to fix it, that's quite understandable too. That doesn't make the problem invalid or low priority though.

Revision history for this message
dagurasu (dagurasu15) wrote :

My apologies.. I was confused and thought I landed on kile bug reporting thread. For ubuntu I certainly agree it's upstream... but that's true regardless of whether it's kate or kile, so not sure why the response wasn't even more decisive, partially why I was confused. Anyway, it should just be reported to Kile as they are the latex people, and let them decide who to send it to. I'll check there.

Revision history for this message
Andreas Wenning (andreas-wenning) wrote :

@dagurasu
Patching core KDE functionality to do it is out of scope for Ubuntu/Kubuntu. But if an upstream patch is committed, cherry-picking it might be an option.

The bug is marked as "confirmed" for kile (it is invalid for kdelibs, as that is the KDE3 version of KDE's core libraries, and the problem is in KDE4).

If you can check if the this is reported upstream and if not report it, that would indeed be great! Please, if you find or make an upstream bug, please link it here (if you don't know why, just post a link to the upstream bug, and I'll do it). Then we'll be able to track the issue and cherry-pick a fix if applicable.

Revision history for this message
Dominik (dominik.k) wrote :

@Andreas:
This bug should be fixed in Kile 2.1 with kdelibs 4.4 (see https://bugs.kde.org/show_bug.cgi?id=190906)

Revision history for this message
molecule-eye (niburu1) wrote :

This bug is pretty close to being a joke: a LaTeX editor without auto spellchecking and a manual spellcheck that doesn't ignore LaTeX markup!

Excuse me, I just moved from gnome to KDE and I find this quite unbelievable.

Changed in kile:
status: Unknown → Fix Released
Revision history for this message
In , Niburu1-k (niburu1-k) wrote :

The fix is not entirely adequate. E.g. \bibliography is not marked as a spelling error but \bibliographystyle, \emph, \lnot, etc. are. It appears there's only a select "few" commands that are being ignored by spell check, but EVERY command should be ignored, i.e. every string of the form '\<command>'. I imagine this is even easier to implement then creating a "blacklist" of commands to ignore which is why it surprises me that this route was not chosen.

Revision history for this message
In , Michel Ludwig (michel-ludwig) wrote :

(In reply to comment #4)
> The fix is not entirely adequate. E.g. \bibliography is not marked as a
> spelling error but \bibliographystyle, \emph, \lnot, etc. are. It appears
> there's only a select "few" commands that are being ignored by spell check, > but EVERY command should be ignored, i.e. every string of the form
> '\<command>'.I imagine this is even easier to implement then creating a
> "blacklist" of commands to ignore which is why it surprises me that this
> route was not chosen.

This is exactly what is done.

Please ensure that you are using (at least) KDE 4.4, and that you are using the most recent LaTeX highlighting file (latex.xml). You might also want to delete an old version of it in

  $HOME/.kde/share/apps/katepart/syntax/

Revision history for this message
In , Niburu1-k (niburu1-k) wrote :

(In reply to comment #5)
> (In reply to comment #4)
> > The fix is not entirely adequate. E.g. \bibliography is not marked as a
> > spelling error but \bibliographystyle, \emph, \lnot, etc. are. It appears
> > there's only a select "few" commands that are being ignored by spell check, > but EVERY command should be ignored, i.e. every string of the form
> > '\<command>'.I imagine this is even easier to implement then creating a
> > "blacklist" of commands to ignore which is why it surprises me that this
> > route was not chosen.
>
> This is exactly what is done.
>
> Please ensure that you are using (at least) KDE 4.4, and that you are using the
> most recent LaTeX highlighting file (latex.xml). You might also want to delete
> an old version of it in
>
> $HOME/.kde/share/apps/katepart/syntax/

Ah, I'm using a custom latex.xml file I saved in my local directory so that I could get syntax highlighting to behave nicely with my dark color scheme. I suppose I might have to remove that to get spell check to work correctly, but whether spell check ignores '\...' strings *should* be independent of the syntax highlighting file. Why is the one dependent on the other?

Revision history for this message
In , Michel Ludwig (michel-ludwig) wrote :

(In reply to comment #6)
> Ah, I'm using a custom latex.xml file I saved in my local directory so that I
> could get syntax highlighting to behave nicely with my dark color scheme. I
> suppose I might have to remove that to get spell check to work correctly, but
> whether spell check ignores '\...' strings *should* be independent of the
> syntax highlighting file. Why is the one dependent on the other?

It's because the highlighting files specify which parts of the document are being spell checked.

If you just want to adjust the colours for highlighting, there is no need to modify the highlighting files themselves. You can set the colours in the configuration dialog (Configure Kile / Editor / Fonts & Colours / Highlighting Text Styles and then choose Markup / LaTeX).

Revision history for this message
levien (levien) wrote :

As a reasonable temporary workaround in Lucid, I downloaded the latest version of latex.xml from svn (http://websvn.kde.org/trunk/KDE/kdelibs/kate/syntax/data/latex.xml?view=markup) and copied it into ~/.kde/share/apps/katepart/syntax/
It still has trouble with macro-parameters and backward quotes, but at least most LaTeX commands will be properly recognised as such. Especially if you only use on-the-fly spellchecking, it is quite usable this way...

Revision history for this message
Bruno Lenzi (brunorlenzi) wrote :

Hi, I tried the above solution in Lucid and got no improvement. All the names of the figures in {} are misinterpreted for instance.

Thanks,
Bruno

Changed in kile:
importance: Unknown → Medium
Revision history for this message
Ivan (ispmarin) wrote :

Hi all,

I'm running 12.04 with Kile 2.1.0, myspell 1:3.3.0-2ubuntu3, and latex keywords are still being considered grammar errors. Any solutions for this problem?

Revision history for this message
Ivan (ispmarin) wrote :

No news about this bug? It's still there...

Revision history for this message
petko (papam2parky) wrote :

Hello guys,

I have just found out how to get rid of highlighting/spell checking commented text in kile. The problem lies in editing latex.xml file. You should be able to find this file in (in my ubuntu distro)

/usr/share/apps/katepart/syntax/latex.xml

or you can just download an updated version of this file from

https://projects.kde.org/projects/kde/applications/kate/repository/revisions/eea99f31dfe5c67ca6a26e5bf48a897f9287a958/raw/part/syntax/data/latex.xml

and save it to

~/.kde/share/apps/katepart/syntax/latex.xml

(This version also solves issues with highlighting of \citet{} and \citep{} commands.) Then open it and find the line (452. line) containing

<itemData name="Comment" defStyleNum="dsComment"/>

and replace it with

<itemData name="Comment" defStyleNum="dsComment" spellChecking="false"/>

resulting in ignoring comments by the spell checker. As you can see, almost all other environments are spell-check ignored. That's all, folks. I hope this post will be helpful.

Regards,
petko

Revision history for this message
israelgarcia86 (israelgarcia86) wrote :

Hello Petko,

I tried your solution and it worked fine. Thanks a lot!

Bests,

Israel

Revision history for this message
In , Árpád Lukács (lukacs-arpad) wrote :

(In reply to Michel Ludwig from comment #3)
> Fixed in kdelibs 4.4 with Kile 2.1.

I am still experiencing this behaviour in kile 2.9.91 using kde 5.44.0 in kubuntu 18.04.2.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.