THE CGREEK21 REFERENCE MANUAL

Table of Contents

  1. Installation
  2. Basic Operations
  3. Using TLG CD-ROM
  4. Printing with TeX
  5. Customisation

Installation

Install the Core System

Here is the minimal procedure to use this package.

  1. Extract files

    Download the tarball and untar it under your home directory.

      % cd
      % tar xfvz cgreek21.tar.gz
    

    The above operations create the directory ~/cgreek21 and save all the necessary files there.

  2. Install the font

    The current CGreek package includes two Unicode fonts to display polytonic Greek characters. Copy ~/cgreek21/bdf/cgreek16-unicode.bdf to an appropriate font directory, e.g. /usr/lib/X11/fonts/misc, and run the mkfontdir command in that directory. Leave the other font, ~/cgreek21/bdf/cgreek24-unicode.bdf, in that directory.

  3. Rewrite ~/.emacs

    Add the following lines at the end of your ~/.emacs file.

      (setq load-path (cons "~/cgreek21" load-path))
      (load "cgreek")
    
  4. Test

    Start Emacs with the option -fn fontset-standard. Then select CGreek → Open TeX File from the menu bar and type ~/cgreek21/sample.tex for the filename. Do you see an example of multilingual text?

Install Additional Systems

So far, you have installed the core part of the CGreek package. Now you can display, enter, edit, and print multilingual text that contains Greek characters. Basic requirements are fulfilled with these functions. To get more advanced features, however, there are more procedures to be done.

If you want to read the TLG CD-ROM, you also need to install two converter programs. See Using TLG CD-ROM below.

To print Greek text with TeX, you must have Ibycus4 Greek TeX package. See Printing with TeX below for the details.

Back to Table of Contents

Basic Operations

We do not explain the basic operations of Emacs itself. If you are new to Emacs, try its online tutorial (invoked by C-h t).

Keyboard Input

  1. Greek Characters

    First, select CGreek → Input Greek from the menu. Then input Greek characters as described below.

    keyGreek
    aalpha
    bbeta
    ggamma
    ddelta
    eepsilon
    fphi
    zzeta
    heta
    qtheta
    iiota
    kkappa
    llambda
    mmu
    nnu
    xxi
    oomicron
    ppi
    rrho
    ssigma
    ttau
    uupsilon
    ypsi
    cchi
    womega

    Lowercase j gives terminal sigma and uppercase J gives iota subscriptum.

      aj = <alpha> <terminal sigma>
      aJ = <alpha + iota subscriptum>
    

    Consult the table below for various marks.

    keymark
    'smooth breathing
    vsmooth breathing
    `rough breathing
    Vrough breathing
    /acute accent
    ?grave accent
    \circumflex accent
    ^circumflex accent
    "trema
    keypunctuation
    ,Greek comma
    .Greek full-stop
    ;Greek question mark
    :Greek colon
    keyancient character
    !Sampi
    #Digamma
    $Stigma
    %qoppa
    &Qoppa

    You have to type iota subscriptum (the J key) right after the vowel, but other accents, breathings and trema can be typed in any order.

      a J ' ?   →  <alpha + iota sub. + smooth + grave>
      w / `     →  <omega + acute + rough>
    

    A key stroke preceded by C-q gives an independent character.

      a  '     →  <alpha + smooth> (1 character)
      a C-q '  →  <alpha> <'> (2 characters)
    

    We also provide an Ibycus4-like input method for Greek. If you have already learned Ibycus4, you may prefer this method. See Using Other Input Methods for the details.

  2. Latin characters with diacritical marks

    You can use any Latin input method provided by Emacs. The default is set to "latin-1-postfix". To use this input method, select CGreek → Input Latin from the menu. Then type the following keys after a Latin character.

    keymarkexample
    'acutea' = á
    `gravea` = à
    ^circumflexa^ = â
    "diaeresisa" = ä
    ~tildea~ = ã
    ,cedillac, = ç
    /miscs/ = ß

    A key stroke preceded by C-q gives an independent character.

      a '      →  <a + acute> (1 character)
      a C-q '  →  <a> <'> (2 characters)
    

    Alternatively, you can decompose the attached diacritical mark and the base character by hitting the same key twice. (This is not the case for Greek.)

      a '    →  <a + acute> (1 character)
      a ' '  →  <a> <'> (2 characters)
    

    For more information, consult the online help. To see it, type M-x quail-help when "Latin Mode" is selected from the CGreek menu. If you want to use other Latin input methods, see the section Using Other Input Methods.

    To return to the ordinary ASCII mode, hit C-\.

  3. Other languages

    The CGreek menu has two more entries for keyboard input: Input Local Language and Input Foreign Language. For historical reasons, they default to the input methods japanese and russian-jcuken, respectively. You can, however, change the bindings to any language and any input method you like. See the section Using Other Input Methods for details.

  4. Tips

    You may feel selecting the input language from the menu bar using the mouse is awkward. A quick alternative is to use function keys. The following explains how to do that.

    1. Open the file ~/cgreek21/cgreek.el.
    2. Look for the following lines in that file.
        ;(define-key global-map [f9]
        ;  (lambda () (interactive) (set-input-method cgreek-greek-im)))
        ;(define-key global-map [f10]
        ;  (lambda () (interactive) (set-input-method cgreek-latin-im)))
        ;(define-key global-map [f11]
        ;  (lambda () (interactive) (set-input-method cgreek-local-im)))
        ;(define-key global-map [f12]
        ;  (lambda () (interactive) (set-input-method cgreek-foreign-im)))
      
    3. Remove the semicolons at the beginning of line to uncomment these lines.
    4. Save the buffer and restart Emacs.

    With this setting, F9, F10, F11 and F12 will change the input language to Greek, Latin and two other languages.

