Custom Dictionaries, Aspell, and LaTeX

It took me a bit of hunting and twiddling to figure out exactly how to use aspell with a custom dictionary that supplements (not replaces) the master dictionary, so I thought I’d document it for posterity.


aspell --lang en create master ./custom_dict.aspell < ./custom_word_list.txt aspell --add-extra-dicts=./custom_dict.aspell -t -c my_document.tex

And that's it for the checking part. The only latex specific piece is the "-t" option which tells aspell to filter out latex nonsense. If you remove it, then you can use this recipe with a more generic text document.

To create my initial word list I did this:


aspell -t list -a < my_document.tex | sort -u > ./custom_word_list.txt

This command just creates a list of unrecognized words from the document, and ensures that the are sorted and unique. After I created it I went through and carefully edited the word result. Enjoy.

This entry was posted in Programming. Bookmark the permalink.