# How to prevent ispell from checking inside mathematical formulae

By invoking M-x ispell, ispell says that 'ij' in the following formula is incorrect. How to permanently prevent ispell from this behavior.

$\phi_{ij}$

• Check to make sure you're actually in a LaTeX buffer (M-: (eq major-mode 'latex-mode)). ispell seems to ignore math environments out of the box -- at least for me, it ignores $\phi_{ij}$ when I'm in latex-mode, but not when I'm in, e.g., text-mode. See also this S.O. thread for more details. – Dan Dec 22 '14 at 14:23
• @Dan the emacs on my system uses Aspell. I am in Latex-mode. The content of that link doesn't help either. – Name Dec 22 '14 at 15:14
• In that case, start Emacs with emacs -Q and try again. The behavior you request is the default in current Emacs. What's your emacs version? – Malabarba Dec 22 '14 at 15:37
• @Malabarba my emacs version is "GNU Emacs 24.4.1 (i686-pc-mingw32) of 2014-10-24 on LEG570" – Name Dec 22 '14 at 15:54
• @Name In that case, start Emacs with emacs -Q and try again. – Malabarba Dec 22 '14 at 16:01

(add-hook 'LaTeX-mode-hook
'(("[^\\]\\$" . "[^\\]\\$")))