Printing

CGreek21 comes with three patched Emacs Lisp files (ps-bdf.el, ps-print.el and ps-mule.el) that enable printing Greek characters as well as other characters. They convert the buffer content into PostScript and send it to the specified printer. Follow the instruction below to get a hardcopy of an Emacs buffer.

  1. Specifying the Printer

    First, you must specify the name of the PostScript printer. This is done by putting the following line in your ~/.emacs file.

      (setq ps-printer-name "ps")
    

    Do not forget to replace the printer name "ps" with the name of your PostScript printer.

    If you omit this procedure, the default printer (a printer named lp or the one specified by the environment variable PRINTER) is used for printing.

  2. Printing the Entire Buffer

    Selecting the menu CGreek → Print Buffer converts the entire buffer into PostScript and sends it to the specified printer.

  3. Printing the Specified Region

    Selecting the menu CGreek → Print Region works similar to the above, but prints only the specified region. This function is not available if region is not specified in the current buffer.

By default, these printing functions use the bitmap font etl24-unicode.bdf, which also comes with CGreek21, to print Greek characters. Therefore the quality of Greek characters is worse than that of Latin and Japanese characters, for which builtin PostScript fonts are used.

The printing quality is greatly improved if you install a larger BDF font, say 36x72 pixels. To use a font other than the default one, see the section Customising ps-print.

Another way to get high quality output is to use TeX. This CGreek package understands how Greek characters are represented in Ibycus4, which is a Greek TeX. See the section Printing with TeX for details.

File I/O

CGreek21 supports five file formats for reading and three for saving. You can activate the functions from the menu bar.

Open a file

  1. CGreek → Open TeX File

    Read a file in which Greek characters are encoded in the form of the Ibycus4 LaTeX commands and accented Latin characters in the form of the standard LaTeX command.

  2. CGreek → Open Unicode File

    Read a file saved in the UTF-8 format. Only those Unicode characters that are supported by Emacs can be read.

  3. CGreek → Open HTML File

    First read a file in. Then convert all the &xxxx; sequences into the corresponding Unicode characters.

  4. CGreek → Open WinGreek File

    Read a file assuming that characters are encoded in the WinGreek format.

  5. CGreek → Open TLG CD-ROM

    Read a file recorded on a TLG CD-ROM. To use this function, you must install tlg2emacs and tlg2cit. See the section Using TLG CD-ROM for details.

