Root
Configuring Lyx for cyrillic input
Centibyte.org Last modified: April 23, 2004

Doug Johnson

Setting up cyrillic in lyx

Actually its pretty easy: you don't have to mess around with X11 keyboard settings or anything ; -)

Here's how:

  1. Install some koi8 fonts. You'll need both TEX and X11 fonts (called 'screen fonts' by lyx). For the screen fonts, I was able to get MS Times New Roman working, I couldn't get other fonts working :P If you're running Debian, do 'apt-get install msttcorefonts'. For the tex fonts, do 'apt-get install scalable-cyrfonts-tex'
  2. Run lyx
  3. Do edit->preferences, select 'Look & Feel', then 'Screen Fonts'. Change 'Roman' from '-*-roman' to '-*-times new roman'
  4. Change 'Encoding' to koi8-r'.
  5. Now select 'Lang Opts' then 'Language'. Change 'Default language' to russian.
  6. Change 'Package' from '\userpackage{babel}' to '\usepackage[russian]{babel}'
  7. Select 'Keyboard map', then set '1st' to '/usr/share/lyx/kbd/koi8-r.kmap' (if the file doesn't exist in that path, look for it by doing 'find /usr -name "koi8-r.kmap"'.)
  8. do 'Apply' then 'Save'.
  9. Try hitting some keys. If everything went ok (and I remembered all the steps :P) nice cyrillic characters should begin appearing in the document. If you upper case and lower case seem to be backwards, you might have a mismatch between the input and display encodings. If it says it couldn't find a font and is using 'fixed' instead, it means it isn't finding any fonts that match the pattern in step 3. I was only able to get ms fonts working for now...

Note: It's important that the encoding for the screen fonts is the same encoding as the keyboard map. Since lyx only seems to come with a koi8 keymap, and no cp1251(ms windows) keymap, you have to use koi8 fonts. Actually, the keyboard map files are just text files, you could whip up a cp1251 version from the koi8 version pretty easy. blah. Todo: need to fool around with this a little more. why aren't the cronyx fonts working? they claim to use koi8, but lyx doesn't find them. hmm...

I was even able to print! yay!

I can't guarentee that this will work for anyone else ;)

I'm using Lyx 1.1.6.

This page is very alpha. I promise I'll go through later and make it readable ;-)

Ok, this works find and dandy... but there's no quick way to switch back to english mode. Fortunately this is easily remedied. Simply move the directory ~/.lyx to ~/.lix-ru, and start lyx up. This will generate a new ~/.lyx directory, using the default english settings. Once you have done this, you can run lyx in english mode by doing 'lyx', and run in cyrillic mode by doing 'lyx -userdir ~/.lyx-ru'.

One time setup:

cd ~
mv .lyx .lyx-ru
# Run lyx and exit right away.
lyx

After you have done the above, put the following in your ~/.bashrc or ~/.bash_profile files:

 
alias lyx-ru='lyx -userdir ~/.lyx-ru'

Now log out and log back in. Try running 'lyx'. You should be able to enter english characters. Now exit and run 'lyx-ru'. You should be able to enter cyrillic characters.

Site design and original content (c)2000-2004 Doug Johnson, Webmaster.
All other stuff copyright its respective owner.
Validate XHTML 1.0 with W3