## Tuesday, 3 May 2011

### Spell checking LaTeX documents

Spell checking a LaTeX document is different from spell checking a plain text document, since the LaTeX document contains commands that should be ignored by the spell checker. For example, consider this command for including a figure with a caption:

\begin{figure}
\centering
\includegraphics[width = 7cm]{image1}
\caption{Focused image of piont scatterer.}
\end{figure}

Here, a spell checker should not suggest changing "\includegraphics" to "include graphics", but it should suggest changing the misspelled "piont" in the caption to "point". Luckily, there are spell checkers that interpret LaTeX commands, and I am currently using one of them, Aspell. In Linux, Aspell is easily installed by the following commands:

apt-get install aspell
apt-get install aspell-en

which installs both the program and the english dictionary. To spell check a LaTeX file called paper.tex on the command line, type

aspell -c paper.tex

Note that Aspell (and its relative Ispell) can also be used at runtime by text processing programs like Kile.