Re: Towards a multilingual Maxima/XMaxima under Windows



----- Original Message -----
From: "Nikolaos I. Ioakimidis" <ioakimidis at otenet>
To: "James Amundson" <amundson@fnal.gov>; "Maxima List"
<maxima@www.ma.utexas.edu>
Cc: "Nikolaos I. Ioakimidis" <ioakimidis@otenet.gr>
Sent: Tuesday, February 11, 2003 9:58 PM
Subject: Re: [Maxima] Maxima 5.9.0 has been released

"James Amundson wrote:"


> > I hope that this problem will be fixed by moving to StarKits, as was
> > suggested elsewhere on the list.

"Nikolaos I. Ioakimidis wrote:"

> This point requires some additional effort by a non-experienced
> user of Maxima. Perhaps tomorrow. Presently, I have installed
> the original (English-Western European) version of Maxima
> officially distributed with the cp1252 encoding. The English-
> Greek version (cp1253 encoding) later!

Dear Jim,
Dear Colleagues,

Next to my above comment yesterday, the good news for me is that
I have been able to work with Freewrap and I am now able to have
Maxima working with Greek both in symbols and in strings as well
as in comments (in Maxima lines and between two Maxima lines).
Unfortunately, I have not been able to work with Starkits and I
will report you the details soon. (I am disappointed, I will not
try again with Starkits in the near future, I simply failed!)

In any case, now the Maxima icon (for some reason I do not
understand) works perfectly. I am very pleased for this situation.

I will report below what I have done (sufficient for me) since
it might be of interest to you and or to some other colleague.
In principle, Maxima is multilingual now. What has been done
(and can be repeated by any interested user of Maxima/XMaxima)
has as follows (apologies for any minor errors that may be present
in these comments):

1. Download the file FREEWRAP.ZIP (version 5.5, January
2003) from

http://sourceforge.net/projects/freewrap/

following the instructions there.

2. Next unzip this file and get the file FREEWRAP.EXE. Optionally,
move this file to C:\Maxima\Maxima\bin. (This is not necessary!)

3. Edit the xmaxima file there (e.g. with the DOS EDIT editor) and
add the line (TCL command)

encoding system "/maxima/maxima/bin/cp1253"

after the line: exec wish83 "$0" "$@"

i.e. near the beginning of the file. Now XMaxima has (in advance)
the English-Greek encoding (cp1253) as a standard encoding.

4. Next save the xmaxima file with the new name xmaxima.tcl.
(Freewrap does not accept TCL files without the extension TCL
although StarKits do.)

5. Next, copy the encoding files of interest (in my present
experiment CP1250.ENC, CP1251.ENC, CP1252.ENC,
CP1253.ENC and CP1254.ENC) from the related \library\encoding
directory of the TCL program again to the C:\Maxima\Maxima\bin
directory, where (C:\Maxima) Maxima 5.9.0 is already installed.
Now all the encodings of interest to me in this particular experiment
are present.

6. Next having the freewrap.exe, the xmaxima.tcl and the encoding
files available, prepare the xmaxima.exe file as follows:

freewrap xmaxima.tcl cp1250.enc cp1251.enc cp1252.enc
cp1253.enc cp1254.enc

(in one command, please, or, e.g. C:\Freewrap-5.5\freewrap ,
etc. at the beginning of this command if freewrap.exe is elsewhere.
Moreover, one can use just one encoding, e.g. cp1251.enc for
Cyrillic or different and/or additional encodings.)

(Naturally, it would be nice to have the old xmaxima.exe file
saved under another name since this command leads to its
loss.) Verify that a new xmaxima.exe file has been created
through the DIR command once or twice. The new xmaxima.exe
file is now ready (and much longer, unfortunately, than the
original one).

7. Start Maxima from its icon or through a Run command as
usual. Now Maxima (in XMaxima I mean) is able to write
both in English and in Greek (both single symbols and strings
and whole phrases either in comments or between the input
lines, in the Notebook style, change through ALT+SHIFT
or through the mouse as usual).

