1

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}$
  • 1
    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
  • 1
    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
3

After several attempts, I found the following solution. The code uses the ideas from aspell - special characters and math mode and My .emacs

(add-hook 'LaTeX-mode-hook
          '(lambda ()
             (setq ispell-tex-skip-alists
                   (list
                    (append
                     (car ispell-tex-skip-alists) 
                     '(("[^\\]\\$" . "[^\\]\\$")))
                    (cadr ispell-tex-skip-alists))) ))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.