7

I have a tex file that I update regularly and want to check for spelling every time. I would like aspell to remember the mispelled words that I chose to ignore and automatically ignore them in every subsequent spellcheck. The way I do it so far is the following:

  • Check the file using aspell -t -c file.tex. After that, I know that whatever is left there that is misspelled can be ignored for the next time.
  • Do cat file.tex | aspell list -t | sort | uniq > dictionary.txt and then add personal_ws-1.1 en 162 as the first line of dictionary.txt. This will be a personal dictionary of things that can be ignored in every subsequent spell check.
  • Next time check the file with aspell --home-dir=. --personal=dictionary.txt -t -c file.tex

This works, but the problem is that I need to do this procedure every time I want to update the words that I want to ignore permanently. Is there a way to make aspell put the interactively ignored words in that file, automaticaally during the spell check? Or any other efficient way of achieving what I'm doing above?

geo909
  • 456
  • 1
  • 3
  • 14
  • 1
    For future users of this approach, since it puzzled me: in that first line to add to the dictionary, `en` is the language code, and the number after is a hint at the length of the list, and does not have to be accurate. See ["Format of the Personal and Replacement Dictionaries"](http://aspell.net/man-html/Format-of-the-Personal-and-Replacement-Dictionaries.html#Format-of-the-Personal-and-Replacement-Dictionaries) in the aspell docs for reference. – fbmd Mar 21 '21 at 10:26

1 Answers1

7

I found the answer after posting that question. Here's the solution:

  • Every time, run aspell with aspell --home-dir=. --personal=dictionary.txt -t -c file.tex
  • Instead of pressing "i" or "I" to ignore a word, just press "a" to add it to dictionary.txt.
geo909
  • 456
  • 1
  • 3
  • 14
  • Something that also works for me is to have a central dictionary.txt and then simply symlink that file to each folder I'm working on. – geo909 Jul 31 '18 at 11:51