I use TeXworks to write my documents. The spell checker tool works nice, but I'd like to add some words to the dictionary, but I can't find a function for that.
So how can I do that?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.Sign up to join this community
TeXworks uses a spell checker called Hunspell, an engine which is also used e.g. by OpenOffice:
Each dictionary consists of two files with the extensions
.aff. Where these are located depends on your TeXworks installation, on my system (TeX Live 2010, Windows), they are in the directory
Adding words to the dictionary is quite simple: As the
.dic file is a plain word list, you can just add new lines with your own words. If you want the system to recognize different word forms, too, you have to deal with the
.aff file - see this explanation for more details. However, simply changing the word list should be enough in most cases.
I managed to install the dictionary
PT_EU as follows:
I opened the TeX works went to
Settings and Features and clicked
After downloading the dictionary did
PT_EU http://extensions.services.openoffice.org/en/dictionaries site, downloading a file. Otx. then open this file with 7-zip, and copied the folder "Dictionaries" folder to the 0.4.
Then I copied the entire folder TeXworks (
C:/Users/Abilio/AppData/Local/MiKTeX/2.9/TeXworks/), to the following path
C:/Users/ Abilio / AppData / Local /. Then I reopen the TeXworks, and the dictionary was already there and it worked.
I have windows Vista 32-bit.
In a MiKTeX 2.9 / Windows 8 context, the file to modify turned out to be
There was no problem editing it with a Unix-style editor within Cygwin. The file has a word count at the beginning, but it did not seem necessary to increment the word count when adding new words. I presume the word count is used for storage allocation when the file is loaded. I added new words in alphabetical order.
The remark above about making a backup is right on!
[Windows 7 Ultimate x86, TeXworks Version 0.4.5 r1280 (MiKTeX 2.9)]
I couldn't get my dictionary to be recognised in the
c:\Users\<username> folder structure. So, instead, I copied the
.aff files directly into the
hunspell\dicts sub-folder of my MiKTeX install (I have it in
c:\Program Files\LaTeX) and that worked.
I then followed diabonas' advice about adding my own words to the
.dic file, but they weren't immediately recognised by TeXworks as valid words. I tried opening TeXworks a few times to see if it would finally recognise my changes, but to no avail. The following worked for me in the end:
1) I deleted the
.aff I had copied in to the install folder (as explained above),
2) I opened TeXworks to confirm my dictionary was no longer available.
3) I added the new words to the original
.dic file I downloaded (in the download folder I chose),
4) I then copied the edited files back in the
hunspell/dicts folder as stated above.
5) I went back to TeXworks, and it was all good now.
I can't explain why making the edits directly in the
hunspell\dicts folder would not work. Perhaps something to do with caching or they get compiled. I did not try to reboot my OS since I thought that was not necessary.
I had a similar issue, but with OS X Yosemite. I accidentally caused the built-in OSX spelling dictionary (which is what many LaTeX editors use) to incorrectly learn a misspelled word. By directly editing the text file at
~/Library/Spelling/LocalDictionary you can customize the editor to ignore common LaTeX syntax and to add custom words to ignore.