Save a buffer

  1. CGreek → Save TeX File

    Save the current buffer converting Greek characters into Ibycus4 LaTeX commands and accented Latin characters into standard LaTeX commands. This is the recommended format, even for those who are not using LaTeX and Ibycus4 because the created file contains only plain text.

  2. CGreek → Save Unicode File

    Save multilingual text in the UTF-8 format. Han characters cannot be saved in UTF-8 without a help of other facility, e.g. mule-UCS.

  3. CGreek → Save HTML File

    Unicode characters in the range of U+00A0..U+24FF, which include all Greek and accented Latin characers, are converted into the form of &xxxx; as in HTML. ASCII characters are left unchanged. Other characters are saved using the default encoding.

Back to Table of Contents

Using TLG CD-ROM

The TLG CD-ROM adopts a Latin transliteration to encode Greek (and other) characters. This transliteration is called beta code. This CGreek package includes a converter program, called tlg2emacs, that converts beta code into Emacs' internal representation.

When instructed to open a TLG file, Emacs internally invokes tlg2emacs and displays the converted text in a window. It also invokes another program tlg2cit to extract citation information intermingled with beta code.

Installation

The first thing you have to do is compile tlg2emacs and tlg2cit. You need a C development environment, i.e., a C compiler, make, lex, etc. Most of the UNIX based systems are equipped with such an environment, but you may need to install one yourself if you are using Solaris or Windows. You probably need flex (the GNU version of lex).

The compilation procedure is very simple; just cd to ~/cgreek21 and issue the command make. The program tlg2emacs and tlg2cit are created and put in that directory to be used later by Emacs.

Note that tlg2emacs is not a perfect converter; it ignores some additional information (font size, special parentheses, unusual symbols, etc.) recorded on the TLG CD-ROM. If you are familiar with beta code, you may want to write your own converter program to utilise these informations. See Customising TLG Converter to use your own converter program instead of the default tlg2emacs.

Reading TLG Files

The commands for reading TLG files assume that the TLG CD-ROM is mounted on the directory /cdrom. In other words, files must be accessible with the pathnames like /cdrom/authtab.dir, /cdrom/tlg0059.txt, etc. If this is not the case on your system, remove the leading semicolon of the following line in the ~/cgreek21/cgreek.el file and change the string "/mnt/cdrom" to an appropriate one for your system.

  ;(setq cgreek-tlg-directory "/mnt/cdrom")

If you are using TLG CD-ROM volume D, remove the leading semicolon of the following line in the ~/cgreek21/cgreek.el file.

  ;(setq cgreek-tlg-cdrom-version "D")

The default value of this variable is "E".

Now you can read TLG files by selecting the menu CGreek → Open TLG CD-ROM.

following the menu path: CGreek, Open TLG CD-ROM

It opens the list of authors in the *TLG authtab* buffer.

list of authors and their TLG  numbers

You can create your own version of author list. See Customising Author List for the details.

Hit the Enter key or click mouse-2 on an author. The list of works written by that author appears in the *tlg????.idt* buffer, where ???? is four digits representing the author. Let's call this buffer a "work list buffer". You can have more than one work list buffers.

list of Plato's works

Again, hit the Enter key or click mouse-2 on a title. The text of the work appears in another buffer with its name. Let's call this buffer "work buffer". You can have multiple work buffers. You also see another small buffer *TLG citation* in which the citation information of the cursor position is displayed.

The upper window shows a part of Respublica.  The lower
     shows the author name, the work title, the page number,
     the section number and the line number you are looking at.

Hitting the a key (stands for authors) in a work list buffer or in a work buffer brings you back to the author list *TLG authtab*.

Hitting the w key (stands for works) in a work buffer brings you back to the work list *tlg????.idt* of the same author.

Hitting the q key (stands for quit) in the *TLG authtab* buffer, in a work list buffer or in a work buffer kills that buffer.

Index Jump

Hitting the j key (stands for jump) in a work buffer takes you to the specified position within a work. Emacs asks you the destination from the highest unit (e.g., Stephanus page) via middle units (e.g., section) to the lowest unit (e.g., line). Each time you enter a number, Emacs takes you to the beginning of the text specified so far. Once you are satisfied, you can quit specifying the position with C-g.

jumping to Stephanus page 327 to 433
Back to Table of Contents

