TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I normally use my gedit spell check extension for the task, but wouldn't it be much better if you could fix any typos or otherwise during compilation time, in a sort of interactive mode?

share|improve this question
Related/Duplicate Question: spell checking latex documents – Peter Grill Jan 30 '12 at 20:34
@PeterGrill Related, yes. Duplicate, NO. I want a package in LaTeX, not a tool in my editor. – Ayman Elmasry Jan 30 '12 at 20:37
The problem with an interactive mode is that the typos will still be in the source, so you'd have to do it for every run – Joseph Wright Jan 30 '12 at 20:40
@JosephWright Yes I suppose you're correct, you'd have to save before or after compiling. – Ayman Elmasry Jan 30 '12 at 20:54
@JosephWright By using aspell or ispell as I describe in my answer the spell checked file is automatically saved before compilation. – N.N. Jan 30 '12 at 20:56
up vote 21 down vote accepted

You can let TeX (rather luaTeX) do the spell checking for you! For example, in ConTeXt MkIV, you can use


where en is the current language (you can set different word lists for different languages), and wordlist.txt is a sorted list of correct words. For a complete example, see the ConTeXt wiki

share|improve this answer
Perfect, I'll definitely give it a try. – Ayman Elmasry Jan 31 '12 at 20:36
what does it do if a spelling error is found? – alfC Sep 10 '12 at 10:03
Strange that the above question was not answered by any one for almost 2 years. So, what does it do if it finds a spelling error? does one have to try it to find out? – Nasser Jul 11 '14 at 3:31
@Nasser or look at the example on context wiki (linked in the question). Any misspelled word is colored red. – Aditya Jul 19 '14 at 15:14

It seems unreasonable to implement spell checking as a LaTeX package when there are excellent spell checkers for the terminal that can be incorporated into the compilation process. Before you compile you can do

aspell -t -c file.tex


ispell -t file.tex

Either lets you interactively spell check the whole file. The -t option is to tell the spell checker that the file is in TeX or LaTeX format so that it will ignore macros.

To combine this with the compilation process you can invoke them after each other such as

aspell -t -c file.tex && pdflatex file.tex

or you could make an alias to shorten the command you need to write. If you use latexmk you could make it run aspell or ispell for each compilation by a using a technique similar to what is described in http://tex.stackexchange.com/a/42166/5701.

If you prefer to simply get a list of misspelled words non-interactively, you can run:

cat file.tex | aspell list -t | sort | uniq
share|improve this answer
This is not exactly what I had in mind, but according to Joseph's comment, I suppose it is not logical either, unless you can modify and save a file during LaTeX compile. – Ayman Elmasry Jan 30 '12 at 20:58
@AymanElmasry Why would you want to implement it as a package? Is there are reason except for want of abstraction? In case you make it only for abstraction I see no reason to implement it as package when there are excellent terminal spell checkers already. If you make an alias or implement it via latexmk you would only need to write a short command such as spellpdflatex file.tex or latexmk -r spellcheck file.tex to spell check and compile. – N.N. Jan 30 '12 at 21:02
@N.N You don't understand his question. He wants to fix typos during the compilation time as soon as they are start popping up in the log file. The only people who can answer this questions are pdfTeX developers. That doesn't exist and I am not sure even if it can be implemented. My best guess that is not theoretically possible to implement. – Predrag Punosevac Jan 31 '12 at 3:50
@PredragPunosevac I do understand it but argue that it seems unreasonable to do so when there are excellent spell checkers for the terminal already. – N.N. Jan 31 '12 at 7:21
I'm not 100% sure but I think at least in your last code example test.tex should be file.tex (or the other way around). – Bruno Le Floch May 19 '13 at 10:46

Not an interactive solution, but you might want to have a look at the spelling package. The package requires the LuaTeX engine. Only the LaTeX format is supported, but support for other formats shouldn't be too hard to implement. Contributions are welcome!

share|improve this answer

If you use sublime text as an editor, you could try https://github.com/vaisaghvt/CheckTypos package.

share|improve this answer
Welcome to TeX.sx! Feel free to visit our TeX.SX starter guide to get the most out of this site. – Peter Jansson May 19 '13 at 9:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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