8. From the menu Options-> Show Tcl Console of XMaxima
open the TCL console and give the following TCL command in it

encoding system

The output should be

/maxima/maxima/bin/cp1253

i.e. the encoding cp1253, i.e. the English-Greek encoding
is used now (exactly as XMaxima.tcl has been already
informed).

9. For the change of this encoding to other encodings,
for example to cp1250, one command of the follwing form
can be given in the next line of the TCL console

encoding system "\maxima\maxima\bin\cp1252"

(or with 1250, 1251, 1253, 1254 instead of 1250).
Now the encoding 1252 has been selected.
Returning to XMaxima, one can now use this encoding
for writing strings, Maxima comments or comments
between two Maxima lines in the cp1252 encoding.

10. Further changes in the same way are easily possible.
(The upper arrow in the TCL console repeats the previous
line, just one number should change.) The look of a part of
my TCL console has as follows:

(Desktop) 4 % encoding system "/maxima/maxima/bin/cp1250"
(Desktop) 5 % encoding system "/maxima/maxima/bin/cp1251"
(Desktop) 6 % encoding system "/maxima/maxima/bin/cp1252"
(Desktop) 7 % encoding system "/maxima/maxima/bin/cp1254"
(Desktop) 8 % encoding system "/maxima/maxima/bin/cp1253"

11. In this way, I have been able to prepare (in the display
only) an XMaxima session with formulae (with both English
and Greek symbols) and text including (simultaneously in
XMaxima)

(i) the English language (all encodings include ASCII)

(ii) the Greek language (the cp1253 encoding)

(iii) the Western European languages (the cp1252 encoding)

(iv) the Eastern European languages (the cp1250 encoding)

(v) the Cyrillic languages (the cp1251 encoding) and

(vi) the Turkish language (the cp1254 encoding)

Additional encodings are also possible. To be sincere,
frequently one feels excellent with English and his
own encoding or with English and the Greek encoding
(just for single symbols in the commands and the output).
This will permit a much shorter xmaxima.exe final
executable file.

I have not been able to move these results elsewhere
so far, but I have printed them by using the PrintScreen
keyboard command and MS-Word or even Acrobat
Distiller. Probably, one can also prepare multilingual
DVI tex files by using TeX, of course taking care of the
fonts (i.e. changing fonts if necessary).  For me the Greek
fonts I use are generally sufficient.

The conclusion is that XMaxima can become multilingual
(even in the same session or even the same comment line)
without much effort, but, in the simplest case, it can use
the language the user prefers (change in the maxima TCL
file at first) or the Greek symbols in commands and output
(restriction: single Greek symbols and general strings only).

I do not know if some colleague would be interested
in this approach, which is a slight extension of what I have
done in the past, but now with your excellent Maxima 5.9.0.
(Many sincere thanks again. Nothing would have been
done without your efforts and final success and I am happy!)

If there is any interest by some colleague, with Mike's
precious help, I might be able to proceed a little by
preparing a new (additional) menu in XMaxima for
the choice of the encoding, i.e. the language of the user
and/or Greek for the Greek symbols.

Please, be so kind to forgive me for any omissions
or errors in the above comments. On the other hand,
I do not know whether these comments constitute a
repetition of the work of other colleagues in the past,
but for me I have to prepare Greek Maxima Notebooks
(with both English and Greek symbols and strings and
comments in command lines and between the command
lines) and this has been achieved last year and now again
with Maxima 5.9.0. It is absolutely indispesable for my
students to be able prepare their Maxima Notebooks either
at the University or at home by using both Greek text and
Greek symbols.

Any help, comments and suggestions are, naturally, very
welcome. My report on my failure with StarKits (in a
similar effort) will follow soon, but it is of little interest now.

With many sincere thanks again and best regards from Patras,

Nikos