Do you use natbib (e.g. \citep and \citet)?

Are you ever spell checking a LaTeX document in emacs and it keeps picking up your citation keys (e.g. \citep{Einstein:1936lla}), or text in inline math mode (e.g. $y = a + bx$)?

If so, here's a quick tip to stop it from doing so, and significantly speed up your spell checking. Be warned, however, that this will apply to all your documents. I'm sure there is a way to only apply it to *.tex, I just haven't found it yet. All you need to do is add the following 3 lines to your .emacs file in your home directory:

     ;;Ignore citations and inline math mode when spell checking
     (setq ispell-skip-region-alist '(("\\\\cite.*{" . "}")
                ("\\$" . "\\$")))

This fix doesn't work if you have optional arguments split across a line - e.g.:

some long text at begining of line~\citep[see
e.g.][]{Verbose:2010vba}

but is fine for:

some other long text at start of line~\citep[see e.g.][]{Verbose:2010vba,
Other:2011abc}

If you happen to spell check files with lots of $ symbols in that aren't LaTeX files, I would omit the final line and close up the middle line with )), otherwise ispell wont check any words inbetween two $ signs.

If you know of a better way to do this let me know via twitter @emptypenny