I just upgraded to Lyx 2.1.4 from Lyx 2.1.3 and the spellchecker does not work — it asks if I want to start from the beginning and then closes like it found no errors. I am using Windows 7 with a clean default install of Lyx. Any ideas on how to get the spellchecker working again?
[Tex/LaTex] Spellchecker in Lyx 2.1.4 Does Not Work
lyx
Related Solutions
The support for "aspell" in LyX has been dropped. For Windows, the latest binaries of aspell are dated from Dec 2002, see here or GNU Aspell on Wikipedia. (And "ispell" is even a predecessor of "aspell".) More and more programs are switching to "hunspell". Of course, this does not say using "hunspell" is the best choice in every case.
There is another way to look at it. Often one can choose among different dictionaries in "hunspell" for the same language... There is the often cited repository of OpenOffice (and others may exist). One can download a dictionary, extract the .dic
, .aff
and README-
files from the zip file and store them in the directory used by the operating system for hunspell dictionaries. If the filename of the .dic
and .aff
files do not have a pattern like xx_XX.xxx
or xx.xxx
, one needs to rename them. For example, "en-US.aff" should become "en_US.aff" or just "en.aff". (This information can be found here.)
Update:
For installing a Hunspell dictionary for a language and using it in LyX, one can follow these instructions (I think of particular importance is to set the path "Tools > Preferences > Paths > Hunspell" correctly. Since warnings (or errors) about the spellchecker are not shown as pop-up messages in the LyX frontend it can help to run LyX from the command prompt/shell with lyx -dbg files
.
There are two ways to increase a spell check dictionary.
By adding words to a personal word list in the spellchecker in LyX (or directly to the file of the personal word list;
While spell checking (F7) there is the "Add" button to add unknown words to the personal word list. Then they will be know in the future. If the document language is set to "English", the words will be added to the file
pwl_english.dict
in the home directory of LyX. Search for this file and you can also edit this file with a text editor and add more words manually (just one word per line).If you want to removing a words from it, you can do this also in LyX. Right click on a word that should be remove and select "Remove from personal dictionary".
By replacing an installed Hunspell dictionary by a dictionary created by yourself;
It seems possible to take two or more dictionaries and merge them into one new dictionary (possibly, ".aff" files have to be merged, too). Then this new dictionary can replace the old one. Since this is only related to Hunspell, questions about this might be better asked on a different SE site. Here is at least a link with some background information about how dictionaries in Hunspell to get started.
Thanks Scott! Your answer about changing the Hunspell path in Tools > Preferences > Paths worked for me. I pointed the path to
"C:\Program Files (x86)\MiKTeX 2.9\hunspell\dicts"
Lastly, had to restart Lyx and the spell checking started working.
I tried pointing it to the dict files in the Lyx resources directory ("C:\Program Files (x86)\LyX 2.1\Resources\dicts"
), but that didn't work. Mine was a clean install of Lyx 2.1.4 on Windows 10.
Scott, since you're working in the Lyx project, I think you should have them set the default Hunspell path on the Windows install to the correct one, instead of leaving it blank. I just clean installed it a few days ago, so I don't think I touched any of the settings to affect this.
Also note that at least for me, the dict files in the MikTex directory were a few years old, as opposed to the ones in the Lyx resources directory which were much newer.
(Sorry I'm replying this as an answer, but I just joined and I don't have enough reputation to comment.)
Best Answer
I think I found the problem. First point the path of hunspell to your equivalent folder:
C:\Program Files (x86)\LyX 2.1\Resources\dicts
Then, it is an incorrect or corrupted en_US.aff/dic files. I downloaded another version from hunspell project:
http://sourceforge.net/projects/hunspell/files/Spelling%20dictionaries/en_US/
and overwrite ir in the dicts folder, that worked for me.