Here is the minimal procedure to use this package.
Download the tarball from ftp://ftp.m17n.org/pub/cgreek/cgreek-meadow.tar.gz and untar it under your home directory.
% cd % tar xfvz cgreek-meadow.tar.gz
The above operations create the directory ~/cgreek-emacs20 and saves all the necessary files there.
Add the next line at the end of your ~/.emacs file.
(load "~/cgreek-meadow/dotemacs")
Start a new Meadow session and look for the "CGreek" entry in the menu bar. Select CGreek → Open File → CGreek Format from the menu bar and type ~/cgreek-meadow/sample.txt for the filename. Do you see an example of multilingual text? Also try shift + mouse1 → Fontset → cgreek14 and shift + mouse1 → Fontset → cgreek24 to change the font size. Japanese characters are visible only with fontset-cgreek16. See the section Installing Japanese Fonts to use Japanese fonts in 14- and 24 pixels.
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.
We do not explain the basic operations of Meadow itself. If you are new to Meadow, try its online tutorial (invoked by C-h t).
First, select "Greek Mode" from the CGreek menu. Then input Greek characters as described below.
key | Greek |
---|---|
a | alpha |
b | beta |
g | gamma |
d | delta |
e | epsilon |
f | phi |
z | zeta |
h | eta |
q | theta |
i | iota |
k | kappa |
l | lambda |
m | mu |
n | nu |
x | xi |
o | omicron |
p | pi |
r | rho |
s | sigma |
t | tau |
u | upsilon |
y | psi |
c | chi |
w | omega |
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.
key | mark |
---|---|
' | smooth breathing |
v | smooth breathing |
` | rough breathing |
V | rough breathing |
/ | acute accent |
? | grave accent |
\ | circumflex accent |
^ | circumflex accent |
" | trema |
key | punctuation |
---|---|
, | Greek comma |
. | Greek full-stop |
; | Greek question mark |
: | Greek colon |
key | ancient 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.
You can use any Latin input method provided by Meadow. The default is set to "latin-1-postfix". To use this input method, select "Latin Mode" from the CGreek menu. Then type the following keys after a Latin character.
key | mark | example |
---|---|---|
' | acute | a' = á |
` | grave | a` = à |
^ | circumflex | a^ = â |
" | diaeresis | a" = ä |
~ | tilde | a~ = ã |
, | cedilla | c, = ç |
/ | misc | s/ = ß |
A key stroke preceded by C-q gives an independent character.
e ' → <e + acute> (1 character) e 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.)
e ' → <e + acute> (1 character) e ' ' → <e> <'> (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-\.
The default input method for Japanese is set to a simple method called "japanese". See the section Using Other Input Methods to change this.
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.
;(global-set-key [f10] 'cgreek-greek-mode) ;(global-set-key [f11] 'cgreek-latin-mode) ;(global-set-key [f12] 'cgreek-japanese-mode)
With these procedures, F10, F11 and F12 will change the input language to Greek, Latin and Japanese, respectively.
The Emacs command ps-print prints Greek characters as well as other characters. This command converts the buffer content into PostScript and send it to the specified printer. ps-print understands several text properties such as underline, italic, etc. Colours are also reproduced if you are using a colour 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.
Selecting the menu CGreek → Print → Buffer converts the entire buffer into PostScript and sends it to the specified printer.
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, ps-print uses the bitmap font cgreek24.bdf, which is shipped with the CGreek distribution, 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 Greek font of the size 36x72 pixels (or larger). To let ps-print use fonts other than the default ones, 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.
The current version supports three file formats for writing and four for reading. You can activate the functions from the menu bar.
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.
Save multilingual text in a 7 bit encoding, using private escape sequence. This format is an extension of the ISO 2022 standard.
Save monolingual Greek text in the WinGreek format. Characters not supported by WinGreek are destroyed. Note that you cannot save other than Greek in this format.
Read a file in the TLG CD-ROM. To use this function, you must install tlg2emacs and tlg2cit. See the section Using TLG CD-ROM for details.
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.
Read a file saved by CGreek → Save Buffer → CGreek Format. See above.
Read a file assuming that characters are encoded in the WinGreek format.
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 Meadow's internal representation.
When instructed to open a TLG file, Meadow 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.
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 ~/cgreek-meadow/tlg and issue the command make. The program tlg2emacs and tlg2cit are created and put in that directory to be used later by Meadow.
Note that tlg2emacs is not a perfect converter; it ignores some additional information (font size, special parentheses, unusual symbols, etc.) saved 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.
The commands for reading TLG files assume that the TLG CD-ROM is inserted in Drive C. In other words, files are accessible with the names like C:\authtab.dir, C:\tlg0059.txt, etc. If this is not the case in your system, add the following line in your ~/.emacs file.
(setq cgreek-tlg-directory "D:\\")
Change the drive name "D" with an appropriate one for your system. Do not forget the final \\.
If you are using TLG CD-ROM volume D, add the following line in your ~/.emacs file as well.
(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 File → TLG Format. It opens the list of authors in the *TLG authtab* buffer.
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.
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.
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.
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.
As described above, you can automatically convert from beta code into Meadow's representation when you open a TLG file. In some cases, however, you may have a fragment of unconverted beta code in a buffer and need to convert it afterwards. A typical example is the case that you look up a certain segment in a TLG file with some other TLG browsing software and copy the necessary region from that browsing software to Meadow.
You can manually convert the region from beta code into Greek characters by selecting CGreek → Convert Region → TLG to CGreek from the menu bar. To convert the whole buffer, just set region to the entire buffer.
This CGreek 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. Neither Latex2e nor Ibycus4 are bundled in this CGreek package, but both of them should be found on any CTAN site, for example,
Read their documentations for installation.
Selecting CGreek → Save Buffer → TeX Format 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 TeX → CGreek conversion. The automated conversion functionality, 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.
Files saved in the TeX format can be read in Meadow and edited afterwards. Select CGreek → Open File → TeX Format 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.
Sometimes you create, 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 specified region by selecting CGreek → Convert Region → TeX to CGreek from the menu bar.
This command first looks for the string \begin{greek}, then converts the following TeX commands into Greek characters until it encounters the string \end{greek}. The strings \begin{greek} and \end{greek} themselves are deleted. In addition to Greek, it also converts the commands for accented Latin characters into actual characters.
If you want to convert only either Greek or accented Latin, use the following commands. The command name tells you what it does.
M-x tex-to-cgreek-buffer M-x tex-to-cgreek-region M-x tex-to-latin1-buffer M-x tex-to-latin1-region
Reverse conversion is also possible.
M-x cgreek-to-tex-buffer M-x cgreek-to-tex-region M-x latin1-to-tex-buffer M-x latin1-to-tex-region
We have successfully installed Ibycus4 over ASCII's platex. No information has been reported about NTT's jTeX. We welcome any information about this matter.
When "TeX Format" is selected for file I/O, Japanese characters are written out or read in using the japanese-shift-jis coding system by default. If you prefer Japanese EUC for file I/O, include the following line in your ~/.emacs file.
(setq cgreek-tex-coding-system 'japanese-iso-8bit-cgreek)
If you prefer the iso-2022-7bit format (so called the JIS format), use the following line instead.
(setq cgreek-tex-coding-system iso-2022-7bit-cgreek)
The two commands CGreek → Highlight Greek and CGreek → Unhighlight Greek turns on and off the highlighting of Greek characters. This functionality helps to distinguish some Greek characters from Latin characters otherwise difficult or impossible to do so. For example, Greek capital letter ALPHA and Latin capital letter A are a such pair. Greek question mark and ASCII semicolon is another.
The situation in which such a distinction is most important would be apostrophes and parentheses in a TeX source. The result of typesetting may be greatly affected if you use wrong characters. Try to to check the source with highlighting when you are curious about the quality of TeX outputs.
The commands invoked by CGreek → Save Buffer → WinGreek Format and CGreek → Open File → WinGreek Format are based on the codepoints defined in the WinGreek font. These commands are not well tested.
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.
language | variable | defalut value | alternative |
---|---|---|---|
Greek | cgreek-greek-input-method | "cgreek" | "greek-ibycus4" |
Latin | cgreek-latin-input-method | "latin-1-postfix" | "latin-1-prefix" |
Japanese | cgreek-japanese-input-method | "japanese" | "MW32-IME" |
For example, if you prefer the Ibycus4-style for Greek input, include the following line in your ~/.emacs file.
(setq cgreek-greek-input-method "greek-ibycus4")
The mapping table of greek-ibycus4 is given below.
key | Greek |
---|---|
a | alpha |
b | beta |
g | gamma |
d | delta |
e | epsilon |
z | zeta |
h | eta |
q | theta |
i | iota |
k | kappa |
l | lambda |
m | mu |
n | nu |
c | xi |
o | omicron |
p | pi |
r | rho |
s | sigma |
t | tau |
u | upsilon |
f | phi |
x | chi |
y | psi |
w | omega |
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.
key | mark |
---|---|
) | smooth breathing |
( | rough breathing |
' | acute accent |
` | grave accent |
= | circumflex accent |
+ | trema |
| | iota subscriptum |
key | punctuation |
---|---|
, | Greek comma |
. | Greek full-stop |
? | Greek question mark |
; | Greek colon |
(( | parenleft |
)) | parenright |
key | ancient character |
---|---|
s+ | lower sampi |
V | upper digamma |
k+ | lower koppa |
K+ | upper koppa |
When a character carries more than one marks, type them in the following order.
A key stroke preceded by C-q makes an independent character.
a ' → <alpha + acute> (1 character) a C-q ' → <alpha> <'> (2 characters)
If you want to use MW32-IME for Japanese input, modify the ~/cgreek-meadow/dotemacs.el file. First, find the following lines in it.
;(set-language-environment 'japanese) ;(set-keyboard-coding-system 'sjis-dos) ;(mw32-ime-initialize) ;(setq mw32-ime-mode-line-state-indicator "[--]") ;(setq mw32-ime-mode-line-state-indicator-list '("--" "[あ]" "[--]")) ;(setq cgreek-japanese-input-method "MW32-IME")
Remove the semicolons at the beginnig of line and restart Meadow. Then MW32-IME is used for Japanese input.
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
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.
Each ps-print page comes with a header by default. If you prefer simpler style, include the following line in your ~/.emacs file.
(setq ps-print-header nil)
The font size in ps-print is controlled by the variable ps-font-size. Put the following line in your ~/.emacs file to change the font size to 10 point.
(setq ps-font-size 10)
You need to prepare a bigger bdf font to get better quality in printing Greek characters. A font of the size 36x72 pixels should make you satisfied.
Several tools are available to create or modify bdf fonts. For example, bdfresize can be used to magnify or shrink bdf fonts. Another program called xmbdfed has a good user interface for font design. Both programs should be easily found using a Web search engine.
Once you have created a new bdf font, save it under the directory ~/cgreek-meadow/bdf with an arbitrary name, say, mycgreek.bdf.
Then you rewrite the file ~/cgreek-meadow/dotemacs.el. Look for the following line.
(cons '(cgreek (normal bdf "cgreek24.bdf" MuleCGreek 1))
Replace the string "cgreek24.bdf" with "mycgreek.bdf" so that the line looks like the following.
(cons '(cgreek (normal bdf "mycgreek.bdf" MuleCGreek 1))
With this new definition, Meadow will use mycgreek.bdf to print Greek characters.
In TeX files, the four symbols ª, º, « and » are converted as shown below.
symbol | TeX command |
---|---|
ª | $\\mathrm{^{\\underline{a}}}$ |
º | $\\mathrm{^{\\underline{o}}}$ |
« | $\\ll$ |
» | $\\gg$ |
You can change these definitions by setting the following variables.
symbol | variable name |
---|---|
ª | texcommand-feminine-ordinal-indicator |
º | texcommand-masculine-ordinal-indicator |
« | texcommand-left-pointing-guillemet |
» | texcommand-right-pointing-guillemet |
For example, the symbol ª will be printed without underline if you put the following line in your ~/.emacs file. (Do not forget that "\" must be written as "\\" in Emacs Lisp.)
(setq texcommand-feminine-ordinal-indicator "$\\mathrm{^{a}}$")
Here are some examples to customise the highlighting of Greek characters.
Add the following line in your ~/.emacs file.
(setq-default cgreek-highlight-switch t)
Add the following line in your ~/.emacs file.
(setq cgreek-greek-text-property 'underline)
(make-face 'cgreek-myface) (set-face-foreground 'cgreek-myface "magenta") (set-face-background 'cgreek-myface "lightgreen") (set-face-underline-p 'cgreek-myface t) (setq cgreek-greek-text-property 'cgreek-myface)
The first and the last lines need not be changed. The second line sets the foregroud colour to magenta and the third line makes background lightgreen. The fourth line adds underline to the highlighted string.
The variable cgreek-tlg2emacs-program specifies the program that perform TLG conversion. Its default value is the string "~/cgreek-meadow/tlg/tlg2emacs", thus pointing the default converter program tlg2emacs.
The source program is ~/cgreek-meadow/tlg/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")
Since the size of a Japanese font is so big, this CGreek package does not contain Japanese fonts other than 16 pixels. You have to install the following four fonts to use Japanese in the 14- and 24 pixels environments.
national standard | width (in pixels) | font file example |
---|---|---|
JISX0201-1976 | 7 | 7x14rk.bdf |
JISX0201-1976 | 12 | 12x24rk.bdf |
JISX0208-1983 | 7 | k14.bdf |
JISX0208-1983 | 12 | jiskan24.bdf |
The font files shown in the example column should be found at any FTP site of the X Window System, most often in the directory xc/fonts/bdf/misc. You can use other Japanese fonts if the pixel size matches.
Store the font files in the directory ~/cgreek-meadow/bdf and restart Meadow. Now you see Japanese characters of the size 14- and 24 pixels.