                        MATHS DISPLAY FOR REDUCE
                        ========================

For fancy mathematical display mode to be available you need
  (a) A system configured with windowed support (this is the default)
  (b) to be running in windowed mode
  (c) to have a directory r38.fonts next to the r38 executable with
      suitable fonts in it.

In simple cases REDUCE will then start up displaying maths using the
fonts given. This action can be turned off by going "off fancy;".

In reality contol of just what happens is more complicated. So here is
a fuller explanation:

r38
   Launch reduce in normal windowed mode with fancy maths display enabled
   by default. "off fancy;" can be used to switch it off.
r38 -w
   Launch r38 as a console mode application. Fancy maths will be disabled
   at startup. (Note: -w+ forces an attempt to windowed mode, -w- disables
   windows whatever).
   If "on fancy;" is issued TeX-like material will be displayed.
r38 -l logfile
   Send a transcript of the session to the given log file. The scheme used is
   exactly what you get from the use of a command 'lisp spool "logfile";' from
   within a running Reduce. The screen should show fancy maths but regular
   text-based displays will go to the log file. After "r38 -w -l logfile"
   non-fancy displays will go to both terminal and log file, or after
   "on fancy;" the terminal should show TeX and the log file normal textual
   display mathematics.
r38 > logfile     and
r38 < infile > logfile
   If either input or output is redirected then Reduce runs (unless you have
   said "-w+" too!) as a console mode application and thus fancy display is
   disabled on startup and the log file will end up with text-based displays. 
   "on fancy;" would lead to TeX-like material appearing in both.
r38 -w+ > logfile
   A window pops up and output goes to the screen not the log file. The
   "> logfile" is, in effect, ignored.
r38 -- logfile
   This is Reduce doing its own output redirection for you. Even if Reduce
   runs in windowed mode in this case the system will behave as if fancy
   display is not possible, and will start up in non-fancy mode. You should
   never see Reduce output on the screen. "on fancy;" would cause TeX to
   be generated to the logfile. You may wonder why this mode does not force
   Reduce to run in console mode. The reason is that the user can still cause
   progress or status information to appear on the title bar of the (otherwise
   pretty useless!) window while something runs, while in console mode there
   are no side-channels of this sort. The jobs that build and test Reduce
   often run this way.
popen("r38"...)
   If Reduce is called from another program via a pipe if defaults to
   console mode behaviour. If you want the TeX style output from the
   display processor (eg because the program calling it implements an
   interface that can handle that) arrange to issue the Reduce command
   "on fancy;" to switch it on explicitly.
The Reduce command "out file;"
   When from within Reduce you select an alternative place to send output to
   then even if screen display is fancy output within the file will be plain.
   Even after an extra "on fancy;" TeX does not appear.

By use of the programming language within Reduce almost any combination of
effects can be achieved! But I hope that the above documents cases where
reasonably common user activity might interact with the maths display
processing.


Here is a "to do" list for the maths display code. Some issues for it seem
very hard to cope with.

Because of line splitting I can have a pair of lines
   \left( AAA BBB CCC
   DDD EEE FFF \right)
I fix it so that I repair bracket matching by treating the above as if it
had been
   \left( AAA BBB CCC \right.
   \left. DDD EEE FFF \right)
but then the heights of the left and right parens are not guaranteed to match,
so the result will be poor if (say) AAA is very tall but all other chunks
are normal height. I think this would not be easy to deal with using anything
very much like the current code. 

Does screen get refreshed properly after multiple fast scrolls?

Check how things recover if an error happens inside display code.

Printing of maths, as in print rather than show on screen.

Cut & paste with maths.

\left \langle and \rangle where bits of big delim need x-offsets.
also \left /, \left \backslash.  I hope these are never generated
by tmprint and so will leave these pending at the moment!

Look for other TeX features that might usefully be supported but are not

Tune spacings and layout to make it all as pretty as possible: I am fairly
happy about things right now but there is always scope for tinkering. Eg
I give extra space in f^3 (because of the italic slope of f and its great
height)!

At present line-splitting is done in a part of the code remote from where
detailed measurements can be made and so judgements about whether a formula
will fit on one line may sometimes be less than perfect. It is not clear that
there is any even reasonably easy way to cope with this! I should do
line-breaking within my C code.

sum(f i, i, 0, n) + z(i) displays in a way that to my mind is ambiguous. It
typesets as if \sum has a higher precedence than "+". Maybe I should wonder
what other people think of this.

Symbols with names that contain almost any punctuation mark en dup with
any subscript centred above them, which astonished me!

Some cases disable math display in a manner I do not yet understand.



