home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 13 / CDA13.ISO / DOC / HOWTO / CYRILLIC.GZ / CYRILLIC
Encoding:
Text File  |  1996-06-27  |  31.6 KB  |  751 lines

  1.   The Linux Cyrillic HOWTO
  2.   Alexander L. Belikoff
  3.   v2.1, 17 September 1995
  4.  
  5.   This document describes how to set up your Linux box to typeset, view
  6.   and print the documents in the Russian language.
  7.  
  8.   1.  Introduction
  9.  
  10.   [ 27 June 1996
  11.   As far as I am concerned, this HOWTO is not being maintained by the
  12.   author any more.  If you are interested in maintaining the Cyrillic
  13.   HOWTO, or know how to contact the author, please get in touch with me
  14.   at gregh@sunsite.unc.edu ]
  15.  
  16.   This document covers the things you need to successfully typeset,
  17.   view, and print documents in Russian.
  18.  
  19.   The description is targeted primarily to the end users. While writing
  20.   it, I tried to keep the things as simple as possible. On my opinion,
  21.   it is unfair to overburden the user with the X Window System or TeX
  22.   implementation details, because she merely wants to type or view the
  23.   nice texts in Russian. However, I don't describe what the X Window
  24.   System is and how to typeset the documents with TeX and LaTeX.
  25.   Consequently, having a guru at hand for the case of potential problems
  26.   would be an advantage.
  27.  
  28.   There is some conflict between MS-DOG and Un*x Cyrillic codesets. In
  29.   MS-DOG, the most popular Cyrillic codeset is Alt (so-called
  30.   alternative codeset). In Un*x, however, the traditional codeset with
  31.   Russian characters is KOI-8. It is specified in the RFC 1489
  32.   ("Registration of a Cyrillic Character Set").
  33.  
  34.   The difference in two codesets is usage is pretty minimal (except the
  35.   TeX packages). Therefore, we will describe only KOI-8 codeset setup.
  36.  
  37.   I appreciate any comments corrections and suggestions concerning the
  38.   document.
  39.  
  40.   2.  Acknowledgments and copyrights
  41.  
  42.   Many people helped me (and not only me) with valuable information and
  43.   suggestions. Even more people contributed software to the public
  44.   community. I am sorry if I have forgotten to mention somebody.
  45.  
  46.   So, here they go: Bas V._de Bakker, David Daves, Serge Vakulenko,
  47.   Sergei O. Naoumov, Winfried Truemper.
  48.  
  49.   This document is Copyright (C) 1995 by Alexander L. Belikoff. It may
  50.   be used and distributed under the usual Linux HOWTO terms described
  51.   below.
  52.  
  53.   The following is a Linux HOWTO copyright notice:
  54.  
  55.        Unless otherwise stated, Linux HOWTO documents are copy¡
  56.        righted by their respective authors. Linux HOWTO documents
  57.        may be reproduced and distributed in whole or in part, in
  58.        any medium physical or electronic, as long as this copyright
  59.        notice is retained on all copies. Commercial redistribution
  60.   is allowed and encouraged; however, the author would like to
  61.   be notified of any such distributions.
  62.  
  63.        All translations, derivative works, or aggregate works
  64.        incorporating any Linux HOWTO documents must be covered
  65.        under this copyright notice.  That is, you may not produce a
  66.        derivative work from a HOWTO and impose additional restric¡
  67.        tions on its distribution. Exceptions to these rules may be
  68.        granted under certain conditions; please contact the Linux
  69.        HOWTO coordinator at the address given below.
  70.  
  71.        In short, we wish to promote dissemination of this informa¡
  72.        tion through as many channels as possible. However, we do
  73.        wish to retain copyright on the HOWTO documents, and would
  74.        like to be notified of any plans to redistribute the HOWTOs.
  75.  
  76.   If you have questions, please contact Greg Hankins, the Linux HOWTO
  77.   coordinator, at gregh@sunsite.unc.edu. You may finger this address for
  78.   phone number and additional contact information.
  79.  
  80.   3.  Further plans
  81.  
  82.   The next versions of this document will be accessible on
  83.   sunsite.unc.edu and tsx-11.mit.edu in HOWTO directory of the Linux
  84.   Document Project.
  85.  
  86.   I am looking forward to include more information on TeX and LaTeX as
  87.   well as much more elaborated information on printing.
  88.  
  89.   4.  Setting up the environment
  90.  
  91.   4.1.  Console
  92.  
  93.   All stuff needed for russification of the Linux console is contained
  94.   in the kbd package. The package is accessible at sunsite.unc.edu or
  95.   tsx-11.mit.edu. Usually, that package is already installed (it is a
  96.   standard part of at least Slackware distribution).
  97.  
  98.   To setup the Cyrillic stuff, one should do three things:
  99.  
  100.   1. Set the appropriate screen font. This is performed by the setfont
  101.      program. The fonts files are placed in /usr/lib/kbd/consolefonts.
  102.  
  103.      NOTE: Never run the setfont program under X or it will hang your
  104.      system. This is because it works with low-level video card calls
  105.      which X doesn't like.
  106.  
  107.   2. If you use the font in Alt coding (as I do) then you have to set up
  108.      the screen mapping program to perform automatic conversion from Alt
  109.      to KOI-8. For that purpose use the mapscrn program and the
  110.      /usr/lib/kbd/consoletrans/koi2alt file.
  111.  
  112.   3. Load the appropriate keyboard layout with the loadkeys program.
  113.  
  114.   4. Output an ESC(K escape sequence on the screen (ESC stands for the
  115.      Escape character with code 033). Only God knows the purpose of that
  116.      combination. I stole it from the Danish-HOWTO
  117.      <file://sunsite.unc.edu/pub/Linux/docs/HOWTO/Danish-HOWTO> (thanks,
  118.      Thomas Petersen) and it works for me!
  119.  
  120.   The following is an example of a script which sets up the Cyrillic
  121.   mode for console:
  122.  
  123.   #!/bin/bash
  124.   #
  125.   # load cyrillic defs for console
  126.   #
  127.   # *** NEVER TRY IT UNDER X!!! ***
  128.  
  129.   loadkeys /usr/lib/kbd/keytables/ru.map
  130.   setfont /usr/lib/kbd/consolefonts/Cyr_a8x16
  131.   mapscrn /usr/lib/kbd/consoletrans/koi2alt
  132.   echo -ne 'ESC(K'        # use the REAL ESCAPE character here !
  133.   echo "Use the right Ctrl key to switch the mode..."
  134.  
  135.   4.2.  The X Window System
  136.  
  137.   Like the console mode, the X environment also requires some setup.
  138.   This involves setting up the input mode and the X fonts. Both are
  139.   being discussed below.
  140.  
  141.   4.2.1.  The X fonts.
  142.  
  143.   First of all, you have to obtain the fonts collection having the
  144.   Cyrillic glyphs at the appropriate places.
  145.  
  146.   There is a number of such fonts on the net. The author's favorite one
  147.   is the collection VakuFonts created by Serge Vakulenko
  148.   (vak@cronyx.ru). It can be found in the collection of cyrillic stuff
  149.   for the X Window System
  150.   <ftp://ftp.funet.fi/pub/culture/russian/comp/xwin> where you can find
  151.   many useful packages for X.
  152.  
  153.   Note: Apparently, that package is included to the XFree86 version
  154.   3.1.2 as well as to the most recent public patch for the X11 Release
  155.   6. Unfortunately, the author hasn't had a chance to check it yet.
  156.  
  157.   Usually the X fonts are distributed in the BDF format which is
  158.   actually the textual font description. You should compile the fonts to
  159.   the PCF format using the bdftopcf command:
  160.  
  161.        bdftopcf -o name.pcf name.bdf
  162.  
  163.   It is also possible to compress the compiled font using the compress
  164.   program (I am not sure about the gzip support).
  165.  
  166.   Now you should do three things to set everything up:
  167.  
  168.   1. Put the compiled (and possibly compressed) fonts to the specified
  169.      directory.
  170.  
  171.   2. Recreate the list of fonts for the directory. Simply cd to it and
  172.      run:
  173.  
  174.        mkfontdir .
  175.  
  176.   You should run it once. This will upgrade the the fonts catalog file
  177.   fonts.dir.
  178.  
  179.   3. If the fonts package provides the file of fonts' aliases (usually
  180.      fonts.alias) then append it's contents to the fonts' aliases file
  181.      in the directory containing the fonts.
  182.  
  183.   4. If that directory is not already known to the X server, then you
  184.      should make it known. To achieve that, add the following commands
  185.      to the xinitrc file (either local or global one):
  186.  
  187.        xset +fp directory_with_fonts xset fp rehash
  188.  
  189.   After you have made the settings above, you can check the availability
  190.   of the new fonts by running the following command:
  191.  
  192.        xfd -fn fontname
  193.  
  194.   This should show the table of characters of the specified font.
  195.  
  196.   4.2.2.  The input translation
  197.  
  198.   The switching between the different input translations is set up by
  199.   the xmodmap program. This program allows customization of codes
  200.   emitted by various characters and their combinations. It sets the
  201.   things up based on the file containing the translation table, usually
  202.   ~/.Xmodmap.
  203.  
  204.   The following is a simplified description of input customization. If
  205.   you want to do more sophisticated tricks, refer to the xmodmap(1) or,
  206.   even better, wait for the X11 Release 7 which will address the current
  207.   input problems.
  208.  
  209.   In our case, the translation table should define two things:
  210.  
  211.   ╖  the character codes emitted by the alphanumeric characters, and
  212.  
  213.   ╖  the mode switching rules
  214.  
  215.   4.2.2.1.  The table of characters
  216.  
  217.   This is basically a sequence of directives which assign the certain
  218.   keysyms to a specified keycodes. The general syntax is the following:
  219.  
  220.        keycode code = sym1 sym2 sym3 sym4
  221.  
  222.   where code is the numerical code of the given key on the keyboard
  223.   (refer to the standard table for your system. In my case it is stored
  224.   in the file /usr/lib/X11/etc/xmodmap.std). The syms define the keysyms
  225.   emitted by that key in different conditions. Sym1 is the keysym
  226.   emitted by the key in a regular state, sym2 corresponds the key in
  227.   shifted state (usually when Shift is held down). Sym3 and sym4 define
  228.   the keysyms emitted when the Mode_switch is active for the normal and
  229.   shifted states respectively (group 2, according the X Protocol
  230.   Specification). In our case, the active Mode_switch corresponds to the
  231.   Cyrillic input mode.
  232.  
  233.   These should be either hexadecimal codes or the symbolic constants
  234.   from /usr/include/X11/keysymdef.h (without leading "XK_").
  235.  
  236.   Thus, if we wanted the key corresponding to the Latin 'a' generate the
  237.   Russian 'a' in the alternative mode, we would write the following:
  238.  
  239.   keycode 38  =  a  A  0xC1 0xE1
  240.  
  241.   The reader might be curious why I haven't used the Cyrillic_a and
  242.   Cyrillic_A constants respectively. The answer is that it didn't work
  243.   for me. I am not very familiar with the guts of the X Window System
  244.   specification, but I have the following explanation. The symbolic
  245.   constants above have the values 0x6C1 and 0x6E1 respectively. This
  246.   means that in really multi-lingual environment they could be
  247.   successfully used without overlapping with any other character set.
  248.   However the KOI-8 standard is not well suited for such environment.
  249.   Thus, since we want to retain compatible with the past, we will
  250.   violate the rules of multi-lingual support in the X Window System.
  251.  
  252.   The following is a table for the most popular russian JCUKEN keyboard
  253.   layout (these tables are derived from the ones in the VakuFonts
  254.   package):
  255.  
  256.   keysym  4             = 4               dollar          4       quotedbl
  257.   keysym  5             = 5               percent         5       colon
  258.   keysym  6             = 6               asciicircum     6       comma
  259.   keysym  7             = 7               ampersand       7       period
  260.   keysym  q             = q               Q               0xCA    0xEA
  261.   keysym  w             = w               W               0xC3    0xE3
  262.   keysym  e             = e               E               0xD5    0xF5
  263.   keysym  r             = r               R               0xCB    0xEB
  264.   keysym  t             = t               T               0xC5    0xE5
  265.   keysym  y             = y               Y               0xCE    0xEE
  266.   keysym  u             = u               U               0xC7    0xE7
  267.   keysym  i             = i               I               0xDB    0xFB
  268.   keysym  o             = o               O               0xDD    0xFD
  269.   keysym  p             = p               P               0xDA    0xFA
  270.   keysym  bracketleft   = bracketleft     braceleft       0xC8    0xE8
  271.   keysym  bracketright  = bracketright    braceright      0xDF    0xFF
  272.   keysym  a             = a               A               0xC6    0xE6
  273.   keysym  s             = s               S               0xD9    0xF9
  274.   keysym  d             = d               D               0xD7    0xF7
  275.   keysym  f             = f               F               0xC1    0xE1
  276.   keysym  g             = g               G               0xD0    0xF0
  277.   keysym  h             = h               H               0xD2    0xF2
  278.   keysym  j             = j               J               0xCF    0xEF
  279.   keysym  k             = k               K               0xCC    0xEC
  280.   keysym  l             = l               L               0xC4    0xE4
  281.   keysym  semicolon     = semicolon       colon           0xD6    0xF6
  282.   keysym  apostrophe    = apostrophe      quotedbl        0xDC    0xFC
  283.   keysym  grave         = grave           asciitilde      0xA3    0xB3
  284.   keysym  z             = z               Z               0xD1    0xF1
  285.   keysym  x             = x               X               0xDE    0xFE
  286.   keysym  c             = c               C               0xD3    0xF3
  287.   keysym  v             = v               V               0xCD    0xED
  288.   keysym  b             = b               B               0xC9    0xE9
  289.   keysym  n             = n               N               0xD4    0xF4
  290.   keysym  m             = m               M               0xD8    0xF8
  291.   keysym  comma         = comma           less            0xC2    0xE2
  292.   keysym  period        = period          greater         0xC0    0xE0
  293.  
  294.   Also, for those using the russian YAWERTY layout, I've included the
  295.   following table:
  296.  
  297.   keysym  q             = q               Q               0xD1    0xF1
  298.   keysym  w             = w               W               0xD7    0xF7
  299.   keysym  e             = e               E               0xC5    0xE5
  300.   keysym  r             = r               R               0xD2    0xF2
  301.   keysym  t             = t               T               0xD4    0xF4
  302.   keysym  y             = y               Y               0xD9    0xF9
  303.   keysym  u             = u               U               0xD5    0xF5
  304.   keysym  i             = i               I               0xC9    0xE9
  305.   keysym  o             = o               O               0xCF    0xEF
  306.   keysym  p             = p               P               0xD0    0xF0
  307.   keysym  bracketleft   = bracketleft     braceleft       0xDB    0xFB
  308.   keysym  bracketright  = bracketright    braceright      0xDD    0xFD
  309.   keysym  a             = a               A               0xC1    0xE1
  310.   keysym  s             = s               S               0xD3    0xF3
  311.   keysym  d             = d               D               0xC4    0xE4
  312.   keysym  f             = f               F               0xC6    0xE6
  313.   keysym  g             = g               G               0xC7    0xE7
  314.   keysym  h             = h               H               0xC8    0xE8
  315.   keysym  j             = j               J               0xCA    0xEA
  316.   keysym  k             = k               K               0xCB    0xEB
  317.   keysym  l             = l               L               0xCC    0xEC
  318.   keysym  z             = z               Z               0xDA    0xFA
  319.   keysym  x             = x               X               0xD8    0xF8
  320.   keysym  c             = c               C               0xC3    0xE3
  321.   keysym  v             = v               V               0xD6    0xF6
  322.   keysym  b             = b               B               0xC2    0xE2
  323.   keysym  n             = n               N               0xCE    0xEE
  324.   keysym  m             = m               M               0xCD    0xED
  325.   keysym  backslash     = backslash       bar             0xDC    0xFC
  326.   keysym  grave         = grave           asciitilde      0xC0    0xE0
  327.   keysym  equal         = equal           plus            0xDE    0xFE
  328.   keysym  3             = 3               numbersign      3       0xDF
  329.   keysym  4             = 4               dollar          4       0xFF
  330.  
  331.   4.2.2.2.  The mode switching rules
  332.  
  333.   This is basically the trickiest part of the X Cyrillic setup. You
  334.   should define the conditions in which the current mode is switched
  335.   between the regular and the Cyrillic one.
  336.  
  337.   There are two ways to achieve that in Linux. One is XFree86-specific,
  338.   while the other is more general (well, not too much, as I'll show
  339.   below).
  340.  
  341.   The XFree86-specific way is the following. There are two virtual
  342.   actions which can be assigned to the keys in the XF86Config file:
  343.   ModeShift which changes to the mode alternative to the regular one
  344.   without locking, and ModeLock which does the same but with locking. In
  345.   the first case the keys will emit the alternative keysyms only when
  346.   the key generating the ModeShift is held down, whereas in the latter
  347.   case the user needs to press the key generating the ModeLock keysym
  348.   only once and the keyboard will be generating the alternative keysyms
  349.   until that key is pressed for a second time. You should assign the
  350.   ModeShift and ModeLock keysyms to the keys you want to work the mode
  351.   switches.
  352.  
  353.   Thus, if one wants to assign the ModeShift action to the right Alt
  354.   key, she should place the following directive in her XF86Config:
  355.  
  356.   RightAlt        ModeShift
  357.  
  358.   Similarly, if the action required was ModeLock, the directive would
  359.   be:
  360.  
  361.   RightAlt        ModeLock
  362.  
  363.   See the XF86Config(4/5) for more details.
  364.  
  365.   The other way is, again, to use the xmodmap utility. This is much more
  366.   tricky. Basically what you should do is:
  367.  
  368.   ╖  Assign the Mode_switch keysym to some key, and
  369.  
  370.   ╖  Add Mode_switch to some spare modifier map
  371.  
  372.   Now the key to which the ModeShift is assigned will act as a mode
  373.   switch. This means that while it is held down, the keyboard is in
  374.   alternative mode.
  375.  
  376.   Moreover, if you add a lockable key to that modifier's map, this key
  377.   will lock the alternative mode.
  378.  
  379.   Note: There are some problems however. Serge Vakulenko
  380.   (vak@cronyx.com) pointed out that the different X Server
  381.   implementations may have different rules of assignments the mode
  382.   switches (like, for example, some servers restrict the set of the keys
  383.   which may work in toggle mode to, say, CapsLock, NumLock, and
  384.   ScrollLock). Hopefully, this is a subject to change in the next
  385.   release of the X Window System. For more details, see the X Protocol
  386.   specification.
  387.  
  388.   Let's see an example. Suppose, one wants to use the right Alt as a
  389.   mode switch and the ScrollLock as as a mode lock. First of all, one
  390.   should check the default modifiers' map. This is accomplished by
  391.   running the xmodmap without arguments:
  392.  
  393.        $ xmodmap
  394.  
  395.        xmodmap:  up to 2 keys per modifier, (keycodes in parentheses):
  396.  
  397.        shift       Shift_L (0x32),  Shift_R (0x3e)
  398.        lock        Caps_Lock (0x42)
  399.        control     Control_L (0x25)
  400.        mod1        Alt_L (0x40),  Alt_R (0x71)
  401.        mod2        Num_Lock (0x4d)
  402.        mod3
  403.        mod4
  404.        mod5
  405.  
  406.   According to the above, the plan of attack is the following:
  407.  
  408.   1. remove the Alt_R key from the mod1 map
  409.  
  410.   2. assign the Mode_switch keysym to the Alt_R key
  411.  
  412.   3. assign the Scroll_Lock keysym to the keycode 78 (the code of the
  413.      actual ScrollLock)
  414.  
  415.   4. add the Mode_switch to the spare (mod3) map, and
  416.  
  417.   5. add the Scroll_Lock keysym to the mod3 map
  418.  
  419.   Thus, here is the solution:
  420.  
  421.   remove mod1 = Alt_R
  422.   keysym Alt_R = Mode_switch
  423.   keycode 78 = Scroll_Lock
  424.   add mod3 = Mode_switch
  425.   add mod3 = Scroll_Lock
  426.  
  427.   If you use the latter solution, you may combine both the table and the
  428.   mode directives in your ~/.Xmodmap file.
  429.  
  430.   Such files are generally supplied with the various X Cyrillic stuff
  431.   packages. The good example is the tables in the perfect package by
  432.   Serge Vakulenko described above.
  433.  
  434.   Once you have such file containing the table, you should run the
  435.   command:
  436.  
  437.        xmodmap filename
  438.  
  439.   every time you start X. Modify your .xinitrc file to perform it. NOTE:
  440.   your .xinitrc can already contain the code to run the xmodmap over
  441.   your local table if the one exists.
  442.  
  443.   The table distributed with the Serge's Vakulenko package didn't work
  444.   for the author. The following patch fixed the problem:
  445.  
  446.   diff -u --new-file jcuken.xmm jcuken.xmm.mod
  447.   --- jcuken.xmm  Mon May 20 09:11:36 1991
  448.   +++ jcuken.xmm.mod      Sun Aug 13 15:44:06 1995
  449.   @@ -2,6 +2,8 @@
  450.    ! Cyrillic keyboard mapping table.
  451.    ! Produced by Serge Vakulenko, <vak@kiae.su>, Moscow.
  452.    !
  453.   +! Modified by Alexander L. Belikoff (abel@wisdom.weizmann.ac.il), 1995
  454.   +!
  455.    ! Russian JCUKENG keyboard layout implemented.
  456.    ! Cyrillic characters are entered in koi8 encoding.
  457.    !
  458.   @@ -10,7 +12,9 @@
  459.  
  460.    ! Use CapsLock as rus/lat switch key.
  461.    remove lock = Caps_Lock
  462.   -add mod2 = Caps_Lock
  463.   +keysym Caps_Lock = Mode_switch
  464.   +add mod2 = Mode_switch
  465.   +add lock = Mode_switch
  466.  
  467.    !       Key             Base            Shift           Caps    ShiftCaps
  468.    !------------------------------------------------------------------------
  469.  
  470.   This allowed me to use the Caps Lock key to switch between normal and
  471.   Cyrillic input modes.
  472.  
  473.   5.  Cyrillic support in LaTeX
  474.  
  475.   In this section I'll describe the procedure of making LaTeX typeset
  476.   Russian. LaTeX is a macro package for TeX offering the user many
  477.   useful styles, templates, and commands. If you are making your mind on
  478.   what package to use, I personally suggest LaTeX. Moreover, there are
  479.   two versions of LaTeX available - 2.09 is the old one, while 2e is a
  480.   new pre-3.0 release. If you are using LaTeX 2.09, then switch quickly
  481.   to the 2e. The latter retains compatibility with the old one, but has
  482.   much more features. Hopefully, version 3 will be released soon. So far
  483.   I describe the LaTeX 2e setup.
  484.  
  485.   I have an experience with two packages. One is the cmcyralt package by
  486.   Vadim V. Zhytnikov (vvzhy@phy.ncu.edu.tw) and Alexander Harin
  487.   (harin@lourie.und.ac.za), and the other is the LH package by the
  488.   CyrTUG group with styles and hyphenation for LaTeX2e by Sergei O.
  489.   Naoumov (serge@astro.unc.edu). I'll describe both.
  490.  
  491.   Note: Both of these packages require the Cyrillic text to be typeset
  492.   using the Alt codeset, not KOI-8! This is caused by historical
  493.   reasons, since the creators of these packages used to work with EmTeX
  494.   - the MS-DOG version of TeX (they didn't know about Linux yet :-).
  495.   Switching to the KOI-8 requires some effort and is being expected to
  496.   be done soon. So far, use some utility to convert your russian text
  497.   from KOI-8 to Alt. See section ``User's tools''.
  498.  
  499.   5.1.  Using the cmcyralt package
  500.  
  501.   The cmcyralt package can be found on any CTAN (Comprehensive TeX
  502.   Archive Network) site like ftp.dante.de. You should get two
  503.   collections: the fonts collection from fonts/cmcyralt and the styles
  504.   and hyphenation rules from macros/latex/contrib/others/cmcyralt.
  505.  
  506.   Note: Make sure you have the Sauter package installed, since cmcyralt
  507.   requires some fonts from it. You can get this package from CTAN site
  508.   as well.
  509.  
  510.   Now you should do the following:
  511.  
  512.   1. Put the new fonts to the TeX fonts tree. On my system (Slackware
  513.      2.2) I created a cmcyralt directory in the
  514.      /usr/lib/texmf/fonts/cm/. Create the src, tfm, and vf
  515.      subdirectories in it. Put there .mf, .tfm, and vf files
  516.      respectively.
  517.  
  518.   2. Put the font driver files (*.fd) from the styles archive to the
  519.      appropriate place (in my case it was /usr/lib/texmf/tex/latex/fd).
  520.  
  521.   3. Put the style files (*.sty) to the appropriate LaTeX styles
  522.      directory (in my case /usr/lib/texmf/tex/latex/sty).
  523.  
  524.   Now the hyphenation setup. This requires to remake the LaTeX base
  525.   file.
  526.  
  527.   1. The file hyphen.cfg contains the directives for both English and
  528.      Russian hyphenation. Extract the one for Russian and place it to
  529.      the LaTeX hyphenation config file lthyphen.ltx. In my case, that
  530.      file was in /usr/lib/texmf/tex/latex/latex-base.
  531.  
  532.   2. Put the rhyphen.tex to the same directory. It is needed for making
  533.      the new base file. Later, you can remove it.
  534.  
  535.   3. Do 'make' in that directory. Don't for get to make a link from
  536.      Makefile to Makefile.unx. During the make process check the output.
  537.      There should be a message:
  538.  
  539.      Loading hyphenation patterns for Russian.
  540.  
  541.   If everything goes OK, you will get the new latex.fmt in that direc¡
  542.   tory. Put it to the appropriate place, where the previous one was
  543.   (like /usr/lib/texmf/ini/). Don't forget to save the previous one!.
  544.  
  545.   This is it. The installation is complete. Try processing the examples
  546.   found in the styles archive. If you are to create the PostScript files
  547.   without any problems, then everything is OK. Now, to use Cyrillic in
  548.   LaTeX, prepend your document with the following directive:
  549.  
  550.   \usepackage{cmcyralt}
  551.  
  552.   For more details, see the README file in the cmcyralt styles archive.
  553.  
  554.   Note: if you do have problems with the examples, provided you have
  555.   installed the things right, then probably your TeX system hasn't been
  556.   installed correctly. For example, during my first try, every attempt
  557.   to create the .pk files for the russian fonts failed (MakeTeXPK
  558.   stage). A substantial investigation discovered some implicit conflict
  559.   between the localfont and ljfour METAFONT configurations. It used to
  560.   work before, but kept crashing after the cmcyralt installation.
  561.   Contact your local TeX guru - TeX is very (sometimes too much)
  562.   complicated to reconfigure it without any prior knowledge.
  563.  
  564.   5.2.  Using the CyrTUG package
  565.  
  566.   You can obtain the CyrTUG package from the SunSite archive
  567.   <ftp://sunsite.unc.edu/pub/academic/russian-studies/Software>. Get the
  568.   files CyrTUGfonts.tar.gz, CyrTUGmacro.tar.gz, and hyphen.tar.Z.
  569.  
  570.   The process of installation doesn't differ from the previous one.
  571.  
  572.   6.  Miscellaneous utilities setup
  573.  
  574.   Generally, to set the certain utility up to handle the Cyrillic
  575.   requires just to allow the 8 bit input. In some cases it is required
  576.   to tell the application to show the extended ASCII characters in their
  577.   "native" form.
  578.  
  579.   6.1.  bash
  580.  
  581.   Three variables should be set on order to make bash understand the
  582.   8-bit characters. The best place is ~/.inputrc file. The following
  583.   should be set:
  584.  
  585.   set meta-flag on
  586.   set convert-meta off
  587.   set output-meta on
  588.  
  589.   6.2.  csh/tcsh
  590.  
  591.   The following should be set in .cshrc:
  592.  
  593.   setenv LC_CTYPE iso_8859_5
  594.   stty pass8
  595.  
  596.   If you don't have the POSIX stty (impossible for Linux), then replace
  597.   the last call to the following:
  598.  
  599.   stty -istrip cs8
  600.  
  601.   6.3.  emacs
  602.  
  603.   The minimal cyrillic support in emacs is done by adding the following
  604.   calls to one's .emacs (provided that the Cyrillic character set
  605.   support is installed for console or X respectively):
  606.  
  607.   (standard-display-european t)
  608.  
  609.   (set-input-mode (car (current-input-mode))
  610.      (nth 1 (current-input-mode))
  611.      0)
  612.  
  613.   This allows the user to view and input documents in Russian.
  614.  
  615.   However, such mode is not of a big convenience because emacs doesn't
  616.   recognize the usual keyboard commands while set in Cyrillic input
  617.   mode. There are a number of packages which use the different approach.
  618.   They don't rely on the input mode stuff established by the environment
  619.   (either X or console. Instead, they allow the user to switch the input
  620.   mode by the special emacs command and emacs itself is responsible for
  621.   re-mapping the character set. The author took a chance to look at
  622.   three of them. The russian.el package by Valery Alexeev
  623.   (ava@math.jhu.edu) allows the user to switch between cyrillic and
  624.   regular input mode and to translate the contents of a buffer from one
  625.   Cyrillic coding standard to another (which is especially useful while
  626.   reading the texts imported from MS-DOG). The rustable.el (sorry, I
  627.   don't know the author of it) adds the syntax rules of Cyrillic codeset
  628.   to emacs (words' bounds, case change rules etc.) These packages can be
  629.   found at most Emacs-Lisp archives. Another one is the package remap
  630.   which tries to make such support more generic. This package is written
  631.   by Per Abrahamsen (abraham@iesd.auc.dk) and is accessible at
  632.   ftp.iesd.auc.dk.
  633.  
  634.   As for the author's opinion, I would suggest to start using the
  635.   russian.el package because it is very easy to setup and use.
  636.  
  637.   6.4.  ispell
  638.  
  639.   Check the sunsite.unc.edu:/pub/academic/russian-studies/Software for
  640.   the russian dictionary created by Neal Dalton (nrd@cray.com) for the
  641.   ispell package.
  642.  
  643.   6.5.  less
  644.  
  645.   So far, less doesn't support the KOI-8 character set, but the
  646.   following environment variable will do the job:
  647.  
  648.   LESSCHARSET=latin1
  649.  
  650.   6.6.  Netscape
  651.  
  652.   Set the following resource:
  653.  
  654.   *documentFonts*registry:        koi8
  655.  
  656.   6.7.  rlogin
  657.  
  658.   Use 'rlogin -8'
  659.  
  660.   7.  Printing
  661.  
  662.   To print the text files containing the Russian characters using on
  663.   PostScript printers, you need two things: the fonts and the 8bit-aware
  664.   software able to print the texts using those fonts. The best package
  665.   to print the text files in PostScript is a2ps by Evan Kirshenbaum
  666.   (evan@csli) and Miguel Santana (miguel@imag.imag.fr). The last version
  667.   is 8bit-aware. You can get it from imag.imag.fr:/archive/postscript/.
  668.  
  669.   Check the sunsite.unc.edu:/pub/academic/russian-studies/Software/ in
  670.   order to obtain the Cyrillic PostScript fonts. Also, there is a lot of
  671.   fonts in the SimTel <ftp://oak.oakland.edu/pub/SimTel/> collection.
  672.  
  673.   8.  Useful Tools
  674.  
  675.   8.1.  User's tools
  676.  
  677.   There are number of programs able to convert from KOI-8 to Alt and
  678.   back. You can even use the special mode for emacs (see section
  679.   ``Emacs'').
  680.  
  681.   One nice standalone package is translit. It is available at the
  682.   SunSite archive <ftp://sunsite.unc.edu/pub/academic/russian-
  683.   studies/Software>. This package is capable of converting between
  684.   different formats including the KOI-8 and the Alt ones.
  685.  
  686.   8.2.  Programmer's tools
  687.  
  688.   So far, I explained the ways to make the programs accept and display
  689.   the Cyrillic codeset. However the full localization of the system
  690.   comprises much more. All discussed above is not enough. The system
  691.   should be friendly for a user who doesn't necessarily speak English.
  692.   In my own opinion, it is not a big deal to become familiar with
  693.   English at the level of the programs' messages. However, it is not
  694.   quite fair to require it.
  695.  
  696.   Thus, the next level of localization requires the programs to be
  697.   customizable to the requirements of different languages and data
  698.   representation habits.
  699.  
  700.   Before, that was done by developing some abstraction of the messages
  701.   to output from the program's code. Now, such mechanism is (more or
  702.   less) standardized. And, of course, there are free implementations of
  703.   it!
  704.  
  705.   The good news is that GNU finally adopted the way of making the
  706.   internationalized applications. Ulrich Drepper (drepper@ipd.info.uni-
  707.   karlsruhe.de) developed a package gettext. This package is available
  708.   at all GNU sites like prep.ai.mit.edu
  709.   <ftp://prep.ai.mit.edu/pub/gnu/>. It allows you to develop programs in
  710.   the way that you can easily make them support more languages. I don't
  711.   intend to describe the programming techniques, especially because the
  712.   gettext package is delivered with excellent manual.
  713.  
  714.   So, if you are developing programs which output messages (have you
  715.   ever developed any program which didn't?), then don't be lazy to put a
  716.   little (yes, really little) effort to make your program locale-aware.
  717.  
  718.   Request for collaboration: If you want to learn the gettext package
  719.   and to contribute to the GNU project simultaneously; or even if you
  720.   just want to contribute, then you can do it! GNU goes international,
  721.   so all the utilities are being made locale-aware. The problem is to
  722.   translate the messages from English to Russian (and other languages if
  723.   you'd like). Basically, what one has to do is to get the special .po
  724.   file consisting of the English messages for a certain utility and to
  725.   append each message with it's equivalent in Russian. Ultimately, this
  726.   will make the system speak Russian if the user wants it! For more
  727.   details and further directions contact Ulrich Drepper
  728.   (drepper@ipd.info.uni-karlsruhe.de <mailto:drepper@ipd.info.uni-
  729.   karlsruhe.de>).
  730.   9.  Summary of the various useful resources
  731.  
  732.   The remap package for Emacs <ftp://ftp.iesd.auc.dk/>
  733.  
  734.   Many fonts collections for X
  735.   <ftp://ftp.funet.fi/pub/culture/russian/comp/xwin>
  736.  
  737.   Information on Cyrillic Software
  738.   <http://sunsite.oit.unc.edu/sergei/Software/Software.html>
  739.  
  740.   Useful Cyrillic packages <ftp://sunsite.unc.edu/pub/academic/russian-
  741.   studies/Software>
  742.  
  743.   The kbd package for Linux
  744.   <ftp://sunsite.unc.edu/pub/Linux/system/Keyboards/>
  745.  
  746.   X fonts collections <ftp://ftp.switch.ch/mirror/linux/X11/fonts/>
  747.  
  748.   rspell <ftp://sunsite.unc.edu/pub/academic/russian-
  749.   studies/Software/rspell.tar.gz>
  750.  
  751.