Support of Greek characters in Maxima/XMaxima under MS-Windows
Subject: Support of Greek characters in Maxima/XMaxima under MS-Windows
From: Nikolaos I. Ioakimidis
Date: Sun, 8 Sep 2002 19:41:34 +0300
Dear Mike,
Dear colleagues,
This is a report (further to a message of mine to Mike Clarkson)
on what I have done so far (I believe successfully) with the
support of all of the Greek characters (lower-case and capital
even the accented ones) under the MS-Windows Millenium
environment by using Maxima and XMaxima in Patras, Greece.
The Maxima release used has been 5.5 beta.
Greek characters appear quite frequently in mathematical, physical
and engineering problems and are already supported by Mathematica
(this is doubtful for Maple although they appear on the display).
Therefore, the present report may be of a more general interest to the
Maxima community. (For me it is a "must" to have the Greek characters
supported, since I and my students will thus be able to have them
available both in commands and in answers, but also in the comments
preceeding the commands and explaining the problem and what the
commands intend to do.)
I worked in a naive way. The steps I have followed are:
1. I have taken the xmaxima.tcl file out of the xmaxima.exe file available
to me in release 5.5. (This has been an easy task.)
2. I modified this tcl file by adding (at the beginning, but after the
introductory commands) the simple tcl command
encoding system "/maxima/cp1253"
in this way having essentially changed the encoding from cp1252
(English and Western European that Freewrap supports) to
cp1253 (English and Greek). I put also a notice of modification
by me in the new xmaxima.tcl file.
3. I copied the cp1253.enc short file from the tcl/tk distribution
to the basic maxima directory (in my case c:\maxima) son that
it can be available at least to Freewrap (perhaps constantly in
the new xmaxima.exe executable file under preparation).
4. I appropriately used freewrap.exe to prepare a modified
xmaxima.exe file by using (in MS-Windows) the command
freewrap xmaxima.tcl -e \maxima\cp1253.enc
(depending on where freewrap.exe is available). This resulted
in the preparation of a new (modified) xmaxima.exe Windows
executable file with full support of the English-Greek cp1253.enc.
5. In the ordinary way, but with the cp1253.enc file available in
the \maxima directory (this may not be necessary) and the new
xmaxima.exe file also available in the \maxima\maxima\src
directory (in release 5.5 and in my installation) everything went
O.K. and I have been able to use the Greek characters in
both comments and inputs and have them also available in the
Maxima output. It is understood that a font supporting Greek
(such as all the standard Windows fonts: Arial, Times, etc.)
should be used, but in Maxima one has to use a fixed-point
font (in order to keep the vertical alignment) and the Courier
New (perhaps Bold) font seems to be the best possibility. The
change of font has been made through the netmath.ini file. An
xmaxima.ini file can also be used instead. (I am looking for a
better possibility, but the xmaxima menu presents problems
in my installation.) That's all!
6. If one wishes to teach Maxima to use (always!) the Greek
pi for the %pi symbol, one should also use the alias command
alias(just the Greek pi should be here, %pi).
In this way, one can easily (without any special fonts, just the
Windows Courier New Bold font) use any Greek symbol in
Maxima under MS-Windows. Therefore, strange symbols such as
theta (for an angle) and omega (for the circular frequency), etc.,
etc. can be completely avoided. Printing (through Notepad
and the prepartion of PDF files has been also achieved without
any difficulty.)
7. The above approach (with the cp1253.enc) supports only
English and Greek (simultaneously of course). For the support
of the Western European languages too one has to change the
encoding back by moving to the tcl console of XMaxima and
giving the command
encoding system identity
(Only this has been successful.) Now the Greek alphabet is not
supported any more. (We are back to the Western European
characters in XMaxima.) A new change (to the Greek alphabet)
can be made by similarly using the command
encoding system cp1253
again in the tcl console of XMaxima to return to the English-
Greek alphabets and so on if the simultaneous support of
English-Greek and Western European characters is required
in the same XMaxima session. Unfortunately, now this happens
only with the display and no printing has been possible (I
am using Notepad for this task, but this is another question
to be discussed another time.) Printing and PDF files have been
successful only with the exclusive use of the same encoding
throughout the Maxima session. Some idea for printing
with multiple encodings?
My suggestions are:
1. That the cp1253.enc become an officially supported encoding
for tkmaxima.tcl and xmaxima.exe for release 5.9.0 under
preparation with the opportunity to use also the cp1253.enc
if required. In this way, perhaps almost everybody will be happy.
Additional encodings can be added of course (for other alphabets
too) exactly in the above described way.
2. That the change between the cp1253 and cp1252 encodings
takes place without resort to the tcl console of xmaxima/tkmaxima,
but directly through a (new) menu and use of the mouse.
I would greatly appreciate receiving any better ideas beyond the
above naive one on the support of the Greek symbols in Maxima
as well as any comments on the approach.
(Perhaps, I am saying nothing new to the Maxima community and
the Greek alphabet is already supported in Maxima. In fact, I
would be extremely happy if this is already the case!)
I would also be thankful for possible confirmations of the
approach in independent machines (outside Greece) either
under MS-Windows or under Linux. Perhaps in other
(naturally non-Western European) languages too. Please
let me know on this and alternative approaches permitting
a better internationalization of Maxima! (The codepages
cp1250, cp1251 and cp1254 are among the first (?) candidates
for this task!) What about using Unicode in MS-Windows
without any need for codepage changes? Is this possible?
Many sincere thanks in advance!
Kindest regards from Patras,
Nikos