How to set up thesaurus in TexStudio?
A tiny note:
I did this on Windows, but I don't see this being much different for whichever OS you are using (Ubuntu, from the comments?). Also for the record, this is on TeXstudio 2.12.6 (hg 6632:7777b2b8a906).
This solution is largely inspired by another one from StackOverflow, but I will supplement this with pictures, and to provide an answer here in TeX.SE. Hopefully this will be sufficient and clear enough to answer future questions about thesauruses in TeXstudio.
With that out of the way,
Step 1. Obtain the database files for the thesaurus of your desired language. Admittedly, this might be the harder step of the two due to the lack of thesaurus databases out there. TeXstudio suggests two sites to look at (these links are clickable from within TeXstudio's options as well):
- OpenOffice
- LibreOffice
If you already have a database (.dat
file), then skip ahead to Step 2. If you can't find one in your language, I don't think there's much you can do except to create the database yourself?
Here I provide an example for English. As of August 2017, it seems that the most updated English database is one from LibreOffice, found here, last updated Jul 2017. (The official project website can be found here.)
(Yes, it does say that it is a dictionary, but it works fine as a thesaurus as well.)
Go ahead and download the .oxt
file. If you extract this .oxt
file, using 7Zip or the likes, you should see a th_en_US_v2.dat
and th_en_US_v2.idx
file.
Step 2. Copy the .dat
and .idx
files to a convenient folder for you. I would recommend placing it in a folder named thesaurus
within your TeXstudio folder, (for Windows)
~\AppData\Roaming\TeXstudio\thesaurus
To find this directory quickly, you can try these steps:
Step 2a. Under TeXstudio options, navigate to:
Configure TeXstudio -> Language Checking -> 'Spell Check' section
and see the directory for your Spelling Dictionary Directories
(indicated by the longer red box). By default, this should link you to a dictionaries
folder within your TeXstudio parent folder.
The end result should be the .dat
and .idx
files being in a particular folder (the texstudio\thesaurus
folder, in my case).
Step 3. The final step is to copy the directory of the thesaurus .dat
file and paste into the Thesaurus Database
entry in the TeXstudio options. Another (quicker) way is to click the icon (indicated by the small black box) in the above picture, and navigate to the folder containing the thesaurus files.
Choose the .dat
file, click ok and you're done!
Step 4. If you set everything up correctly, then it should work when you give it a test. See the following:
Right clicking on the word (in this case, happy
) that you want to search the thesaurus for:
and getting a window that pops up:
An alternative (default) keyboard shortcut for this is Ctrl+Shift+F8, which opens up the same thesaurus window for the word your cursor is currently sitting on.