Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ispell in Emacs LaTeX mode

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.

like image 631
Hnedy Medved Avatar asked Jan 23 '10 03:01

Hnedy Medved


3 Answers

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.

like image 110
Charles Stewart Avatar answered Sep 23 '22 00:09

Charles Stewart


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

like image 25
Andrew McGregor Avatar answered Sep 23 '22 00:09

Andrew McGregor


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.

like image 35
Brett Daniel Avatar answered Sep 24 '22 00:09

Brett Daniel