Next Previous Contents

8. Printing and PostScript

8.1 Text to PostScript conversion

Sometimes you have just a plain ASCII KOI8-R text and you want to print it just to get it on the paper. One of the easiest ways to achieve that is to use special programs converting text to PostScript.

There are a number of programs doing such conversion. I personally prefer a2ps. Originally developed as a simple text-to-PostScript converter it became a big and highly configurable program with many options and allows you to manage various page layouts, syntax highlighting etc. Another tool (now available as a part of the GNU project) is enscript.

An a2ps converter

A text to PostScript converter has been around for a while and is one of the most versatile printing tools. The author proved to be very open to suggestions, so since the release 4.9.8 a2ps supports Cyrillic right off-the-shelf. All you need is a PostScript printer.

The command I use is:

a2ps -X koi8r --print-anyway  <file>

The GNU enscript

The GNU enscript program is also designed for converting text to PostScript and it also has a non-ASCII codeset support. It doesn't have Cyrillic PostScript fonts, but it is very easy to get them, as will be explained below (thanks to Michael Van Canneyt):

  1. Install the newest enscript. As of now, the most recent release is 1.5. You may either get the one from the GNU FTP archive, or take an RPM package from the Redhat site.
  2. Now, if you are a lucky RedHat Linux user, download and install Cyrillic Textbook font.
  3. If you don't use RPM, download a file textbook.tar.gz from the Cyrillic Software collection on sunsite.unc.edu. Extract it to a directory, where enscript fonts are located (usually /usr/share/enscript). Now change to that directory and run the following command:
        mkafmmap *.afm
    
  4. The setup is finished. Try to print some text in KOI8-R Cyrillic with the following command:
        enscript --font=Textbook8 --encoding=koi8 some.file
    

If you want a really quick and dirty solution and you don't care about the output quality and all you need is just Cyrillic on the paper, try the rtxt2ps package. It is a very simple no-frills text-to-PostScript conversion program. The output quality is not very good (or, to be honest, just bad) but it does it's job.

8.2 Text to TeX conversion

If all you need is just to print an ASCII text without any additional word processing, you may try to use some programs, which would convert your Cyrillic text to a ready-to-process TeX file. One of the best programs for such purposes is translit (see section conversion ). In this case, you don't even have to bother about installing the Cyrillic fonts for TeX, since translit uses a Washington Cyrillic package, which is included in most TeX distributions (or am I wrong?)


Next Previous Contents