Printing with TeX

Requirements

The CGreek21 package supports TeX file I/O in the Ibycus4 style. To fully benefit from this capability, you need to install LaTeX2e and Ibycus4 on your system. LaTeX2e is available for most distributions. Ibycus4 can be installed in various ways depending on your operating system.

Debian (Etch or newer)

Issue the following command as root and everything is done.

  # apt-get install texlive-lang-greek
Vine Linux 4.1 (Thanks to Haruichi Yabuki)

Follow the instructions below if you are installing CGreek21 on Vine Linux 4.1.

  $ wget ftp://ftp.ring.gr.jp/pub/text/CTAN/fonts/greek/ibygrk.zip
  $ unzip ibygrk.zip 
  $ cd ibygrk
  $ su
  # cp -r doc/*   /usr/share/texmf/doc/
  # cp -r fonts/* /usr/share/texmf/fonts/
  # cp -r tex/*   /usr/share/texmf/tex/

Then rewrite line 48 in /usr/share/texmf/dvips/config/config.ps from

  % p +myfonts.map

to

  p +iby.map
Finally, issue the following commands.
  # cp ./fonts/map/dvips/ibycus4/iby.map  /usr/share/texmf/fonts/map/dvips/
  # cp ./fonts/map/dvips/ibycus4/iby.map  /usr/share/texmf/fonts/map/dvipdfm/
  # cp ./fonts/map/dvips/ibycus4/iby.map  /usr/share/texmf/fonts/map/xdvi
  # mktexlsr
  # updmap --enable Map=iby.map
Vine Linux 3.2 (Thanks to Masatoshi KURIYAMA)

Follow the instructions below if you are using teTex-2 included in Vine Linux 3.2.

  $ wget ftp://ftp.ring.gr.jp/pub/text/CTAN/fonts/greek/ibygrk.zip
  $ unzip ibygrk.zip 
  $ cd ibygrk
  $ su 
  # mkdir -p /usr/share/texmf-local
  # cp -rfvp doc /usr/share/texmf-local/
  # cp -rfvp fonts /usr/share/texmf-local/
  # cp -rfvp tex /usr/share/texmf-local/
  # mktexlsr
  # updmap --enable Map=iby.map

If you have installed teTex-3 (ptetex3) by yourself, change the commands after 'su' as the followings.

  # mkdir -p /usr/local/teTeX/share/texmf-local
  # cp -rfvp doc /usr/local/teTeX/share/texmf-local/
  # cp -rfvp fonts /usr/local/teTeX/share/texmf-local/
  # cp -rfvp tex /usr/local/teTeX/share/texmf-local/
  # mktexlsr
  # updmap-sys --enable Map=iby.map
Other operating systems

Download Ibycus4 from a CTAN mirror site, for example,

Read the README file in the Ibycus4 package for installation.

Save Buffer in TeX Format

Selecting CGreek → Save TeX File from the menu bar saves the current buffer into a file converting Greek characters into Ibycus4 commands and accented Latin characters into standard LaTeX commands. Characters in other character sets, e.g., Japanese characters, are left unchanged.

In the file, each segment of consecutive Greek characters is converted into Ibycus4 commands and is surrounded by \begin{greek} and \end{greek}. Accented Latin characters are converted into standard LaTeX commands representing those characters. The window, however, keeps on displaying Greek and accented Latin characters as they are.

When you create a TeX source file in which Greek and accented Latin characters are included, it is highly recommended to use this auto-conversion functionality rather than to handwrite TeX commands for those characters. There are multiple ways in TeX to represent a single Greek character and some of them may not be decoded correctly by the automated decoding. The CGreek → Save TeX File operation, on the other hand, always uses the "canonical" command forms and they are guaranteed to be decoded correctly.

Note that saving in the TeX format only transliterates Greek and accented Latin characters. You must add \documentclass{article}, \begin{document}, \end{document} and other commands to process it with TeX.

Open File in TeX Format

Files saved in the TeX format can be read in Emacs and edited afterwards. Select CGreek → Open TeX File from the menu bar. The TeX commands representing Greek and accented Latin characters are decoded automatically and appear as "actual" characters on the screen.

