Hunspell dictionaries (.dic
and .aff
) are more complex than just word lists (i.e. it contains information of possible affixes). Therefore, a proper entry cannot be generated from a single word.
The solution in TexStudio is to store additional words in an ignore word list (.ign
) next to the dictionary. This list can be populated via Context Menu -> always ignore
or via the Always Ingore
button in the spell checking dialog.
Note: On Windows 7 the default dictionaries are in
C:\Program Files (x86)\TeXstudio\dictionaries\
Windows 7 prevents writing to the program files directory.It redirects the writes to User dictionaries, which are in
C:\Users\<User>\AppData\Local\VirtualStore\Program Files (x86)\TeXstudio\dictionaries
You may find the .ign
files there.
For that, you will have to make use of a custom .cwl file (which, afaik, requires a recent version of TeXstudio).
Create a file, let's say mycwl.cwl
, in either %appdata%\texstudio\completion\user
or .config/texstudio/completion/user
according to your system.
In it, place the following line:
\alternative{label}#r
and save it. Technically, you can put anything meaningful in the argument, but some terms are reserved and have special meaning. And, as you wish TeXstudio to recognize a label there, you require one of those, namely label
. The comment at the end of the line tells TeXstudio what kind of command yours is. #r
stands for this command declares a reference like "\ref{key}"
. For further commands, just add a new line to your mycwl.cwl
.
Then, in TeXstudio, go to Options
-> Configure TeXstudio
-> Completion
and check mycwl.cwl
on the list (crucial). And that's about it.
For more details on customizing autocompletion with cwl files, check the TeXstudio manual, section "4.13 Description of the cwl format".
A tip: If the manual seems complicated, and you'd like to emulate the behavior of some command's autocompletion you like, you might want to download the sourcecode tarball at http://texstudio.sourceforge.net/, unpack it and look at the built-in cwl files in the "completion" folder. From there, you can proceed by means of examples of your commands of interest.
Best Answer
TeXstudio only has a command completion (based on the cwl files). There is no word completion (also not for words that already appear in the document).
You can however achieve something similar for fixed word lists by scripting.