Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
3  
Related/Duplicate Question: spell checking latex documents –  Peter Grill Jan 30 '12 at 20:34
1  
@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
3  
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
show 1 more comment

4 Answers

up vote 15 down vote accepted

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

\loadspellchecklist[en][wordlist.txt]
\setupspellchecking[state=start]

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
6  
what does it do if a spelling error is found? –  alfC Sep 10 '12 at 10:03
add comment

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

or

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.

share|improve this answer
1  
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
add comment

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
add comment

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

share|improve this answer
1  
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
add comment

Your Answer

 
discard

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.