As warned above, this decoding process is not perfect. It can decode only "canonical" TeX commands for Greek and accented Latin characters. TeX commands you have written by hand may not be decoded correctly.

Converting TeX Commands Manually

Sometimes you get, intentionally or unintentionally, a buffer that shows raw TeX commands \begin{greek} ... \end{greek}. Visiting a TeX source file with C-x C-f is an example. You can manually convert the whole buffer or the specified region with the following commands

  M-x cgreek-tex-to-unicode-buffer
  M-x cgreek-tex-to-unicode-region

These commands first look for the string \begin{greek}, then convert the following TeX commands into Greek characters until they encounter the string \end{greek}. The strings \begin{greek} and \end{greek} themselves are deleted. They also convert the commands for accented Latin characters outside the \begin{greek} and \end{greek} into actual characters.

Reverse conversion is also possible.

  M-x cgreek-unicode-to-tex-buffer
  M-x cgreek-unicode-to-tex-region
Back to Table of Contents

Customisation

Using Other Input Methods

Each time you select a language mode from the menu bar, the value of the following variables are checked to invoke the corresponding input method.

input variable defalut value alternatives
Greek cgreek-greek-im greek-mizuochi greek-ibycus4 greek-babel-elot1000
Latin cgreek-latin-im latin-1-postfix latin-1-prefix TeX
Local cgreek-local-im japanese japanese-egg-wnn
Foreign cgreek-foreign-im cyrillic-jcuken cyrillic-jcuken-unicode

The "alternatives" above are merely suggestions. You can specify any input method you like.

The value of these variables can be changed in the ~/cgreek21/cgreek.el file. Uncomment the setq lines and rewrite the name of input method if you want.

The mapping table of greek-ibycus4 is given below.

keyGreek
aalpha
bbeta
ggamma
ddelta
eepsilon
zzeta
heta
qtheta
iiota
kkappa
llambda
mmu
nnu
cxi
oomicron
ppi
rrho
ssigma
ttau
uupsilon
fphi
xchi
ypsi
womega

A lowercase sigma followed by a space, comma, period, etc. will automatically change its shape into a terminal sigma. If you want to be explicit, j always inserts a terminal sigma and s| always an ordinary sigma.

keymark
)smooth breathing
(rough breathing
'acute accent
`grave accent
=circumflex accent
+trema
|iota subscriptum
keypunctuation
,Greek comma
.Greek full-stop
?Greek question mark
;Greek colon
((parenleft
))parenright
keyancient character
s+lower sampi
Vupper digamma
k+lower koppa
K+upper koppa

When a character carries more than one marks, type them in the following order.

  1. base character
  2. breething or trema
  3. accent
  4. iota subscriptum

A key stroke preceded by C-q makes an independent character.

  a '      →  <alpha + acute> (1 character)
  a C-q '  →  <alpha> <'> (2 characters)

Customising Author List

Not many people require the complete list of classical authors. You can create your own version of author list for author selection.

First, open the *TLG authtab* buffer from the menu and save the contents in a file with C-x C-w. Then delete unnecessary lines or move your favourite authors to the top of the list.

Next, include the following line in your ~/.emacs file.

  (setq cgreek-tlg-my-authtab-file "/your/author/list/file/name")

You can always access the original authortab file even if you have a customised one. Issue the following command in Emacs.

  M-x set-variable RET cgreek-tlg-my-authtab-file RET nil RET

Customising ps-print

You can customise the behaviour of ps-print by setting variables. Here we explain some of them. If you want to know more, consult the info pages.

Customising TLG Converter

The variable cgreek-tlg2emacs-program specifies the program that perform TLG conversion. Its default value is the string "~/cgreek21/tlg2emacs", thus pointing the default converter program tlg2emacs.

The source program is ~/cgreek21/tlg2emacs.lex, written in lex. You can modify this source to make your own converter program.

Suppose that you have installed your own converter program as /usr/local/bin/my_tlg_converter. In this case, put the following line in your ~/.emacs file to use that program instead of the default tlg2emacs.

  (setq cgreek-tlg2emacs-program "/usr/local/bin/my_tlg_converter")
Back to Table of Contents

Last modified : 31 January 2008