Tuesday, November 2, 2010

A geeky note about multilingual support for WinEdt 6.0

So WinEdt 6.0 has been out for a while now. It's a good piece of software, and I've been using various versions of WinEdt since 2003 (sometimes I use emacs with auctex, but for larger projects, I definitely prefer WinEdt).

Anyway, if you often switch between languages, you have to play around to get WinEdt to open your files with appropriate dictionaries. This is where modes kick in. It so happens that the explanation that WinEdt provides for this stuff isn't too clear, so here is a step-by-step procedure that will get you multilingual support for WinEdt 6.0.

  1. Download appropriate dictionaries. They are available here. Extract (if needed) and save the file(s) somewhere. It doesn't really matter where, just make sure you know where it is. Say you want to install Polish and download pl_huge.dic saving it at C:\Program Files\WinEdt Team\WinEdt\Dict\pl_huge.dic.
  2. Run WinEdt 6, go to Options. Under Editor: Mouse, Modes, Defaults you will find Modes. Open the file.
  3. Now, what I do, is I look at the submodes and add a line: MODE=":PL|*.pl.tex" This creates a submode PL which is assigned automatically to all files ending with .pl.tex
  4. I also replace corresponding lines for US and UK English, using: MODE=":UK|*.uk.tex" and MODE=":US|*.us.tex"
  5. That way, whenever I have a file in Polish I save it as, if I have a file in American English, I save it as, and so on.
  6. This sets the modes right. Now dictionaries. In the Options tree go to Dictionary Manager and then to Word Lists.
  7. Then you add something like this to the list:
FILE="C:\Program Files\WinEdt Team\WinEdt\Dict\pl_huge.dic"

The first line just gives your setting a name. The second locates the dictionary file (that's why you need to remember where you saved it). The mode filter tells you for which modes this dictionary is active.

8. Now you also have to turn off your English dictionaries for the Polish file and switch them on for US and UK submodes. That is, you look at all English dictionaries listed and make sure their mode filter contains appropriate submode. Thus, for example:

DICTIONARY="English (common)"

Then, you save all the changes you've made in the options sections, restart WinEdt to make sure it loads its settings anew and check if language selection works properly. Make sure the files you use have appropriate extensions.

If you think something's still off, feel free to include mode declaration in the beginning of each file. Just include % -*- TeX:US -*- (or % -*- TeX:PL -*- or...) in your preamble.

1 comment:

Álvaro González said...

Thank you, Rafal, for posting this! It worked fine to me. Best regards, Álvaro.