views:

415

answers:

5

When I run Emacs command ispell-buffer on an Emacs buffer which is in the LaTeX mode, ispell checks spelling also inside math expressions. I'd very much like to disable this. Is there an easy way to do it? I've read about detex but detex does not seem to be integrated into Emacs.

Thanks a lot!!!

A: 

This doesn't answer your question directly, but I have found Flyspell, an on-the-fly spell checker, incredibly useful when editing LaTeX documents. It still spellchecks inside equations, but it is much easier to ignore a few extra red underlines than ispell's interactive commands.

Brett Daniel
-1: It doesn't answer the question *at all*.
Charles Stewart
+2  A: 

Yes, you can: install aspell instead of ispell, and use flyspell with it.

Andrew McGregor
He may already be doing that. The command is still called ispell in Emacs, even if it actually invokes aspell.
Chris Conway
Further to what @Chris said, both ispell and aspell can parse Tex maths, so this possibility isn't likely to help the qner.
Charles Stewart
A: 

You may know this, but you can press A during spell checking to add a word to the buffer-local dictionary (that's capital A, lowercase a adds it to the global dictionary). It's not ideal, but this is how I usually suppress spell-checking of technical terms and variable names, etc., in my LaTeX documents.

Chris Conway
A: 

It shouldn't do this, if you are using latexisms (eg. \[ ... \], equation environments, &c) to invoke math mode. Check the contents of ispell-tex-skip-alists; cf. section 6 of the ispell FAQ for what kind of thing should be there.

You can use $..$, $$..$$ to mark out maths using ispell-tex-skip-alists, but beware getting them out of kilter...

Postscript

Check also the value of the ispell-parser variable: this should be 'tex, otherwise ispell will not look for $...$ and $$...$$ regions.

Charles Stewart
A: 

This AUCTeX mailing list thread : "spell checker (ispell-buffer) complains about products in math modes" has some workarounds and the answer demonstrates how to use ispell-tex-skip-alists.

RamyenHead