typesetting in native Maxima.



I messed up on addressing this and failed to cc: the maxima list.
Somehow my copying removed the >  marks (damn netscape mailer...)
rjf


Andrey G. Grozin wrote:

Hello *,


Instead of making the output of maxima run through
tex, why don't we change the output of the Maxima display
program to be whatever information is actually needed
to display.  I don't know if this is some kind of
unicode or postscript or some other format, but the
program that displays
        2
       x

can certainly learn to use different size fonts and
spaces.  Since the maxima program also presumable has
some environmental access it can tell how wide your display
is and such stuff.

First, high-quality typesetting of formulae is not a trivial problem. Just
have a look at the sizes of programs that can do it well: TeX, lout,
TeXmacs. Your suggestion amounts to reimplementing one of them in Lisp. No
doudt, this is possible. The above examples show that this would require
many man-years of work.

RJF:
No no... I have never heard of lout, but the size of those programs
may not be a good indication of the complexity of math typesetting 
because they must also include all of the support functions.  TeX for 
example has to do storage management, parsing, etc.  So it is the size 
of (a part of) Lisp + typesetting.  Maxima already has Lisp.  Besides 
which, TeX  (I don't know about the others) doesn't solve the problem of 
expressions that are too long. I have heard about but not tried a latex 
macro package that supposedly does this, but frankly I would be 
surprised if it works.  Maxima used to (probably still does) change
a+b+c
-----
d+e+f ....

to
(a+b+c)/(d+e+f)..
as the numerator and denominator grow.  Is the Latex macro clever enough 
for this?
(maybe.. I don't know).

The Maxima program already exists in large measure.  To change it to use
variable size fonts should not be a big change.  The technique for
summing up the width and height of subexpressions needs to be changed
to account for font characteristics.  Also, the second pass that
outputs stuff needs to change.  I think the subtleties of Knuth's glue 
algorithm might be added, but that seems to me to be optional.


Second, what OS API do you propose to use? Direct use of Win32 API is
tedious, and it would mean that all this work will be useless on all
platforms but one. You mentioned PostScript. It was indeed used for
display in NeXTStep, and can be used now in GNUStep with Display
GhostScript. Not too wide choice. Use X protocole? X fonts are not
particularly well suited for mathematics (this is the reason why LyX has
not so good display quality as TeXmacs).

RJF:
This is a really my question too.  What if emacs21 worked on windows
with display fonts?  Would that solve the problem in a portable way?
I think that if Win32 stuff were used, that would be nice for windows
users, and what would be needed is a linux (etc) simulation.  I find
the use of X window simulation on Windows (via Hummingbird) to be
a barely-acceptable alternative, but I don't know if that is free or
good enough.




I'd say that it is much better not to re-invent too many wheels, and to
use high-quality free software available. It seems to me that running TeX
on each Maxima output is a bit heavy-weight (though the results should be
good). I think that TeXmacs is a better solution. Have you used it? When
TeXmacs-Maxima interface works, it produces very high-quality results. I
think, we should stabilize this interface, maybe, merging it with Emaxima.
They should have, I suppose, very much code in common.

RJF:

I think these are two highly different programs.
(Also, Texmacs is quite complex, and not on windows. emacs21 also
is not fully functional on windows.)


--RJF

Date: Fri, 07 Dec 2001 07:39:10 -0800
From: Richard Fateman <fateman at cs>
Organization: computer science division,   UC Berkeley
To: "Andrey G. Grozin" <A.G.Grozin@inp.nsk.su>, maxima
Subject: Re: [Maxima] Maybe some work to make Maxima display much better

Andrey G. Grozin wrote:

> Hello *,
> 
> 
>>Instead of making the output of maxima run through
>>tex, why don't we change the output of the Maxima display
>>program to be whatever information is actually needed
>>to display.  I don't know if this is some kind of
>>unicode or postscript or some other format, but the
>>program that displays
>>        2
>>       x
>>
>>can certainly learn to use different size fonts and
>>spaces.  Since the maxima program also presumable has
>>some environmental access it can tell how wide your display
>>is and such stuff.
>>
> First, high-quality typesetting of formulae is not a trivial problem. Just
> have a look at the sizes of programs that can do it well: TeX, lout,
> TeXmacs. Your suggestion amounts to reimplementing one of them in Lisp. No
> doudt, this is possible. The above examples show that this would require
> many man-years of work.


No no... I have never heard of lout, but the size of those programs
may not be a good indication of the complexity of math typesetting 
because they must also include all of the support functions.  TeX for 
example has to do storage management, parsing, etc.  So it is the size 
of (a part of) Lisp + typesetting.  Maxima already has Lisp.  Besides 
which, TeX  (I don't know about the others) doesn't solve the problem of 
expressions that are too long. I have heard about but not tried a latex 
macro package that supposedly does this, but frankly I would be 
surprised if it works.  Maxima used to (probably still does) change
a+b+c
-----
d+e+f ....

to
(a+b+c)/(d+e+f)..
as the numerator and denominator grow.  Is the Latex macro clever enough 
for this?
(maybe.. I don't know).

The Maxima program already exists in large measure.  To change it to use
variable size fonts should not be a big change.  The technique for
summing up the width and height of subexpressions needs to be changed
to account for font characteristics.  Also, the second pass that
outputs stuff needs to change.  I think the subtleties of Knuth's glue 
algorithm might be added, but that seems to me to be optional.


> Second, what OS API do you propose to use? Direct use of Win32 API is
> tedious, and it would mean that all this work will be useless on all
> platforms but one. You mentioned PostScript. It was indeed used for
> display in NeXTStep, and can be used now in GNUStep with Display
> GhostScript. Not too wide choice. Use X protocole? X fonts are not
> particularly well suited for mathematics (this is the reason why LyX has
> not so good display quality as TeXmacs).


This is a really my question too.  What if emacs21 worked on windows
with display fonts?  Would that solve the problem in a portable way?
I think that if Win32 stuff were used, that would be nice for windows
users, and what would be needed is a linux (etc) simulation.  I find
the use of X window simulation on Windows (via Hummingbird) to be
a barely-acceptable alternative, but I don't know if that is free or
good enough.



> 
> I'd say that it is much better not to re-invent too many wheels, and to
> use high-quality free software available. It seems to me that running TeX
> on each Maxima output is a bit heavy-weight (though the results should be
> good). I think that TeXmacs is a better solution. Have you used it? When
> TeXmacs-Maxima interface works, it produces very high-quality results. I
> think, we should stabilize this interface, maybe, merging it with Emaxima.
> They should have, I suppose, very much code in common.


I think these are two highly different programs.


> 
> Best wishes,
> Andrey
>