REDUCE Typeset Mathematics Display

Francis Wright, October 2020

This is an attempt to document the options that are readily available to users for controlling the tmprint package, which is used internally by the CSL REDUCE GUI and the REDUCE TeXmacs interface to generate TeX markup for typeset maths display. Closely related code is used for the same purpose by Run-REDUCE.

Enable and disable

Typeset maths display can be turned on and off using the switch fancy, so on fancy turns it on (the default) and off fancy turns it off. (But do not do this in Run-REDUCE; use the Typeset Maths check item in the View menu.)

Derivatives

The (shared) variable fancy_print_df can be set to one of the values partial, total or indexed to control the display of derivatives. The default value is partial. From REDUCE revision 5418 onward, typeset maths supports the dfprint switch, and if this switch is on then fancy_print_df is ignored. For example, with the following settings, derivatives are displayed as follows (assuming depend f,x,y and operator g):

Setting df(f,x,2,y) df(g(x,y),x,2,y)
fancy_print_df := partial \(\frac{\partial^3 f}{\partial x^2 \partial y}\) \(\frac{\partial^3 g(x,y)}{\partial x^2 \partial y}\)
fancy_print_df := total \(\frac{d^3 f}{d x^2 d y}\) \(\frac{d^3 g(x,y)}{d x^2 d y}\)
fancy_print_df := indexed \(f_{x,x,y}\) \(g(x,y)_{x,x,y}\)
on dfprint \(f_{x,x,y}\) \(g_{x,x,y}\)

Operators

An operator declared print_indexed has its arguments displayed as indices, e.g. after print_indexed a; the operator value a(i,2) is displayed as \(a_{i,2}\). You can also declare several operators together to be indexed, e.g.

print_indexed b, c;

(In REDUCE versions before revision 5417 the display of indexed operators is slightly different and possibly incorrect, and parentheses are required around multiple arguments of print_indexed)

Digits in identifiers

The (shared) variable fancy_lower_digits can be set to one of the values t, nil or all to control the display of digits within identifiers. The default value is t. Digits in an identifier are typeset as subscripts if fancy_lower_digits = all or if fancy_lower_digits = t and the digits are all at the end. For example, with the following values assigned to fancy_lower_digits, ab12cd34 and abcd34 are displayed as follows:

fancy_lower_digits ab12cd34 abcd34
t \(ab12cd34\) \(abcd_{34}\)
all \(ab_{12}cd_{34}\) \(abcd_{34}\)
nil \(ab12cd34\) \(abcd34\)

(However, CSL REDUCE currently displays identifiers with more than one letter in roman rather than italic font style, and Run-REDUCE currently displays implicit subscript digits in italic rather than normal font style, but I hope to have that fixed soon!)