home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / docs / cyrillic < prev    next >
Encoding:
Text File  |  1996-07-11  |  31.4 KB  |  744 lines

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